LiFanxing commited on
Commit
43f3043
·
verified ·
1 Parent(s): d580619

Add files using upload-large-folder tool

Browse files
Files changed (50) hide show
  1. README.md +36 -0
  2. objects/appleseed_sofatable/materials/omniverse/simready_content/materials/SimPBR.mdl +562 -0
  3. objects/appleseed_sofatable/materials/omniverse/simready_content/materials/SimPBR_Model.mdl +212 -0
  4. objects/appleseed_sofatable/materials/omniverse/simready_content/materials/baking_annotations.mdl +38 -0
  5. objects/av_book_11/av_book_11.usd +0 -0
  6. objects/av_book_21/av_book_21.usd +0 -0
  7. objects/av_coaster_hexagon/av_coaster_hexagon.usd +0 -0
  8. objects/cline/materials/omniverse/simready_content/materials/SimPBR.mdl +562 -0
  9. objects/cline/materials/omniverse/simready_content/materials/SimPBR_Model.mdl +212 -0
  10. objects/cline/materials/omniverse/simready_content/materials/baking_annotations.mdl +38 -0
  11. objects/contemporary_laterialfile/materials/omniverse/simready_content/materials/SimPBR.mdl +562 -0
  12. objects/contemporary_laterialfile/materials/omniverse/simready_content/materials/SimPBR_Model.mdl +212 -0
  13. objects/contemporary_laterialfile/materials/omniverse/simready_content/materials/baking_annotations.mdl +38 -0
  14. objects/contemporary_lowhalfdesk/materials/omniverse/simready_content/materials/SimPBR.mdl +562 -0
  15. objects/contemporary_lowhalfdesk/materials/omniverse/simready_content/materials/SimPBR_Model.mdl +212 -0
  16. objects/contemporary_lowhalfdesk/materials/omniverse/simready_content/materials/baking_annotations.mdl +38 -0
  17. objects/contemporary_openstorage/materials/omniverse/simready_content/materials/SimPBR.mdl +562 -0
  18. objects/contemporary_openstorage/materials/omniverse/simready_content/materials/SimPBR_Model.mdl +212 -0
  19. objects/contemporary_openstorage/materials/omniverse/simready_content/materials/baking_annotations.mdl +38 -0
  20. objects/desk_01/materials/omniverse/simready_content/materials/SimPBR.mdl +562 -0
  21. objects/desk_01/materials/omniverse/simready_content/materials/SimPBR_Model.mdl +212 -0
  22. objects/desk_01/materials/omniverse/simready_content/materials/baking_annotations.mdl +38 -0
  23. objects/fstylejug_a01/materials/omniverse/simready_content/common_assets/props/fstylejug_a01/materials/Natural_Plastic_E.mdl +171 -0
  24. objects/fstylejug_a01/materials/omniverse/simready_content/common_assets/props/fstylejug_a01/materials/Plastic_Glossy_White_A.mdl +36 -0
  25. objects/gilbert/materials/omniverse/simready_content/materials/SimPBR.mdl +562 -0
  26. objects/gilbert/materials/omniverse/simready_content/materials/SimPBR_Model.mdl +212 -0
  27. objects/gilbert/materials/omniverse/simready_content/materials/SimPBR_Translucent.mdl +291 -0
  28. objects/gilbert/materials/omniverse/simready_content/materials/baking_annotations.mdl +38 -0
  29. objects/green_block/green_block.usd +0 -0
  30. objects/lime01/materials/robolab/objects/fruits_veggies/materials/SimPBR_Model.mdl +212 -0
  31. objects/red_block/red_block.usd +0 -0
  32. objects/standard_halfunit/materials/omniverse/simready_content/materials/SimPBR.mdl +562 -0
  33. objects/standard_halfunit/materials/omniverse/simready_content/materials/SimPBR_Model.mdl +212 -0
  34. objects/standard_halfunit/materials/omniverse/simready_content/materials/baking_annotations.mdl +38 -0
  35. objects/table_bamboo/table_bamboo.usd +0 -0
  36. objects/table_black/materials/remote/omniverse-content-production.s3.us-west-2.amazonaws.com/Materials/2023_1/Base/Plastics/Plastic.mdl +42 -0
  37. objects/table_black/materials/remote/omniverse-content-production.s3.us-west-2.amazonaws.com/Materials/2023_1/Base/Plastics/Plastic_Clear.mdl +21 -0
  38. objects/table_black/materials/remote/omniverse-content-production.s3.us-west-2.amazonaws.com/Materials/2023_1/vMaterials_2/Paint/Carpaint/Carpaint_Solid.mdl +1112 -0
  39. objects/table_black/materials/remote/omniverse-content-production.s3.us-west-2.amazonaws.com/Materials/2023_1/vMaterials_2/Plastic/Plastic_Thick_Translucent.mdl +673 -0
  40. objects/table_black/materials/remote/omniverse-content-production.s3.us-west-2.amazonaws.com/Materials/2023_1/vMaterials_2/Plastic/Plastic_Thick_Translucent_Flakes.mdl +1025 -0
  41. objects/table_maple/materials/remote/omniverse-content-production.s3.us-west-2.amazonaws.com/Materials/2023_1/Base/Plastics/Plastic.mdl +42 -0
  42. objects/table_maple/materials/remote/omniverse-content-production.s3.us-west-2.amazonaws.com/Materials/2023_1/Base/Plastics/Plastic_Clear.mdl +21 -0
  43. objects/table_maple/materials/remote/omniverse-content-production.s3.us-west-2.amazonaws.com/Materials/2023_1/vMaterials_2/Paint/Carpaint/Carpaint_Solid.mdl +1112 -0
  44. objects/table_maple/materials/remote/omniverse-content-production.s3.us-west-2.amazonaws.com/Materials/2023_1/vMaterials_2/Plastic/Plastic_Thick_Translucent.mdl +673 -0
  45. objects/table_maple/materials/remote/omniverse-content-production.s3.us-west-2.amazonaws.com/Materials/2023_1/vMaterials_2/Plastic/Plastic_Thick_Translucent_Flakes.mdl +1025 -0
  46. objects/table_oak/materials/remote/omniverse-content-production.s3.us-west-2.amazonaws.com/Materials/2023_1/Base/Plastics/Plastic.mdl +42 -0
  47. objects/table_oak/materials/remote/omniverse-content-production.s3.us-west-2.amazonaws.com/Materials/2023_1/Base/Plastics/Plastic_Clear.mdl +21 -0
  48. objects/table_oak/materials/remote/omniverse-content-production.s3.us-west-2.amazonaws.com/Materials/2023_1/vMaterials_2/Paint/Carpaint/Carpaint_Solid.mdl +1112 -0
  49. objects/table_oak/materials/remote/omniverse-content-production.s3.us-west-2.amazonaws.com/Materials/2023_1/vMaterials_2/Plastic/Plastic_Thick_Translucent.mdl +673 -0
  50. objects/table_oak/materials/remote/omniverse-content-production.s3.us-west-2.amazonaws.com/Materials/2023_1/vMaterials_2/Plastic/Plastic_Thick_Translucent_Flakes.mdl +1025 -0
README.md ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ pretty_name: HeteroTask assets
3
+ tags:
4
+ - robotics
5
+ - isaac-lab
6
+ - usd
7
+ ---
8
+
9
+ # HeteroTask assets
10
+
11
+ Assets of the heterogeneous vision-language-action pick-and-place tasks of Isaac Lab
12
+ (`isaaclab_tasks.contrib.heterogeneous_tasks`, registered as `IsaacContrib-VLA-PickPlace<NNN>-Franka` and
13
+ `IsaacContrib-VLA-Heterogeneous-Franka`), as complete USD files. The tasks load them from
14
+ `https://huggingface.co/datasets/LiFanxing/HeteroTask/resolve/main`, or from the location in the
15
+ `VLA_BENCHMARKS_ASSETS_DIR` environment variable.
16
+
17
+ ## Layout
18
+
19
+ | Path | Content |
20
+ |---|---|
21
+ | `objects/<name>/<name>.usd` | An object or piece of furniture with its physics: rigid body, mass and inertia, and convex-hull colliders (objects) or box colliders (furniture). |
22
+ | `objects/<name>/materials/` | The textures and MDL materials of the object. |
23
+ | `robots/franka_robotiq_2f_85/` | Franka arm with a Robotiq 2F-85 gripper. |
24
+ | `scene/franka_table/` | Table that the robot stands on. |
25
+ | `scene/home_office.exr` | Dome light texture. |
26
+
27
+ ## Sources
28
+
29
+ - Objects and furniture: the [Omniverse](https://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/)
30
+ SimReady and ArchVis libraries, and the RoboLab object library (YCB, HOPE, HOT3D, HANDAL, Objaverse and other
31
+ objects). The ArchVis models, which have no physics, got rigid bodies, masses and colliders; colliders decomposed
32
+ into convex hulls were baked into at most 32 hulls each (16 for ArchVis objects), and furniture collides with boxes
33
+ of its boards and panels.
34
+ - Robot, robot table and dome light texture: RoboLab.
35
+
36
+ The assets keep the licenses of their sources.
objects/appleseed_sofatable/materials/omniverse/simready_content/materials/SimPBR.mdl ADDED
@@ -0,0 +1,562 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*****************************************************************************
2
+ * Copyright 1986-2020 NVIDIA Corporation. All rights reserved.
3
+ ******************************************************************************
4
+
5
+ MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,
6
+ WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,
7
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
8
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
9
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
10
+ COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA
11
+ CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
12
+ ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
13
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
14
+ THE USE OR INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN
15
+ THE MDL MATERIALS.
16
+ */
17
+
18
+ mdl 1.4;
19
+
20
+ import ::df::*;
21
+ import ::state::*;
22
+ import ::math::*;
23
+ import ::base::*;
24
+ import ::tex::*;
25
+ import ::anno::*;
26
+
27
+ import ::nvidia::core_definitions::file_texture;
28
+ import ::nvidia::core_definitions::normalmap_texture;
29
+
30
+ using .::SimPBR_Model import *;
31
+ using .::baking_annotations import *;
32
+
33
+ export material SimPBR(
34
+ // -------------------- DIFFUSE REFLECTION ----------------------
35
+ color diffuse_color_constant = color(0.2f)
36
+ [[
37
+ anno::display_name("Albedo Base Color"),
38
+ anno::description("The base albedo color to use if no texture is specified"),
39
+ anno::in_group("Diffuse")
40
+ ]],
41
+ uniform texture_2d diffuse_texture = texture_2d()
42
+ [[
43
+ anno::display_name("Albedo Map"),
44
+ anno::description("The texture specifying the albedo value to use"),
45
+ anno::in_group("Diffuse")
46
+ ]],
47
+ uniform color diffuse_tint = color(1.0f)
48
+ [[
49
+ anno::display_name("Albedo Tint"),
50
+ anno::description("This tints the albedo color or texture contant"),
51
+ anno::in_group("Diffuse")
52
+ ]],
53
+ uniform bool enable_transmission = false
54
+ [[
55
+ anno::display_name("Enable Diffuse Transmission"),
56
+ anno::description("Enables the diffuse transmission of light through thin diffuse scattering layer"),
57
+ anno::in_group("Diffuse")
58
+ ]],
59
+ uniform float opacity_ratio = 1.f
60
+ [[
61
+ anno::enable_if("enable_transmission == true"),
62
+ anno::display_name("Opacity Ratio"),
63
+ anno::description("Amount of opacity"),
64
+ anno::in_group("Diffuse")
65
+ ]],
66
+ uniform color opacity_tint = color(1.0f)
67
+ [[
68
+ anno::enable_if("enable_transmission == true"),
69
+ anno::display_name("Diffuse transmission tint"),
70
+ anno::description("Base diffuse transmission color"),
71
+ anno::in_group("Diffuse")
72
+ ]],
73
+ uniform float opacity_multiplier = 1.f
74
+ [[
75
+ anno::enable_if("enable_transmission == true"),
76
+ anno::display_name("Diffuse transmission multiplier"),
77
+ anno::description("Base diffuse transmission multiplier"),
78
+ anno::in_group("Diffuse")
79
+ ]],
80
+
81
+ // -------------------- SPECULAR REFLECTION ----------------------
82
+ float reflection_roughness_constant = 0.5f
83
+ [[
84
+ anno::display_name("Roughness Amount"),
85
+ anno::hard_range(0.0,1.),
86
+ anno::description("Higher roughness values lead to more blurry reflections"),
87
+ anno::in_group("Specular")
88
+ ]],
89
+ uniform float reflection_roughness_texture_influence = 0.0f
90
+ [[
91
+ anno::display_name("Roughness Map Influence"),
92
+ anno::hard_range(0.0, 1.),
93
+ anno::description("Blends between the constant value and the lookup of the roughness texture"),
94
+ anno::in_group("Specular")
95
+ ]],
96
+ uniform texture_2d reflectionroughness_texture = texture_2d()
97
+ [[
98
+ anno::display_name("Roughness Map"),
99
+ anno::in_group("Specular")
100
+ ]],
101
+
102
+ float anisotropy_constant = 0.0f
103
+ [[
104
+ anno::display_name("Anisotropy Amount"),
105
+ anno::hard_range(-1.,1.),
106
+ anno::description("0 for isotropic, extents of -1 to 1 for anisotropy"),
107
+ anno::in_group("Specular")
108
+ ]],
109
+ uniform float anisotropy_texture_influence = 0.0f
110
+ [[
111
+ anno::display_name("Anisotropy Map Influence"),
112
+ anno::hard_range(0.0, 1.),
113
+ anno::description("Blends between the constant value and the lookup of the anisotropy texture"),
114
+ anno::in_group("Specular")
115
+ ]],
116
+ uniform texture_2d anisotropy_texture = texture_2d()
117
+ [[
118
+ anno::display_name("Anisotropy Map"),
119
+ anno::in_group("Specular")
120
+ ]],
121
+
122
+ float metallic_constant = 0.f
123
+ [[
124
+ anno::display_name("Metallic Amount"),
125
+ anno::hard_range(0.0,1.),
126
+ anno::description("Metallic Material"),
127
+ anno::in_group("Specular")
128
+ ]],
129
+ uniform float metallic_texture_influence = 0.0f
130
+ [[
131
+ anno::display_name("Metallic Map Influence"),
132
+ anno::hard_range(0.0, 1.),
133
+ anno::description("Blends between the constant value and the lookup of the metallic texture"),
134
+ anno::in_group("Specular")
135
+ ]],
136
+ uniform texture_2d metallic_texture = texture_2d()
137
+ [[
138
+ anno::display_name("Metallic Map"),
139
+ anno::in_group("Specular")
140
+ ]],
141
+
142
+ float specular_constant = 1.f
143
+ [[
144
+ anno::display_name("Specular amount"),
145
+ anno::hard_range(0.0, 1.0),
146
+ anno::description("Scale of the specular component"),
147
+ anno::in_group("Specular")
148
+ ]],
149
+ uniform texture_2d specular_texture = texture_2d()
150
+ [[
151
+ anno::display_name("Specular Map"),
152
+ anno::in_group("Specular")
153
+ ]],
154
+
155
+ // -------------------- ORM ----------------------
156
+ uniform bool enable_ORM_texture = true
157
+ [[
158
+ anno::display_name("Enable ORM Texture"),
159
+ anno::description("When True the ORM texture will be used to extract the Occlusion, Roughness and Metallic Map"),
160
+ anno::in_group("Reflectivity")
161
+ ]],
162
+ uniform texture_2d ORM_texture = texture_2d()
163
+ [[
164
+ anno::display_name("ORM Map"),
165
+ anno::description("Texture that hae Occlusion, Roughness and Metallic map stored in the respective r, g and b channels"),
166
+ anno::in_group("Reflectivity")
167
+ ]],
168
+
169
+ // -------------------- Clearcoat ----------------------
170
+ uniform bool enable_clearcoat = false
171
+ [[
172
+ anno::display_name("Enable Clearcoat Layer"),
173
+ anno::description("Adds a clearcoat layer on top of the material when enabled"),
174
+ anno::in_group("Clearcoat")
175
+ ]],
176
+ color clearcoat_tint = color(1.0f)
177
+ [[
178
+ anno::display_name("Clearcoat Tint"),
179
+ anno::description("Clearcoat is tinted and affects the underlying material"),
180
+ anno::in_group("Clearcoat")
181
+ ]],
182
+ float clearcoat_transparency = 1.0f
183
+ [[
184
+ anno::display_name("Clearcoat Transparency"),
185
+ anno::description("Adjusts the transparency of the clearcoat. Can be turned into a fully opaque clearcoat "
186
+ "covering the underlying layer"),
187
+ anno::in_group("Clearcoat")
188
+ ]],
189
+ float clearcoat_reflection_roughness = 0.0f
190
+ [[
191
+ anno::display_name("Clearcoat Roughness"),
192
+ anno::description("Higher roughness values lead to more blurry reflections"),
193
+ anno::hard_range(0.0f, 1.0f),
194
+ anno::in_group("Clearcoat")
195
+ ]],
196
+ float clearcoat_weight = 1.0f
197
+ [[
198
+ anno::display_name("Clearcoat Weight"),
199
+ anno::description("Sets the weight for clearcoat layer"),
200
+ anno::hard_range(0.0f, 1.0f),
201
+ anno::in_group("Clearcoat")
202
+ ]],
203
+ float clearcoat_flatten = 1.0f
204
+ [[
205
+ anno::display_name("Clearcoat Flatten"),
206
+ anno::description("Flattens the clearcoat to even out the underlying bump maps"),
207
+ anno::hard_range(0.0f, 1.0f),
208
+ anno::in_group("Clearcoat")
209
+ ]],
210
+ float clearcoat_ior = 1.56f
211
+ [[
212
+ anno::display_name("Clearcoat IOR"),
213
+ anno::description("Sets the Index of refraction for the clearcoat layer"),
214
+ anno::soft_range(1.0f, 4.0f),
215
+ anno::in_group("Clearcoat")
216
+ ]],
217
+ uniform float clearcoat_bump_factor = 1.f
218
+ [[
219
+ anno::display_name("Clearcoat Normal Map Strength"),
220
+ anno::description("Strength of normal map."),
221
+ anno::in_group("Clearcoat")
222
+ ]],
223
+
224
+ float3 clearcoat_normal_input = float3(0.0, 0.0, 0.0),
225
+ uniform texture_2d clearcoat_normalmap_texture = texture_2d()
226
+ [[
227
+ anno::display_name("Clearcoat Normal Map"),
228
+ anno::description("Enables the usage of the normalmap texture"),
229
+ anno::in_group("Clearcoat")
230
+ ]],
231
+
232
+ uniform bool clearcoat_flip_tangent_u = false
233
+ [[
234
+ anno::display_name("Clearcoat Normal Map Flip U Tangent"),
235
+ anno::in_group("Clearcoat")
236
+ ]],
237
+ uniform bool clearcoat_flip_tangent_v = true
238
+ [[
239
+ anno::display_name("Clearcoat Normal Map Flip V Tangent"),
240
+ anno::in_group("Clearcoat")
241
+ ]],
242
+
243
+
244
+ // -------------------- REFLECTIVITY ----------------------
245
+ uniform bool enable_retroreflection = false
246
+ [[
247
+ anno::display_name("Enable Retroreflection"),
248
+ anno::in_group("Reflectivity")
249
+ ]],
250
+ color retroreflection_tint = color(.182,.800,.000)
251
+ [[
252
+ anno::display_name("Retro-reflection tint"),
253
+ anno::description("The tint of the retroreflection"),
254
+ anno::in_group("Reflectivity")
255
+ ]],
256
+ uniform float normal_reflectivity = 0.5
257
+ [[
258
+ anno::display_name("Retro-reflection weight facing"),
259
+ anno::hard_range(0.0,1.),
260
+ anno::description("Reflectivity control for geometry facing the viewer"),
261
+ anno::in_group("Reflectivity")
262
+ ]],
263
+ uniform float grazing_reflectivity = 1.0
264
+ [[
265
+ anno::display_name("Retro-reflection weight edge"),
266
+ anno::hard_range(0.0,1.),
267
+ anno::description("Reflectivity control for the reflectivity at geometry edges"),
268
+ anno::in_group("Reflectivity")
269
+ ]],
270
+
271
+ // -------------------- AMBIENT OCCLUSION ----------------------
272
+ float ao_to_diffuse = 0.0
273
+ [[
274
+ anno::display_name("AO to Diffuse"),
275
+ anno::description("Controls the amount of ambient occlusion multiplied into the diffuse color channel"),
276
+ anno::in_group("AO")
277
+ ]],
278
+ float ao_input = float(1.0),
279
+ uniform texture_2d ao_texture = texture_2d()
280
+ [[
281
+ anno::display_name("Ambient Occlusion Map"),
282
+ anno::description("The Ambient Occlusion texture for the material"),
283
+ anno::in_group("AO")
284
+ ]],
285
+
286
+ // -------------------- EMISSIVE ----------------------
287
+ uniform bool enable_emission = false
288
+ [[
289
+ anno::display_name("Enable Emission"),
290
+ anno::description("Enables the emission of light from the material"),
291
+ anno::in_group("Emissive")
292
+ ]],
293
+ uniform color emissive_color = color(1.0, 0.1, 0.1)
294
+ [[
295
+ anno::enable_if("enable_emission == true"),
296
+ anno::display_name("Emissive Color"),
297
+ anno::description("The emission color"),
298
+ anno::in_group("Emissive")
299
+ ]],
300
+
301
+ color emissive_mask_input = color(1.0),
302
+ uniform texture_2d emissive_mask_texture = texture_2d()
303
+ [[
304
+ anno::enable_if("enable_emission == true"),
305
+ anno::display_name("Emissive Mask Map"),
306
+ anno::description("The texture masking the emissive color"),
307
+ anno::in_group("Emissive")
308
+ ]],
309
+ uniform float emissive_intensity = 40.f
310
+ [[
311
+ anno::enable_if("enable_emission == true"),
312
+ anno::display_name("Emissive Intensity"),
313
+ anno::description("Intensity of the emission"),
314
+ anno::in_group("Emissive")
315
+ ]],
316
+ uniform bool enable_emissive_flipbook = false
317
+ [[
318
+ anno::display_name("Enable Flipbook for emission"),
319
+ anno::description("Allows the use of animated emissive textures (e.g. video screens)"),
320
+ anno::in_group("Emissive")
321
+ ]],
322
+ uniform int2 flipbook_dim = int2(1,1)
323
+ [[
324
+ anno::enable_if("enable_emissive_flipbook == true"),
325
+ anno::display_name("Flipbook Rows/Columns"),
326
+ anno::description("How many rows and columns are in the flipbook?"),
327
+ anno::in_group("Emissive")
328
+ ]],
329
+ uniform int target_fps = 1
330
+ [[
331
+ anno::enable_if("enable_emissive_flipbook == true"),
332
+ anno::display_name("Flipbook Target FPS"),
333
+ anno::description("Playback speed in frames per second"),
334
+ anno::in_group("Emissive")
335
+ ]],
336
+
337
+ // -------------------- ALPHA ----------------------
338
+ uniform bool enable_opacity = false
339
+ [[
340
+ anno::display_name("Enable Opacity"),
341
+ anno::description("Enables or disables alpha functionality"),
342
+ anno::in_group("Alpha")
343
+ ]],
344
+ float alpha_constant = 1.0
345
+ [[
346
+ anno::enable_if("enable_opacity == true"),
347
+ anno::display_name("Opacity Fallback Constant"),
348
+ anno::hard_range(0.0, 1.0),
349
+ anno::description("The base alpha constant to use if no texture is specified"),
350
+ anno::in_group("Alpha")
351
+ ]],
352
+ uniform texture_2d opacity_texture = texture_2d()
353
+ [[
354
+ anno::enable_if("enable_opacity == true"),
355
+ anno::display_name("Opacity Map"),
356
+ anno::description("The texture specifying the opacity value to use"),
357
+ anno::in_group("Alpha")
358
+ ]],
359
+ uniform bool enable_opacity_cutout = false
360
+ [[
361
+ anno::enable_if("enable_opacity == true"),
362
+ anno::display_name("Enable Alpha Cutout"),
363
+ anno::description("Enables or disables alpha cutout functionality"),
364
+ anno::in_group("Alpha")
365
+ ]],
366
+ uniform float alpha_cutout_cutoff = 1.f
367
+ [[
368
+ anno::enable_if("enable_opacity == true"),
369
+ anno::enable_if("enable_opacity_cutout == true"),
370
+ anno::hard_range(0.0, 1.0),
371
+ anno::display_name("Alpha Cutout Cutoff"),
372
+ anno::description("The cutoff value to to render as transparent up to and opaque past"),
373
+ anno::in_group("Alpha")
374
+ ]],
375
+
376
+ // -------------------- NORMAL ----------------------
377
+ uniform float bump_factor = 1.f
378
+ [[
379
+ anno::display_name("Normal Map Strength"),
380
+ anno::description("Strength of normal map."),
381
+ anno::in_group("Normal")
382
+ ]],
383
+
384
+ float3 normal_input = state::normal(),
385
+ uniform texture_2d normalmap_texture = texture_2d()
386
+ [[
387
+ anno::display_name("Normal Map"),
388
+ anno::in_group("Normal")
389
+ ]],
390
+ uniform bool flip_tangent_u = false
391
+ [[
392
+ anno::display_name("Normal Map Flip U Tangent"),
393
+ anno::in_group("Normal")
394
+ ]],
395
+ uniform bool flip_tangent_v = true
396
+ [[
397
+ anno::display_name("Normal Map Flip V Tangent"),
398
+ anno::in_group("Normal")
399
+ ]],
400
+
401
+ // -------------------- UV ADJUSTMENTS ----------------------
402
+ uniform bool project_uvw = false
403
+ [[
404
+ anno::display_name("Enable Project UVW Coordinates"),
405
+ anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"),
406
+ anno::in_group("UV")
407
+ ]],
408
+ uniform bool world_or_object = false
409
+ [[
410
+ anno::enable_if("project_uvw == true"),
411
+ anno::display_name("Enable World Space"),
412
+ anno::description("When set to 'true' uses world space for projection, when 'false' object space is used"),
413
+ anno::in_group("UV")
414
+ ]],
415
+ uniform float2 texture_translate = float2(0.0f)
416
+ [[
417
+ anno::display_name("Texture Translate"),
418
+ anno::description("Controls position of texture."),
419
+ anno::in_group("UV")
420
+ ]],
421
+ uniform float2 texture_scale = float2(1.0f)
422
+ [[
423
+ anno::display_name("Texture Tiling"),
424
+ anno::description("Controls repetition of the texture."),
425
+ anno::in_group("UV")
426
+ ]],
427
+ uniform float2 texture_speed = float2(0.0f)
428
+ [[
429
+ anno::display_name("Texture Speed"),
430
+ anno::description("Scrolling texture animation speed in UVs per sec."),
431
+ anno::in_group("UV")
432
+ ]]
433
+ )
434
+ [[
435
+ anno::display_name("Sim PBR"),
436
+ anno::description("Supports the opaque alpha cutout material model of the Sim Renderer"),
437
+ anno::in_group("SimReady"),
438
+ anno::version( 1, 0, 0),
439
+ anno::author("NVIDIA CORPORATION"),
440
+ anno::key_words(string[]("Sim", "PBR", "opaque", "alpha", "cutout", "omniverse", "generic"))
441
+ ]]
442
+ = let {
443
+ base::texture_coordinate_system the_system = world_or_object ? base::texture_coordinate_world : base::texture_coordinate_object;
444
+
445
+ base::texture_coordinate_info uvw = project_uvw ?
446
+ base::coordinate_projection(
447
+ coordinate_system: the_system,
448
+ texture_space: 0,
449
+ projection_type: base::projection_cubic
450
+ ) : base::coordinate_source(
451
+ coordinate_system: base::texture_coordinate_uvw,
452
+ texture_space: 0
453
+ );
454
+
455
+ // Need to use a small value so the compiler doesnt optimize out this var...
456
+ float t = 0.00000001;//state::animation_time();
457
+ base::texture_coordinate_info transformed_uvw = base::transform_coordinate(
458
+ transform: base::rotation_translation_scale(
459
+ scaling: float3(texture_scale.x, texture_scale.y, 1.0),
460
+ rotation: float3(0.0, 0.0, 0.0 ),
461
+ translation: float3(texture_translate.x + t * texture_speed.x, texture_translate.y + t * texture_speed.y, 0.0)),
462
+ coordinate: uvw
463
+ );
464
+ float2 uv = float2(transformed_uvw.position.x, transformed_uvw.position.y);
465
+
466
+ // Diffuse Color Lookup and AO
467
+ float4 base_lookup = tex::texture_isvalid(diffuse_texture) ? tex::lookup_float4(tex: diffuse_texture, coord: uv) : float4(1, 1, 1, 1);
468
+
469
+ float opacityValue = tex::texture_isvalid(opacity_texture) ? tex::lookup_float4(tex: opacity_texture, coord: uv).w : alpha_constant;
470
+
471
+ // Normal calculations
472
+ float3 normal_lookup = tex::texture_isvalid(normalmap_texture) ?
473
+ base::tangent_space_normal_texture(
474
+ texture: normalmap_texture,
475
+ factor: bump_factor,
476
+ uvw: transformed_uvw,
477
+ flip_tangent_u: flip_tangent_u,
478
+ flip_tangent_v: flip_tangent_v
479
+ ) : normal_input;
480
+
481
+ float3 clearcoat_normal = tex::texture_isvalid(clearcoat_normalmap_texture) ?
482
+ base::tangent_space_normal_texture(
483
+ texture: clearcoat_normalmap_texture,
484
+ factor: clearcoat_bump_factor,
485
+ uvw: uvw,
486
+ flip_tangent_u: clearcoat_flip_tangent_u,
487
+ flip_tangent_v: clearcoat_flip_tangent_v
488
+ ) : clearcoat_normal_input;
489
+
490
+ float3 flattened_clearcoat_normal = ::math::lerp(normal_lookup, ::state::normal(), clearcoat_flatten);
491
+ float3 final_clearcoat_normal = tex::texture_isvalid(clearcoat_normalmap_texture) ? clearcoat_normal : flattened_clearcoat_normal;
492
+
493
+ float ao_lookup = tex::texture_isvalid(ao_texture) ? tex::lookup_float4(tex: ao_texture, coord: uv).x : ao_input;
494
+
495
+ color diffuse_color = tex::texture_isvalid(diffuse_texture) ? color(base_lookup.x, base_lookup.y, base_lookup.z) : diffuse_color_constant;
496
+
497
+ float3 ORM_lookup = tex::lookup_float3(
498
+ tex: ORM_texture,
499
+ coord: float2(transformed_uvw.position.x, transformed_uvw.position.y)
500
+ );
501
+
502
+ float roughness_lookup = tex::texture_isvalid(reflectionroughness_texture) ?
503
+ tex::lookup_float4(tex: reflectionroughness_texture, coord: uv).x : reflection_roughness_constant;
504
+ float anisotropy_lookup = tex::texture_isvalid(anisotropy_texture) ?
505
+ (tex::lookup_float4(tex: anisotropy_texture, coord: uv).x * 2.0f - 1.0f) : anisotropy_constant;
506
+ float metallic_lookup = tex::texture_isvalid(metallic_texture) ?
507
+ tex::lookup_float4(tex: metallic_texture, coord: uv).x : metallic_constant;
508
+ float specular_lookup = tex::texture_isvalid(specular_texture) ?
509
+ tex::lookup_float4(tex: specular_texture, coord: uv).x : specular_constant;
510
+
511
+ float roughness_selection = enable_ORM_texture ? ORM_lookup.y : roughness_lookup;
512
+ float metallic_selection = enable_ORM_texture ? ORM_lookup.z : metallic_lookup;
513
+ float ao = enable_ORM_texture ? ORM_lookup.x : ao_lookup;
514
+
515
+ float reflection_roughness = math::lerp(reflection_roughness_constant, roughness_selection, reflection_roughness_texture_influence);
516
+ float anisotropy = math::lerp(anisotropy_constant, anisotropy_lookup, anisotropy_texture_influence);
517
+ float metallic = math::lerp(metallic_constant, metallic_selection, metallic_texture_influence);
518
+
519
+ int rows = flipbook_dim.x;
520
+ int columns = flipbook_dim.y;
521
+ int numFrames = rows * columns;
522
+ varying int frameIdx = int(state::animation_time() * target_fps) % numFrames;
523
+ varying float2 baseUV = float2(transformed_uvw.position.x, transformed_uvw.position.y);
524
+ varying float2 emissiveUV = enable_emissive_flipbook ?
525
+ ((baseUV + float2(frameIdx % rows, frameIdx / rows)) / float2(rows, columns)) : baseUV;
526
+
527
+ color emissive_mask = tex::texture_isvalid(emissive_mask_texture) ?
528
+ tex::lookup_color(emissive_mask_texture, emissiveUV, tex::wrap_repeat, tex::wrap_repeat) : emissive_mask_input;
529
+
530
+ } in SimPBR_Model(
531
+ diffuse_color: diffuse_color,
532
+ diffuse_tint: diffuse_tint,
533
+ roughness: reflection_roughness,
534
+ anisotropy: anisotropy,
535
+ metallic: metallic,
536
+ specular: specular_lookup,
537
+ normal: normal_lookup,
538
+ enable_clearcoat: enable_clearcoat,
539
+ clearcoat_tint: clearcoat_tint,
540
+ clearcoat_transparency: clearcoat_transparency,
541
+ clearcoat_reflection_roughness: clearcoat_reflection_roughness,
542
+ clearcoat_weight: clearcoat_weight,
543
+ clearcoat_ior: clearcoat_ior,
544
+ clearcoat_normal: final_clearcoat_normal,
545
+ enable_retroreflection: enable_retroreflection,
546
+ retroreflection_tint: retroreflection_tint,
547
+ normal_reflectivity: normal_reflectivity,
548
+ grazing_reflectivity: grazing_reflectivity,
549
+ ao_to_diffuse: ao_to_diffuse,
550
+ ao: ao,
551
+ enable_emission: enable_emission,
552
+ emissive_color: emissive_color,
553
+ emissive_mask: emissive_mask,
554
+ emissive_intensity: emissive_intensity,
555
+ enable_opacity: enable_opacity,
556
+ alpha: opacityValue,
557
+ enable_opacity_cutout: enable_opacity_cutout,
558
+ alpha_cutout_cutoff: alpha_cutout_cutoff,
559
+ opacity_ratio: enable_transmission ? opacity_ratio : 1.0,
560
+ opacity_tint : opacity_tint,
561
+ opacity_multiplier : opacity_multiplier
562
+ );
objects/appleseed_sofatable/materials/omniverse/simready_content/materials/SimPBR_Model.mdl ADDED
@@ -0,0 +1,212 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*****************************************************************************
2
+ * Copyright 1986-2020 NVIDIA Corporation. All rights reserved.
3
+ ******************************************************************************
4
+
5
+ MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,
6
+ WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,
7
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
8
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
9
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
10
+ COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA
11
+ CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
12
+ ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
13
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
14
+ THE USE OR INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN
15
+ THE MDL MATERIALS.
16
+ */
17
+
18
+ mdl 1.4;
19
+
20
+ import ::df::*;
21
+ import ::state::*;
22
+ import ::math::*;
23
+ import ::base::*;
24
+ import ::tex::*;
25
+ import ::anno::*;
26
+
27
+ using .::baking_annotations import *;
28
+
29
+ base::texture_return multiply_colors(
30
+ color color_1 = color(1.0, 1.0, 1.0),
31
+ color color_2 = color(.5, .5, .5),
32
+ float weight = 1.0
33
+ )
34
+ [[
35
+ anno::hidden()
36
+ ]]
37
+ {
38
+ return base::blend_color_layers(
39
+ layers: base::color_layer[](
40
+ base::color_layer(
41
+ layer_color: color_2,
42
+ weight: weight,
43
+ mode: base::color_layer_multiply
44
+ )
45
+ ), base: color_1
46
+ );
47
+ }
48
+
49
+ export material SimPBR_Model(
50
+ color diffuse_color = color(0.2f) [[ target_baked_argument("diffuse_texture", "diffuse_color_constant", "RGBA8_UNORM") ]],
51
+ uniform color diffuse_tint = color(1.0f),
52
+ float roughness = 0.5f [[ target_baked_argument("reflectionroughness_texture", "reflection_roughness_constant", "R8_UNORM") ]],
53
+ float anisotropy = 0.0f [[ target_baked_argument("anisotropy_texture", "anisotropy_constant", "R8_SNORM") ]],
54
+ float metallic = 0.f [[ target_baked_argument("metallic_texture", "metallic_constant", "R8_UNORM") ]],
55
+ float specular = 1.f [[ target_baked_argument("specular_texture", "specular_constant", "R8_UNORM") ]],
56
+ float3 normal = float3(0.0, 0.0, 0.0) [[ target_baked_argument("normalmap_texture", "normal_input", "RGBA8_SNORM", baking_annotations::TRANSFORM_UNORM_VECTOR) ]],
57
+ uniform bool enable_clearcoat = false,
58
+ color clearcoat_tint = color(1.0f),
59
+ float clearcoat_transparency = 1.0f,
60
+ float clearcoat_reflection_roughness = 0.0f,
61
+ float clearcoat_weight = 1.0f,
62
+ float clearcoat_ior = 1.56f,
63
+ float3 clearcoat_normal = float3(0.0, 0.0, 0.0) [[ target_baked_argument("clearcoat_normalmap_texture", "clearcoat_normal_input", "RGBA8_SNORM", baking_annotations::TRANSFORM_UNORM_VECTOR) ]],
64
+ uniform bool enable_retroreflection = false,
65
+ color retroreflection_tint = color(.182,.800,.000),
66
+ uniform float normal_reflectivity = 0.5,
67
+ uniform float grazing_reflectivity = 1.0,
68
+ float ao_to_diffuse = 0.0,
69
+ float ao = 1.0f [[ target_baked_argument("ao_texture", "ao_input", "R8_UNORM") ]],
70
+ uniform bool enable_emission = false,
71
+ uniform color emissive_color = color(1.0, 0.1, 0.1),
72
+ color emissive_mask = color(1.0, 0.1, 0.1) [[ target_baked_argument("emissive_mask_texture", "emissive_mask_input", "R8_UNORM") ]],
73
+ uniform float emissive_intensity = 40.f,
74
+ uniform bool enable_opacity = false,
75
+ float alpha = 1.0,
76
+ uniform bool enable_opacity_cutout = false,
77
+ uniform float alpha_cutout_cutoff = 1.f,
78
+ uniform float opacity_ratio = 1.f,
79
+ uniform color opacity_tint = color(1.0f),
80
+ uniform float opacity_multiplier = 1.f
81
+ )
82
+ [[
83
+ target_material_model(),
84
+ target_material_rendering("..::SimPBR::SimPBR")
85
+ ]]
86
+ = let {
87
+ color base_color = multiply_colors(diffuse_color, diffuse_tint, 1.0).tint;
88
+ color ao_weighted_base_color = multiply_colors(base_color, color(ao), ao_to_diffuse).tint;
89
+
90
+ float squared_roughness = roughness * roughness;
91
+ float roughness_u = squared_roughness * (1 + anisotropy);
92
+ float roughness_v = squared_roughness * (1 - anisotropy);
93
+
94
+ color diffuse_transmission_color = base_color * opacity_tint * opacity_multiplier;
95
+
96
+ bsdf diffuse_bsdf = df::weighted_layer(
97
+ weight: opacity_ratio,
98
+ layer: df::diffuse_reflection_bsdf(
99
+ tint: ao_weighted_base_color,
100
+ roughness: 0.0f
101
+ ),
102
+ base: df::diffuse_transmission_bsdf(tint: diffuse_transmission_color),
103
+ normal: enable_clearcoat ? normal : state::normal()
104
+ );
105
+
106
+ bsdf ggx_smith_bsdf = df::microfacet_ggx_smith_bsdf(
107
+ roughness_u: roughness_u,
108
+ roughness_v: roughness_v,
109
+ tint: color(1.0, 1.0, 1.0),
110
+ mode: df::scatter_reflect
111
+ );
112
+
113
+ bsdf custom_curve_layer_bsdf = df::custom_curve_layer(
114
+ normal_reflectivity: 0.03,
115
+ grazing_reflectivity: 1.0,
116
+ exponent: 5.0,
117
+ weight: specular,
118
+ layer: ggx_smith_bsdf,
119
+ base: diffuse_bsdf,
120
+ normal: enable_clearcoat ? normal : state::normal()
121
+ );
122
+
123
+ //
124
+ // Begin RETROREFLECTION SUPPORT
125
+ //
126
+ color final_retroreflection_color = multiply_colors(retroreflection_tint, base_color, 1.0).tint;
127
+ bsdf backscattering_glossy_bsdf = df::backscattering_glossy_reflection_bsdf(
128
+ tint: final_retroreflection_color,
129
+ roughness_u: squared_roughness
130
+ );
131
+
132
+ /*bsdf retroreflection_bsdf = df::custom_curve_layer(
133
+ normal_reflectivity: 1.-normal_reflectivity,
134
+ grazing_reflectivity: 1.-grazing_reflectivity,
135
+ base: backscattering_glossy_bsdf,
136
+ layer: custom_curve_layer_bsdf,
137
+ normal: enable_clearcoat ? normal_lookup : state::normal()
138
+ );*/
139
+
140
+ // if normal_reflectivity and grazing_reflectivity are 1 and weight is 1, just the layer is used
141
+ bsdf opt_retroreflection_bsdf = df::custom_curve_layer(
142
+ normal_reflectivity: enable_retroreflection ? 1.-normal_reflectivity : 1,
143
+ grazing_reflectivity: enable_retroreflection ? 1.-grazing_reflectivity : 1,
144
+ base: backscattering_glossy_bsdf,
145
+ layer: custom_curve_layer_bsdf,
146
+ normal: enable_clearcoat ? normal : state::normal()
147
+ );
148
+
149
+ //
150
+ // End RETROREFLECTION SUPPORT
151
+ //
152
+
153
+ bsdf directional_factor_bsdf = df::directional_factor(
154
+ normal_tint: ao_weighted_base_color,
155
+ grazing_tint: color(1.0, 1.0, 1.0),
156
+ exponent: 5.0f,
157
+ base: ggx_smith_bsdf
158
+ );
159
+
160
+ // CLEARCOAT
161
+ bsdf omni_PBR_bsdf = df::weighted_layer(
162
+ weight: metallic,
163
+ layer: directional_factor_bsdf,
164
+ base: opt_retroreflection_bsdf, //enable_retroreflection ? retroreflection_bsdf : custom_curve_layer_bsdf,
165
+ normal: enable_clearcoat ? normal : state::normal()
166
+ );
167
+
168
+ bsdf clearcoat_bsdf = df::microfacet_ggx_smith_bsdf(
169
+ roughness_u: clearcoat_reflection_roughness * clearcoat_reflection_roughness,
170
+ roughness_v: clearcoat_reflection_roughness * clearcoat_reflection_roughness,
171
+ tint: color(1.0f),
172
+ mode: df::scatter_reflect
173
+ );
174
+
175
+ // bsdf omni_PBR_coated_bsdf = df::custom_curve_layer(
176
+ // normal_reflectivity: clearcoat_reflectivity * 0.08,
177
+ // grazing_reflectivity: 1.0,
178
+ // weight: clearcoat_weight,
179
+ // layer: clearcoat_bsdf,
180
+ // base: omni_PBR_bsdf,
181
+ // normal: final_clearcoat_normal
182
+ // );
183
+
184
+ bsdf opt_opaque_clearcoat = df::weighted_layer(
185
+ weight: enable_clearcoat ? clearcoat_transparency : 1,
186
+ layer: ::df::tint(tint: enable_clearcoat ? clearcoat_tint : color(1), base: omni_PBR_bsdf),
187
+ base: ::df::diffuse_reflection_bsdf(tint: clearcoat_tint)
188
+ );
189
+
190
+ bsdf opt_omni_PBR_coated_bsdf = df::fresnel_layer(
191
+ ior: clearcoat_ior,
192
+ weight: enable_clearcoat ? clearcoat_weight : 0,
193
+ layer: clearcoat_bsdf,
194
+ base: opt_opaque_clearcoat,
195
+ normal: clearcoat_normal
196
+ );
197
+
198
+ bsdf final_bsdf = opt_omni_PBR_coated_bsdf;
199
+ } in material(
200
+ thin_walled: false,
201
+ surface: material_surface(
202
+ scattering: final_bsdf,
203
+ emission: material_emission(
204
+ df::diffuse_edf(),
205
+ intensity: enable_emission ? emissive_color * emissive_mask * color(emissive_intensity) : color(0)
206
+ )
207
+ ),
208
+ geometry: material_geometry(
209
+ normal: enable_clearcoat ? state::normal() : normal,
210
+ cutout_opacity: enable_opacity ? (enable_opacity_cutout ? (alpha < alpha_cutout_cutoff ? 0.0 : 1.0) : alpha) : 1.0
211
+ )
212
+ );
objects/appleseed_sofatable/materials/omniverse/simready_content/materials/baking_annotations.mdl ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.4;
2
+ import ::anno::*;
3
+
4
+ export const string TRANSFORM_NONE = "NONE";
5
+ export const string TRANSFORM_UNORM_VECTOR = "UNORM_VECTOR";
6
+
7
+ export const string FORMAT_RGBA8_UNORM = "RGBA8_UNORM";
8
+ export const string FORMAT_R8_UNORM = "R8_UNORM";
9
+ export const string FORMAT_RGBA16_SFLOAT = "RGBA16_SFLOAT";
10
+
11
+ export const string BLEND_MODE_OPACITY = "opacity_blend";
12
+ export const string BLEND_MODE_REPLACE = "replace";
13
+
14
+ // This annotation is used to mark a material as target material for baking.
15
+ // It is that is detected by the MDL SDK and neuray.
16
+ export annotation target_material_model();
17
+
18
+ export annotation target_material_rendering(
19
+ string rendering_material_override = "" // if set, the baked material will be rendering using this material,
20
+ // otherwise the target itself is used
21
+ );
22
+
23
+ export annotation target_baked_argument(
24
+ // the name of the baked texture parameter in the rendering material
25
+ string baked_name,
26
+
27
+ // the name of the constant parameter in the rendering material in case baking was not necessary
28
+ string constant_name = "",
29
+
30
+ // texture format to bake to
31
+ string format = "",
32
+
33
+ // transformations, like encoding normals into [0,1] range
34
+ string transform = TRANSFORM_NONE,
35
+
36
+ // blending, e.g., based on alpha or replace
37
+ string blend_mode = BLEND_MODE_OPACITY
38
+ );
objects/av_book_11/av_book_11.usd ADDED
Binary file (41.8 kB). View file
 
objects/av_book_21/av_book_21.usd ADDED
Binary file (42 kB). View file
 
objects/av_coaster_hexagon/av_coaster_hexagon.usd ADDED
Binary file (6.44 kB). View file
 
objects/cline/materials/omniverse/simready_content/materials/SimPBR.mdl ADDED
@@ -0,0 +1,562 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*****************************************************************************
2
+ * Copyright 1986-2020 NVIDIA Corporation. All rights reserved.
3
+ ******************************************************************************
4
+
5
+ MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,
6
+ WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,
7
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
8
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
9
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
10
+ COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA
11
+ CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
12
+ ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
13
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
14
+ THE USE OR INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN
15
+ THE MDL MATERIALS.
16
+ */
17
+
18
+ mdl 1.4;
19
+
20
+ import ::df::*;
21
+ import ::state::*;
22
+ import ::math::*;
23
+ import ::base::*;
24
+ import ::tex::*;
25
+ import ::anno::*;
26
+
27
+ import ::nvidia::core_definitions::file_texture;
28
+ import ::nvidia::core_definitions::normalmap_texture;
29
+
30
+ using .::SimPBR_Model import *;
31
+ using .::baking_annotations import *;
32
+
33
+ export material SimPBR(
34
+ // -------------------- DIFFUSE REFLECTION ----------------------
35
+ color diffuse_color_constant = color(0.2f)
36
+ [[
37
+ anno::display_name("Albedo Base Color"),
38
+ anno::description("The base albedo color to use if no texture is specified"),
39
+ anno::in_group("Diffuse")
40
+ ]],
41
+ uniform texture_2d diffuse_texture = texture_2d()
42
+ [[
43
+ anno::display_name("Albedo Map"),
44
+ anno::description("The texture specifying the albedo value to use"),
45
+ anno::in_group("Diffuse")
46
+ ]],
47
+ uniform color diffuse_tint = color(1.0f)
48
+ [[
49
+ anno::display_name("Albedo Tint"),
50
+ anno::description("This tints the albedo color or texture contant"),
51
+ anno::in_group("Diffuse")
52
+ ]],
53
+ uniform bool enable_transmission = false
54
+ [[
55
+ anno::display_name("Enable Diffuse Transmission"),
56
+ anno::description("Enables the diffuse transmission of light through thin diffuse scattering layer"),
57
+ anno::in_group("Diffuse")
58
+ ]],
59
+ uniform float opacity_ratio = 1.f
60
+ [[
61
+ anno::enable_if("enable_transmission == true"),
62
+ anno::display_name("Opacity Ratio"),
63
+ anno::description("Amount of opacity"),
64
+ anno::in_group("Diffuse")
65
+ ]],
66
+ uniform color opacity_tint = color(1.0f)
67
+ [[
68
+ anno::enable_if("enable_transmission == true"),
69
+ anno::display_name("Diffuse transmission tint"),
70
+ anno::description("Base diffuse transmission color"),
71
+ anno::in_group("Diffuse")
72
+ ]],
73
+ uniform float opacity_multiplier = 1.f
74
+ [[
75
+ anno::enable_if("enable_transmission == true"),
76
+ anno::display_name("Diffuse transmission multiplier"),
77
+ anno::description("Base diffuse transmission multiplier"),
78
+ anno::in_group("Diffuse")
79
+ ]],
80
+
81
+ // -------------------- SPECULAR REFLECTION ----------------------
82
+ float reflection_roughness_constant = 0.5f
83
+ [[
84
+ anno::display_name("Roughness Amount"),
85
+ anno::hard_range(0.0,1.),
86
+ anno::description("Higher roughness values lead to more blurry reflections"),
87
+ anno::in_group("Specular")
88
+ ]],
89
+ uniform float reflection_roughness_texture_influence = 0.0f
90
+ [[
91
+ anno::display_name("Roughness Map Influence"),
92
+ anno::hard_range(0.0, 1.),
93
+ anno::description("Blends between the constant value and the lookup of the roughness texture"),
94
+ anno::in_group("Specular")
95
+ ]],
96
+ uniform texture_2d reflectionroughness_texture = texture_2d()
97
+ [[
98
+ anno::display_name("Roughness Map"),
99
+ anno::in_group("Specular")
100
+ ]],
101
+
102
+ float anisotropy_constant = 0.0f
103
+ [[
104
+ anno::display_name("Anisotropy Amount"),
105
+ anno::hard_range(-1.,1.),
106
+ anno::description("0 for isotropic, extents of -1 to 1 for anisotropy"),
107
+ anno::in_group("Specular")
108
+ ]],
109
+ uniform float anisotropy_texture_influence = 0.0f
110
+ [[
111
+ anno::display_name("Anisotropy Map Influence"),
112
+ anno::hard_range(0.0, 1.),
113
+ anno::description("Blends between the constant value and the lookup of the anisotropy texture"),
114
+ anno::in_group("Specular")
115
+ ]],
116
+ uniform texture_2d anisotropy_texture = texture_2d()
117
+ [[
118
+ anno::display_name("Anisotropy Map"),
119
+ anno::in_group("Specular")
120
+ ]],
121
+
122
+ float metallic_constant = 0.f
123
+ [[
124
+ anno::display_name("Metallic Amount"),
125
+ anno::hard_range(0.0,1.),
126
+ anno::description("Metallic Material"),
127
+ anno::in_group("Specular")
128
+ ]],
129
+ uniform float metallic_texture_influence = 0.0f
130
+ [[
131
+ anno::display_name("Metallic Map Influence"),
132
+ anno::hard_range(0.0, 1.),
133
+ anno::description("Blends between the constant value and the lookup of the metallic texture"),
134
+ anno::in_group("Specular")
135
+ ]],
136
+ uniform texture_2d metallic_texture = texture_2d()
137
+ [[
138
+ anno::display_name("Metallic Map"),
139
+ anno::in_group("Specular")
140
+ ]],
141
+
142
+ float specular_constant = 1.f
143
+ [[
144
+ anno::display_name("Specular amount"),
145
+ anno::hard_range(0.0, 1.0),
146
+ anno::description("Scale of the specular component"),
147
+ anno::in_group("Specular")
148
+ ]],
149
+ uniform texture_2d specular_texture = texture_2d()
150
+ [[
151
+ anno::display_name("Specular Map"),
152
+ anno::in_group("Specular")
153
+ ]],
154
+
155
+ // -------------------- ORM ----------------------
156
+ uniform bool enable_ORM_texture = true
157
+ [[
158
+ anno::display_name("Enable ORM Texture"),
159
+ anno::description("When True the ORM texture will be used to extract the Occlusion, Roughness and Metallic Map"),
160
+ anno::in_group("Reflectivity")
161
+ ]],
162
+ uniform texture_2d ORM_texture = texture_2d()
163
+ [[
164
+ anno::display_name("ORM Map"),
165
+ anno::description("Texture that hae Occlusion, Roughness and Metallic map stored in the respective r, g and b channels"),
166
+ anno::in_group("Reflectivity")
167
+ ]],
168
+
169
+ // -------------------- Clearcoat ----------------------
170
+ uniform bool enable_clearcoat = false
171
+ [[
172
+ anno::display_name("Enable Clearcoat Layer"),
173
+ anno::description("Adds a clearcoat layer on top of the material when enabled"),
174
+ anno::in_group("Clearcoat")
175
+ ]],
176
+ color clearcoat_tint = color(1.0f)
177
+ [[
178
+ anno::display_name("Clearcoat Tint"),
179
+ anno::description("Clearcoat is tinted and affects the underlying material"),
180
+ anno::in_group("Clearcoat")
181
+ ]],
182
+ float clearcoat_transparency = 1.0f
183
+ [[
184
+ anno::display_name("Clearcoat Transparency"),
185
+ anno::description("Adjusts the transparency of the clearcoat. Can be turned into a fully opaque clearcoat "
186
+ "covering the underlying layer"),
187
+ anno::in_group("Clearcoat")
188
+ ]],
189
+ float clearcoat_reflection_roughness = 0.0f
190
+ [[
191
+ anno::display_name("Clearcoat Roughness"),
192
+ anno::description("Higher roughness values lead to more blurry reflections"),
193
+ anno::hard_range(0.0f, 1.0f),
194
+ anno::in_group("Clearcoat")
195
+ ]],
196
+ float clearcoat_weight = 1.0f
197
+ [[
198
+ anno::display_name("Clearcoat Weight"),
199
+ anno::description("Sets the weight for clearcoat layer"),
200
+ anno::hard_range(0.0f, 1.0f),
201
+ anno::in_group("Clearcoat")
202
+ ]],
203
+ float clearcoat_flatten = 1.0f
204
+ [[
205
+ anno::display_name("Clearcoat Flatten"),
206
+ anno::description("Flattens the clearcoat to even out the underlying bump maps"),
207
+ anno::hard_range(0.0f, 1.0f),
208
+ anno::in_group("Clearcoat")
209
+ ]],
210
+ float clearcoat_ior = 1.56f
211
+ [[
212
+ anno::display_name("Clearcoat IOR"),
213
+ anno::description("Sets the Index of refraction for the clearcoat layer"),
214
+ anno::soft_range(1.0f, 4.0f),
215
+ anno::in_group("Clearcoat")
216
+ ]],
217
+ uniform float clearcoat_bump_factor = 1.f
218
+ [[
219
+ anno::display_name("Clearcoat Normal Map Strength"),
220
+ anno::description("Strength of normal map."),
221
+ anno::in_group("Clearcoat")
222
+ ]],
223
+
224
+ float3 clearcoat_normal_input = float3(0.0, 0.0, 0.0),
225
+ uniform texture_2d clearcoat_normalmap_texture = texture_2d()
226
+ [[
227
+ anno::display_name("Clearcoat Normal Map"),
228
+ anno::description("Enables the usage of the normalmap texture"),
229
+ anno::in_group("Clearcoat")
230
+ ]],
231
+
232
+ uniform bool clearcoat_flip_tangent_u = false
233
+ [[
234
+ anno::display_name("Clearcoat Normal Map Flip U Tangent"),
235
+ anno::in_group("Clearcoat")
236
+ ]],
237
+ uniform bool clearcoat_flip_tangent_v = true
238
+ [[
239
+ anno::display_name("Clearcoat Normal Map Flip V Tangent"),
240
+ anno::in_group("Clearcoat")
241
+ ]],
242
+
243
+
244
+ // -------------------- REFLECTIVITY ----------------------
245
+ uniform bool enable_retroreflection = false
246
+ [[
247
+ anno::display_name("Enable Retroreflection"),
248
+ anno::in_group("Reflectivity")
249
+ ]],
250
+ color retroreflection_tint = color(.182,.800,.000)
251
+ [[
252
+ anno::display_name("Retro-reflection tint"),
253
+ anno::description("The tint of the retroreflection"),
254
+ anno::in_group("Reflectivity")
255
+ ]],
256
+ uniform float normal_reflectivity = 0.5
257
+ [[
258
+ anno::display_name("Retro-reflection weight facing"),
259
+ anno::hard_range(0.0,1.),
260
+ anno::description("Reflectivity control for geometry facing the viewer"),
261
+ anno::in_group("Reflectivity")
262
+ ]],
263
+ uniform float grazing_reflectivity = 1.0
264
+ [[
265
+ anno::display_name("Retro-reflection weight edge"),
266
+ anno::hard_range(0.0,1.),
267
+ anno::description("Reflectivity control for the reflectivity at geometry edges"),
268
+ anno::in_group("Reflectivity")
269
+ ]],
270
+
271
+ // -------------------- AMBIENT OCCLUSION ----------------------
272
+ float ao_to_diffuse = 0.0
273
+ [[
274
+ anno::display_name("AO to Diffuse"),
275
+ anno::description("Controls the amount of ambient occlusion multiplied into the diffuse color channel"),
276
+ anno::in_group("AO")
277
+ ]],
278
+ float ao_input = float(1.0),
279
+ uniform texture_2d ao_texture = texture_2d()
280
+ [[
281
+ anno::display_name("Ambient Occlusion Map"),
282
+ anno::description("The Ambient Occlusion texture for the material"),
283
+ anno::in_group("AO")
284
+ ]],
285
+
286
+ // -------------------- EMISSIVE ----------------------
287
+ uniform bool enable_emission = false
288
+ [[
289
+ anno::display_name("Enable Emission"),
290
+ anno::description("Enables the emission of light from the material"),
291
+ anno::in_group("Emissive")
292
+ ]],
293
+ uniform color emissive_color = color(1.0, 0.1, 0.1)
294
+ [[
295
+ anno::enable_if("enable_emission == true"),
296
+ anno::display_name("Emissive Color"),
297
+ anno::description("The emission color"),
298
+ anno::in_group("Emissive")
299
+ ]],
300
+
301
+ color emissive_mask_input = color(1.0),
302
+ uniform texture_2d emissive_mask_texture = texture_2d()
303
+ [[
304
+ anno::enable_if("enable_emission == true"),
305
+ anno::display_name("Emissive Mask Map"),
306
+ anno::description("The texture masking the emissive color"),
307
+ anno::in_group("Emissive")
308
+ ]],
309
+ uniform float emissive_intensity = 40.f
310
+ [[
311
+ anno::enable_if("enable_emission == true"),
312
+ anno::display_name("Emissive Intensity"),
313
+ anno::description("Intensity of the emission"),
314
+ anno::in_group("Emissive")
315
+ ]],
316
+ uniform bool enable_emissive_flipbook = false
317
+ [[
318
+ anno::display_name("Enable Flipbook for emission"),
319
+ anno::description("Allows the use of animated emissive textures (e.g. video screens)"),
320
+ anno::in_group("Emissive")
321
+ ]],
322
+ uniform int2 flipbook_dim = int2(1,1)
323
+ [[
324
+ anno::enable_if("enable_emissive_flipbook == true"),
325
+ anno::display_name("Flipbook Rows/Columns"),
326
+ anno::description("How many rows and columns are in the flipbook?"),
327
+ anno::in_group("Emissive")
328
+ ]],
329
+ uniform int target_fps = 1
330
+ [[
331
+ anno::enable_if("enable_emissive_flipbook == true"),
332
+ anno::display_name("Flipbook Target FPS"),
333
+ anno::description("Playback speed in frames per second"),
334
+ anno::in_group("Emissive")
335
+ ]],
336
+
337
+ // -------------------- ALPHA ----------------------
338
+ uniform bool enable_opacity = false
339
+ [[
340
+ anno::display_name("Enable Opacity"),
341
+ anno::description("Enables or disables alpha functionality"),
342
+ anno::in_group("Alpha")
343
+ ]],
344
+ float alpha_constant = 1.0
345
+ [[
346
+ anno::enable_if("enable_opacity == true"),
347
+ anno::display_name("Opacity Fallback Constant"),
348
+ anno::hard_range(0.0, 1.0),
349
+ anno::description("The base alpha constant to use if no texture is specified"),
350
+ anno::in_group("Alpha")
351
+ ]],
352
+ uniform texture_2d opacity_texture = texture_2d()
353
+ [[
354
+ anno::enable_if("enable_opacity == true"),
355
+ anno::display_name("Opacity Map"),
356
+ anno::description("The texture specifying the opacity value to use"),
357
+ anno::in_group("Alpha")
358
+ ]],
359
+ uniform bool enable_opacity_cutout = false
360
+ [[
361
+ anno::enable_if("enable_opacity == true"),
362
+ anno::display_name("Enable Alpha Cutout"),
363
+ anno::description("Enables or disables alpha cutout functionality"),
364
+ anno::in_group("Alpha")
365
+ ]],
366
+ uniform float alpha_cutout_cutoff = 1.f
367
+ [[
368
+ anno::enable_if("enable_opacity == true"),
369
+ anno::enable_if("enable_opacity_cutout == true"),
370
+ anno::hard_range(0.0, 1.0),
371
+ anno::display_name("Alpha Cutout Cutoff"),
372
+ anno::description("The cutoff value to to render as transparent up to and opaque past"),
373
+ anno::in_group("Alpha")
374
+ ]],
375
+
376
+ // -------------------- NORMAL ----------------------
377
+ uniform float bump_factor = 1.f
378
+ [[
379
+ anno::display_name("Normal Map Strength"),
380
+ anno::description("Strength of normal map."),
381
+ anno::in_group("Normal")
382
+ ]],
383
+
384
+ float3 normal_input = state::normal(),
385
+ uniform texture_2d normalmap_texture = texture_2d()
386
+ [[
387
+ anno::display_name("Normal Map"),
388
+ anno::in_group("Normal")
389
+ ]],
390
+ uniform bool flip_tangent_u = false
391
+ [[
392
+ anno::display_name("Normal Map Flip U Tangent"),
393
+ anno::in_group("Normal")
394
+ ]],
395
+ uniform bool flip_tangent_v = true
396
+ [[
397
+ anno::display_name("Normal Map Flip V Tangent"),
398
+ anno::in_group("Normal")
399
+ ]],
400
+
401
+ // -------------------- UV ADJUSTMENTS ----------------------
402
+ uniform bool project_uvw = false
403
+ [[
404
+ anno::display_name("Enable Project UVW Coordinates"),
405
+ anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"),
406
+ anno::in_group("UV")
407
+ ]],
408
+ uniform bool world_or_object = false
409
+ [[
410
+ anno::enable_if("project_uvw == true"),
411
+ anno::display_name("Enable World Space"),
412
+ anno::description("When set to 'true' uses world space for projection, when 'false' object space is used"),
413
+ anno::in_group("UV")
414
+ ]],
415
+ uniform float2 texture_translate = float2(0.0f)
416
+ [[
417
+ anno::display_name("Texture Translate"),
418
+ anno::description("Controls position of texture."),
419
+ anno::in_group("UV")
420
+ ]],
421
+ uniform float2 texture_scale = float2(1.0f)
422
+ [[
423
+ anno::display_name("Texture Tiling"),
424
+ anno::description("Controls repetition of the texture."),
425
+ anno::in_group("UV")
426
+ ]],
427
+ uniform float2 texture_speed = float2(0.0f)
428
+ [[
429
+ anno::display_name("Texture Speed"),
430
+ anno::description("Scrolling texture animation speed in UVs per sec."),
431
+ anno::in_group("UV")
432
+ ]]
433
+ )
434
+ [[
435
+ anno::display_name("Sim PBR"),
436
+ anno::description("Supports the opaque alpha cutout material model of the Sim Renderer"),
437
+ anno::in_group("SimReady"),
438
+ anno::version( 1, 0, 0),
439
+ anno::author("NVIDIA CORPORATION"),
440
+ anno::key_words(string[]("Sim", "PBR", "opaque", "alpha", "cutout", "omniverse", "generic"))
441
+ ]]
442
+ = let {
443
+ base::texture_coordinate_system the_system = world_or_object ? base::texture_coordinate_world : base::texture_coordinate_object;
444
+
445
+ base::texture_coordinate_info uvw = project_uvw ?
446
+ base::coordinate_projection(
447
+ coordinate_system: the_system,
448
+ texture_space: 0,
449
+ projection_type: base::projection_cubic
450
+ ) : base::coordinate_source(
451
+ coordinate_system: base::texture_coordinate_uvw,
452
+ texture_space: 0
453
+ );
454
+
455
+ // Need to use a small value so the compiler doesnt optimize out this var...
456
+ float t = 0.00000001;//state::animation_time();
457
+ base::texture_coordinate_info transformed_uvw = base::transform_coordinate(
458
+ transform: base::rotation_translation_scale(
459
+ scaling: float3(texture_scale.x, texture_scale.y, 1.0),
460
+ rotation: float3(0.0, 0.0, 0.0 ),
461
+ translation: float3(texture_translate.x + t * texture_speed.x, texture_translate.y + t * texture_speed.y, 0.0)),
462
+ coordinate: uvw
463
+ );
464
+ float2 uv = float2(transformed_uvw.position.x, transformed_uvw.position.y);
465
+
466
+ // Diffuse Color Lookup and AO
467
+ float4 base_lookup = tex::texture_isvalid(diffuse_texture) ? tex::lookup_float4(tex: diffuse_texture, coord: uv) : float4(1, 1, 1, 1);
468
+
469
+ float opacityValue = tex::texture_isvalid(opacity_texture) ? tex::lookup_float4(tex: opacity_texture, coord: uv).w : alpha_constant;
470
+
471
+ // Normal calculations
472
+ float3 normal_lookup = tex::texture_isvalid(normalmap_texture) ?
473
+ base::tangent_space_normal_texture(
474
+ texture: normalmap_texture,
475
+ factor: bump_factor,
476
+ uvw: transformed_uvw,
477
+ flip_tangent_u: flip_tangent_u,
478
+ flip_tangent_v: flip_tangent_v
479
+ ) : normal_input;
480
+
481
+ float3 clearcoat_normal = tex::texture_isvalid(clearcoat_normalmap_texture) ?
482
+ base::tangent_space_normal_texture(
483
+ texture: clearcoat_normalmap_texture,
484
+ factor: clearcoat_bump_factor,
485
+ uvw: uvw,
486
+ flip_tangent_u: clearcoat_flip_tangent_u,
487
+ flip_tangent_v: clearcoat_flip_tangent_v
488
+ ) : clearcoat_normal_input;
489
+
490
+ float3 flattened_clearcoat_normal = ::math::lerp(normal_lookup, ::state::normal(), clearcoat_flatten);
491
+ float3 final_clearcoat_normal = tex::texture_isvalid(clearcoat_normalmap_texture) ? clearcoat_normal : flattened_clearcoat_normal;
492
+
493
+ float ao_lookup = tex::texture_isvalid(ao_texture) ? tex::lookup_float4(tex: ao_texture, coord: uv).x : ao_input;
494
+
495
+ color diffuse_color = tex::texture_isvalid(diffuse_texture) ? color(base_lookup.x, base_lookup.y, base_lookup.z) : diffuse_color_constant;
496
+
497
+ float3 ORM_lookup = tex::lookup_float3(
498
+ tex: ORM_texture,
499
+ coord: float2(transformed_uvw.position.x, transformed_uvw.position.y)
500
+ );
501
+
502
+ float roughness_lookup = tex::texture_isvalid(reflectionroughness_texture) ?
503
+ tex::lookup_float4(tex: reflectionroughness_texture, coord: uv).x : reflection_roughness_constant;
504
+ float anisotropy_lookup = tex::texture_isvalid(anisotropy_texture) ?
505
+ (tex::lookup_float4(tex: anisotropy_texture, coord: uv).x * 2.0f - 1.0f) : anisotropy_constant;
506
+ float metallic_lookup = tex::texture_isvalid(metallic_texture) ?
507
+ tex::lookup_float4(tex: metallic_texture, coord: uv).x : metallic_constant;
508
+ float specular_lookup = tex::texture_isvalid(specular_texture) ?
509
+ tex::lookup_float4(tex: specular_texture, coord: uv).x : specular_constant;
510
+
511
+ float roughness_selection = enable_ORM_texture ? ORM_lookup.y : roughness_lookup;
512
+ float metallic_selection = enable_ORM_texture ? ORM_lookup.z : metallic_lookup;
513
+ float ao = enable_ORM_texture ? ORM_lookup.x : ao_lookup;
514
+
515
+ float reflection_roughness = math::lerp(reflection_roughness_constant, roughness_selection, reflection_roughness_texture_influence);
516
+ float anisotropy = math::lerp(anisotropy_constant, anisotropy_lookup, anisotropy_texture_influence);
517
+ float metallic = math::lerp(metallic_constant, metallic_selection, metallic_texture_influence);
518
+
519
+ int rows = flipbook_dim.x;
520
+ int columns = flipbook_dim.y;
521
+ int numFrames = rows * columns;
522
+ varying int frameIdx = int(state::animation_time() * target_fps) % numFrames;
523
+ varying float2 baseUV = float2(transformed_uvw.position.x, transformed_uvw.position.y);
524
+ varying float2 emissiveUV = enable_emissive_flipbook ?
525
+ ((baseUV + float2(frameIdx % rows, frameIdx / rows)) / float2(rows, columns)) : baseUV;
526
+
527
+ color emissive_mask = tex::texture_isvalid(emissive_mask_texture) ?
528
+ tex::lookup_color(emissive_mask_texture, emissiveUV, tex::wrap_repeat, tex::wrap_repeat) : emissive_mask_input;
529
+
530
+ } in SimPBR_Model(
531
+ diffuse_color: diffuse_color,
532
+ diffuse_tint: diffuse_tint,
533
+ roughness: reflection_roughness,
534
+ anisotropy: anisotropy,
535
+ metallic: metallic,
536
+ specular: specular_lookup,
537
+ normal: normal_lookup,
538
+ enable_clearcoat: enable_clearcoat,
539
+ clearcoat_tint: clearcoat_tint,
540
+ clearcoat_transparency: clearcoat_transparency,
541
+ clearcoat_reflection_roughness: clearcoat_reflection_roughness,
542
+ clearcoat_weight: clearcoat_weight,
543
+ clearcoat_ior: clearcoat_ior,
544
+ clearcoat_normal: final_clearcoat_normal,
545
+ enable_retroreflection: enable_retroreflection,
546
+ retroreflection_tint: retroreflection_tint,
547
+ normal_reflectivity: normal_reflectivity,
548
+ grazing_reflectivity: grazing_reflectivity,
549
+ ao_to_diffuse: ao_to_diffuse,
550
+ ao: ao,
551
+ enable_emission: enable_emission,
552
+ emissive_color: emissive_color,
553
+ emissive_mask: emissive_mask,
554
+ emissive_intensity: emissive_intensity,
555
+ enable_opacity: enable_opacity,
556
+ alpha: opacityValue,
557
+ enable_opacity_cutout: enable_opacity_cutout,
558
+ alpha_cutout_cutoff: alpha_cutout_cutoff,
559
+ opacity_ratio: enable_transmission ? opacity_ratio : 1.0,
560
+ opacity_tint : opacity_tint,
561
+ opacity_multiplier : opacity_multiplier
562
+ );
objects/cline/materials/omniverse/simready_content/materials/SimPBR_Model.mdl ADDED
@@ -0,0 +1,212 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*****************************************************************************
2
+ * Copyright 1986-2020 NVIDIA Corporation. All rights reserved.
3
+ ******************************************************************************
4
+
5
+ MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,
6
+ WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,
7
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
8
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
9
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
10
+ COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA
11
+ CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
12
+ ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
13
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
14
+ THE USE OR INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN
15
+ THE MDL MATERIALS.
16
+ */
17
+
18
+ mdl 1.4;
19
+
20
+ import ::df::*;
21
+ import ::state::*;
22
+ import ::math::*;
23
+ import ::base::*;
24
+ import ::tex::*;
25
+ import ::anno::*;
26
+
27
+ using .::baking_annotations import *;
28
+
29
+ base::texture_return multiply_colors(
30
+ color color_1 = color(1.0, 1.0, 1.0),
31
+ color color_2 = color(.5, .5, .5),
32
+ float weight = 1.0
33
+ )
34
+ [[
35
+ anno::hidden()
36
+ ]]
37
+ {
38
+ return base::blend_color_layers(
39
+ layers: base::color_layer[](
40
+ base::color_layer(
41
+ layer_color: color_2,
42
+ weight: weight,
43
+ mode: base::color_layer_multiply
44
+ )
45
+ ), base: color_1
46
+ );
47
+ }
48
+
49
+ export material SimPBR_Model(
50
+ color diffuse_color = color(0.2f) [[ target_baked_argument("diffuse_texture", "diffuse_color_constant", "RGBA8_UNORM") ]],
51
+ uniform color diffuse_tint = color(1.0f),
52
+ float roughness = 0.5f [[ target_baked_argument("reflectionroughness_texture", "reflection_roughness_constant", "R8_UNORM") ]],
53
+ float anisotropy = 0.0f [[ target_baked_argument("anisotropy_texture", "anisotropy_constant", "R8_SNORM") ]],
54
+ float metallic = 0.f [[ target_baked_argument("metallic_texture", "metallic_constant", "R8_UNORM") ]],
55
+ float specular = 1.f [[ target_baked_argument("specular_texture", "specular_constant", "R8_UNORM") ]],
56
+ float3 normal = float3(0.0, 0.0, 0.0) [[ target_baked_argument("normalmap_texture", "normal_input", "RGBA8_SNORM", baking_annotations::TRANSFORM_UNORM_VECTOR) ]],
57
+ uniform bool enable_clearcoat = false,
58
+ color clearcoat_tint = color(1.0f),
59
+ float clearcoat_transparency = 1.0f,
60
+ float clearcoat_reflection_roughness = 0.0f,
61
+ float clearcoat_weight = 1.0f,
62
+ float clearcoat_ior = 1.56f,
63
+ float3 clearcoat_normal = float3(0.0, 0.0, 0.0) [[ target_baked_argument("clearcoat_normalmap_texture", "clearcoat_normal_input", "RGBA8_SNORM", baking_annotations::TRANSFORM_UNORM_VECTOR) ]],
64
+ uniform bool enable_retroreflection = false,
65
+ color retroreflection_tint = color(.182,.800,.000),
66
+ uniform float normal_reflectivity = 0.5,
67
+ uniform float grazing_reflectivity = 1.0,
68
+ float ao_to_diffuse = 0.0,
69
+ float ao = 1.0f [[ target_baked_argument("ao_texture", "ao_input", "R8_UNORM") ]],
70
+ uniform bool enable_emission = false,
71
+ uniform color emissive_color = color(1.0, 0.1, 0.1),
72
+ color emissive_mask = color(1.0, 0.1, 0.1) [[ target_baked_argument("emissive_mask_texture", "emissive_mask_input", "R8_UNORM") ]],
73
+ uniform float emissive_intensity = 40.f,
74
+ uniform bool enable_opacity = false,
75
+ float alpha = 1.0,
76
+ uniform bool enable_opacity_cutout = false,
77
+ uniform float alpha_cutout_cutoff = 1.f,
78
+ uniform float opacity_ratio = 1.f,
79
+ uniform color opacity_tint = color(1.0f),
80
+ uniform float opacity_multiplier = 1.f
81
+ )
82
+ [[
83
+ target_material_model(),
84
+ target_material_rendering("..::SimPBR::SimPBR")
85
+ ]]
86
+ = let {
87
+ color base_color = multiply_colors(diffuse_color, diffuse_tint, 1.0).tint;
88
+ color ao_weighted_base_color = multiply_colors(base_color, color(ao), ao_to_diffuse).tint;
89
+
90
+ float squared_roughness = roughness * roughness;
91
+ float roughness_u = squared_roughness * (1 + anisotropy);
92
+ float roughness_v = squared_roughness * (1 - anisotropy);
93
+
94
+ color diffuse_transmission_color = base_color * opacity_tint * opacity_multiplier;
95
+
96
+ bsdf diffuse_bsdf = df::weighted_layer(
97
+ weight: opacity_ratio,
98
+ layer: df::diffuse_reflection_bsdf(
99
+ tint: ao_weighted_base_color,
100
+ roughness: 0.0f
101
+ ),
102
+ base: df::diffuse_transmission_bsdf(tint: diffuse_transmission_color),
103
+ normal: enable_clearcoat ? normal : state::normal()
104
+ );
105
+
106
+ bsdf ggx_smith_bsdf = df::microfacet_ggx_smith_bsdf(
107
+ roughness_u: roughness_u,
108
+ roughness_v: roughness_v,
109
+ tint: color(1.0, 1.0, 1.0),
110
+ mode: df::scatter_reflect
111
+ );
112
+
113
+ bsdf custom_curve_layer_bsdf = df::custom_curve_layer(
114
+ normal_reflectivity: 0.03,
115
+ grazing_reflectivity: 1.0,
116
+ exponent: 5.0,
117
+ weight: specular,
118
+ layer: ggx_smith_bsdf,
119
+ base: diffuse_bsdf,
120
+ normal: enable_clearcoat ? normal : state::normal()
121
+ );
122
+
123
+ //
124
+ // Begin RETROREFLECTION SUPPORT
125
+ //
126
+ color final_retroreflection_color = multiply_colors(retroreflection_tint, base_color, 1.0).tint;
127
+ bsdf backscattering_glossy_bsdf = df::backscattering_glossy_reflection_bsdf(
128
+ tint: final_retroreflection_color,
129
+ roughness_u: squared_roughness
130
+ );
131
+
132
+ /*bsdf retroreflection_bsdf = df::custom_curve_layer(
133
+ normal_reflectivity: 1.-normal_reflectivity,
134
+ grazing_reflectivity: 1.-grazing_reflectivity,
135
+ base: backscattering_glossy_bsdf,
136
+ layer: custom_curve_layer_bsdf,
137
+ normal: enable_clearcoat ? normal_lookup : state::normal()
138
+ );*/
139
+
140
+ // if normal_reflectivity and grazing_reflectivity are 1 and weight is 1, just the layer is used
141
+ bsdf opt_retroreflection_bsdf = df::custom_curve_layer(
142
+ normal_reflectivity: enable_retroreflection ? 1.-normal_reflectivity : 1,
143
+ grazing_reflectivity: enable_retroreflection ? 1.-grazing_reflectivity : 1,
144
+ base: backscattering_glossy_bsdf,
145
+ layer: custom_curve_layer_bsdf,
146
+ normal: enable_clearcoat ? normal : state::normal()
147
+ );
148
+
149
+ //
150
+ // End RETROREFLECTION SUPPORT
151
+ //
152
+
153
+ bsdf directional_factor_bsdf = df::directional_factor(
154
+ normal_tint: ao_weighted_base_color,
155
+ grazing_tint: color(1.0, 1.0, 1.0),
156
+ exponent: 5.0f,
157
+ base: ggx_smith_bsdf
158
+ );
159
+
160
+ // CLEARCOAT
161
+ bsdf omni_PBR_bsdf = df::weighted_layer(
162
+ weight: metallic,
163
+ layer: directional_factor_bsdf,
164
+ base: opt_retroreflection_bsdf, //enable_retroreflection ? retroreflection_bsdf : custom_curve_layer_bsdf,
165
+ normal: enable_clearcoat ? normal : state::normal()
166
+ );
167
+
168
+ bsdf clearcoat_bsdf = df::microfacet_ggx_smith_bsdf(
169
+ roughness_u: clearcoat_reflection_roughness * clearcoat_reflection_roughness,
170
+ roughness_v: clearcoat_reflection_roughness * clearcoat_reflection_roughness,
171
+ tint: color(1.0f),
172
+ mode: df::scatter_reflect
173
+ );
174
+
175
+ // bsdf omni_PBR_coated_bsdf = df::custom_curve_layer(
176
+ // normal_reflectivity: clearcoat_reflectivity * 0.08,
177
+ // grazing_reflectivity: 1.0,
178
+ // weight: clearcoat_weight,
179
+ // layer: clearcoat_bsdf,
180
+ // base: omni_PBR_bsdf,
181
+ // normal: final_clearcoat_normal
182
+ // );
183
+
184
+ bsdf opt_opaque_clearcoat = df::weighted_layer(
185
+ weight: enable_clearcoat ? clearcoat_transparency : 1,
186
+ layer: ::df::tint(tint: enable_clearcoat ? clearcoat_tint : color(1), base: omni_PBR_bsdf),
187
+ base: ::df::diffuse_reflection_bsdf(tint: clearcoat_tint)
188
+ );
189
+
190
+ bsdf opt_omni_PBR_coated_bsdf = df::fresnel_layer(
191
+ ior: clearcoat_ior,
192
+ weight: enable_clearcoat ? clearcoat_weight : 0,
193
+ layer: clearcoat_bsdf,
194
+ base: opt_opaque_clearcoat,
195
+ normal: clearcoat_normal
196
+ );
197
+
198
+ bsdf final_bsdf = opt_omni_PBR_coated_bsdf;
199
+ } in material(
200
+ thin_walled: false,
201
+ surface: material_surface(
202
+ scattering: final_bsdf,
203
+ emission: material_emission(
204
+ df::diffuse_edf(),
205
+ intensity: enable_emission ? emissive_color * emissive_mask * color(emissive_intensity) : color(0)
206
+ )
207
+ ),
208
+ geometry: material_geometry(
209
+ normal: enable_clearcoat ? state::normal() : normal,
210
+ cutout_opacity: enable_opacity ? (enable_opacity_cutout ? (alpha < alpha_cutout_cutoff ? 0.0 : 1.0) : alpha) : 1.0
211
+ )
212
+ );
objects/cline/materials/omniverse/simready_content/materials/baking_annotations.mdl ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.4;
2
+ import ::anno::*;
3
+
4
+ export const string TRANSFORM_NONE = "NONE";
5
+ export const string TRANSFORM_UNORM_VECTOR = "UNORM_VECTOR";
6
+
7
+ export const string FORMAT_RGBA8_UNORM = "RGBA8_UNORM";
8
+ export const string FORMAT_R8_UNORM = "R8_UNORM";
9
+ export const string FORMAT_RGBA16_SFLOAT = "RGBA16_SFLOAT";
10
+
11
+ export const string BLEND_MODE_OPACITY = "opacity_blend";
12
+ export const string BLEND_MODE_REPLACE = "replace";
13
+
14
+ // This annotation is used to mark a material as target material for baking.
15
+ // It is that is detected by the MDL SDK and neuray.
16
+ export annotation target_material_model();
17
+
18
+ export annotation target_material_rendering(
19
+ string rendering_material_override = "" // if set, the baked material will be rendering using this material,
20
+ // otherwise the target itself is used
21
+ );
22
+
23
+ export annotation target_baked_argument(
24
+ // the name of the baked texture parameter in the rendering material
25
+ string baked_name,
26
+
27
+ // the name of the constant parameter in the rendering material in case baking was not necessary
28
+ string constant_name = "",
29
+
30
+ // texture format to bake to
31
+ string format = "",
32
+
33
+ // transformations, like encoding normals into [0,1] range
34
+ string transform = TRANSFORM_NONE,
35
+
36
+ // blending, e.g., based on alpha or replace
37
+ string blend_mode = BLEND_MODE_OPACITY
38
+ );
objects/contemporary_laterialfile/materials/omniverse/simready_content/materials/SimPBR.mdl ADDED
@@ -0,0 +1,562 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*****************************************************************************
2
+ * Copyright 1986-2020 NVIDIA Corporation. All rights reserved.
3
+ ******************************************************************************
4
+
5
+ MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,
6
+ WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,
7
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
8
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
9
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
10
+ COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA
11
+ CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
12
+ ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
13
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
14
+ THE USE OR INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN
15
+ THE MDL MATERIALS.
16
+ */
17
+
18
+ mdl 1.4;
19
+
20
+ import ::df::*;
21
+ import ::state::*;
22
+ import ::math::*;
23
+ import ::base::*;
24
+ import ::tex::*;
25
+ import ::anno::*;
26
+
27
+ import ::nvidia::core_definitions::file_texture;
28
+ import ::nvidia::core_definitions::normalmap_texture;
29
+
30
+ using .::SimPBR_Model import *;
31
+ using .::baking_annotations import *;
32
+
33
+ export material SimPBR(
34
+ // -------------------- DIFFUSE REFLECTION ----------------------
35
+ color diffuse_color_constant = color(0.2f)
36
+ [[
37
+ anno::display_name("Albedo Base Color"),
38
+ anno::description("The base albedo color to use if no texture is specified"),
39
+ anno::in_group("Diffuse")
40
+ ]],
41
+ uniform texture_2d diffuse_texture = texture_2d()
42
+ [[
43
+ anno::display_name("Albedo Map"),
44
+ anno::description("The texture specifying the albedo value to use"),
45
+ anno::in_group("Diffuse")
46
+ ]],
47
+ uniform color diffuse_tint = color(1.0f)
48
+ [[
49
+ anno::display_name("Albedo Tint"),
50
+ anno::description("This tints the albedo color or texture contant"),
51
+ anno::in_group("Diffuse")
52
+ ]],
53
+ uniform bool enable_transmission = false
54
+ [[
55
+ anno::display_name("Enable Diffuse Transmission"),
56
+ anno::description("Enables the diffuse transmission of light through thin diffuse scattering layer"),
57
+ anno::in_group("Diffuse")
58
+ ]],
59
+ uniform float opacity_ratio = 1.f
60
+ [[
61
+ anno::enable_if("enable_transmission == true"),
62
+ anno::display_name("Opacity Ratio"),
63
+ anno::description("Amount of opacity"),
64
+ anno::in_group("Diffuse")
65
+ ]],
66
+ uniform color opacity_tint = color(1.0f)
67
+ [[
68
+ anno::enable_if("enable_transmission == true"),
69
+ anno::display_name("Diffuse transmission tint"),
70
+ anno::description("Base diffuse transmission color"),
71
+ anno::in_group("Diffuse")
72
+ ]],
73
+ uniform float opacity_multiplier = 1.f
74
+ [[
75
+ anno::enable_if("enable_transmission == true"),
76
+ anno::display_name("Diffuse transmission multiplier"),
77
+ anno::description("Base diffuse transmission multiplier"),
78
+ anno::in_group("Diffuse")
79
+ ]],
80
+
81
+ // -------------------- SPECULAR REFLECTION ----------------------
82
+ float reflection_roughness_constant = 0.5f
83
+ [[
84
+ anno::display_name("Roughness Amount"),
85
+ anno::hard_range(0.0,1.),
86
+ anno::description("Higher roughness values lead to more blurry reflections"),
87
+ anno::in_group("Specular")
88
+ ]],
89
+ uniform float reflection_roughness_texture_influence = 0.0f
90
+ [[
91
+ anno::display_name("Roughness Map Influence"),
92
+ anno::hard_range(0.0, 1.),
93
+ anno::description("Blends between the constant value and the lookup of the roughness texture"),
94
+ anno::in_group("Specular")
95
+ ]],
96
+ uniform texture_2d reflectionroughness_texture = texture_2d()
97
+ [[
98
+ anno::display_name("Roughness Map"),
99
+ anno::in_group("Specular")
100
+ ]],
101
+
102
+ float anisotropy_constant = 0.0f
103
+ [[
104
+ anno::display_name("Anisotropy Amount"),
105
+ anno::hard_range(-1.,1.),
106
+ anno::description("0 for isotropic, extents of -1 to 1 for anisotropy"),
107
+ anno::in_group("Specular")
108
+ ]],
109
+ uniform float anisotropy_texture_influence = 0.0f
110
+ [[
111
+ anno::display_name("Anisotropy Map Influence"),
112
+ anno::hard_range(0.0, 1.),
113
+ anno::description("Blends between the constant value and the lookup of the anisotropy texture"),
114
+ anno::in_group("Specular")
115
+ ]],
116
+ uniform texture_2d anisotropy_texture = texture_2d()
117
+ [[
118
+ anno::display_name("Anisotropy Map"),
119
+ anno::in_group("Specular")
120
+ ]],
121
+
122
+ float metallic_constant = 0.f
123
+ [[
124
+ anno::display_name("Metallic Amount"),
125
+ anno::hard_range(0.0,1.),
126
+ anno::description("Metallic Material"),
127
+ anno::in_group("Specular")
128
+ ]],
129
+ uniform float metallic_texture_influence = 0.0f
130
+ [[
131
+ anno::display_name("Metallic Map Influence"),
132
+ anno::hard_range(0.0, 1.),
133
+ anno::description("Blends between the constant value and the lookup of the metallic texture"),
134
+ anno::in_group("Specular")
135
+ ]],
136
+ uniform texture_2d metallic_texture = texture_2d()
137
+ [[
138
+ anno::display_name("Metallic Map"),
139
+ anno::in_group("Specular")
140
+ ]],
141
+
142
+ float specular_constant = 1.f
143
+ [[
144
+ anno::display_name("Specular amount"),
145
+ anno::hard_range(0.0, 1.0),
146
+ anno::description("Scale of the specular component"),
147
+ anno::in_group("Specular")
148
+ ]],
149
+ uniform texture_2d specular_texture = texture_2d()
150
+ [[
151
+ anno::display_name("Specular Map"),
152
+ anno::in_group("Specular")
153
+ ]],
154
+
155
+ // -------------------- ORM ----------------------
156
+ uniform bool enable_ORM_texture = true
157
+ [[
158
+ anno::display_name("Enable ORM Texture"),
159
+ anno::description("When True the ORM texture will be used to extract the Occlusion, Roughness and Metallic Map"),
160
+ anno::in_group("Reflectivity")
161
+ ]],
162
+ uniform texture_2d ORM_texture = texture_2d()
163
+ [[
164
+ anno::display_name("ORM Map"),
165
+ anno::description("Texture that hae Occlusion, Roughness and Metallic map stored in the respective r, g and b channels"),
166
+ anno::in_group("Reflectivity")
167
+ ]],
168
+
169
+ // -------------------- Clearcoat ----------------------
170
+ uniform bool enable_clearcoat = false
171
+ [[
172
+ anno::display_name("Enable Clearcoat Layer"),
173
+ anno::description("Adds a clearcoat layer on top of the material when enabled"),
174
+ anno::in_group("Clearcoat")
175
+ ]],
176
+ color clearcoat_tint = color(1.0f)
177
+ [[
178
+ anno::display_name("Clearcoat Tint"),
179
+ anno::description("Clearcoat is tinted and affects the underlying material"),
180
+ anno::in_group("Clearcoat")
181
+ ]],
182
+ float clearcoat_transparency = 1.0f
183
+ [[
184
+ anno::display_name("Clearcoat Transparency"),
185
+ anno::description("Adjusts the transparency of the clearcoat. Can be turned into a fully opaque clearcoat "
186
+ "covering the underlying layer"),
187
+ anno::in_group("Clearcoat")
188
+ ]],
189
+ float clearcoat_reflection_roughness = 0.0f
190
+ [[
191
+ anno::display_name("Clearcoat Roughness"),
192
+ anno::description("Higher roughness values lead to more blurry reflections"),
193
+ anno::hard_range(0.0f, 1.0f),
194
+ anno::in_group("Clearcoat")
195
+ ]],
196
+ float clearcoat_weight = 1.0f
197
+ [[
198
+ anno::display_name("Clearcoat Weight"),
199
+ anno::description("Sets the weight for clearcoat layer"),
200
+ anno::hard_range(0.0f, 1.0f),
201
+ anno::in_group("Clearcoat")
202
+ ]],
203
+ float clearcoat_flatten = 1.0f
204
+ [[
205
+ anno::display_name("Clearcoat Flatten"),
206
+ anno::description("Flattens the clearcoat to even out the underlying bump maps"),
207
+ anno::hard_range(0.0f, 1.0f),
208
+ anno::in_group("Clearcoat")
209
+ ]],
210
+ float clearcoat_ior = 1.56f
211
+ [[
212
+ anno::display_name("Clearcoat IOR"),
213
+ anno::description("Sets the Index of refraction for the clearcoat layer"),
214
+ anno::soft_range(1.0f, 4.0f),
215
+ anno::in_group("Clearcoat")
216
+ ]],
217
+ uniform float clearcoat_bump_factor = 1.f
218
+ [[
219
+ anno::display_name("Clearcoat Normal Map Strength"),
220
+ anno::description("Strength of normal map."),
221
+ anno::in_group("Clearcoat")
222
+ ]],
223
+
224
+ float3 clearcoat_normal_input = float3(0.0, 0.0, 0.0),
225
+ uniform texture_2d clearcoat_normalmap_texture = texture_2d()
226
+ [[
227
+ anno::display_name("Clearcoat Normal Map"),
228
+ anno::description("Enables the usage of the normalmap texture"),
229
+ anno::in_group("Clearcoat")
230
+ ]],
231
+
232
+ uniform bool clearcoat_flip_tangent_u = false
233
+ [[
234
+ anno::display_name("Clearcoat Normal Map Flip U Tangent"),
235
+ anno::in_group("Clearcoat")
236
+ ]],
237
+ uniform bool clearcoat_flip_tangent_v = true
238
+ [[
239
+ anno::display_name("Clearcoat Normal Map Flip V Tangent"),
240
+ anno::in_group("Clearcoat")
241
+ ]],
242
+
243
+
244
+ // -------------------- REFLECTIVITY ----------------------
245
+ uniform bool enable_retroreflection = false
246
+ [[
247
+ anno::display_name("Enable Retroreflection"),
248
+ anno::in_group("Reflectivity")
249
+ ]],
250
+ color retroreflection_tint = color(.182,.800,.000)
251
+ [[
252
+ anno::display_name("Retro-reflection tint"),
253
+ anno::description("The tint of the retroreflection"),
254
+ anno::in_group("Reflectivity")
255
+ ]],
256
+ uniform float normal_reflectivity = 0.5
257
+ [[
258
+ anno::display_name("Retro-reflection weight facing"),
259
+ anno::hard_range(0.0,1.),
260
+ anno::description("Reflectivity control for geometry facing the viewer"),
261
+ anno::in_group("Reflectivity")
262
+ ]],
263
+ uniform float grazing_reflectivity = 1.0
264
+ [[
265
+ anno::display_name("Retro-reflection weight edge"),
266
+ anno::hard_range(0.0,1.),
267
+ anno::description("Reflectivity control for the reflectivity at geometry edges"),
268
+ anno::in_group("Reflectivity")
269
+ ]],
270
+
271
+ // -------------------- AMBIENT OCCLUSION ----------------------
272
+ float ao_to_diffuse = 0.0
273
+ [[
274
+ anno::display_name("AO to Diffuse"),
275
+ anno::description("Controls the amount of ambient occlusion multiplied into the diffuse color channel"),
276
+ anno::in_group("AO")
277
+ ]],
278
+ float ao_input = float(1.0),
279
+ uniform texture_2d ao_texture = texture_2d()
280
+ [[
281
+ anno::display_name("Ambient Occlusion Map"),
282
+ anno::description("The Ambient Occlusion texture for the material"),
283
+ anno::in_group("AO")
284
+ ]],
285
+
286
+ // -------------------- EMISSIVE ----------------------
287
+ uniform bool enable_emission = false
288
+ [[
289
+ anno::display_name("Enable Emission"),
290
+ anno::description("Enables the emission of light from the material"),
291
+ anno::in_group("Emissive")
292
+ ]],
293
+ uniform color emissive_color = color(1.0, 0.1, 0.1)
294
+ [[
295
+ anno::enable_if("enable_emission == true"),
296
+ anno::display_name("Emissive Color"),
297
+ anno::description("The emission color"),
298
+ anno::in_group("Emissive")
299
+ ]],
300
+
301
+ color emissive_mask_input = color(1.0),
302
+ uniform texture_2d emissive_mask_texture = texture_2d()
303
+ [[
304
+ anno::enable_if("enable_emission == true"),
305
+ anno::display_name("Emissive Mask Map"),
306
+ anno::description("The texture masking the emissive color"),
307
+ anno::in_group("Emissive")
308
+ ]],
309
+ uniform float emissive_intensity = 40.f
310
+ [[
311
+ anno::enable_if("enable_emission == true"),
312
+ anno::display_name("Emissive Intensity"),
313
+ anno::description("Intensity of the emission"),
314
+ anno::in_group("Emissive")
315
+ ]],
316
+ uniform bool enable_emissive_flipbook = false
317
+ [[
318
+ anno::display_name("Enable Flipbook for emission"),
319
+ anno::description("Allows the use of animated emissive textures (e.g. video screens)"),
320
+ anno::in_group("Emissive")
321
+ ]],
322
+ uniform int2 flipbook_dim = int2(1,1)
323
+ [[
324
+ anno::enable_if("enable_emissive_flipbook == true"),
325
+ anno::display_name("Flipbook Rows/Columns"),
326
+ anno::description("How many rows and columns are in the flipbook?"),
327
+ anno::in_group("Emissive")
328
+ ]],
329
+ uniform int target_fps = 1
330
+ [[
331
+ anno::enable_if("enable_emissive_flipbook == true"),
332
+ anno::display_name("Flipbook Target FPS"),
333
+ anno::description("Playback speed in frames per second"),
334
+ anno::in_group("Emissive")
335
+ ]],
336
+
337
+ // -------------------- ALPHA ----------------------
338
+ uniform bool enable_opacity = false
339
+ [[
340
+ anno::display_name("Enable Opacity"),
341
+ anno::description("Enables or disables alpha functionality"),
342
+ anno::in_group("Alpha")
343
+ ]],
344
+ float alpha_constant = 1.0
345
+ [[
346
+ anno::enable_if("enable_opacity == true"),
347
+ anno::display_name("Opacity Fallback Constant"),
348
+ anno::hard_range(0.0, 1.0),
349
+ anno::description("The base alpha constant to use if no texture is specified"),
350
+ anno::in_group("Alpha")
351
+ ]],
352
+ uniform texture_2d opacity_texture = texture_2d()
353
+ [[
354
+ anno::enable_if("enable_opacity == true"),
355
+ anno::display_name("Opacity Map"),
356
+ anno::description("The texture specifying the opacity value to use"),
357
+ anno::in_group("Alpha")
358
+ ]],
359
+ uniform bool enable_opacity_cutout = false
360
+ [[
361
+ anno::enable_if("enable_opacity == true"),
362
+ anno::display_name("Enable Alpha Cutout"),
363
+ anno::description("Enables or disables alpha cutout functionality"),
364
+ anno::in_group("Alpha")
365
+ ]],
366
+ uniform float alpha_cutout_cutoff = 1.f
367
+ [[
368
+ anno::enable_if("enable_opacity == true"),
369
+ anno::enable_if("enable_opacity_cutout == true"),
370
+ anno::hard_range(0.0, 1.0),
371
+ anno::display_name("Alpha Cutout Cutoff"),
372
+ anno::description("The cutoff value to to render as transparent up to and opaque past"),
373
+ anno::in_group("Alpha")
374
+ ]],
375
+
376
+ // -------------------- NORMAL ----------------------
377
+ uniform float bump_factor = 1.f
378
+ [[
379
+ anno::display_name("Normal Map Strength"),
380
+ anno::description("Strength of normal map."),
381
+ anno::in_group("Normal")
382
+ ]],
383
+
384
+ float3 normal_input = state::normal(),
385
+ uniform texture_2d normalmap_texture = texture_2d()
386
+ [[
387
+ anno::display_name("Normal Map"),
388
+ anno::in_group("Normal")
389
+ ]],
390
+ uniform bool flip_tangent_u = false
391
+ [[
392
+ anno::display_name("Normal Map Flip U Tangent"),
393
+ anno::in_group("Normal")
394
+ ]],
395
+ uniform bool flip_tangent_v = true
396
+ [[
397
+ anno::display_name("Normal Map Flip V Tangent"),
398
+ anno::in_group("Normal")
399
+ ]],
400
+
401
+ // -------------------- UV ADJUSTMENTS ----------------------
402
+ uniform bool project_uvw = false
403
+ [[
404
+ anno::display_name("Enable Project UVW Coordinates"),
405
+ anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"),
406
+ anno::in_group("UV")
407
+ ]],
408
+ uniform bool world_or_object = false
409
+ [[
410
+ anno::enable_if("project_uvw == true"),
411
+ anno::display_name("Enable World Space"),
412
+ anno::description("When set to 'true' uses world space for projection, when 'false' object space is used"),
413
+ anno::in_group("UV")
414
+ ]],
415
+ uniform float2 texture_translate = float2(0.0f)
416
+ [[
417
+ anno::display_name("Texture Translate"),
418
+ anno::description("Controls position of texture."),
419
+ anno::in_group("UV")
420
+ ]],
421
+ uniform float2 texture_scale = float2(1.0f)
422
+ [[
423
+ anno::display_name("Texture Tiling"),
424
+ anno::description("Controls repetition of the texture."),
425
+ anno::in_group("UV")
426
+ ]],
427
+ uniform float2 texture_speed = float2(0.0f)
428
+ [[
429
+ anno::display_name("Texture Speed"),
430
+ anno::description("Scrolling texture animation speed in UVs per sec."),
431
+ anno::in_group("UV")
432
+ ]]
433
+ )
434
+ [[
435
+ anno::display_name("Sim PBR"),
436
+ anno::description("Supports the opaque alpha cutout material model of the Sim Renderer"),
437
+ anno::in_group("SimReady"),
438
+ anno::version( 1, 0, 0),
439
+ anno::author("NVIDIA CORPORATION"),
440
+ anno::key_words(string[]("Sim", "PBR", "opaque", "alpha", "cutout", "omniverse", "generic"))
441
+ ]]
442
+ = let {
443
+ base::texture_coordinate_system the_system = world_or_object ? base::texture_coordinate_world : base::texture_coordinate_object;
444
+
445
+ base::texture_coordinate_info uvw = project_uvw ?
446
+ base::coordinate_projection(
447
+ coordinate_system: the_system,
448
+ texture_space: 0,
449
+ projection_type: base::projection_cubic
450
+ ) : base::coordinate_source(
451
+ coordinate_system: base::texture_coordinate_uvw,
452
+ texture_space: 0
453
+ );
454
+
455
+ // Need to use a small value so the compiler doesnt optimize out this var...
456
+ float t = 0.00000001;//state::animation_time();
457
+ base::texture_coordinate_info transformed_uvw = base::transform_coordinate(
458
+ transform: base::rotation_translation_scale(
459
+ scaling: float3(texture_scale.x, texture_scale.y, 1.0),
460
+ rotation: float3(0.0, 0.0, 0.0 ),
461
+ translation: float3(texture_translate.x + t * texture_speed.x, texture_translate.y + t * texture_speed.y, 0.0)),
462
+ coordinate: uvw
463
+ );
464
+ float2 uv = float2(transformed_uvw.position.x, transformed_uvw.position.y);
465
+
466
+ // Diffuse Color Lookup and AO
467
+ float4 base_lookup = tex::texture_isvalid(diffuse_texture) ? tex::lookup_float4(tex: diffuse_texture, coord: uv) : float4(1, 1, 1, 1);
468
+
469
+ float opacityValue = tex::texture_isvalid(opacity_texture) ? tex::lookup_float4(tex: opacity_texture, coord: uv).w : alpha_constant;
470
+
471
+ // Normal calculations
472
+ float3 normal_lookup = tex::texture_isvalid(normalmap_texture) ?
473
+ base::tangent_space_normal_texture(
474
+ texture: normalmap_texture,
475
+ factor: bump_factor,
476
+ uvw: transformed_uvw,
477
+ flip_tangent_u: flip_tangent_u,
478
+ flip_tangent_v: flip_tangent_v
479
+ ) : normal_input;
480
+
481
+ float3 clearcoat_normal = tex::texture_isvalid(clearcoat_normalmap_texture) ?
482
+ base::tangent_space_normal_texture(
483
+ texture: clearcoat_normalmap_texture,
484
+ factor: clearcoat_bump_factor,
485
+ uvw: uvw,
486
+ flip_tangent_u: clearcoat_flip_tangent_u,
487
+ flip_tangent_v: clearcoat_flip_tangent_v
488
+ ) : clearcoat_normal_input;
489
+
490
+ float3 flattened_clearcoat_normal = ::math::lerp(normal_lookup, ::state::normal(), clearcoat_flatten);
491
+ float3 final_clearcoat_normal = tex::texture_isvalid(clearcoat_normalmap_texture) ? clearcoat_normal : flattened_clearcoat_normal;
492
+
493
+ float ao_lookup = tex::texture_isvalid(ao_texture) ? tex::lookup_float4(tex: ao_texture, coord: uv).x : ao_input;
494
+
495
+ color diffuse_color = tex::texture_isvalid(diffuse_texture) ? color(base_lookup.x, base_lookup.y, base_lookup.z) : diffuse_color_constant;
496
+
497
+ float3 ORM_lookup = tex::lookup_float3(
498
+ tex: ORM_texture,
499
+ coord: float2(transformed_uvw.position.x, transformed_uvw.position.y)
500
+ );
501
+
502
+ float roughness_lookup = tex::texture_isvalid(reflectionroughness_texture) ?
503
+ tex::lookup_float4(tex: reflectionroughness_texture, coord: uv).x : reflection_roughness_constant;
504
+ float anisotropy_lookup = tex::texture_isvalid(anisotropy_texture) ?
505
+ (tex::lookup_float4(tex: anisotropy_texture, coord: uv).x * 2.0f - 1.0f) : anisotropy_constant;
506
+ float metallic_lookup = tex::texture_isvalid(metallic_texture) ?
507
+ tex::lookup_float4(tex: metallic_texture, coord: uv).x : metallic_constant;
508
+ float specular_lookup = tex::texture_isvalid(specular_texture) ?
509
+ tex::lookup_float4(tex: specular_texture, coord: uv).x : specular_constant;
510
+
511
+ float roughness_selection = enable_ORM_texture ? ORM_lookup.y : roughness_lookup;
512
+ float metallic_selection = enable_ORM_texture ? ORM_lookup.z : metallic_lookup;
513
+ float ao = enable_ORM_texture ? ORM_lookup.x : ao_lookup;
514
+
515
+ float reflection_roughness = math::lerp(reflection_roughness_constant, roughness_selection, reflection_roughness_texture_influence);
516
+ float anisotropy = math::lerp(anisotropy_constant, anisotropy_lookup, anisotropy_texture_influence);
517
+ float metallic = math::lerp(metallic_constant, metallic_selection, metallic_texture_influence);
518
+
519
+ int rows = flipbook_dim.x;
520
+ int columns = flipbook_dim.y;
521
+ int numFrames = rows * columns;
522
+ varying int frameIdx = int(state::animation_time() * target_fps) % numFrames;
523
+ varying float2 baseUV = float2(transformed_uvw.position.x, transformed_uvw.position.y);
524
+ varying float2 emissiveUV = enable_emissive_flipbook ?
525
+ ((baseUV + float2(frameIdx % rows, frameIdx / rows)) / float2(rows, columns)) : baseUV;
526
+
527
+ color emissive_mask = tex::texture_isvalid(emissive_mask_texture) ?
528
+ tex::lookup_color(emissive_mask_texture, emissiveUV, tex::wrap_repeat, tex::wrap_repeat) : emissive_mask_input;
529
+
530
+ } in SimPBR_Model(
531
+ diffuse_color: diffuse_color,
532
+ diffuse_tint: diffuse_tint,
533
+ roughness: reflection_roughness,
534
+ anisotropy: anisotropy,
535
+ metallic: metallic,
536
+ specular: specular_lookup,
537
+ normal: normal_lookup,
538
+ enable_clearcoat: enable_clearcoat,
539
+ clearcoat_tint: clearcoat_tint,
540
+ clearcoat_transparency: clearcoat_transparency,
541
+ clearcoat_reflection_roughness: clearcoat_reflection_roughness,
542
+ clearcoat_weight: clearcoat_weight,
543
+ clearcoat_ior: clearcoat_ior,
544
+ clearcoat_normal: final_clearcoat_normal,
545
+ enable_retroreflection: enable_retroreflection,
546
+ retroreflection_tint: retroreflection_tint,
547
+ normal_reflectivity: normal_reflectivity,
548
+ grazing_reflectivity: grazing_reflectivity,
549
+ ao_to_diffuse: ao_to_diffuse,
550
+ ao: ao,
551
+ enable_emission: enable_emission,
552
+ emissive_color: emissive_color,
553
+ emissive_mask: emissive_mask,
554
+ emissive_intensity: emissive_intensity,
555
+ enable_opacity: enable_opacity,
556
+ alpha: opacityValue,
557
+ enable_opacity_cutout: enable_opacity_cutout,
558
+ alpha_cutout_cutoff: alpha_cutout_cutoff,
559
+ opacity_ratio: enable_transmission ? opacity_ratio : 1.0,
560
+ opacity_tint : opacity_tint,
561
+ opacity_multiplier : opacity_multiplier
562
+ );
objects/contemporary_laterialfile/materials/omniverse/simready_content/materials/SimPBR_Model.mdl ADDED
@@ -0,0 +1,212 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*****************************************************************************
2
+ * Copyright 1986-2020 NVIDIA Corporation. All rights reserved.
3
+ ******************************************************************************
4
+
5
+ MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,
6
+ WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,
7
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
8
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
9
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
10
+ COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA
11
+ CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
12
+ ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
13
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
14
+ THE USE OR INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN
15
+ THE MDL MATERIALS.
16
+ */
17
+
18
+ mdl 1.4;
19
+
20
+ import ::df::*;
21
+ import ::state::*;
22
+ import ::math::*;
23
+ import ::base::*;
24
+ import ::tex::*;
25
+ import ::anno::*;
26
+
27
+ using .::baking_annotations import *;
28
+
29
+ base::texture_return multiply_colors(
30
+ color color_1 = color(1.0, 1.0, 1.0),
31
+ color color_2 = color(.5, .5, .5),
32
+ float weight = 1.0
33
+ )
34
+ [[
35
+ anno::hidden()
36
+ ]]
37
+ {
38
+ return base::blend_color_layers(
39
+ layers: base::color_layer[](
40
+ base::color_layer(
41
+ layer_color: color_2,
42
+ weight: weight,
43
+ mode: base::color_layer_multiply
44
+ )
45
+ ), base: color_1
46
+ );
47
+ }
48
+
49
+ export material SimPBR_Model(
50
+ color diffuse_color = color(0.2f) [[ target_baked_argument("diffuse_texture", "diffuse_color_constant", "RGBA8_UNORM") ]],
51
+ uniform color diffuse_tint = color(1.0f),
52
+ float roughness = 0.5f [[ target_baked_argument("reflectionroughness_texture", "reflection_roughness_constant", "R8_UNORM") ]],
53
+ float anisotropy = 0.0f [[ target_baked_argument("anisotropy_texture", "anisotropy_constant", "R8_SNORM") ]],
54
+ float metallic = 0.f [[ target_baked_argument("metallic_texture", "metallic_constant", "R8_UNORM") ]],
55
+ float specular = 1.f [[ target_baked_argument("specular_texture", "specular_constant", "R8_UNORM") ]],
56
+ float3 normal = float3(0.0, 0.0, 0.0) [[ target_baked_argument("normalmap_texture", "normal_input", "RGBA8_SNORM", baking_annotations::TRANSFORM_UNORM_VECTOR) ]],
57
+ uniform bool enable_clearcoat = false,
58
+ color clearcoat_tint = color(1.0f),
59
+ float clearcoat_transparency = 1.0f,
60
+ float clearcoat_reflection_roughness = 0.0f,
61
+ float clearcoat_weight = 1.0f,
62
+ float clearcoat_ior = 1.56f,
63
+ float3 clearcoat_normal = float3(0.0, 0.0, 0.0) [[ target_baked_argument("clearcoat_normalmap_texture", "clearcoat_normal_input", "RGBA8_SNORM", baking_annotations::TRANSFORM_UNORM_VECTOR) ]],
64
+ uniform bool enable_retroreflection = false,
65
+ color retroreflection_tint = color(.182,.800,.000),
66
+ uniform float normal_reflectivity = 0.5,
67
+ uniform float grazing_reflectivity = 1.0,
68
+ float ao_to_diffuse = 0.0,
69
+ float ao = 1.0f [[ target_baked_argument("ao_texture", "ao_input", "R8_UNORM") ]],
70
+ uniform bool enable_emission = false,
71
+ uniform color emissive_color = color(1.0, 0.1, 0.1),
72
+ color emissive_mask = color(1.0, 0.1, 0.1) [[ target_baked_argument("emissive_mask_texture", "emissive_mask_input", "R8_UNORM") ]],
73
+ uniform float emissive_intensity = 40.f,
74
+ uniform bool enable_opacity = false,
75
+ float alpha = 1.0,
76
+ uniform bool enable_opacity_cutout = false,
77
+ uniform float alpha_cutout_cutoff = 1.f,
78
+ uniform float opacity_ratio = 1.f,
79
+ uniform color opacity_tint = color(1.0f),
80
+ uniform float opacity_multiplier = 1.f
81
+ )
82
+ [[
83
+ target_material_model(),
84
+ target_material_rendering("..::SimPBR::SimPBR")
85
+ ]]
86
+ = let {
87
+ color base_color = multiply_colors(diffuse_color, diffuse_tint, 1.0).tint;
88
+ color ao_weighted_base_color = multiply_colors(base_color, color(ao), ao_to_diffuse).tint;
89
+
90
+ float squared_roughness = roughness * roughness;
91
+ float roughness_u = squared_roughness * (1 + anisotropy);
92
+ float roughness_v = squared_roughness * (1 - anisotropy);
93
+
94
+ color diffuse_transmission_color = base_color * opacity_tint * opacity_multiplier;
95
+
96
+ bsdf diffuse_bsdf = df::weighted_layer(
97
+ weight: opacity_ratio,
98
+ layer: df::diffuse_reflection_bsdf(
99
+ tint: ao_weighted_base_color,
100
+ roughness: 0.0f
101
+ ),
102
+ base: df::diffuse_transmission_bsdf(tint: diffuse_transmission_color),
103
+ normal: enable_clearcoat ? normal : state::normal()
104
+ );
105
+
106
+ bsdf ggx_smith_bsdf = df::microfacet_ggx_smith_bsdf(
107
+ roughness_u: roughness_u,
108
+ roughness_v: roughness_v,
109
+ tint: color(1.0, 1.0, 1.0),
110
+ mode: df::scatter_reflect
111
+ );
112
+
113
+ bsdf custom_curve_layer_bsdf = df::custom_curve_layer(
114
+ normal_reflectivity: 0.03,
115
+ grazing_reflectivity: 1.0,
116
+ exponent: 5.0,
117
+ weight: specular,
118
+ layer: ggx_smith_bsdf,
119
+ base: diffuse_bsdf,
120
+ normal: enable_clearcoat ? normal : state::normal()
121
+ );
122
+
123
+ //
124
+ // Begin RETROREFLECTION SUPPORT
125
+ //
126
+ color final_retroreflection_color = multiply_colors(retroreflection_tint, base_color, 1.0).tint;
127
+ bsdf backscattering_glossy_bsdf = df::backscattering_glossy_reflection_bsdf(
128
+ tint: final_retroreflection_color,
129
+ roughness_u: squared_roughness
130
+ );
131
+
132
+ /*bsdf retroreflection_bsdf = df::custom_curve_layer(
133
+ normal_reflectivity: 1.-normal_reflectivity,
134
+ grazing_reflectivity: 1.-grazing_reflectivity,
135
+ base: backscattering_glossy_bsdf,
136
+ layer: custom_curve_layer_bsdf,
137
+ normal: enable_clearcoat ? normal_lookup : state::normal()
138
+ );*/
139
+
140
+ // if normal_reflectivity and grazing_reflectivity are 1 and weight is 1, just the layer is used
141
+ bsdf opt_retroreflection_bsdf = df::custom_curve_layer(
142
+ normal_reflectivity: enable_retroreflection ? 1.-normal_reflectivity : 1,
143
+ grazing_reflectivity: enable_retroreflection ? 1.-grazing_reflectivity : 1,
144
+ base: backscattering_glossy_bsdf,
145
+ layer: custom_curve_layer_bsdf,
146
+ normal: enable_clearcoat ? normal : state::normal()
147
+ );
148
+
149
+ //
150
+ // End RETROREFLECTION SUPPORT
151
+ //
152
+
153
+ bsdf directional_factor_bsdf = df::directional_factor(
154
+ normal_tint: ao_weighted_base_color,
155
+ grazing_tint: color(1.0, 1.0, 1.0),
156
+ exponent: 5.0f,
157
+ base: ggx_smith_bsdf
158
+ );
159
+
160
+ // CLEARCOAT
161
+ bsdf omni_PBR_bsdf = df::weighted_layer(
162
+ weight: metallic,
163
+ layer: directional_factor_bsdf,
164
+ base: opt_retroreflection_bsdf, //enable_retroreflection ? retroreflection_bsdf : custom_curve_layer_bsdf,
165
+ normal: enable_clearcoat ? normal : state::normal()
166
+ );
167
+
168
+ bsdf clearcoat_bsdf = df::microfacet_ggx_smith_bsdf(
169
+ roughness_u: clearcoat_reflection_roughness * clearcoat_reflection_roughness,
170
+ roughness_v: clearcoat_reflection_roughness * clearcoat_reflection_roughness,
171
+ tint: color(1.0f),
172
+ mode: df::scatter_reflect
173
+ );
174
+
175
+ // bsdf omni_PBR_coated_bsdf = df::custom_curve_layer(
176
+ // normal_reflectivity: clearcoat_reflectivity * 0.08,
177
+ // grazing_reflectivity: 1.0,
178
+ // weight: clearcoat_weight,
179
+ // layer: clearcoat_bsdf,
180
+ // base: omni_PBR_bsdf,
181
+ // normal: final_clearcoat_normal
182
+ // );
183
+
184
+ bsdf opt_opaque_clearcoat = df::weighted_layer(
185
+ weight: enable_clearcoat ? clearcoat_transparency : 1,
186
+ layer: ::df::tint(tint: enable_clearcoat ? clearcoat_tint : color(1), base: omni_PBR_bsdf),
187
+ base: ::df::diffuse_reflection_bsdf(tint: clearcoat_tint)
188
+ );
189
+
190
+ bsdf opt_omni_PBR_coated_bsdf = df::fresnel_layer(
191
+ ior: clearcoat_ior,
192
+ weight: enable_clearcoat ? clearcoat_weight : 0,
193
+ layer: clearcoat_bsdf,
194
+ base: opt_opaque_clearcoat,
195
+ normal: clearcoat_normal
196
+ );
197
+
198
+ bsdf final_bsdf = opt_omni_PBR_coated_bsdf;
199
+ } in material(
200
+ thin_walled: false,
201
+ surface: material_surface(
202
+ scattering: final_bsdf,
203
+ emission: material_emission(
204
+ df::diffuse_edf(),
205
+ intensity: enable_emission ? emissive_color * emissive_mask * color(emissive_intensity) : color(0)
206
+ )
207
+ ),
208
+ geometry: material_geometry(
209
+ normal: enable_clearcoat ? state::normal() : normal,
210
+ cutout_opacity: enable_opacity ? (enable_opacity_cutout ? (alpha < alpha_cutout_cutoff ? 0.0 : 1.0) : alpha) : 1.0
211
+ )
212
+ );
objects/contemporary_laterialfile/materials/omniverse/simready_content/materials/baking_annotations.mdl ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.4;
2
+ import ::anno::*;
3
+
4
+ export const string TRANSFORM_NONE = "NONE";
5
+ export const string TRANSFORM_UNORM_VECTOR = "UNORM_VECTOR";
6
+
7
+ export const string FORMAT_RGBA8_UNORM = "RGBA8_UNORM";
8
+ export const string FORMAT_R8_UNORM = "R8_UNORM";
9
+ export const string FORMAT_RGBA16_SFLOAT = "RGBA16_SFLOAT";
10
+
11
+ export const string BLEND_MODE_OPACITY = "opacity_blend";
12
+ export const string BLEND_MODE_REPLACE = "replace";
13
+
14
+ // This annotation is used to mark a material as target material for baking.
15
+ // It is that is detected by the MDL SDK and neuray.
16
+ export annotation target_material_model();
17
+
18
+ export annotation target_material_rendering(
19
+ string rendering_material_override = "" // if set, the baked material will be rendering using this material,
20
+ // otherwise the target itself is used
21
+ );
22
+
23
+ export annotation target_baked_argument(
24
+ // the name of the baked texture parameter in the rendering material
25
+ string baked_name,
26
+
27
+ // the name of the constant parameter in the rendering material in case baking was not necessary
28
+ string constant_name = "",
29
+
30
+ // texture format to bake to
31
+ string format = "",
32
+
33
+ // transformations, like encoding normals into [0,1] range
34
+ string transform = TRANSFORM_NONE,
35
+
36
+ // blending, e.g., based on alpha or replace
37
+ string blend_mode = BLEND_MODE_OPACITY
38
+ );
objects/contemporary_lowhalfdesk/materials/omniverse/simready_content/materials/SimPBR.mdl ADDED
@@ -0,0 +1,562 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*****************************************************************************
2
+ * Copyright 1986-2020 NVIDIA Corporation. All rights reserved.
3
+ ******************************************************************************
4
+
5
+ MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,
6
+ WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,
7
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
8
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
9
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
10
+ COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA
11
+ CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
12
+ ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
13
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
14
+ THE USE OR INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN
15
+ THE MDL MATERIALS.
16
+ */
17
+
18
+ mdl 1.4;
19
+
20
+ import ::df::*;
21
+ import ::state::*;
22
+ import ::math::*;
23
+ import ::base::*;
24
+ import ::tex::*;
25
+ import ::anno::*;
26
+
27
+ import ::nvidia::core_definitions::file_texture;
28
+ import ::nvidia::core_definitions::normalmap_texture;
29
+
30
+ using .::SimPBR_Model import *;
31
+ using .::baking_annotations import *;
32
+
33
+ export material SimPBR(
34
+ // -------------------- DIFFUSE REFLECTION ----------------------
35
+ color diffuse_color_constant = color(0.2f)
36
+ [[
37
+ anno::display_name("Albedo Base Color"),
38
+ anno::description("The base albedo color to use if no texture is specified"),
39
+ anno::in_group("Diffuse")
40
+ ]],
41
+ uniform texture_2d diffuse_texture = texture_2d()
42
+ [[
43
+ anno::display_name("Albedo Map"),
44
+ anno::description("The texture specifying the albedo value to use"),
45
+ anno::in_group("Diffuse")
46
+ ]],
47
+ uniform color diffuse_tint = color(1.0f)
48
+ [[
49
+ anno::display_name("Albedo Tint"),
50
+ anno::description("This tints the albedo color or texture contant"),
51
+ anno::in_group("Diffuse")
52
+ ]],
53
+ uniform bool enable_transmission = false
54
+ [[
55
+ anno::display_name("Enable Diffuse Transmission"),
56
+ anno::description("Enables the diffuse transmission of light through thin diffuse scattering layer"),
57
+ anno::in_group("Diffuse")
58
+ ]],
59
+ uniform float opacity_ratio = 1.f
60
+ [[
61
+ anno::enable_if("enable_transmission == true"),
62
+ anno::display_name("Opacity Ratio"),
63
+ anno::description("Amount of opacity"),
64
+ anno::in_group("Diffuse")
65
+ ]],
66
+ uniform color opacity_tint = color(1.0f)
67
+ [[
68
+ anno::enable_if("enable_transmission == true"),
69
+ anno::display_name("Diffuse transmission tint"),
70
+ anno::description("Base diffuse transmission color"),
71
+ anno::in_group("Diffuse")
72
+ ]],
73
+ uniform float opacity_multiplier = 1.f
74
+ [[
75
+ anno::enable_if("enable_transmission == true"),
76
+ anno::display_name("Diffuse transmission multiplier"),
77
+ anno::description("Base diffuse transmission multiplier"),
78
+ anno::in_group("Diffuse")
79
+ ]],
80
+
81
+ // -------------------- SPECULAR REFLECTION ----------------------
82
+ float reflection_roughness_constant = 0.5f
83
+ [[
84
+ anno::display_name("Roughness Amount"),
85
+ anno::hard_range(0.0,1.),
86
+ anno::description("Higher roughness values lead to more blurry reflections"),
87
+ anno::in_group("Specular")
88
+ ]],
89
+ uniform float reflection_roughness_texture_influence = 0.0f
90
+ [[
91
+ anno::display_name("Roughness Map Influence"),
92
+ anno::hard_range(0.0, 1.),
93
+ anno::description("Blends between the constant value and the lookup of the roughness texture"),
94
+ anno::in_group("Specular")
95
+ ]],
96
+ uniform texture_2d reflectionroughness_texture = texture_2d()
97
+ [[
98
+ anno::display_name("Roughness Map"),
99
+ anno::in_group("Specular")
100
+ ]],
101
+
102
+ float anisotropy_constant = 0.0f
103
+ [[
104
+ anno::display_name("Anisotropy Amount"),
105
+ anno::hard_range(-1.,1.),
106
+ anno::description("0 for isotropic, extents of -1 to 1 for anisotropy"),
107
+ anno::in_group("Specular")
108
+ ]],
109
+ uniform float anisotropy_texture_influence = 0.0f
110
+ [[
111
+ anno::display_name("Anisotropy Map Influence"),
112
+ anno::hard_range(0.0, 1.),
113
+ anno::description("Blends between the constant value and the lookup of the anisotropy texture"),
114
+ anno::in_group("Specular")
115
+ ]],
116
+ uniform texture_2d anisotropy_texture = texture_2d()
117
+ [[
118
+ anno::display_name("Anisotropy Map"),
119
+ anno::in_group("Specular")
120
+ ]],
121
+
122
+ float metallic_constant = 0.f
123
+ [[
124
+ anno::display_name("Metallic Amount"),
125
+ anno::hard_range(0.0,1.),
126
+ anno::description("Metallic Material"),
127
+ anno::in_group("Specular")
128
+ ]],
129
+ uniform float metallic_texture_influence = 0.0f
130
+ [[
131
+ anno::display_name("Metallic Map Influence"),
132
+ anno::hard_range(0.0, 1.),
133
+ anno::description("Blends between the constant value and the lookup of the metallic texture"),
134
+ anno::in_group("Specular")
135
+ ]],
136
+ uniform texture_2d metallic_texture = texture_2d()
137
+ [[
138
+ anno::display_name("Metallic Map"),
139
+ anno::in_group("Specular")
140
+ ]],
141
+
142
+ float specular_constant = 1.f
143
+ [[
144
+ anno::display_name("Specular amount"),
145
+ anno::hard_range(0.0, 1.0),
146
+ anno::description("Scale of the specular component"),
147
+ anno::in_group("Specular")
148
+ ]],
149
+ uniform texture_2d specular_texture = texture_2d()
150
+ [[
151
+ anno::display_name("Specular Map"),
152
+ anno::in_group("Specular")
153
+ ]],
154
+
155
+ // -------------------- ORM ----------------------
156
+ uniform bool enable_ORM_texture = true
157
+ [[
158
+ anno::display_name("Enable ORM Texture"),
159
+ anno::description("When True the ORM texture will be used to extract the Occlusion, Roughness and Metallic Map"),
160
+ anno::in_group("Reflectivity")
161
+ ]],
162
+ uniform texture_2d ORM_texture = texture_2d()
163
+ [[
164
+ anno::display_name("ORM Map"),
165
+ anno::description("Texture that hae Occlusion, Roughness and Metallic map stored in the respective r, g and b channels"),
166
+ anno::in_group("Reflectivity")
167
+ ]],
168
+
169
+ // -------------------- Clearcoat ----------------------
170
+ uniform bool enable_clearcoat = false
171
+ [[
172
+ anno::display_name("Enable Clearcoat Layer"),
173
+ anno::description("Adds a clearcoat layer on top of the material when enabled"),
174
+ anno::in_group("Clearcoat")
175
+ ]],
176
+ color clearcoat_tint = color(1.0f)
177
+ [[
178
+ anno::display_name("Clearcoat Tint"),
179
+ anno::description("Clearcoat is tinted and affects the underlying material"),
180
+ anno::in_group("Clearcoat")
181
+ ]],
182
+ float clearcoat_transparency = 1.0f
183
+ [[
184
+ anno::display_name("Clearcoat Transparency"),
185
+ anno::description("Adjusts the transparency of the clearcoat. Can be turned into a fully opaque clearcoat "
186
+ "covering the underlying layer"),
187
+ anno::in_group("Clearcoat")
188
+ ]],
189
+ float clearcoat_reflection_roughness = 0.0f
190
+ [[
191
+ anno::display_name("Clearcoat Roughness"),
192
+ anno::description("Higher roughness values lead to more blurry reflections"),
193
+ anno::hard_range(0.0f, 1.0f),
194
+ anno::in_group("Clearcoat")
195
+ ]],
196
+ float clearcoat_weight = 1.0f
197
+ [[
198
+ anno::display_name("Clearcoat Weight"),
199
+ anno::description("Sets the weight for clearcoat layer"),
200
+ anno::hard_range(0.0f, 1.0f),
201
+ anno::in_group("Clearcoat")
202
+ ]],
203
+ float clearcoat_flatten = 1.0f
204
+ [[
205
+ anno::display_name("Clearcoat Flatten"),
206
+ anno::description("Flattens the clearcoat to even out the underlying bump maps"),
207
+ anno::hard_range(0.0f, 1.0f),
208
+ anno::in_group("Clearcoat")
209
+ ]],
210
+ float clearcoat_ior = 1.56f
211
+ [[
212
+ anno::display_name("Clearcoat IOR"),
213
+ anno::description("Sets the Index of refraction for the clearcoat layer"),
214
+ anno::soft_range(1.0f, 4.0f),
215
+ anno::in_group("Clearcoat")
216
+ ]],
217
+ uniform float clearcoat_bump_factor = 1.f
218
+ [[
219
+ anno::display_name("Clearcoat Normal Map Strength"),
220
+ anno::description("Strength of normal map."),
221
+ anno::in_group("Clearcoat")
222
+ ]],
223
+
224
+ float3 clearcoat_normal_input = float3(0.0, 0.0, 0.0),
225
+ uniform texture_2d clearcoat_normalmap_texture = texture_2d()
226
+ [[
227
+ anno::display_name("Clearcoat Normal Map"),
228
+ anno::description("Enables the usage of the normalmap texture"),
229
+ anno::in_group("Clearcoat")
230
+ ]],
231
+
232
+ uniform bool clearcoat_flip_tangent_u = false
233
+ [[
234
+ anno::display_name("Clearcoat Normal Map Flip U Tangent"),
235
+ anno::in_group("Clearcoat")
236
+ ]],
237
+ uniform bool clearcoat_flip_tangent_v = true
238
+ [[
239
+ anno::display_name("Clearcoat Normal Map Flip V Tangent"),
240
+ anno::in_group("Clearcoat")
241
+ ]],
242
+
243
+
244
+ // -------------------- REFLECTIVITY ----------------------
245
+ uniform bool enable_retroreflection = false
246
+ [[
247
+ anno::display_name("Enable Retroreflection"),
248
+ anno::in_group("Reflectivity")
249
+ ]],
250
+ color retroreflection_tint = color(.182,.800,.000)
251
+ [[
252
+ anno::display_name("Retro-reflection tint"),
253
+ anno::description("The tint of the retroreflection"),
254
+ anno::in_group("Reflectivity")
255
+ ]],
256
+ uniform float normal_reflectivity = 0.5
257
+ [[
258
+ anno::display_name("Retro-reflection weight facing"),
259
+ anno::hard_range(0.0,1.),
260
+ anno::description("Reflectivity control for geometry facing the viewer"),
261
+ anno::in_group("Reflectivity")
262
+ ]],
263
+ uniform float grazing_reflectivity = 1.0
264
+ [[
265
+ anno::display_name("Retro-reflection weight edge"),
266
+ anno::hard_range(0.0,1.),
267
+ anno::description("Reflectivity control for the reflectivity at geometry edges"),
268
+ anno::in_group("Reflectivity")
269
+ ]],
270
+
271
+ // -------------------- AMBIENT OCCLUSION ----------------------
272
+ float ao_to_diffuse = 0.0
273
+ [[
274
+ anno::display_name("AO to Diffuse"),
275
+ anno::description("Controls the amount of ambient occlusion multiplied into the diffuse color channel"),
276
+ anno::in_group("AO")
277
+ ]],
278
+ float ao_input = float(1.0),
279
+ uniform texture_2d ao_texture = texture_2d()
280
+ [[
281
+ anno::display_name("Ambient Occlusion Map"),
282
+ anno::description("The Ambient Occlusion texture for the material"),
283
+ anno::in_group("AO")
284
+ ]],
285
+
286
+ // -------------------- EMISSIVE ----------------------
287
+ uniform bool enable_emission = false
288
+ [[
289
+ anno::display_name("Enable Emission"),
290
+ anno::description("Enables the emission of light from the material"),
291
+ anno::in_group("Emissive")
292
+ ]],
293
+ uniform color emissive_color = color(1.0, 0.1, 0.1)
294
+ [[
295
+ anno::enable_if("enable_emission == true"),
296
+ anno::display_name("Emissive Color"),
297
+ anno::description("The emission color"),
298
+ anno::in_group("Emissive")
299
+ ]],
300
+
301
+ color emissive_mask_input = color(1.0),
302
+ uniform texture_2d emissive_mask_texture = texture_2d()
303
+ [[
304
+ anno::enable_if("enable_emission == true"),
305
+ anno::display_name("Emissive Mask Map"),
306
+ anno::description("The texture masking the emissive color"),
307
+ anno::in_group("Emissive")
308
+ ]],
309
+ uniform float emissive_intensity = 40.f
310
+ [[
311
+ anno::enable_if("enable_emission == true"),
312
+ anno::display_name("Emissive Intensity"),
313
+ anno::description("Intensity of the emission"),
314
+ anno::in_group("Emissive")
315
+ ]],
316
+ uniform bool enable_emissive_flipbook = false
317
+ [[
318
+ anno::display_name("Enable Flipbook for emission"),
319
+ anno::description("Allows the use of animated emissive textures (e.g. video screens)"),
320
+ anno::in_group("Emissive")
321
+ ]],
322
+ uniform int2 flipbook_dim = int2(1,1)
323
+ [[
324
+ anno::enable_if("enable_emissive_flipbook == true"),
325
+ anno::display_name("Flipbook Rows/Columns"),
326
+ anno::description("How many rows and columns are in the flipbook?"),
327
+ anno::in_group("Emissive")
328
+ ]],
329
+ uniform int target_fps = 1
330
+ [[
331
+ anno::enable_if("enable_emissive_flipbook == true"),
332
+ anno::display_name("Flipbook Target FPS"),
333
+ anno::description("Playback speed in frames per second"),
334
+ anno::in_group("Emissive")
335
+ ]],
336
+
337
+ // -------------------- ALPHA ----------------------
338
+ uniform bool enable_opacity = false
339
+ [[
340
+ anno::display_name("Enable Opacity"),
341
+ anno::description("Enables or disables alpha functionality"),
342
+ anno::in_group("Alpha")
343
+ ]],
344
+ float alpha_constant = 1.0
345
+ [[
346
+ anno::enable_if("enable_opacity == true"),
347
+ anno::display_name("Opacity Fallback Constant"),
348
+ anno::hard_range(0.0, 1.0),
349
+ anno::description("The base alpha constant to use if no texture is specified"),
350
+ anno::in_group("Alpha")
351
+ ]],
352
+ uniform texture_2d opacity_texture = texture_2d()
353
+ [[
354
+ anno::enable_if("enable_opacity == true"),
355
+ anno::display_name("Opacity Map"),
356
+ anno::description("The texture specifying the opacity value to use"),
357
+ anno::in_group("Alpha")
358
+ ]],
359
+ uniform bool enable_opacity_cutout = false
360
+ [[
361
+ anno::enable_if("enable_opacity == true"),
362
+ anno::display_name("Enable Alpha Cutout"),
363
+ anno::description("Enables or disables alpha cutout functionality"),
364
+ anno::in_group("Alpha")
365
+ ]],
366
+ uniform float alpha_cutout_cutoff = 1.f
367
+ [[
368
+ anno::enable_if("enable_opacity == true"),
369
+ anno::enable_if("enable_opacity_cutout == true"),
370
+ anno::hard_range(0.0, 1.0),
371
+ anno::display_name("Alpha Cutout Cutoff"),
372
+ anno::description("The cutoff value to to render as transparent up to and opaque past"),
373
+ anno::in_group("Alpha")
374
+ ]],
375
+
376
+ // -------------------- NORMAL ----------------------
377
+ uniform float bump_factor = 1.f
378
+ [[
379
+ anno::display_name("Normal Map Strength"),
380
+ anno::description("Strength of normal map."),
381
+ anno::in_group("Normal")
382
+ ]],
383
+
384
+ float3 normal_input = state::normal(),
385
+ uniform texture_2d normalmap_texture = texture_2d()
386
+ [[
387
+ anno::display_name("Normal Map"),
388
+ anno::in_group("Normal")
389
+ ]],
390
+ uniform bool flip_tangent_u = false
391
+ [[
392
+ anno::display_name("Normal Map Flip U Tangent"),
393
+ anno::in_group("Normal")
394
+ ]],
395
+ uniform bool flip_tangent_v = true
396
+ [[
397
+ anno::display_name("Normal Map Flip V Tangent"),
398
+ anno::in_group("Normal")
399
+ ]],
400
+
401
+ // -------------------- UV ADJUSTMENTS ----------------------
402
+ uniform bool project_uvw = false
403
+ [[
404
+ anno::display_name("Enable Project UVW Coordinates"),
405
+ anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"),
406
+ anno::in_group("UV")
407
+ ]],
408
+ uniform bool world_or_object = false
409
+ [[
410
+ anno::enable_if("project_uvw == true"),
411
+ anno::display_name("Enable World Space"),
412
+ anno::description("When set to 'true' uses world space for projection, when 'false' object space is used"),
413
+ anno::in_group("UV")
414
+ ]],
415
+ uniform float2 texture_translate = float2(0.0f)
416
+ [[
417
+ anno::display_name("Texture Translate"),
418
+ anno::description("Controls position of texture."),
419
+ anno::in_group("UV")
420
+ ]],
421
+ uniform float2 texture_scale = float2(1.0f)
422
+ [[
423
+ anno::display_name("Texture Tiling"),
424
+ anno::description("Controls repetition of the texture."),
425
+ anno::in_group("UV")
426
+ ]],
427
+ uniform float2 texture_speed = float2(0.0f)
428
+ [[
429
+ anno::display_name("Texture Speed"),
430
+ anno::description("Scrolling texture animation speed in UVs per sec."),
431
+ anno::in_group("UV")
432
+ ]]
433
+ )
434
+ [[
435
+ anno::display_name("Sim PBR"),
436
+ anno::description("Supports the opaque alpha cutout material model of the Sim Renderer"),
437
+ anno::in_group("SimReady"),
438
+ anno::version( 1, 0, 0),
439
+ anno::author("NVIDIA CORPORATION"),
440
+ anno::key_words(string[]("Sim", "PBR", "opaque", "alpha", "cutout", "omniverse", "generic"))
441
+ ]]
442
+ = let {
443
+ base::texture_coordinate_system the_system = world_or_object ? base::texture_coordinate_world : base::texture_coordinate_object;
444
+
445
+ base::texture_coordinate_info uvw = project_uvw ?
446
+ base::coordinate_projection(
447
+ coordinate_system: the_system,
448
+ texture_space: 0,
449
+ projection_type: base::projection_cubic
450
+ ) : base::coordinate_source(
451
+ coordinate_system: base::texture_coordinate_uvw,
452
+ texture_space: 0
453
+ );
454
+
455
+ // Need to use a small value so the compiler doesnt optimize out this var...
456
+ float t = 0.00000001;//state::animation_time();
457
+ base::texture_coordinate_info transformed_uvw = base::transform_coordinate(
458
+ transform: base::rotation_translation_scale(
459
+ scaling: float3(texture_scale.x, texture_scale.y, 1.0),
460
+ rotation: float3(0.0, 0.0, 0.0 ),
461
+ translation: float3(texture_translate.x + t * texture_speed.x, texture_translate.y + t * texture_speed.y, 0.0)),
462
+ coordinate: uvw
463
+ );
464
+ float2 uv = float2(transformed_uvw.position.x, transformed_uvw.position.y);
465
+
466
+ // Diffuse Color Lookup and AO
467
+ float4 base_lookup = tex::texture_isvalid(diffuse_texture) ? tex::lookup_float4(tex: diffuse_texture, coord: uv) : float4(1, 1, 1, 1);
468
+
469
+ float opacityValue = tex::texture_isvalid(opacity_texture) ? tex::lookup_float4(tex: opacity_texture, coord: uv).w : alpha_constant;
470
+
471
+ // Normal calculations
472
+ float3 normal_lookup = tex::texture_isvalid(normalmap_texture) ?
473
+ base::tangent_space_normal_texture(
474
+ texture: normalmap_texture,
475
+ factor: bump_factor,
476
+ uvw: transformed_uvw,
477
+ flip_tangent_u: flip_tangent_u,
478
+ flip_tangent_v: flip_tangent_v
479
+ ) : normal_input;
480
+
481
+ float3 clearcoat_normal = tex::texture_isvalid(clearcoat_normalmap_texture) ?
482
+ base::tangent_space_normal_texture(
483
+ texture: clearcoat_normalmap_texture,
484
+ factor: clearcoat_bump_factor,
485
+ uvw: uvw,
486
+ flip_tangent_u: clearcoat_flip_tangent_u,
487
+ flip_tangent_v: clearcoat_flip_tangent_v
488
+ ) : clearcoat_normal_input;
489
+
490
+ float3 flattened_clearcoat_normal = ::math::lerp(normal_lookup, ::state::normal(), clearcoat_flatten);
491
+ float3 final_clearcoat_normal = tex::texture_isvalid(clearcoat_normalmap_texture) ? clearcoat_normal : flattened_clearcoat_normal;
492
+
493
+ float ao_lookup = tex::texture_isvalid(ao_texture) ? tex::lookup_float4(tex: ao_texture, coord: uv).x : ao_input;
494
+
495
+ color diffuse_color = tex::texture_isvalid(diffuse_texture) ? color(base_lookup.x, base_lookup.y, base_lookup.z) : diffuse_color_constant;
496
+
497
+ float3 ORM_lookup = tex::lookup_float3(
498
+ tex: ORM_texture,
499
+ coord: float2(transformed_uvw.position.x, transformed_uvw.position.y)
500
+ );
501
+
502
+ float roughness_lookup = tex::texture_isvalid(reflectionroughness_texture) ?
503
+ tex::lookup_float4(tex: reflectionroughness_texture, coord: uv).x : reflection_roughness_constant;
504
+ float anisotropy_lookup = tex::texture_isvalid(anisotropy_texture) ?
505
+ (tex::lookup_float4(tex: anisotropy_texture, coord: uv).x * 2.0f - 1.0f) : anisotropy_constant;
506
+ float metallic_lookup = tex::texture_isvalid(metallic_texture) ?
507
+ tex::lookup_float4(tex: metallic_texture, coord: uv).x : metallic_constant;
508
+ float specular_lookup = tex::texture_isvalid(specular_texture) ?
509
+ tex::lookup_float4(tex: specular_texture, coord: uv).x : specular_constant;
510
+
511
+ float roughness_selection = enable_ORM_texture ? ORM_lookup.y : roughness_lookup;
512
+ float metallic_selection = enable_ORM_texture ? ORM_lookup.z : metallic_lookup;
513
+ float ao = enable_ORM_texture ? ORM_lookup.x : ao_lookup;
514
+
515
+ float reflection_roughness = math::lerp(reflection_roughness_constant, roughness_selection, reflection_roughness_texture_influence);
516
+ float anisotropy = math::lerp(anisotropy_constant, anisotropy_lookup, anisotropy_texture_influence);
517
+ float metallic = math::lerp(metallic_constant, metallic_selection, metallic_texture_influence);
518
+
519
+ int rows = flipbook_dim.x;
520
+ int columns = flipbook_dim.y;
521
+ int numFrames = rows * columns;
522
+ varying int frameIdx = int(state::animation_time() * target_fps) % numFrames;
523
+ varying float2 baseUV = float2(transformed_uvw.position.x, transformed_uvw.position.y);
524
+ varying float2 emissiveUV = enable_emissive_flipbook ?
525
+ ((baseUV + float2(frameIdx % rows, frameIdx / rows)) / float2(rows, columns)) : baseUV;
526
+
527
+ color emissive_mask = tex::texture_isvalid(emissive_mask_texture) ?
528
+ tex::lookup_color(emissive_mask_texture, emissiveUV, tex::wrap_repeat, tex::wrap_repeat) : emissive_mask_input;
529
+
530
+ } in SimPBR_Model(
531
+ diffuse_color: diffuse_color,
532
+ diffuse_tint: diffuse_tint,
533
+ roughness: reflection_roughness,
534
+ anisotropy: anisotropy,
535
+ metallic: metallic,
536
+ specular: specular_lookup,
537
+ normal: normal_lookup,
538
+ enable_clearcoat: enable_clearcoat,
539
+ clearcoat_tint: clearcoat_tint,
540
+ clearcoat_transparency: clearcoat_transparency,
541
+ clearcoat_reflection_roughness: clearcoat_reflection_roughness,
542
+ clearcoat_weight: clearcoat_weight,
543
+ clearcoat_ior: clearcoat_ior,
544
+ clearcoat_normal: final_clearcoat_normal,
545
+ enable_retroreflection: enable_retroreflection,
546
+ retroreflection_tint: retroreflection_tint,
547
+ normal_reflectivity: normal_reflectivity,
548
+ grazing_reflectivity: grazing_reflectivity,
549
+ ao_to_diffuse: ao_to_diffuse,
550
+ ao: ao,
551
+ enable_emission: enable_emission,
552
+ emissive_color: emissive_color,
553
+ emissive_mask: emissive_mask,
554
+ emissive_intensity: emissive_intensity,
555
+ enable_opacity: enable_opacity,
556
+ alpha: opacityValue,
557
+ enable_opacity_cutout: enable_opacity_cutout,
558
+ alpha_cutout_cutoff: alpha_cutout_cutoff,
559
+ opacity_ratio: enable_transmission ? opacity_ratio : 1.0,
560
+ opacity_tint : opacity_tint,
561
+ opacity_multiplier : opacity_multiplier
562
+ );
objects/contemporary_lowhalfdesk/materials/omniverse/simready_content/materials/SimPBR_Model.mdl ADDED
@@ -0,0 +1,212 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*****************************************************************************
2
+ * Copyright 1986-2020 NVIDIA Corporation. All rights reserved.
3
+ ******************************************************************************
4
+
5
+ MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,
6
+ WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,
7
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
8
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
9
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
10
+ COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA
11
+ CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
12
+ ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
13
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
14
+ THE USE OR INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN
15
+ THE MDL MATERIALS.
16
+ */
17
+
18
+ mdl 1.4;
19
+
20
+ import ::df::*;
21
+ import ::state::*;
22
+ import ::math::*;
23
+ import ::base::*;
24
+ import ::tex::*;
25
+ import ::anno::*;
26
+
27
+ using .::baking_annotations import *;
28
+
29
+ base::texture_return multiply_colors(
30
+ color color_1 = color(1.0, 1.0, 1.0),
31
+ color color_2 = color(.5, .5, .5),
32
+ float weight = 1.0
33
+ )
34
+ [[
35
+ anno::hidden()
36
+ ]]
37
+ {
38
+ return base::blend_color_layers(
39
+ layers: base::color_layer[](
40
+ base::color_layer(
41
+ layer_color: color_2,
42
+ weight: weight,
43
+ mode: base::color_layer_multiply
44
+ )
45
+ ), base: color_1
46
+ );
47
+ }
48
+
49
+ export material SimPBR_Model(
50
+ color diffuse_color = color(0.2f) [[ target_baked_argument("diffuse_texture", "diffuse_color_constant", "RGBA8_UNORM") ]],
51
+ uniform color diffuse_tint = color(1.0f),
52
+ float roughness = 0.5f [[ target_baked_argument("reflectionroughness_texture", "reflection_roughness_constant", "R8_UNORM") ]],
53
+ float anisotropy = 0.0f [[ target_baked_argument("anisotropy_texture", "anisotropy_constant", "R8_SNORM") ]],
54
+ float metallic = 0.f [[ target_baked_argument("metallic_texture", "metallic_constant", "R8_UNORM") ]],
55
+ float specular = 1.f [[ target_baked_argument("specular_texture", "specular_constant", "R8_UNORM") ]],
56
+ float3 normal = float3(0.0, 0.0, 0.0) [[ target_baked_argument("normalmap_texture", "normal_input", "RGBA8_SNORM", baking_annotations::TRANSFORM_UNORM_VECTOR) ]],
57
+ uniform bool enable_clearcoat = false,
58
+ color clearcoat_tint = color(1.0f),
59
+ float clearcoat_transparency = 1.0f,
60
+ float clearcoat_reflection_roughness = 0.0f,
61
+ float clearcoat_weight = 1.0f,
62
+ float clearcoat_ior = 1.56f,
63
+ float3 clearcoat_normal = float3(0.0, 0.0, 0.0) [[ target_baked_argument("clearcoat_normalmap_texture", "clearcoat_normal_input", "RGBA8_SNORM", baking_annotations::TRANSFORM_UNORM_VECTOR) ]],
64
+ uniform bool enable_retroreflection = false,
65
+ color retroreflection_tint = color(.182,.800,.000),
66
+ uniform float normal_reflectivity = 0.5,
67
+ uniform float grazing_reflectivity = 1.0,
68
+ float ao_to_diffuse = 0.0,
69
+ float ao = 1.0f [[ target_baked_argument("ao_texture", "ao_input", "R8_UNORM") ]],
70
+ uniform bool enable_emission = false,
71
+ uniform color emissive_color = color(1.0, 0.1, 0.1),
72
+ color emissive_mask = color(1.0, 0.1, 0.1) [[ target_baked_argument("emissive_mask_texture", "emissive_mask_input", "R8_UNORM") ]],
73
+ uniform float emissive_intensity = 40.f,
74
+ uniform bool enable_opacity = false,
75
+ float alpha = 1.0,
76
+ uniform bool enable_opacity_cutout = false,
77
+ uniform float alpha_cutout_cutoff = 1.f,
78
+ uniform float opacity_ratio = 1.f,
79
+ uniform color opacity_tint = color(1.0f),
80
+ uniform float opacity_multiplier = 1.f
81
+ )
82
+ [[
83
+ target_material_model(),
84
+ target_material_rendering("..::SimPBR::SimPBR")
85
+ ]]
86
+ = let {
87
+ color base_color = multiply_colors(diffuse_color, diffuse_tint, 1.0).tint;
88
+ color ao_weighted_base_color = multiply_colors(base_color, color(ao), ao_to_diffuse).tint;
89
+
90
+ float squared_roughness = roughness * roughness;
91
+ float roughness_u = squared_roughness * (1 + anisotropy);
92
+ float roughness_v = squared_roughness * (1 - anisotropy);
93
+
94
+ color diffuse_transmission_color = base_color * opacity_tint * opacity_multiplier;
95
+
96
+ bsdf diffuse_bsdf = df::weighted_layer(
97
+ weight: opacity_ratio,
98
+ layer: df::diffuse_reflection_bsdf(
99
+ tint: ao_weighted_base_color,
100
+ roughness: 0.0f
101
+ ),
102
+ base: df::diffuse_transmission_bsdf(tint: diffuse_transmission_color),
103
+ normal: enable_clearcoat ? normal : state::normal()
104
+ );
105
+
106
+ bsdf ggx_smith_bsdf = df::microfacet_ggx_smith_bsdf(
107
+ roughness_u: roughness_u,
108
+ roughness_v: roughness_v,
109
+ tint: color(1.0, 1.0, 1.0),
110
+ mode: df::scatter_reflect
111
+ );
112
+
113
+ bsdf custom_curve_layer_bsdf = df::custom_curve_layer(
114
+ normal_reflectivity: 0.03,
115
+ grazing_reflectivity: 1.0,
116
+ exponent: 5.0,
117
+ weight: specular,
118
+ layer: ggx_smith_bsdf,
119
+ base: diffuse_bsdf,
120
+ normal: enable_clearcoat ? normal : state::normal()
121
+ );
122
+
123
+ //
124
+ // Begin RETROREFLECTION SUPPORT
125
+ //
126
+ color final_retroreflection_color = multiply_colors(retroreflection_tint, base_color, 1.0).tint;
127
+ bsdf backscattering_glossy_bsdf = df::backscattering_glossy_reflection_bsdf(
128
+ tint: final_retroreflection_color,
129
+ roughness_u: squared_roughness
130
+ );
131
+
132
+ /*bsdf retroreflection_bsdf = df::custom_curve_layer(
133
+ normal_reflectivity: 1.-normal_reflectivity,
134
+ grazing_reflectivity: 1.-grazing_reflectivity,
135
+ base: backscattering_glossy_bsdf,
136
+ layer: custom_curve_layer_bsdf,
137
+ normal: enable_clearcoat ? normal_lookup : state::normal()
138
+ );*/
139
+
140
+ // if normal_reflectivity and grazing_reflectivity are 1 and weight is 1, just the layer is used
141
+ bsdf opt_retroreflection_bsdf = df::custom_curve_layer(
142
+ normal_reflectivity: enable_retroreflection ? 1.-normal_reflectivity : 1,
143
+ grazing_reflectivity: enable_retroreflection ? 1.-grazing_reflectivity : 1,
144
+ base: backscattering_glossy_bsdf,
145
+ layer: custom_curve_layer_bsdf,
146
+ normal: enable_clearcoat ? normal : state::normal()
147
+ );
148
+
149
+ //
150
+ // End RETROREFLECTION SUPPORT
151
+ //
152
+
153
+ bsdf directional_factor_bsdf = df::directional_factor(
154
+ normal_tint: ao_weighted_base_color,
155
+ grazing_tint: color(1.0, 1.0, 1.0),
156
+ exponent: 5.0f,
157
+ base: ggx_smith_bsdf
158
+ );
159
+
160
+ // CLEARCOAT
161
+ bsdf omni_PBR_bsdf = df::weighted_layer(
162
+ weight: metallic,
163
+ layer: directional_factor_bsdf,
164
+ base: opt_retroreflection_bsdf, //enable_retroreflection ? retroreflection_bsdf : custom_curve_layer_bsdf,
165
+ normal: enable_clearcoat ? normal : state::normal()
166
+ );
167
+
168
+ bsdf clearcoat_bsdf = df::microfacet_ggx_smith_bsdf(
169
+ roughness_u: clearcoat_reflection_roughness * clearcoat_reflection_roughness,
170
+ roughness_v: clearcoat_reflection_roughness * clearcoat_reflection_roughness,
171
+ tint: color(1.0f),
172
+ mode: df::scatter_reflect
173
+ );
174
+
175
+ // bsdf omni_PBR_coated_bsdf = df::custom_curve_layer(
176
+ // normal_reflectivity: clearcoat_reflectivity * 0.08,
177
+ // grazing_reflectivity: 1.0,
178
+ // weight: clearcoat_weight,
179
+ // layer: clearcoat_bsdf,
180
+ // base: omni_PBR_bsdf,
181
+ // normal: final_clearcoat_normal
182
+ // );
183
+
184
+ bsdf opt_opaque_clearcoat = df::weighted_layer(
185
+ weight: enable_clearcoat ? clearcoat_transparency : 1,
186
+ layer: ::df::tint(tint: enable_clearcoat ? clearcoat_tint : color(1), base: omni_PBR_bsdf),
187
+ base: ::df::diffuse_reflection_bsdf(tint: clearcoat_tint)
188
+ );
189
+
190
+ bsdf opt_omni_PBR_coated_bsdf = df::fresnel_layer(
191
+ ior: clearcoat_ior,
192
+ weight: enable_clearcoat ? clearcoat_weight : 0,
193
+ layer: clearcoat_bsdf,
194
+ base: opt_opaque_clearcoat,
195
+ normal: clearcoat_normal
196
+ );
197
+
198
+ bsdf final_bsdf = opt_omni_PBR_coated_bsdf;
199
+ } in material(
200
+ thin_walled: false,
201
+ surface: material_surface(
202
+ scattering: final_bsdf,
203
+ emission: material_emission(
204
+ df::diffuse_edf(),
205
+ intensity: enable_emission ? emissive_color * emissive_mask * color(emissive_intensity) : color(0)
206
+ )
207
+ ),
208
+ geometry: material_geometry(
209
+ normal: enable_clearcoat ? state::normal() : normal,
210
+ cutout_opacity: enable_opacity ? (enable_opacity_cutout ? (alpha < alpha_cutout_cutoff ? 0.0 : 1.0) : alpha) : 1.0
211
+ )
212
+ );
objects/contemporary_lowhalfdesk/materials/omniverse/simready_content/materials/baking_annotations.mdl ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.4;
2
+ import ::anno::*;
3
+
4
+ export const string TRANSFORM_NONE = "NONE";
5
+ export const string TRANSFORM_UNORM_VECTOR = "UNORM_VECTOR";
6
+
7
+ export const string FORMAT_RGBA8_UNORM = "RGBA8_UNORM";
8
+ export const string FORMAT_R8_UNORM = "R8_UNORM";
9
+ export const string FORMAT_RGBA16_SFLOAT = "RGBA16_SFLOAT";
10
+
11
+ export const string BLEND_MODE_OPACITY = "opacity_blend";
12
+ export const string BLEND_MODE_REPLACE = "replace";
13
+
14
+ // This annotation is used to mark a material as target material for baking.
15
+ // It is that is detected by the MDL SDK and neuray.
16
+ export annotation target_material_model();
17
+
18
+ export annotation target_material_rendering(
19
+ string rendering_material_override = "" // if set, the baked material will be rendering using this material,
20
+ // otherwise the target itself is used
21
+ );
22
+
23
+ export annotation target_baked_argument(
24
+ // the name of the baked texture parameter in the rendering material
25
+ string baked_name,
26
+
27
+ // the name of the constant parameter in the rendering material in case baking was not necessary
28
+ string constant_name = "",
29
+
30
+ // texture format to bake to
31
+ string format = "",
32
+
33
+ // transformations, like encoding normals into [0,1] range
34
+ string transform = TRANSFORM_NONE,
35
+
36
+ // blending, e.g., based on alpha or replace
37
+ string blend_mode = BLEND_MODE_OPACITY
38
+ );
objects/contemporary_openstorage/materials/omniverse/simready_content/materials/SimPBR.mdl ADDED
@@ -0,0 +1,562 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*****************************************************************************
2
+ * Copyright 1986-2020 NVIDIA Corporation. All rights reserved.
3
+ ******************************************************************************
4
+
5
+ MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,
6
+ WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,
7
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
8
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
9
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
10
+ COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA
11
+ CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
12
+ ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
13
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
14
+ THE USE OR INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN
15
+ THE MDL MATERIALS.
16
+ */
17
+
18
+ mdl 1.4;
19
+
20
+ import ::df::*;
21
+ import ::state::*;
22
+ import ::math::*;
23
+ import ::base::*;
24
+ import ::tex::*;
25
+ import ::anno::*;
26
+
27
+ import ::nvidia::core_definitions::file_texture;
28
+ import ::nvidia::core_definitions::normalmap_texture;
29
+
30
+ using .::SimPBR_Model import *;
31
+ using .::baking_annotations import *;
32
+
33
+ export material SimPBR(
34
+ // -------------------- DIFFUSE REFLECTION ----------------------
35
+ color diffuse_color_constant = color(0.2f)
36
+ [[
37
+ anno::display_name("Albedo Base Color"),
38
+ anno::description("The base albedo color to use if no texture is specified"),
39
+ anno::in_group("Diffuse")
40
+ ]],
41
+ uniform texture_2d diffuse_texture = texture_2d()
42
+ [[
43
+ anno::display_name("Albedo Map"),
44
+ anno::description("The texture specifying the albedo value to use"),
45
+ anno::in_group("Diffuse")
46
+ ]],
47
+ uniform color diffuse_tint = color(1.0f)
48
+ [[
49
+ anno::display_name("Albedo Tint"),
50
+ anno::description("This tints the albedo color or texture contant"),
51
+ anno::in_group("Diffuse")
52
+ ]],
53
+ uniform bool enable_transmission = false
54
+ [[
55
+ anno::display_name("Enable Diffuse Transmission"),
56
+ anno::description("Enables the diffuse transmission of light through thin diffuse scattering layer"),
57
+ anno::in_group("Diffuse")
58
+ ]],
59
+ uniform float opacity_ratio = 1.f
60
+ [[
61
+ anno::enable_if("enable_transmission == true"),
62
+ anno::display_name("Opacity Ratio"),
63
+ anno::description("Amount of opacity"),
64
+ anno::in_group("Diffuse")
65
+ ]],
66
+ uniform color opacity_tint = color(1.0f)
67
+ [[
68
+ anno::enable_if("enable_transmission == true"),
69
+ anno::display_name("Diffuse transmission tint"),
70
+ anno::description("Base diffuse transmission color"),
71
+ anno::in_group("Diffuse")
72
+ ]],
73
+ uniform float opacity_multiplier = 1.f
74
+ [[
75
+ anno::enable_if("enable_transmission == true"),
76
+ anno::display_name("Diffuse transmission multiplier"),
77
+ anno::description("Base diffuse transmission multiplier"),
78
+ anno::in_group("Diffuse")
79
+ ]],
80
+
81
+ // -------------------- SPECULAR REFLECTION ----------------------
82
+ float reflection_roughness_constant = 0.5f
83
+ [[
84
+ anno::display_name("Roughness Amount"),
85
+ anno::hard_range(0.0,1.),
86
+ anno::description("Higher roughness values lead to more blurry reflections"),
87
+ anno::in_group("Specular")
88
+ ]],
89
+ uniform float reflection_roughness_texture_influence = 0.0f
90
+ [[
91
+ anno::display_name("Roughness Map Influence"),
92
+ anno::hard_range(0.0, 1.),
93
+ anno::description("Blends between the constant value and the lookup of the roughness texture"),
94
+ anno::in_group("Specular")
95
+ ]],
96
+ uniform texture_2d reflectionroughness_texture = texture_2d()
97
+ [[
98
+ anno::display_name("Roughness Map"),
99
+ anno::in_group("Specular")
100
+ ]],
101
+
102
+ float anisotropy_constant = 0.0f
103
+ [[
104
+ anno::display_name("Anisotropy Amount"),
105
+ anno::hard_range(-1.,1.),
106
+ anno::description("0 for isotropic, extents of -1 to 1 for anisotropy"),
107
+ anno::in_group("Specular")
108
+ ]],
109
+ uniform float anisotropy_texture_influence = 0.0f
110
+ [[
111
+ anno::display_name("Anisotropy Map Influence"),
112
+ anno::hard_range(0.0, 1.),
113
+ anno::description("Blends between the constant value and the lookup of the anisotropy texture"),
114
+ anno::in_group("Specular")
115
+ ]],
116
+ uniform texture_2d anisotropy_texture = texture_2d()
117
+ [[
118
+ anno::display_name("Anisotropy Map"),
119
+ anno::in_group("Specular")
120
+ ]],
121
+
122
+ float metallic_constant = 0.f
123
+ [[
124
+ anno::display_name("Metallic Amount"),
125
+ anno::hard_range(0.0,1.),
126
+ anno::description("Metallic Material"),
127
+ anno::in_group("Specular")
128
+ ]],
129
+ uniform float metallic_texture_influence = 0.0f
130
+ [[
131
+ anno::display_name("Metallic Map Influence"),
132
+ anno::hard_range(0.0, 1.),
133
+ anno::description("Blends between the constant value and the lookup of the metallic texture"),
134
+ anno::in_group("Specular")
135
+ ]],
136
+ uniform texture_2d metallic_texture = texture_2d()
137
+ [[
138
+ anno::display_name("Metallic Map"),
139
+ anno::in_group("Specular")
140
+ ]],
141
+
142
+ float specular_constant = 1.f
143
+ [[
144
+ anno::display_name("Specular amount"),
145
+ anno::hard_range(0.0, 1.0),
146
+ anno::description("Scale of the specular component"),
147
+ anno::in_group("Specular")
148
+ ]],
149
+ uniform texture_2d specular_texture = texture_2d()
150
+ [[
151
+ anno::display_name("Specular Map"),
152
+ anno::in_group("Specular")
153
+ ]],
154
+
155
+ // -------------------- ORM ----------------------
156
+ uniform bool enable_ORM_texture = true
157
+ [[
158
+ anno::display_name("Enable ORM Texture"),
159
+ anno::description("When True the ORM texture will be used to extract the Occlusion, Roughness and Metallic Map"),
160
+ anno::in_group("Reflectivity")
161
+ ]],
162
+ uniform texture_2d ORM_texture = texture_2d()
163
+ [[
164
+ anno::display_name("ORM Map"),
165
+ anno::description("Texture that hae Occlusion, Roughness and Metallic map stored in the respective r, g and b channels"),
166
+ anno::in_group("Reflectivity")
167
+ ]],
168
+
169
+ // -------------------- Clearcoat ----------------------
170
+ uniform bool enable_clearcoat = false
171
+ [[
172
+ anno::display_name("Enable Clearcoat Layer"),
173
+ anno::description("Adds a clearcoat layer on top of the material when enabled"),
174
+ anno::in_group("Clearcoat")
175
+ ]],
176
+ color clearcoat_tint = color(1.0f)
177
+ [[
178
+ anno::display_name("Clearcoat Tint"),
179
+ anno::description("Clearcoat is tinted and affects the underlying material"),
180
+ anno::in_group("Clearcoat")
181
+ ]],
182
+ float clearcoat_transparency = 1.0f
183
+ [[
184
+ anno::display_name("Clearcoat Transparency"),
185
+ anno::description("Adjusts the transparency of the clearcoat. Can be turned into a fully opaque clearcoat "
186
+ "covering the underlying layer"),
187
+ anno::in_group("Clearcoat")
188
+ ]],
189
+ float clearcoat_reflection_roughness = 0.0f
190
+ [[
191
+ anno::display_name("Clearcoat Roughness"),
192
+ anno::description("Higher roughness values lead to more blurry reflections"),
193
+ anno::hard_range(0.0f, 1.0f),
194
+ anno::in_group("Clearcoat")
195
+ ]],
196
+ float clearcoat_weight = 1.0f
197
+ [[
198
+ anno::display_name("Clearcoat Weight"),
199
+ anno::description("Sets the weight for clearcoat layer"),
200
+ anno::hard_range(0.0f, 1.0f),
201
+ anno::in_group("Clearcoat")
202
+ ]],
203
+ float clearcoat_flatten = 1.0f
204
+ [[
205
+ anno::display_name("Clearcoat Flatten"),
206
+ anno::description("Flattens the clearcoat to even out the underlying bump maps"),
207
+ anno::hard_range(0.0f, 1.0f),
208
+ anno::in_group("Clearcoat")
209
+ ]],
210
+ float clearcoat_ior = 1.56f
211
+ [[
212
+ anno::display_name("Clearcoat IOR"),
213
+ anno::description("Sets the Index of refraction for the clearcoat layer"),
214
+ anno::soft_range(1.0f, 4.0f),
215
+ anno::in_group("Clearcoat")
216
+ ]],
217
+ uniform float clearcoat_bump_factor = 1.f
218
+ [[
219
+ anno::display_name("Clearcoat Normal Map Strength"),
220
+ anno::description("Strength of normal map."),
221
+ anno::in_group("Clearcoat")
222
+ ]],
223
+
224
+ float3 clearcoat_normal_input = float3(0.0, 0.0, 0.0),
225
+ uniform texture_2d clearcoat_normalmap_texture = texture_2d()
226
+ [[
227
+ anno::display_name("Clearcoat Normal Map"),
228
+ anno::description("Enables the usage of the normalmap texture"),
229
+ anno::in_group("Clearcoat")
230
+ ]],
231
+
232
+ uniform bool clearcoat_flip_tangent_u = false
233
+ [[
234
+ anno::display_name("Clearcoat Normal Map Flip U Tangent"),
235
+ anno::in_group("Clearcoat")
236
+ ]],
237
+ uniform bool clearcoat_flip_tangent_v = true
238
+ [[
239
+ anno::display_name("Clearcoat Normal Map Flip V Tangent"),
240
+ anno::in_group("Clearcoat")
241
+ ]],
242
+
243
+
244
+ // -------------------- REFLECTIVITY ----------------------
245
+ uniform bool enable_retroreflection = false
246
+ [[
247
+ anno::display_name("Enable Retroreflection"),
248
+ anno::in_group("Reflectivity")
249
+ ]],
250
+ color retroreflection_tint = color(.182,.800,.000)
251
+ [[
252
+ anno::display_name("Retro-reflection tint"),
253
+ anno::description("The tint of the retroreflection"),
254
+ anno::in_group("Reflectivity")
255
+ ]],
256
+ uniform float normal_reflectivity = 0.5
257
+ [[
258
+ anno::display_name("Retro-reflection weight facing"),
259
+ anno::hard_range(0.0,1.),
260
+ anno::description("Reflectivity control for geometry facing the viewer"),
261
+ anno::in_group("Reflectivity")
262
+ ]],
263
+ uniform float grazing_reflectivity = 1.0
264
+ [[
265
+ anno::display_name("Retro-reflection weight edge"),
266
+ anno::hard_range(0.0,1.),
267
+ anno::description("Reflectivity control for the reflectivity at geometry edges"),
268
+ anno::in_group("Reflectivity")
269
+ ]],
270
+
271
+ // -------------------- AMBIENT OCCLUSION ----------------------
272
+ float ao_to_diffuse = 0.0
273
+ [[
274
+ anno::display_name("AO to Diffuse"),
275
+ anno::description("Controls the amount of ambient occlusion multiplied into the diffuse color channel"),
276
+ anno::in_group("AO")
277
+ ]],
278
+ float ao_input = float(1.0),
279
+ uniform texture_2d ao_texture = texture_2d()
280
+ [[
281
+ anno::display_name("Ambient Occlusion Map"),
282
+ anno::description("The Ambient Occlusion texture for the material"),
283
+ anno::in_group("AO")
284
+ ]],
285
+
286
+ // -------------------- EMISSIVE ----------------------
287
+ uniform bool enable_emission = false
288
+ [[
289
+ anno::display_name("Enable Emission"),
290
+ anno::description("Enables the emission of light from the material"),
291
+ anno::in_group("Emissive")
292
+ ]],
293
+ uniform color emissive_color = color(1.0, 0.1, 0.1)
294
+ [[
295
+ anno::enable_if("enable_emission == true"),
296
+ anno::display_name("Emissive Color"),
297
+ anno::description("The emission color"),
298
+ anno::in_group("Emissive")
299
+ ]],
300
+
301
+ color emissive_mask_input = color(1.0),
302
+ uniform texture_2d emissive_mask_texture = texture_2d()
303
+ [[
304
+ anno::enable_if("enable_emission == true"),
305
+ anno::display_name("Emissive Mask Map"),
306
+ anno::description("The texture masking the emissive color"),
307
+ anno::in_group("Emissive")
308
+ ]],
309
+ uniform float emissive_intensity = 40.f
310
+ [[
311
+ anno::enable_if("enable_emission == true"),
312
+ anno::display_name("Emissive Intensity"),
313
+ anno::description("Intensity of the emission"),
314
+ anno::in_group("Emissive")
315
+ ]],
316
+ uniform bool enable_emissive_flipbook = false
317
+ [[
318
+ anno::display_name("Enable Flipbook for emission"),
319
+ anno::description("Allows the use of animated emissive textures (e.g. video screens)"),
320
+ anno::in_group("Emissive")
321
+ ]],
322
+ uniform int2 flipbook_dim = int2(1,1)
323
+ [[
324
+ anno::enable_if("enable_emissive_flipbook == true"),
325
+ anno::display_name("Flipbook Rows/Columns"),
326
+ anno::description("How many rows and columns are in the flipbook?"),
327
+ anno::in_group("Emissive")
328
+ ]],
329
+ uniform int target_fps = 1
330
+ [[
331
+ anno::enable_if("enable_emissive_flipbook == true"),
332
+ anno::display_name("Flipbook Target FPS"),
333
+ anno::description("Playback speed in frames per second"),
334
+ anno::in_group("Emissive")
335
+ ]],
336
+
337
+ // -------------------- ALPHA ----------------------
338
+ uniform bool enable_opacity = false
339
+ [[
340
+ anno::display_name("Enable Opacity"),
341
+ anno::description("Enables or disables alpha functionality"),
342
+ anno::in_group("Alpha")
343
+ ]],
344
+ float alpha_constant = 1.0
345
+ [[
346
+ anno::enable_if("enable_opacity == true"),
347
+ anno::display_name("Opacity Fallback Constant"),
348
+ anno::hard_range(0.0, 1.0),
349
+ anno::description("The base alpha constant to use if no texture is specified"),
350
+ anno::in_group("Alpha")
351
+ ]],
352
+ uniform texture_2d opacity_texture = texture_2d()
353
+ [[
354
+ anno::enable_if("enable_opacity == true"),
355
+ anno::display_name("Opacity Map"),
356
+ anno::description("The texture specifying the opacity value to use"),
357
+ anno::in_group("Alpha")
358
+ ]],
359
+ uniform bool enable_opacity_cutout = false
360
+ [[
361
+ anno::enable_if("enable_opacity == true"),
362
+ anno::display_name("Enable Alpha Cutout"),
363
+ anno::description("Enables or disables alpha cutout functionality"),
364
+ anno::in_group("Alpha")
365
+ ]],
366
+ uniform float alpha_cutout_cutoff = 1.f
367
+ [[
368
+ anno::enable_if("enable_opacity == true"),
369
+ anno::enable_if("enable_opacity_cutout == true"),
370
+ anno::hard_range(0.0, 1.0),
371
+ anno::display_name("Alpha Cutout Cutoff"),
372
+ anno::description("The cutoff value to to render as transparent up to and opaque past"),
373
+ anno::in_group("Alpha")
374
+ ]],
375
+
376
+ // -------------------- NORMAL ----------------------
377
+ uniform float bump_factor = 1.f
378
+ [[
379
+ anno::display_name("Normal Map Strength"),
380
+ anno::description("Strength of normal map."),
381
+ anno::in_group("Normal")
382
+ ]],
383
+
384
+ float3 normal_input = state::normal(),
385
+ uniform texture_2d normalmap_texture = texture_2d()
386
+ [[
387
+ anno::display_name("Normal Map"),
388
+ anno::in_group("Normal")
389
+ ]],
390
+ uniform bool flip_tangent_u = false
391
+ [[
392
+ anno::display_name("Normal Map Flip U Tangent"),
393
+ anno::in_group("Normal")
394
+ ]],
395
+ uniform bool flip_tangent_v = true
396
+ [[
397
+ anno::display_name("Normal Map Flip V Tangent"),
398
+ anno::in_group("Normal")
399
+ ]],
400
+
401
+ // -------------------- UV ADJUSTMENTS ----------------------
402
+ uniform bool project_uvw = false
403
+ [[
404
+ anno::display_name("Enable Project UVW Coordinates"),
405
+ anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"),
406
+ anno::in_group("UV")
407
+ ]],
408
+ uniform bool world_or_object = false
409
+ [[
410
+ anno::enable_if("project_uvw == true"),
411
+ anno::display_name("Enable World Space"),
412
+ anno::description("When set to 'true' uses world space for projection, when 'false' object space is used"),
413
+ anno::in_group("UV")
414
+ ]],
415
+ uniform float2 texture_translate = float2(0.0f)
416
+ [[
417
+ anno::display_name("Texture Translate"),
418
+ anno::description("Controls position of texture."),
419
+ anno::in_group("UV")
420
+ ]],
421
+ uniform float2 texture_scale = float2(1.0f)
422
+ [[
423
+ anno::display_name("Texture Tiling"),
424
+ anno::description("Controls repetition of the texture."),
425
+ anno::in_group("UV")
426
+ ]],
427
+ uniform float2 texture_speed = float2(0.0f)
428
+ [[
429
+ anno::display_name("Texture Speed"),
430
+ anno::description("Scrolling texture animation speed in UVs per sec."),
431
+ anno::in_group("UV")
432
+ ]]
433
+ )
434
+ [[
435
+ anno::display_name("Sim PBR"),
436
+ anno::description("Supports the opaque alpha cutout material model of the Sim Renderer"),
437
+ anno::in_group("SimReady"),
438
+ anno::version( 1, 0, 0),
439
+ anno::author("NVIDIA CORPORATION"),
440
+ anno::key_words(string[]("Sim", "PBR", "opaque", "alpha", "cutout", "omniverse", "generic"))
441
+ ]]
442
+ = let {
443
+ base::texture_coordinate_system the_system = world_or_object ? base::texture_coordinate_world : base::texture_coordinate_object;
444
+
445
+ base::texture_coordinate_info uvw = project_uvw ?
446
+ base::coordinate_projection(
447
+ coordinate_system: the_system,
448
+ texture_space: 0,
449
+ projection_type: base::projection_cubic
450
+ ) : base::coordinate_source(
451
+ coordinate_system: base::texture_coordinate_uvw,
452
+ texture_space: 0
453
+ );
454
+
455
+ // Need to use a small value so the compiler doesnt optimize out this var...
456
+ float t = 0.00000001;//state::animation_time();
457
+ base::texture_coordinate_info transformed_uvw = base::transform_coordinate(
458
+ transform: base::rotation_translation_scale(
459
+ scaling: float3(texture_scale.x, texture_scale.y, 1.0),
460
+ rotation: float3(0.0, 0.0, 0.0 ),
461
+ translation: float3(texture_translate.x + t * texture_speed.x, texture_translate.y + t * texture_speed.y, 0.0)),
462
+ coordinate: uvw
463
+ );
464
+ float2 uv = float2(transformed_uvw.position.x, transformed_uvw.position.y);
465
+
466
+ // Diffuse Color Lookup and AO
467
+ float4 base_lookup = tex::texture_isvalid(diffuse_texture) ? tex::lookup_float4(tex: diffuse_texture, coord: uv) : float4(1, 1, 1, 1);
468
+
469
+ float opacityValue = tex::texture_isvalid(opacity_texture) ? tex::lookup_float4(tex: opacity_texture, coord: uv).w : alpha_constant;
470
+
471
+ // Normal calculations
472
+ float3 normal_lookup = tex::texture_isvalid(normalmap_texture) ?
473
+ base::tangent_space_normal_texture(
474
+ texture: normalmap_texture,
475
+ factor: bump_factor,
476
+ uvw: transformed_uvw,
477
+ flip_tangent_u: flip_tangent_u,
478
+ flip_tangent_v: flip_tangent_v
479
+ ) : normal_input;
480
+
481
+ float3 clearcoat_normal = tex::texture_isvalid(clearcoat_normalmap_texture) ?
482
+ base::tangent_space_normal_texture(
483
+ texture: clearcoat_normalmap_texture,
484
+ factor: clearcoat_bump_factor,
485
+ uvw: uvw,
486
+ flip_tangent_u: clearcoat_flip_tangent_u,
487
+ flip_tangent_v: clearcoat_flip_tangent_v
488
+ ) : clearcoat_normal_input;
489
+
490
+ float3 flattened_clearcoat_normal = ::math::lerp(normal_lookup, ::state::normal(), clearcoat_flatten);
491
+ float3 final_clearcoat_normal = tex::texture_isvalid(clearcoat_normalmap_texture) ? clearcoat_normal : flattened_clearcoat_normal;
492
+
493
+ float ao_lookup = tex::texture_isvalid(ao_texture) ? tex::lookup_float4(tex: ao_texture, coord: uv).x : ao_input;
494
+
495
+ color diffuse_color = tex::texture_isvalid(diffuse_texture) ? color(base_lookup.x, base_lookup.y, base_lookup.z) : diffuse_color_constant;
496
+
497
+ float3 ORM_lookup = tex::lookup_float3(
498
+ tex: ORM_texture,
499
+ coord: float2(transformed_uvw.position.x, transformed_uvw.position.y)
500
+ );
501
+
502
+ float roughness_lookup = tex::texture_isvalid(reflectionroughness_texture) ?
503
+ tex::lookup_float4(tex: reflectionroughness_texture, coord: uv).x : reflection_roughness_constant;
504
+ float anisotropy_lookup = tex::texture_isvalid(anisotropy_texture) ?
505
+ (tex::lookup_float4(tex: anisotropy_texture, coord: uv).x * 2.0f - 1.0f) : anisotropy_constant;
506
+ float metallic_lookup = tex::texture_isvalid(metallic_texture) ?
507
+ tex::lookup_float4(tex: metallic_texture, coord: uv).x : metallic_constant;
508
+ float specular_lookup = tex::texture_isvalid(specular_texture) ?
509
+ tex::lookup_float4(tex: specular_texture, coord: uv).x : specular_constant;
510
+
511
+ float roughness_selection = enable_ORM_texture ? ORM_lookup.y : roughness_lookup;
512
+ float metallic_selection = enable_ORM_texture ? ORM_lookup.z : metallic_lookup;
513
+ float ao = enable_ORM_texture ? ORM_lookup.x : ao_lookup;
514
+
515
+ float reflection_roughness = math::lerp(reflection_roughness_constant, roughness_selection, reflection_roughness_texture_influence);
516
+ float anisotropy = math::lerp(anisotropy_constant, anisotropy_lookup, anisotropy_texture_influence);
517
+ float metallic = math::lerp(metallic_constant, metallic_selection, metallic_texture_influence);
518
+
519
+ int rows = flipbook_dim.x;
520
+ int columns = flipbook_dim.y;
521
+ int numFrames = rows * columns;
522
+ varying int frameIdx = int(state::animation_time() * target_fps) % numFrames;
523
+ varying float2 baseUV = float2(transformed_uvw.position.x, transformed_uvw.position.y);
524
+ varying float2 emissiveUV = enable_emissive_flipbook ?
525
+ ((baseUV + float2(frameIdx % rows, frameIdx / rows)) / float2(rows, columns)) : baseUV;
526
+
527
+ color emissive_mask = tex::texture_isvalid(emissive_mask_texture) ?
528
+ tex::lookup_color(emissive_mask_texture, emissiveUV, tex::wrap_repeat, tex::wrap_repeat) : emissive_mask_input;
529
+
530
+ } in SimPBR_Model(
531
+ diffuse_color: diffuse_color,
532
+ diffuse_tint: diffuse_tint,
533
+ roughness: reflection_roughness,
534
+ anisotropy: anisotropy,
535
+ metallic: metallic,
536
+ specular: specular_lookup,
537
+ normal: normal_lookup,
538
+ enable_clearcoat: enable_clearcoat,
539
+ clearcoat_tint: clearcoat_tint,
540
+ clearcoat_transparency: clearcoat_transparency,
541
+ clearcoat_reflection_roughness: clearcoat_reflection_roughness,
542
+ clearcoat_weight: clearcoat_weight,
543
+ clearcoat_ior: clearcoat_ior,
544
+ clearcoat_normal: final_clearcoat_normal,
545
+ enable_retroreflection: enable_retroreflection,
546
+ retroreflection_tint: retroreflection_tint,
547
+ normal_reflectivity: normal_reflectivity,
548
+ grazing_reflectivity: grazing_reflectivity,
549
+ ao_to_diffuse: ao_to_diffuse,
550
+ ao: ao,
551
+ enable_emission: enable_emission,
552
+ emissive_color: emissive_color,
553
+ emissive_mask: emissive_mask,
554
+ emissive_intensity: emissive_intensity,
555
+ enable_opacity: enable_opacity,
556
+ alpha: opacityValue,
557
+ enable_opacity_cutout: enable_opacity_cutout,
558
+ alpha_cutout_cutoff: alpha_cutout_cutoff,
559
+ opacity_ratio: enable_transmission ? opacity_ratio : 1.0,
560
+ opacity_tint : opacity_tint,
561
+ opacity_multiplier : opacity_multiplier
562
+ );
objects/contemporary_openstorage/materials/omniverse/simready_content/materials/SimPBR_Model.mdl ADDED
@@ -0,0 +1,212 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*****************************************************************************
2
+ * Copyright 1986-2020 NVIDIA Corporation. All rights reserved.
3
+ ******************************************************************************
4
+
5
+ MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,
6
+ WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,
7
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
8
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
9
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
10
+ COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA
11
+ CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
12
+ ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
13
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
14
+ THE USE OR INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN
15
+ THE MDL MATERIALS.
16
+ */
17
+
18
+ mdl 1.4;
19
+
20
+ import ::df::*;
21
+ import ::state::*;
22
+ import ::math::*;
23
+ import ::base::*;
24
+ import ::tex::*;
25
+ import ::anno::*;
26
+
27
+ using .::baking_annotations import *;
28
+
29
+ base::texture_return multiply_colors(
30
+ color color_1 = color(1.0, 1.0, 1.0),
31
+ color color_2 = color(.5, .5, .5),
32
+ float weight = 1.0
33
+ )
34
+ [[
35
+ anno::hidden()
36
+ ]]
37
+ {
38
+ return base::blend_color_layers(
39
+ layers: base::color_layer[](
40
+ base::color_layer(
41
+ layer_color: color_2,
42
+ weight: weight,
43
+ mode: base::color_layer_multiply
44
+ )
45
+ ), base: color_1
46
+ );
47
+ }
48
+
49
+ export material SimPBR_Model(
50
+ color diffuse_color = color(0.2f) [[ target_baked_argument("diffuse_texture", "diffuse_color_constant", "RGBA8_UNORM") ]],
51
+ uniform color diffuse_tint = color(1.0f),
52
+ float roughness = 0.5f [[ target_baked_argument("reflectionroughness_texture", "reflection_roughness_constant", "R8_UNORM") ]],
53
+ float anisotropy = 0.0f [[ target_baked_argument("anisotropy_texture", "anisotropy_constant", "R8_SNORM") ]],
54
+ float metallic = 0.f [[ target_baked_argument("metallic_texture", "metallic_constant", "R8_UNORM") ]],
55
+ float specular = 1.f [[ target_baked_argument("specular_texture", "specular_constant", "R8_UNORM") ]],
56
+ float3 normal = float3(0.0, 0.0, 0.0) [[ target_baked_argument("normalmap_texture", "normal_input", "RGBA8_SNORM", baking_annotations::TRANSFORM_UNORM_VECTOR) ]],
57
+ uniform bool enable_clearcoat = false,
58
+ color clearcoat_tint = color(1.0f),
59
+ float clearcoat_transparency = 1.0f,
60
+ float clearcoat_reflection_roughness = 0.0f,
61
+ float clearcoat_weight = 1.0f,
62
+ float clearcoat_ior = 1.56f,
63
+ float3 clearcoat_normal = float3(0.0, 0.0, 0.0) [[ target_baked_argument("clearcoat_normalmap_texture", "clearcoat_normal_input", "RGBA8_SNORM", baking_annotations::TRANSFORM_UNORM_VECTOR) ]],
64
+ uniform bool enable_retroreflection = false,
65
+ color retroreflection_tint = color(.182,.800,.000),
66
+ uniform float normal_reflectivity = 0.5,
67
+ uniform float grazing_reflectivity = 1.0,
68
+ float ao_to_diffuse = 0.0,
69
+ float ao = 1.0f [[ target_baked_argument("ao_texture", "ao_input", "R8_UNORM") ]],
70
+ uniform bool enable_emission = false,
71
+ uniform color emissive_color = color(1.0, 0.1, 0.1),
72
+ color emissive_mask = color(1.0, 0.1, 0.1) [[ target_baked_argument("emissive_mask_texture", "emissive_mask_input", "R8_UNORM") ]],
73
+ uniform float emissive_intensity = 40.f,
74
+ uniform bool enable_opacity = false,
75
+ float alpha = 1.0,
76
+ uniform bool enable_opacity_cutout = false,
77
+ uniform float alpha_cutout_cutoff = 1.f,
78
+ uniform float opacity_ratio = 1.f,
79
+ uniform color opacity_tint = color(1.0f),
80
+ uniform float opacity_multiplier = 1.f
81
+ )
82
+ [[
83
+ target_material_model(),
84
+ target_material_rendering("..::SimPBR::SimPBR")
85
+ ]]
86
+ = let {
87
+ color base_color = multiply_colors(diffuse_color, diffuse_tint, 1.0).tint;
88
+ color ao_weighted_base_color = multiply_colors(base_color, color(ao), ao_to_diffuse).tint;
89
+
90
+ float squared_roughness = roughness * roughness;
91
+ float roughness_u = squared_roughness * (1 + anisotropy);
92
+ float roughness_v = squared_roughness * (1 - anisotropy);
93
+
94
+ color diffuse_transmission_color = base_color * opacity_tint * opacity_multiplier;
95
+
96
+ bsdf diffuse_bsdf = df::weighted_layer(
97
+ weight: opacity_ratio,
98
+ layer: df::diffuse_reflection_bsdf(
99
+ tint: ao_weighted_base_color,
100
+ roughness: 0.0f
101
+ ),
102
+ base: df::diffuse_transmission_bsdf(tint: diffuse_transmission_color),
103
+ normal: enable_clearcoat ? normal : state::normal()
104
+ );
105
+
106
+ bsdf ggx_smith_bsdf = df::microfacet_ggx_smith_bsdf(
107
+ roughness_u: roughness_u,
108
+ roughness_v: roughness_v,
109
+ tint: color(1.0, 1.0, 1.0),
110
+ mode: df::scatter_reflect
111
+ );
112
+
113
+ bsdf custom_curve_layer_bsdf = df::custom_curve_layer(
114
+ normal_reflectivity: 0.03,
115
+ grazing_reflectivity: 1.0,
116
+ exponent: 5.0,
117
+ weight: specular,
118
+ layer: ggx_smith_bsdf,
119
+ base: diffuse_bsdf,
120
+ normal: enable_clearcoat ? normal : state::normal()
121
+ );
122
+
123
+ //
124
+ // Begin RETROREFLECTION SUPPORT
125
+ //
126
+ color final_retroreflection_color = multiply_colors(retroreflection_tint, base_color, 1.0).tint;
127
+ bsdf backscattering_glossy_bsdf = df::backscattering_glossy_reflection_bsdf(
128
+ tint: final_retroreflection_color,
129
+ roughness_u: squared_roughness
130
+ );
131
+
132
+ /*bsdf retroreflection_bsdf = df::custom_curve_layer(
133
+ normal_reflectivity: 1.-normal_reflectivity,
134
+ grazing_reflectivity: 1.-grazing_reflectivity,
135
+ base: backscattering_glossy_bsdf,
136
+ layer: custom_curve_layer_bsdf,
137
+ normal: enable_clearcoat ? normal_lookup : state::normal()
138
+ );*/
139
+
140
+ // if normal_reflectivity and grazing_reflectivity are 1 and weight is 1, just the layer is used
141
+ bsdf opt_retroreflection_bsdf = df::custom_curve_layer(
142
+ normal_reflectivity: enable_retroreflection ? 1.-normal_reflectivity : 1,
143
+ grazing_reflectivity: enable_retroreflection ? 1.-grazing_reflectivity : 1,
144
+ base: backscattering_glossy_bsdf,
145
+ layer: custom_curve_layer_bsdf,
146
+ normal: enable_clearcoat ? normal : state::normal()
147
+ );
148
+
149
+ //
150
+ // End RETROREFLECTION SUPPORT
151
+ //
152
+
153
+ bsdf directional_factor_bsdf = df::directional_factor(
154
+ normal_tint: ao_weighted_base_color,
155
+ grazing_tint: color(1.0, 1.0, 1.0),
156
+ exponent: 5.0f,
157
+ base: ggx_smith_bsdf
158
+ );
159
+
160
+ // CLEARCOAT
161
+ bsdf omni_PBR_bsdf = df::weighted_layer(
162
+ weight: metallic,
163
+ layer: directional_factor_bsdf,
164
+ base: opt_retroreflection_bsdf, //enable_retroreflection ? retroreflection_bsdf : custom_curve_layer_bsdf,
165
+ normal: enable_clearcoat ? normal : state::normal()
166
+ );
167
+
168
+ bsdf clearcoat_bsdf = df::microfacet_ggx_smith_bsdf(
169
+ roughness_u: clearcoat_reflection_roughness * clearcoat_reflection_roughness,
170
+ roughness_v: clearcoat_reflection_roughness * clearcoat_reflection_roughness,
171
+ tint: color(1.0f),
172
+ mode: df::scatter_reflect
173
+ );
174
+
175
+ // bsdf omni_PBR_coated_bsdf = df::custom_curve_layer(
176
+ // normal_reflectivity: clearcoat_reflectivity * 0.08,
177
+ // grazing_reflectivity: 1.0,
178
+ // weight: clearcoat_weight,
179
+ // layer: clearcoat_bsdf,
180
+ // base: omni_PBR_bsdf,
181
+ // normal: final_clearcoat_normal
182
+ // );
183
+
184
+ bsdf opt_opaque_clearcoat = df::weighted_layer(
185
+ weight: enable_clearcoat ? clearcoat_transparency : 1,
186
+ layer: ::df::tint(tint: enable_clearcoat ? clearcoat_tint : color(1), base: omni_PBR_bsdf),
187
+ base: ::df::diffuse_reflection_bsdf(tint: clearcoat_tint)
188
+ );
189
+
190
+ bsdf opt_omni_PBR_coated_bsdf = df::fresnel_layer(
191
+ ior: clearcoat_ior,
192
+ weight: enable_clearcoat ? clearcoat_weight : 0,
193
+ layer: clearcoat_bsdf,
194
+ base: opt_opaque_clearcoat,
195
+ normal: clearcoat_normal
196
+ );
197
+
198
+ bsdf final_bsdf = opt_omni_PBR_coated_bsdf;
199
+ } in material(
200
+ thin_walled: false,
201
+ surface: material_surface(
202
+ scattering: final_bsdf,
203
+ emission: material_emission(
204
+ df::diffuse_edf(),
205
+ intensity: enable_emission ? emissive_color * emissive_mask * color(emissive_intensity) : color(0)
206
+ )
207
+ ),
208
+ geometry: material_geometry(
209
+ normal: enable_clearcoat ? state::normal() : normal,
210
+ cutout_opacity: enable_opacity ? (enable_opacity_cutout ? (alpha < alpha_cutout_cutoff ? 0.0 : 1.0) : alpha) : 1.0
211
+ )
212
+ );
objects/contemporary_openstorage/materials/omniverse/simready_content/materials/baking_annotations.mdl ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.4;
2
+ import ::anno::*;
3
+
4
+ export const string TRANSFORM_NONE = "NONE";
5
+ export const string TRANSFORM_UNORM_VECTOR = "UNORM_VECTOR";
6
+
7
+ export const string FORMAT_RGBA8_UNORM = "RGBA8_UNORM";
8
+ export const string FORMAT_R8_UNORM = "R8_UNORM";
9
+ export const string FORMAT_RGBA16_SFLOAT = "RGBA16_SFLOAT";
10
+
11
+ export const string BLEND_MODE_OPACITY = "opacity_blend";
12
+ export const string BLEND_MODE_REPLACE = "replace";
13
+
14
+ // This annotation is used to mark a material as target material for baking.
15
+ // It is that is detected by the MDL SDK and neuray.
16
+ export annotation target_material_model();
17
+
18
+ export annotation target_material_rendering(
19
+ string rendering_material_override = "" // if set, the baked material will be rendering using this material,
20
+ // otherwise the target itself is used
21
+ );
22
+
23
+ export annotation target_baked_argument(
24
+ // the name of the baked texture parameter in the rendering material
25
+ string baked_name,
26
+
27
+ // the name of the constant parameter in the rendering material in case baking was not necessary
28
+ string constant_name = "",
29
+
30
+ // texture format to bake to
31
+ string format = "",
32
+
33
+ // transformations, like encoding normals into [0,1] range
34
+ string transform = TRANSFORM_NONE,
35
+
36
+ // blending, e.g., based on alpha or replace
37
+ string blend_mode = BLEND_MODE_OPACITY
38
+ );
objects/desk_01/materials/omniverse/simready_content/materials/SimPBR.mdl ADDED
@@ -0,0 +1,562 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*****************************************************************************
2
+ * Copyright 1986-2020 NVIDIA Corporation. All rights reserved.
3
+ ******************************************************************************
4
+
5
+ MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,
6
+ WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,
7
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
8
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
9
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
10
+ COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA
11
+ CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
12
+ ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
13
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
14
+ THE USE OR INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN
15
+ THE MDL MATERIALS.
16
+ */
17
+
18
+ mdl 1.4;
19
+
20
+ import ::df::*;
21
+ import ::state::*;
22
+ import ::math::*;
23
+ import ::base::*;
24
+ import ::tex::*;
25
+ import ::anno::*;
26
+
27
+ import ::nvidia::core_definitions::file_texture;
28
+ import ::nvidia::core_definitions::normalmap_texture;
29
+
30
+ using .::SimPBR_Model import *;
31
+ using .::baking_annotations import *;
32
+
33
+ export material SimPBR(
34
+ // -------------------- DIFFUSE REFLECTION ----------------------
35
+ color diffuse_color_constant = color(0.2f)
36
+ [[
37
+ anno::display_name("Albedo Base Color"),
38
+ anno::description("The base albedo color to use if no texture is specified"),
39
+ anno::in_group("Diffuse")
40
+ ]],
41
+ uniform texture_2d diffuse_texture = texture_2d()
42
+ [[
43
+ anno::display_name("Albedo Map"),
44
+ anno::description("The texture specifying the albedo value to use"),
45
+ anno::in_group("Diffuse")
46
+ ]],
47
+ uniform color diffuse_tint = color(1.0f)
48
+ [[
49
+ anno::display_name("Albedo Tint"),
50
+ anno::description("This tints the albedo color or texture contant"),
51
+ anno::in_group("Diffuse")
52
+ ]],
53
+ uniform bool enable_transmission = false
54
+ [[
55
+ anno::display_name("Enable Diffuse Transmission"),
56
+ anno::description("Enables the diffuse transmission of light through thin diffuse scattering layer"),
57
+ anno::in_group("Diffuse")
58
+ ]],
59
+ uniform float opacity_ratio = 1.f
60
+ [[
61
+ anno::enable_if("enable_transmission == true"),
62
+ anno::display_name("Opacity Ratio"),
63
+ anno::description("Amount of opacity"),
64
+ anno::in_group("Diffuse")
65
+ ]],
66
+ uniform color opacity_tint = color(1.0f)
67
+ [[
68
+ anno::enable_if("enable_transmission == true"),
69
+ anno::display_name("Diffuse transmission tint"),
70
+ anno::description("Base diffuse transmission color"),
71
+ anno::in_group("Diffuse")
72
+ ]],
73
+ uniform float opacity_multiplier = 1.f
74
+ [[
75
+ anno::enable_if("enable_transmission == true"),
76
+ anno::display_name("Diffuse transmission multiplier"),
77
+ anno::description("Base diffuse transmission multiplier"),
78
+ anno::in_group("Diffuse")
79
+ ]],
80
+
81
+ // -------------------- SPECULAR REFLECTION ----------------------
82
+ float reflection_roughness_constant = 0.5f
83
+ [[
84
+ anno::display_name("Roughness Amount"),
85
+ anno::hard_range(0.0,1.),
86
+ anno::description("Higher roughness values lead to more blurry reflections"),
87
+ anno::in_group("Specular")
88
+ ]],
89
+ uniform float reflection_roughness_texture_influence = 0.0f
90
+ [[
91
+ anno::display_name("Roughness Map Influence"),
92
+ anno::hard_range(0.0, 1.),
93
+ anno::description("Blends between the constant value and the lookup of the roughness texture"),
94
+ anno::in_group("Specular")
95
+ ]],
96
+ uniform texture_2d reflectionroughness_texture = texture_2d()
97
+ [[
98
+ anno::display_name("Roughness Map"),
99
+ anno::in_group("Specular")
100
+ ]],
101
+
102
+ float anisotropy_constant = 0.0f
103
+ [[
104
+ anno::display_name("Anisotropy Amount"),
105
+ anno::hard_range(-1.,1.),
106
+ anno::description("0 for isotropic, extents of -1 to 1 for anisotropy"),
107
+ anno::in_group("Specular")
108
+ ]],
109
+ uniform float anisotropy_texture_influence = 0.0f
110
+ [[
111
+ anno::display_name("Anisotropy Map Influence"),
112
+ anno::hard_range(0.0, 1.),
113
+ anno::description("Blends between the constant value and the lookup of the anisotropy texture"),
114
+ anno::in_group("Specular")
115
+ ]],
116
+ uniform texture_2d anisotropy_texture = texture_2d()
117
+ [[
118
+ anno::display_name("Anisotropy Map"),
119
+ anno::in_group("Specular")
120
+ ]],
121
+
122
+ float metallic_constant = 0.f
123
+ [[
124
+ anno::display_name("Metallic Amount"),
125
+ anno::hard_range(0.0,1.),
126
+ anno::description("Metallic Material"),
127
+ anno::in_group("Specular")
128
+ ]],
129
+ uniform float metallic_texture_influence = 0.0f
130
+ [[
131
+ anno::display_name("Metallic Map Influence"),
132
+ anno::hard_range(0.0, 1.),
133
+ anno::description("Blends between the constant value and the lookup of the metallic texture"),
134
+ anno::in_group("Specular")
135
+ ]],
136
+ uniform texture_2d metallic_texture = texture_2d()
137
+ [[
138
+ anno::display_name("Metallic Map"),
139
+ anno::in_group("Specular")
140
+ ]],
141
+
142
+ float specular_constant = 1.f
143
+ [[
144
+ anno::display_name("Specular amount"),
145
+ anno::hard_range(0.0, 1.0),
146
+ anno::description("Scale of the specular component"),
147
+ anno::in_group("Specular")
148
+ ]],
149
+ uniform texture_2d specular_texture = texture_2d()
150
+ [[
151
+ anno::display_name("Specular Map"),
152
+ anno::in_group("Specular")
153
+ ]],
154
+
155
+ // -------------------- ORM ----------------------
156
+ uniform bool enable_ORM_texture = true
157
+ [[
158
+ anno::display_name("Enable ORM Texture"),
159
+ anno::description("When True the ORM texture will be used to extract the Occlusion, Roughness and Metallic Map"),
160
+ anno::in_group("Reflectivity")
161
+ ]],
162
+ uniform texture_2d ORM_texture = texture_2d()
163
+ [[
164
+ anno::display_name("ORM Map"),
165
+ anno::description("Texture that hae Occlusion, Roughness and Metallic map stored in the respective r, g and b channels"),
166
+ anno::in_group("Reflectivity")
167
+ ]],
168
+
169
+ // -------------------- Clearcoat ----------------------
170
+ uniform bool enable_clearcoat = false
171
+ [[
172
+ anno::display_name("Enable Clearcoat Layer"),
173
+ anno::description("Adds a clearcoat layer on top of the material when enabled"),
174
+ anno::in_group("Clearcoat")
175
+ ]],
176
+ color clearcoat_tint = color(1.0f)
177
+ [[
178
+ anno::display_name("Clearcoat Tint"),
179
+ anno::description("Clearcoat is tinted and affects the underlying material"),
180
+ anno::in_group("Clearcoat")
181
+ ]],
182
+ float clearcoat_transparency = 1.0f
183
+ [[
184
+ anno::display_name("Clearcoat Transparency"),
185
+ anno::description("Adjusts the transparency of the clearcoat. Can be turned into a fully opaque clearcoat "
186
+ "covering the underlying layer"),
187
+ anno::in_group("Clearcoat")
188
+ ]],
189
+ float clearcoat_reflection_roughness = 0.0f
190
+ [[
191
+ anno::display_name("Clearcoat Roughness"),
192
+ anno::description("Higher roughness values lead to more blurry reflections"),
193
+ anno::hard_range(0.0f, 1.0f),
194
+ anno::in_group("Clearcoat")
195
+ ]],
196
+ float clearcoat_weight = 1.0f
197
+ [[
198
+ anno::display_name("Clearcoat Weight"),
199
+ anno::description("Sets the weight for clearcoat layer"),
200
+ anno::hard_range(0.0f, 1.0f),
201
+ anno::in_group("Clearcoat")
202
+ ]],
203
+ float clearcoat_flatten = 1.0f
204
+ [[
205
+ anno::display_name("Clearcoat Flatten"),
206
+ anno::description("Flattens the clearcoat to even out the underlying bump maps"),
207
+ anno::hard_range(0.0f, 1.0f),
208
+ anno::in_group("Clearcoat")
209
+ ]],
210
+ float clearcoat_ior = 1.56f
211
+ [[
212
+ anno::display_name("Clearcoat IOR"),
213
+ anno::description("Sets the Index of refraction for the clearcoat layer"),
214
+ anno::soft_range(1.0f, 4.0f),
215
+ anno::in_group("Clearcoat")
216
+ ]],
217
+ uniform float clearcoat_bump_factor = 1.f
218
+ [[
219
+ anno::display_name("Clearcoat Normal Map Strength"),
220
+ anno::description("Strength of normal map."),
221
+ anno::in_group("Clearcoat")
222
+ ]],
223
+
224
+ float3 clearcoat_normal_input = float3(0.0, 0.0, 0.0),
225
+ uniform texture_2d clearcoat_normalmap_texture = texture_2d()
226
+ [[
227
+ anno::display_name("Clearcoat Normal Map"),
228
+ anno::description("Enables the usage of the normalmap texture"),
229
+ anno::in_group("Clearcoat")
230
+ ]],
231
+
232
+ uniform bool clearcoat_flip_tangent_u = false
233
+ [[
234
+ anno::display_name("Clearcoat Normal Map Flip U Tangent"),
235
+ anno::in_group("Clearcoat")
236
+ ]],
237
+ uniform bool clearcoat_flip_tangent_v = true
238
+ [[
239
+ anno::display_name("Clearcoat Normal Map Flip V Tangent"),
240
+ anno::in_group("Clearcoat")
241
+ ]],
242
+
243
+
244
+ // -------------------- REFLECTIVITY ----------------------
245
+ uniform bool enable_retroreflection = false
246
+ [[
247
+ anno::display_name("Enable Retroreflection"),
248
+ anno::in_group("Reflectivity")
249
+ ]],
250
+ color retroreflection_tint = color(.182,.800,.000)
251
+ [[
252
+ anno::display_name("Retro-reflection tint"),
253
+ anno::description("The tint of the retroreflection"),
254
+ anno::in_group("Reflectivity")
255
+ ]],
256
+ uniform float normal_reflectivity = 0.5
257
+ [[
258
+ anno::display_name("Retro-reflection weight facing"),
259
+ anno::hard_range(0.0,1.),
260
+ anno::description("Reflectivity control for geometry facing the viewer"),
261
+ anno::in_group("Reflectivity")
262
+ ]],
263
+ uniform float grazing_reflectivity = 1.0
264
+ [[
265
+ anno::display_name("Retro-reflection weight edge"),
266
+ anno::hard_range(0.0,1.),
267
+ anno::description("Reflectivity control for the reflectivity at geometry edges"),
268
+ anno::in_group("Reflectivity")
269
+ ]],
270
+
271
+ // -------------------- AMBIENT OCCLUSION ----------------------
272
+ float ao_to_diffuse = 0.0
273
+ [[
274
+ anno::display_name("AO to Diffuse"),
275
+ anno::description("Controls the amount of ambient occlusion multiplied into the diffuse color channel"),
276
+ anno::in_group("AO")
277
+ ]],
278
+ float ao_input = float(1.0),
279
+ uniform texture_2d ao_texture = texture_2d()
280
+ [[
281
+ anno::display_name("Ambient Occlusion Map"),
282
+ anno::description("The Ambient Occlusion texture for the material"),
283
+ anno::in_group("AO")
284
+ ]],
285
+
286
+ // -------------------- EMISSIVE ----------------------
287
+ uniform bool enable_emission = false
288
+ [[
289
+ anno::display_name("Enable Emission"),
290
+ anno::description("Enables the emission of light from the material"),
291
+ anno::in_group("Emissive")
292
+ ]],
293
+ uniform color emissive_color = color(1.0, 0.1, 0.1)
294
+ [[
295
+ anno::enable_if("enable_emission == true"),
296
+ anno::display_name("Emissive Color"),
297
+ anno::description("The emission color"),
298
+ anno::in_group("Emissive")
299
+ ]],
300
+
301
+ color emissive_mask_input = color(1.0),
302
+ uniform texture_2d emissive_mask_texture = texture_2d()
303
+ [[
304
+ anno::enable_if("enable_emission == true"),
305
+ anno::display_name("Emissive Mask Map"),
306
+ anno::description("The texture masking the emissive color"),
307
+ anno::in_group("Emissive")
308
+ ]],
309
+ uniform float emissive_intensity = 40.f
310
+ [[
311
+ anno::enable_if("enable_emission == true"),
312
+ anno::display_name("Emissive Intensity"),
313
+ anno::description("Intensity of the emission"),
314
+ anno::in_group("Emissive")
315
+ ]],
316
+ uniform bool enable_emissive_flipbook = false
317
+ [[
318
+ anno::display_name("Enable Flipbook for emission"),
319
+ anno::description("Allows the use of animated emissive textures (e.g. video screens)"),
320
+ anno::in_group("Emissive")
321
+ ]],
322
+ uniform int2 flipbook_dim = int2(1,1)
323
+ [[
324
+ anno::enable_if("enable_emissive_flipbook == true"),
325
+ anno::display_name("Flipbook Rows/Columns"),
326
+ anno::description("How many rows and columns are in the flipbook?"),
327
+ anno::in_group("Emissive")
328
+ ]],
329
+ uniform int target_fps = 1
330
+ [[
331
+ anno::enable_if("enable_emissive_flipbook == true"),
332
+ anno::display_name("Flipbook Target FPS"),
333
+ anno::description("Playback speed in frames per second"),
334
+ anno::in_group("Emissive")
335
+ ]],
336
+
337
+ // -------------------- ALPHA ----------------------
338
+ uniform bool enable_opacity = false
339
+ [[
340
+ anno::display_name("Enable Opacity"),
341
+ anno::description("Enables or disables alpha functionality"),
342
+ anno::in_group("Alpha")
343
+ ]],
344
+ float alpha_constant = 1.0
345
+ [[
346
+ anno::enable_if("enable_opacity == true"),
347
+ anno::display_name("Opacity Fallback Constant"),
348
+ anno::hard_range(0.0, 1.0),
349
+ anno::description("The base alpha constant to use if no texture is specified"),
350
+ anno::in_group("Alpha")
351
+ ]],
352
+ uniform texture_2d opacity_texture = texture_2d()
353
+ [[
354
+ anno::enable_if("enable_opacity == true"),
355
+ anno::display_name("Opacity Map"),
356
+ anno::description("The texture specifying the opacity value to use"),
357
+ anno::in_group("Alpha")
358
+ ]],
359
+ uniform bool enable_opacity_cutout = false
360
+ [[
361
+ anno::enable_if("enable_opacity == true"),
362
+ anno::display_name("Enable Alpha Cutout"),
363
+ anno::description("Enables or disables alpha cutout functionality"),
364
+ anno::in_group("Alpha")
365
+ ]],
366
+ uniform float alpha_cutout_cutoff = 1.f
367
+ [[
368
+ anno::enable_if("enable_opacity == true"),
369
+ anno::enable_if("enable_opacity_cutout == true"),
370
+ anno::hard_range(0.0, 1.0),
371
+ anno::display_name("Alpha Cutout Cutoff"),
372
+ anno::description("The cutoff value to to render as transparent up to and opaque past"),
373
+ anno::in_group("Alpha")
374
+ ]],
375
+
376
+ // -------------------- NORMAL ----------------------
377
+ uniform float bump_factor = 1.f
378
+ [[
379
+ anno::display_name("Normal Map Strength"),
380
+ anno::description("Strength of normal map."),
381
+ anno::in_group("Normal")
382
+ ]],
383
+
384
+ float3 normal_input = state::normal(),
385
+ uniform texture_2d normalmap_texture = texture_2d()
386
+ [[
387
+ anno::display_name("Normal Map"),
388
+ anno::in_group("Normal")
389
+ ]],
390
+ uniform bool flip_tangent_u = false
391
+ [[
392
+ anno::display_name("Normal Map Flip U Tangent"),
393
+ anno::in_group("Normal")
394
+ ]],
395
+ uniform bool flip_tangent_v = true
396
+ [[
397
+ anno::display_name("Normal Map Flip V Tangent"),
398
+ anno::in_group("Normal")
399
+ ]],
400
+
401
+ // -------------------- UV ADJUSTMENTS ----------------------
402
+ uniform bool project_uvw = false
403
+ [[
404
+ anno::display_name("Enable Project UVW Coordinates"),
405
+ anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"),
406
+ anno::in_group("UV")
407
+ ]],
408
+ uniform bool world_or_object = false
409
+ [[
410
+ anno::enable_if("project_uvw == true"),
411
+ anno::display_name("Enable World Space"),
412
+ anno::description("When set to 'true' uses world space for projection, when 'false' object space is used"),
413
+ anno::in_group("UV")
414
+ ]],
415
+ uniform float2 texture_translate = float2(0.0f)
416
+ [[
417
+ anno::display_name("Texture Translate"),
418
+ anno::description("Controls position of texture."),
419
+ anno::in_group("UV")
420
+ ]],
421
+ uniform float2 texture_scale = float2(1.0f)
422
+ [[
423
+ anno::display_name("Texture Tiling"),
424
+ anno::description("Controls repetition of the texture."),
425
+ anno::in_group("UV")
426
+ ]],
427
+ uniform float2 texture_speed = float2(0.0f)
428
+ [[
429
+ anno::display_name("Texture Speed"),
430
+ anno::description("Scrolling texture animation speed in UVs per sec."),
431
+ anno::in_group("UV")
432
+ ]]
433
+ )
434
+ [[
435
+ anno::display_name("Sim PBR"),
436
+ anno::description("Supports the opaque alpha cutout material model of the Sim Renderer"),
437
+ anno::in_group("SimReady"),
438
+ anno::version( 1, 0, 0),
439
+ anno::author("NVIDIA CORPORATION"),
440
+ anno::key_words(string[]("Sim", "PBR", "opaque", "alpha", "cutout", "omniverse", "generic"))
441
+ ]]
442
+ = let {
443
+ base::texture_coordinate_system the_system = world_or_object ? base::texture_coordinate_world : base::texture_coordinate_object;
444
+
445
+ base::texture_coordinate_info uvw = project_uvw ?
446
+ base::coordinate_projection(
447
+ coordinate_system: the_system,
448
+ texture_space: 0,
449
+ projection_type: base::projection_cubic
450
+ ) : base::coordinate_source(
451
+ coordinate_system: base::texture_coordinate_uvw,
452
+ texture_space: 0
453
+ );
454
+
455
+ // Need to use a small value so the compiler doesnt optimize out this var...
456
+ float t = 0.00000001;//state::animation_time();
457
+ base::texture_coordinate_info transformed_uvw = base::transform_coordinate(
458
+ transform: base::rotation_translation_scale(
459
+ scaling: float3(texture_scale.x, texture_scale.y, 1.0),
460
+ rotation: float3(0.0, 0.0, 0.0 ),
461
+ translation: float3(texture_translate.x + t * texture_speed.x, texture_translate.y + t * texture_speed.y, 0.0)),
462
+ coordinate: uvw
463
+ );
464
+ float2 uv = float2(transformed_uvw.position.x, transformed_uvw.position.y);
465
+
466
+ // Diffuse Color Lookup and AO
467
+ float4 base_lookup = tex::texture_isvalid(diffuse_texture) ? tex::lookup_float4(tex: diffuse_texture, coord: uv) : float4(1, 1, 1, 1);
468
+
469
+ float opacityValue = tex::texture_isvalid(opacity_texture) ? tex::lookup_float4(tex: opacity_texture, coord: uv).w : alpha_constant;
470
+
471
+ // Normal calculations
472
+ float3 normal_lookup = tex::texture_isvalid(normalmap_texture) ?
473
+ base::tangent_space_normal_texture(
474
+ texture: normalmap_texture,
475
+ factor: bump_factor,
476
+ uvw: transformed_uvw,
477
+ flip_tangent_u: flip_tangent_u,
478
+ flip_tangent_v: flip_tangent_v
479
+ ) : normal_input;
480
+
481
+ float3 clearcoat_normal = tex::texture_isvalid(clearcoat_normalmap_texture) ?
482
+ base::tangent_space_normal_texture(
483
+ texture: clearcoat_normalmap_texture,
484
+ factor: clearcoat_bump_factor,
485
+ uvw: uvw,
486
+ flip_tangent_u: clearcoat_flip_tangent_u,
487
+ flip_tangent_v: clearcoat_flip_tangent_v
488
+ ) : clearcoat_normal_input;
489
+
490
+ float3 flattened_clearcoat_normal = ::math::lerp(normal_lookup, ::state::normal(), clearcoat_flatten);
491
+ float3 final_clearcoat_normal = tex::texture_isvalid(clearcoat_normalmap_texture) ? clearcoat_normal : flattened_clearcoat_normal;
492
+
493
+ float ao_lookup = tex::texture_isvalid(ao_texture) ? tex::lookup_float4(tex: ao_texture, coord: uv).x : ao_input;
494
+
495
+ color diffuse_color = tex::texture_isvalid(diffuse_texture) ? color(base_lookup.x, base_lookup.y, base_lookup.z) : diffuse_color_constant;
496
+
497
+ float3 ORM_lookup = tex::lookup_float3(
498
+ tex: ORM_texture,
499
+ coord: float2(transformed_uvw.position.x, transformed_uvw.position.y)
500
+ );
501
+
502
+ float roughness_lookup = tex::texture_isvalid(reflectionroughness_texture) ?
503
+ tex::lookup_float4(tex: reflectionroughness_texture, coord: uv).x : reflection_roughness_constant;
504
+ float anisotropy_lookup = tex::texture_isvalid(anisotropy_texture) ?
505
+ (tex::lookup_float4(tex: anisotropy_texture, coord: uv).x * 2.0f - 1.0f) : anisotropy_constant;
506
+ float metallic_lookup = tex::texture_isvalid(metallic_texture) ?
507
+ tex::lookup_float4(tex: metallic_texture, coord: uv).x : metallic_constant;
508
+ float specular_lookup = tex::texture_isvalid(specular_texture) ?
509
+ tex::lookup_float4(tex: specular_texture, coord: uv).x : specular_constant;
510
+
511
+ float roughness_selection = enable_ORM_texture ? ORM_lookup.y : roughness_lookup;
512
+ float metallic_selection = enable_ORM_texture ? ORM_lookup.z : metallic_lookup;
513
+ float ao = enable_ORM_texture ? ORM_lookup.x : ao_lookup;
514
+
515
+ float reflection_roughness = math::lerp(reflection_roughness_constant, roughness_selection, reflection_roughness_texture_influence);
516
+ float anisotropy = math::lerp(anisotropy_constant, anisotropy_lookup, anisotropy_texture_influence);
517
+ float metallic = math::lerp(metallic_constant, metallic_selection, metallic_texture_influence);
518
+
519
+ int rows = flipbook_dim.x;
520
+ int columns = flipbook_dim.y;
521
+ int numFrames = rows * columns;
522
+ varying int frameIdx = int(state::animation_time() * target_fps) % numFrames;
523
+ varying float2 baseUV = float2(transformed_uvw.position.x, transformed_uvw.position.y);
524
+ varying float2 emissiveUV = enable_emissive_flipbook ?
525
+ ((baseUV + float2(frameIdx % rows, frameIdx / rows)) / float2(rows, columns)) : baseUV;
526
+
527
+ color emissive_mask = tex::texture_isvalid(emissive_mask_texture) ?
528
+ tex::lookup_color(emissive_mask_texture, emissiveUV, tex::wrap_repeat, tex::wrap_repeat) : emissive_mask_input;
529
+
530
+ } in SimPBR_Model(
531
+ diffuse_color: diffuse_color,
532
+ diffuse_tint: diffuse_tint,
533
+ roughness: reflection_roughness,
534
+ anisotropy: anisotropy,
535
+ metallic: metallic,
536
+ specular: specular_lookup,
537
+ normal: normal_lookup,
538
+ enable_clearcoat: enable_clearcoat,
539
+ clearcoat_tint: clearcoat_tint,
540
+ clearcoat_transparency: clearcoat_transparency,
541
+ clearcoat_reflection_roughness: clearcoat_reflection_roughness,
542
+ clearcoat_weight: clearcoat_weight,
543
+ clearcoat_ior: clearcoat_ior,
544
+ clearcoat_normal: final_clearcoat_normal,
545
+ enable_retroreflection: enable_retroreflection,
546
+ retroreflection_tint: retroreflection_tint,
547
+ normal_reflectivity: normal_reflectivity,
548
+ grazing_reflectivity: grazing_reflectivity,
549
+ ao_to_diffuse: ao_to_diffuse,
550
+ ao: ao,
551
+ enable_emission: enable_emission,
552
+ emissive_color: emissive_color,
553
+ emissive_mask: emissive_mask,
554
+ emissive_intensity: emissive_intensity,
555
+ enable_opacity: enable_opacity,
556
+ alpha: opacityValue,
557
+ enable_opacity_cutout: enable_opacity_cutout,
558
+ alpha_cutout_cutoff: alpha_cutout_cutoff,
559
+ opacity_ratio: enable_transmission ? opacity_ratio : 1.0,
560
+ opacity_tint : opacity_tint,
561
+ opacity_multiplier : opacity_multiplier
562
+ );
objects/desk_01/materials/omniverse/simready_content/materials/SimPBR_Model.mdl ADDED
@@ -0,0 +1,212 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*****************************************************************************
2
+ * Copyright 1986-2020 NVIDIA Corporation. All rights reserved.
3
+ ******************************************************************************
4
+
5
+ MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,
6
+ WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,
7
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
8
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
9
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
10
+ COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA
11
+ CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
12
+ ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
13
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
14
+ THE USE OR INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN
15
+ THE MDL MATERIALS.
16
+ */
17
+
18
+ mdl 1.4;
19
+
20
+ import ::df::*;
21
+ import ::state::*;
22
+ import ::math::*;
23
+ import ::base::*;
24
+ import ::tex::*;
25
+ import ::anno::*;
26
+
27
+ using .::baking_annotations import *;
28
+
29
+ base::texture_return multiply_colors(
30
+ color color_1 = color(1.0, 1.0, 1.0),
31
+ color color_2 = color(.5, .5, .5),
32
+ float weight = 1.0
33
+ )
34
+ [[
35
+ anno::hidden()
36
+ ]]
37
+ {
38
+ return base::blend_color_layers(
39
+ layers: base::color_layer[](
40
+ base::color_layer(
41
+ layer_color: color_2,
42
+ weight: weight,
43
+ mode: base::color_layer_multiply
44
+ )
45
+ ), base: color_1
46
+ );
47
+ }
48
+
49
+ export material SimPBR_Model(
50
+ color diffuse_color = color(0.2f) [[ target_baked_argument("diffuse_texture", "diffuse_color_constant", "RGBA8_UNORM") ]],
51
+ uniform color diffuse_tint = color(1.0f),
52
+ float roughness = 0.5f [[ target_baked_argument("reflectionroughness_texture", "reflection_roughness_constant", "R8_UNORM") ]],
53
+ float anisotropy = 0.0f [[ target_baked_argument("anisotropy_texture", "anisotropy_constant", "R8_SNORM") ]],
54
+ float metallic = 0.f [[ target_baked_argument("metallic_texture", "metallic_constant", "R8_UNORM") ]],
55
+ float specular = 1.f [[ target_baked_argument("specular_texture", "specular_constant", "R8_UNORM") ]],
56
+ float3 normal = float3(0.0, 0.0, 0.0) [[ target_baked_argument("normalmap_texture", "normal_input", "RGBA8_SNORM", baking_annotations::TRANSFORM_UNORM_VECTOR) ]],
57
+ uniform bool enable_clearcoat = false,
58
+ color clearcoat_tint = color(1.0f),
59
+ float clearcoat_transparency = 1.0f,
60
+ float clearcoat_reflection_roughness = 0.0f,
61
+ float clearcoat_weight = 1.0f,
62
+ float clearcoat_ior = 1.56f,
63
+ float3 clearcoat_normal = float3(0.0, 0.0, 0.0) [[ target_baked_argument("clearcoat_normalmap_texture", "clearcoat_normal_input", "RGBA8_SNORM", baking_annotations::TRANSFORM_UNORM_VECTOR) ]],
64
+ uniform bool enable_retroreflection = false,
65
+ color retroreflection_tint = color(.182,.800,.000),
66
+ uniform float normal_reflectivity = 0.5,
67
+ uniform float grazing_reflectivity = 1.0,
68
+ float ao_to_diffuse = 0.0,
69
+ float ao = 1.0f [[ target_baked_argument("ao_texture", "ao_input", "R8_UNORM") ]],
70
+ uniform bool enable_emission = false,
71
+ uniform color emissive_color = color(1.0, 0.1, 0.1),
72
+ color emissive_mask = color(1.0, 0.1, 0.1) [[ target_baked_argument("emissive_mask_texture", "emissive_mask_input", "R8_UNORM") ]],
73
+ uniform float emissive_intensity = 40.f,
74
+ uniform bool enable_opacity = false,
75
+ float alpha = 1.0,
76
+ uniform bool enable_opacity_cutout = false,
77
+ uniform float alpha_cutout_cutoff = 1.f,
78
+ uniform float opacity_ratio = 1.f,
79
+ uniform color opacity_tint = color(1.0f),
80
+ uniform float opacity_multiplier = 1.f
81
+ )
82
+ [[
83
+ target_material_model(),
84
+ target_material_rendering("..::SimPBR::SimPBR")
85
+ ]]
86
+ = let {
87
+ color base_color = multiply_colors(diffuse_color, diffuse_tint, 1.0).tint;
88
+ color ao_weighted_base_color = multiply_colors(base_color, color(ao), ao_to_diffuse).tint;
89
+
90
+ float squared_roughness = roughness * roughness;
91
+ float roughness_u = squared_roughness * (1 + anisotropy);
92
+ float roughness_v = squared_roughness * (1 - anisotropy);
93
+
94
+ color diffuse_transmission_color = base_color * opacity_tint * opacity_multiplier;
95
+
96
+ bsdf diffuse_bsdf = df::weighted_layer(
97
+ weight: opacity_ratio,
98
+ layer: df::diffuse_reflection_bsdf(
99
+ tint: ao_weighted_base_color,
100
+ roughness: 0.0f
101
+ ),
102
+ base: df::diffuse_transmission_bsdf(tint: diffuse_transmission_color),
103
+ normal: enable_clearcoat ? normal : state::normal()
104
+ );
105
+
106
+ bsdf ggx_smith_bsdf = df::microfacet_ggx_smith_bsdf(
107
+ roughness_u: roughness_u,
108
+ roughness_v: roughness_v,
109
+ tint: color(1.0, 1.0, 1.0),
110
+ mode: df::scatter_reflect
111
+ );
112
+
113
+ bsdf custom_curve_layer_bsdf = df::custom_curve_layer(
114
+ normal_reflectivity: 0.03,
115
+ grazing_reflectivity: 1.0,
116
+ exponent: 5.0,
117
+ weight: specular,
118
+ layer: ggx_smith_bsdf,
119
+ base: diffuse_bsdf,
120
+ normal: enable_clearcoat ? normal : state::normal()
121
+ );
122
+
123
+ //
124
+ // Begin RETROREFLECTION SUPPORT
125
+ //
126
+ color final_retroreflection_color = multiply_colors(retroreflection_tint, base_color, 1.0).tint;
127
+ bsdf backscattering_glossy_bsdf = df::backscattering_glossy_reflection_bsdf(
128
+ tint: final_retroreflection_color,
129
+ roughness_u: squared_roughness
130
+ );
131
+
132
+ /*bsdf retroreflection_bsdf = df::custom_curve_layer(
133
+ normal_reflectivity: 1.-normal_reflectivity,
134
+ grazing_reflectivity: 1.-grazing_reflectivity,
135
+ base: backscattering_glossy_bsdf,
136
+ layer: custom_curve_layer_bsdf,
137
+ normal: enable_clearcoat ? normal_lookup : state::normal()
138
+ );*/
139
+
140
+ // if normal_reflectivity and grazing_reflectivity are 1 and weight is 1, just the layer is used
141
+ bsdf opt_retroreflection_bsdf = df::custom_curve_layer(
142
+ normal_reflectivity: enable_retroreflection ? 1.-normal_reflectivity : 1,
143
+ grazing_reflectivity: enable_retroreflection ? 1.-grazing_reflectivity : 1,
144
+ base: backscattering_glossy_bsdf,
145
+ layer: custom_curve_layer_bsdf,
146
+ normal: enable_clearcoat ? normal : state::normal()
147
+ );
148
+
149
+ //
150
+ // End RETROREFLECTION SUPPORT
151
+ //
152
+
153
+ bsdf directional_factor_bsdf = df::directional_factor(
154
+ normal_tint: ao_weighted_base_color,
155
+ grazing_tint: color(1.0, 1.0, 1.0),
156
+ exponent: 5.0f,
157
+ base: ggx_smith_bsdf
158
+ );
159
+
160
+ // CLEARCOAT
161
+ bsdf omni_PBR_bsdf = df::weighted_layer(
162
+ weight: metallic,
163
+ layer: directional_factor_bsdf,
164
+ base: opt_retroreflection_bsdf, //enable_retroreflection ? retroreflection_bsdf : custom_curve_layer_bsdf,
165
+ normal: enable_clearcoat ? normal : state::normal()
166
+ );
167
+
168
+ bsdf clearcoat_bsdf = df::microfacet_ggx_smith_bsdf(
169
+ roughness_u: clearcoat_reflection_roughness * clearcoat_reflection_roughness,
170
+ roughness_v: clearcoat_reflection_roughness * clearcoat_reflection_roughness,
171
+ tint: color(1.0f),
172
+ mode: df::scatter_reflect
173
+ );
174
+
175
+ // bsdf omni_PBR_coated_bsdf = df::custom_curve_layer(
176
+ // normal_reflectivity: clearcoat_reflectivity * 0.08,
177
+ // grazing_reflectivity: 1.0,
178
+ // weight: clearcoat_weight,
179
+ // layer: clearcoat_bsdf,
180
+ // base: omni_PBR_bsdf,
181
+ // normal: final_clearcoat_normal
182
+ // );
183
+
184
+ bsdf opt_opaque_clearcoat = df::weighted_layer(
185
+ weight: enable_clearcoat ? clearcoat_transparency : 1,
186
+ layer: ::df::tint(tint: enable_clearcoat ? clearcoat_tint : color(1), base: omni_PBR_bsdf),
187
+ base: ::df::diffuse_reflection_bsdf(tint: clearcoat_tint)
188
+ );
189
+
190
+ bsdf opt_omni_PBR_coated_bsdf = df::fresnel_layer(
191
+ ior: clearcoat_ior,
192
+ weight: enable_clearcoat ? clearcoat_weight : 0,
193
+ layer: clearcoat_bsdf,
194
+ base: opt_opaque_clearcoat,
195
+ normal: clearcoat_normal
196
+ );
197
+
198
+ bsdf final_bsdf = opt_omni_PBR_coated_bsdf;
199
+ } in material(
200
+ thin_walled: false,
201
+ surface: material_surface(
202
+ scattering: final_bsdf,
203
+ emission: material_emission(
204
+ df::diffuse_edf(),
205
+ intensity: enable_emission ? emissive_color * emissive_mask * color(emissive_intensity) : color(0)
206
+ )
207
+ ),
208
+ geometry: material_geometry(
209
+ normal: enable_clearcoat ? state::normal() : normal,
210
+ cutout_opacity: enable_opacity ? (enable_opacity_cutout ? (alpha < alpha_cutout_cutoff ? 0.0 : 1.0) : alpha) : 1.0
211
+ )
212
+ );
objects/desk_01/materials/omniverse/simready_content/materials/baking_annotations.mdl ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.4;
2
+ import ::anno::*;
3
+
4
+ export const string TRANSFORM_NONE = "NONE";
5
+ export const string TRANSFORM_UNORM_VECTOR = "UNORM_VECTOR";
6
+
7
+ export const string FORMAT_RGBA8_UNORM = "RGBA8_UNORM";
8
+ export const string FORMAT_R8_UNORM = "R8_UNORM";
9
+ export const string FORMAT_RGBA16_SFLOAT = "RGBA16_SFLOAT";
10
+
11
+ export const string BLEND_MODE_OPACITY = "opacity_blend";
12
+ export const string BLEND_MODE_REPLACE = "replace";
13
+
14
+ // This annotation is used to mark a material as target material for baking.
15
+ // It is that is detected by the MDL SDK and neuray.
16
+ export annotation target_material_model();
17
+
18
+ export annotation target_material_rendering(
19
+ string rendering_material_override = "" // if set, the baked material will be rendering using this material,
20
+ // otherwise the target itself is used
21
+ );
22
+
23
+ export annotation target_baked_argument(
24
+ // the name of the baked texture parameter in the rendering material
25
+ string baked_name,
26
+
27
+ // the name of the constant parameter in the rendering material in case baking was not necessary
28
+ string constant_name = "",
29
+
30
+ // texture format to bake to
31
+ string format = "",
32
+
33
+ // transformations, like encoding normals into [0,1] range
34
+ string transform = TRANSFORM_NONE,
35
+
36
+ // blending, e.g., based on alpha or replace
37
+ string blend_mode = BLEND_MODE_OPACITY
38
+ );
objects/fstylejug_a01/materials/omniverse/simready_content/common_assets/props/fstylejug_a01/materials/Natural_Plastic_E.mdl ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.7;
2
+
3
+ using m_mdl = "mdl";
4
+
5
+ import ::state::normal;
6
+ import ::OmniSurface::OmniImage::alpha_mode;
7
+ import ::OmniSurface::OmniImage::projection_mode;
8
+ import ::OmniSurface::OmniImage::tangent_bitangent_mapping;
9
+ import ::OmniSurface::OmniImage::wrap_mode;
10
+ import ::OmniSurface::OmniShared::displacement_mode;
11
+ import ::OmniSurface::OmniShared::emission_mode;
12
+ import ::OmniSurface::OmniShared::ior_presets;
13
+ import ::OmniSurface::OmniShared::scattering_colors_presets;
14
+ import ::OmniSurface::OmniSurface;
15
+ import ::base::texture_coordinate_system;
16
+ import ::tex::gamma_mode;
17
+
18
+ export material Natural_Plastic_E(*)
19
+ = ::OmniSurface::OmniSurface(
20
+ diffuse_reflection_weight: 1.f,
21
+ diffuse_reflection_weight_image: texture_2d(),
22
+ diffuse_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
23
+ diffuse_reflection_color: color(1.f, 1.f, 1.f),
24
+ diffuse_reflection_color_image: texture_2d(),
25
+ diffuse_reflection_roughness: 0.f,
26
+ diffuse_reflection_roughness_image: texture_2d(),
27
+ diffuse_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
28
+ metalness: 0.049999997f,
29
+ metalness_image: texture_2d(),
30
+ metalness_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
31
+ specular_reflection_weight: 0.f,
32
+ specular_reflection_weight_image: texture_2d(),
33
+ specular_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
34
+ specular_reflection_color: color(1.f, 1.f, 1.f),
35
+ specular_reflection_color_image: texture_2d(),
36
+ specular_reflection_roughness: 0.299999982f,
37
+ specular_reflection_roughness_image: texture_2d(),
38
+ specular_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
39
+ specular_reflection_ior_preset: OmniSurface::OmniShared::ior_custom,
40
+ specular_reflection_ior: 2.f,
41
+ specular_reflection_anisotropy: 0.f,
42
+ specular_reflection_anisotropy_image: texture_2d(),
43
+ specular_reflection_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
44
+ specular_reflection_anisotropy_rotation: 0.f,
45
+ specular_reflection_anisotropy_rotation_image: texture_2d(),
46
+ specular_reflection_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
47
+ enable_specular_transmission: true,
48
+ specular_transmission_weight: 0.799999952f,
49
+ specular_transmission_weight_image: texture_2d(),
50
+ specular_transmission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
51
+ specular_transmission_color: color(1.f, 1.f, 1.f),
52
+ specular_transmission_color_image: texture_2d(),
53
+ specular_transmission_scattering_depth: 0.f,
54
+ specular_transmission_scattering_depth_image: texture_2d(),
55
+ specular_transmission_scattering_depth_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
56
+ specular_transmission_scattering_color: color(0.f, 0.f, 0.f),
57
+ specular_transmission_scattering_color_image: texture_2d(),
58
+ specular_transmission_scatter_anisotropy: 0.f,
59
+ specular_transmission_scatter_anisotropy_image: texture_2d(),
60
+ specular_transmission_scatter_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
61
+ specular_transmission_dispersion_abbe: 0.f,
62
+ enable_diffuse_transmission: true,
63
+ subsurface_weight: 1.f,
64
+ subsurface_weight_image: texture_2d(),
65
+ subsurface_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
66
+ subsurface_scattering_colors_preset: OmniSurface::OmniShared::scattering_colors_custom,
67
+ subsurface_transmission_color: color(1.f, 1.f, 1.f),
68
+ subsurface_transmission_color_image: texture_2d(),
69
+ subsurface_scattering_color: color(1.f, 1.f, 1.f),
70
+ subsurface_scattering_color_image: texture_2d(),
71
+ subsurface_scale: 1.f,
72
+ subsurface_scale_image: texture_2d(),
73
+ subsurface_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
74
+ subsurface_anisotropy: 0.f,
75
+ subsurface_anisotropy_image: texture_2d(),
76
+ subsurface_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
77
+ coat_weight: 1.f,
78
+ coat_weight_image: texture_2d(),
79
+ coat_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
80
+ coat_color: color(1.f, 1.f, 1.f),
81
+ coat_color_image: texture_2d(),
82
+ coat_roughness: 0.299999982f,
83
+ coat_roughness_image: texture_2d(),
84
+ coat_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
85
+ coat_ior_preset: OmniSurface::OmniShared::ior_custom,
86
+ coat_ior: 1.5f,
87
+ coat_anisotropy: 0.f,
88
+ coat_anisotropy_image: texture_2d(),
89
+ coat_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
90
+ coat_anisotropy_rotation: 0.f,
91
+ coat_anisotropy_rotation_image: texture_2d(),
92
+ coat_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
93
+ coat_affect_color: 0.f,
94
+ coat_affect_color_image: texture_2d(),
95
+ coat_affect_color_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
96
+ coat_affect_roughness: 0.f,
97
+ coat_affect_roughness_image: texture_2d(),
98
+ coat_affect_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
99
+ coat_normal_strength: 1.f,
100
+ coat_normal: state::normal(),
101
+ coat_normal_image: texture_2d(),
102
+ coat_normal_image_flip_r_channel: false,
103
+ coat_normal_image_flip_g_channel: false,
104
+ coat_normal_image_flip_b_channel: false,
105
+ specular_retro_reflection_weight: 0.699999988f,
106
+ specular_retro_reflection_weight_image: texture_2d(),
107
+ specular_retro_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
108
+ specular_retro_reflection_color: color(1.f, 1.f, 1.f),
109
+ specular_retro_reflection_color_image: texture_2d(),
110
+ specular_retro_reflection_roughness: 0.300000012f,
111
+ specular_retro_reflection_roughness_image: texture_2d(),
112
+ specular_retro_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
113
+ emission_weight: 0.f,
114
+ emission_weight_image: texture_2d(),
115
+ emission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
116
+ emission_mode: OmniSurface::OmniShared::emission_lx,
117
+ emission_intensity: 1.f,
118
+ emission_intensity_image: texture_2d(),
119
+ emission_intensity_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
120
+ emission_color: color(1.f, 1.f, 1.f),
121
+ emission_color_image: texture_2d(),
122
+ emission_use_temperature: false,
123
+ emission_temperature: 6500.f,
124
+ emission_temperature_image: texture_2d(),
125
+ emission_temperature_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
126
+ enable_thin_film: false,
127
+ thin_film_thickness: 400.f,
128
+ thin_film_thickness_image: texture_2d(),
129
+ thin_film_thickness_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
130
+ thin_film_ior_preset: OmniSurface::OmniShared::ior_custom,
131
+ thin_film_ior: 1.5f,
132
+ thin_walled: false,
133
+ enable_opacity: false,
134
+ geometry_opacity: 1.f,
135
+ geometry_opacity_image: texture_2d(),
136
+ geometry_opacity_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
137
+ geometry_opacity_threshold: 0.f,
138
+ geometry_normal_strength: 1.f,
139
+ geometry_normal: state::normal(),
140
+ geometry_normal_image: texture_2d(),
141
+ geometry_normal_image_flip_r_channel: false,
142
+ geometry_normal_image_flip_g_channel: false,
143
+ geometry_normal_image_flip_b_channel: false,
144
+ geometry_tangent_bitangent_mapping: OmniSurface::OmniImage::red_green,
145
+ geometry_displacement: float3(0.f),
146
+ geometry_displacement_mode: OmniSurface::OmniShared::displacement_height,
147
+ geometry_displacement_image: texture_2d(),
148
+ geometry_displacement_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
149
+ geometry_displacement_scale: 1.f,
150
+ geometry_displacement_scale_image: texture_2d(),
151
+ geometry_displacement_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
152
+ geometry_displacement_scalar_zero_value: 0.f,
153
+ uvw_texture_coordinate_system: base::texture_coordinate_uvw,
154
+ uvw_uv_set: 0,
155
+ uvw_ignore_missing_textures: false,
156
+ uvw_missing_texture_color: color(0.f, 0.f, 0.f),
157
+ uvw_use_uv_coords: false,
158
+ uvw_uv_coords: float2(0.f),
159
+ uvw_s_offset: 0.f,
160
+ uvw_t_offset: 0.f,
161
+ uvw_s_wrap: OmniSurface::OmniImage::wrap_periodic,
162
+ uvw_t_wrap: OmniSurface::OmniImage::wrap_periodic,
163
+ uvw_s_scale: 1.f,
164
+ uvw_t_scale: 1.f,
165
+ uvw_s_flip: false,
166
+ uvw_t_flip: false,
167
+ uvw_swap_st: false,
168
+ uvw_projection_mode: OmniSurface::OmniImage::projection_cubic,
169
+ uvw_projection_translate: float3(0.f),
170
+ uvw_projection_rotate: float3(0.f),
171
+ uvw_projection_scale: float3(1.f));
objects/fstylejug_a01/materials/omniverse/simready_content/common_assets/props/fstylejug_a01/materials/Plastic_Glossy_White_A.mdl ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.4;
2
+
3
+ using ::OmniPBR import OmniPBR;
4
+ import ::tex::gamma_mode;
5
+ import ::state::normal;
6
+ import ::base::mono_mode;
7
+
8
+ export material Plastic_Glossy_White_A(*)
9
+ = OmniPBR(
10
+ diffuse_color_constant: color(0.2, 0.2, 0.2),
11
+ diffuse_texture: texture_2d("../textures/T_Plastic_Glossy_White_A_Albedo.png", ::tex::gamma_srgb),
12
+ albedo_desaturation: 0.0,
13
+ albedo_add: 0.0,
14
+ albedo_brightness: 1.0,
15
+ diffuse_tint: color(1, 1, 1),
16
+ reflection_roughness_texture_influence: 1.0,
17
+ specular_level: 0.5,
18
+ enable_ORM_texture: true,
19
+ ORM_texture: texture_2d("../textures/T_Plastic_Glossy_White_A_ORM.png", ::tex::gamma_linear),
20
+ ao_to_diffuse: 0.0,
21
+ ao_texture: texture_2d(),
22
+ enable_emission: false,
23
+ enable_opacity: false,
24
+ bump_factor: 1.0,
25
+ normalmap_texture: texture_2d("../textures/T_Plastic_Glossy_White_A_Normal.png", ::tex::gamma_linear),
26
+ flip_tangent_u: false,
27
+ flip_tangent_v: true,
28
+ project_uvw: false,
29
+ world_or_object: false,
30
+ uv_space_index: 0,
31
+ texture_translate: float2(0, 0),
32
+ texture_rotate: 0.0,
33
+ texture_scale: float2(1, 1),
34
+ detail_texture_translate: float2(0, 0),
35
+ detail_texture_rotate: 0.0,
36
+ detail_texture_scale: float2(1, 1));
objects/gilbert/materials/omniverse/simready_content/materials/SimPBR.mdl ADDED
@@ -0,0 +1,562 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*****************************************************************************
2
+ * Copyright 1986-2020 NVIDIA Corporation. All rights reserved.
3
+ ******************************************************************************
4
+
5
+ MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,
6
+ WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,
7
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
8
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
9
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
10
+ COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA
11
+ CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
12
+ ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
13
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
14
+ THE USE OR INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN
15
+ THE MDL MATERIALS.
16
+ */
17
+
18
+ mdl 1.4;
19
+
20
+ import ::df::*;
21
+ import ::state::*;
22
+ import ::math::*;
23
+ import ::base::*;
24
+ import ::tex::*;
25
+ import ::anno::*;
26
+
27
+ import ::nvidia::core_definitions::file_texture;
28
+ import ::nvidia::core_definitions::normalmap_texture;
29
+
30
+ using .::SimPBR_Model import *;
31
+ using .::baking_annotations import *;
32
+
33
+ export material SimPBR(
34
+ // -------------------- DIFFUSE REFLECTION ----------------------
35
+ color diffuse_color_constant = color(0.2f)
36
+ [[
37
+ anno::display_name("Albedo Base Color"),
38
+ anno::description("The base albedo color to use if no texture is specified"),
39
+ anno::in_group("Diffuse")
40
+ ]],
41
+ uniform texture_2d diffuse_texture = texture_2d()
42
+ [[
43
+ anno::display_name("Albedo Map"),
44
+ anno::description("The texture specifying the albedo value to use"),
45
+ anno::in_group("Diffuse")
46
+ ]],
47
+ uniform color diffuse_tint = color(1.0f)
48
+ [[
49
+ anno::display_name("Albedo Tint"),
50
+ anno::description("This tints the albedo color or texture contant"),
51
+ anno::in_group("Diffuse")
52
+ ]],
53
+ uniform bool enable_transmission = false
54
+ [[
55
+ anno::display_name("Enable Diffuse Transmission"),
56
+ anno::description("Enables the diffuse transmission of light through thin diffuse scattering layer"),
57
+ anno::in_group("Diffuse")
58
+ ]],
59
+ uniform float opacity_ratio = 1.f
60
+ [[
61
+ anno::enable_if("enable_transmission == true"),
62
+ anno::display_name("Opacity Ratio"),
63
+ anno::description("Amount of opacity"),
64
+ anno::in_group("Diffuse")
65
+ ]],
66
+ uniform color opacity_tint = color(1.0f)
67
+ [[
68
+ anno::enable_if("enable_transmission == true"),
69
+ anno::display_name("Diffuse transmission tint"),
70
+ anno::description("Base diffuse transmission color"),
71
+ anno::in_group("Diffuse")
72
+ ]],
73
+ uniform float opacity_multiplier = 1.f
74
+ [[
75
+ anno::enable_if("enable_transmission == true"),
76
+ anno::display_name("Diffuse transmission multiplier"),
77
+ anno::description("Base diffuse transmission multiplier"),
78
+ anno::in_group("Diffuse")
79
+ ]],
80
+
81
+ // -------------------- SPECULAR REFLECTION ----------------------
82
+ float reflection_roughness_constant = 0.5f
83
+ [[
84
+ anno::display_name("Roughness Amount"),
85
+ anno::hard_range(0.0,1.),
86
+ anno::description("Higher roughness values lead to more blurry reflections"),
87
+ anno::in_group("Specular")
88
+ ]],
89
+ uniform float reflection_roughness_texture_influence = 0.0f
90
+ [[
91
+ anno::display_name("Roughness Map Influence"),
92
+ anno::hard_range(0.0, 1.),
93
+ anno::description("Blends between the constant value and the lookup of the roughness texture"),
94
+ anno::in_group("Specular")
95
+ ]],
96
+ uniform texture_2d reflectionroughness_texture = texture_2d()
97
+ [[
98
+ anno::display_name("Roughness Map"),
99
+ anno::in_group("Specular")
100
+ ]],
101
+
102
+ float anisotropy_constant = 0.0f
103
+ [[
104
+ anno::display_name("Anisotropy Amount"),
105
+ anno::hard_range(-1.,1.),
106
+ anno::description("0 for isotropic, extents of -1 to 1 for anisotropy"),
107
+ anno::in_group("Specular")
108
+ ]],
109
+ uniform float anisotropy_texture_influence = 0.0f
110
+ [[
111
+ anno::display_name("Anisotropy Map Influence"),
112
+ anno::hard_range(0.0, 1.),
113
+ anno::description("Blends between the constant value and the lookup of the anisotropy texture"),
114
+ anno::in_group("Specular")
115
+ ]],
116
+ uniform texture_2d anisotropy_texture = texture_2d()
117
+ [[
118
+ anno::display_name("Anisotropy Map"),
119
+ anno::in_group("Specular")
120
+ ]],
121
+
122
+ float metallic_constant = 0.f
123
+ [[
124
+ anno::display_name("Metallic Amount"),
125
+ anno::hard_range(0.0,1.),
126
+ anno::description("Metallic Material"),
127
+ anno::in_group("Specular")
128
+ ]],
129
+ uniform float metallic_texture_influence = 0.0f
130
+ [[
131
+ anno::display_name("Metallic Map Influence"),
132
+ anno::hard_range(0.0, 1.),
133
+ anno::description("Blends between the constant value and the lookup of the metallic texture"),
134
+ anno::in_group("Specular")
135
+ ]],
136
+ uniform texture_2d metallic_texture = texture_2d()
137
+ [[
138
+ anno::display_name("Metallic Map"),
139
+ anno::in_group("Specular")
140
+ ]],
141
+
142
+ float specular_constant = 1.f
143
+ [[
144
+ anno::display_name("Specular amount"),
145
+ anno::hard_range(0.0, 1.0),
146
+ anno::description("Scale of the specular component"),
147
+ anno::in_group("Specular")
148
+ ]],
149
+ uniform texture_2d specular_texture = texture_2d()
150
+ [[
151
+ anno::display_name("Specular Map"),
152
+ anno::in_group("Specular")
153
+ ]],
154
+
155
+ // -------------------- ORM ----------------------
156
+ uniform bool enable_ORM_texture = true
157
+ [[
158
+ anno::display_name("Enable ORM Texture"),
159
+ anno::description("When True the ORM texture will be used to extract the Occlusion, Roughness and Metallic Map"),
160
+ anno::in_group("Reflectivity")
161
+ ]],
162
+ uniform texture_2d ORM_texture = texture_2d()
163
+ [[
164
+ anno::display_name("ORM Map"),
165
+ anno::description("Texture that hae Occlusion, Roughness and Metallic map stored in the respective r, g and b channels"),
166
+ anno::in_group("Reflectivity")
167
+ ]],
168
+
169
+ // -------------------- Clearcoat ----------------------
170
+ uniform bool enable_clearcoat = false
171
+ [[
172
+ anno::display_name("Enable Clearcoat Layer"),
173
+ anno::description("Adds a clearcoat layer on top of the material when enabled"),
174
+ anno::in_group("Clearcoat")
175
+ ]],
176
+ color clearcoat_tint = color(1.0f)
177
+ [[
178
+ anno::display_name("Clearcoat Tint"),
179
+ anno::description("Clearcoat is tinted and affects the underlying material"),
180
+ anno::in_group("Clearcoat")
181
+ ]],
182
+ float clearcoat_transparency = 1.0f
183
+ [[
184
+ anno::display_name("Clearcoat Transparency"),
185
+ anno::description("Adjusts the transparency of the clearcoat. Can be turned into a fully opaque clearcoat "
186
+ "covering the underlying layer"),
187
+ anno::in_group("Clearcoat")
188
+ ]],
189
+ float clearcoat_reflection_roughness = 0.0f
190
+ [[
191
+ anno::display_name("Clearcoat Roughness"),
192
+ anno::description("Higher roughness values lead to more blurry reflections"),
193
+ anno::hard_range(0.0f, 1.0f),
194
+ anno::in_group("Clearcoat")
195
+ ]],
196
+ float clearcoat_weight = 1.0f
197
+ [[
198
+ anno::display_name("Clearcoat Weight"),
199
+ anno::description("Sets the weight for clearcoat layer"),
200
+ anno::hard_range(0.0f, 1.0f),
201
+ anno::in_group("Clearcoat")
202
+ ]],
203
+ float clearcoat_flatten = 1.0f
204
+ [[
205
+ anno::display_name("Clearcoat Flatten"),
206
+ anno::description("Flattens the clearcoat to even out the underlying bump maps"),
207
+ anno::hard_range(0.0f, 1.0f),
208
+ anno::in_group("Clearcoat")
209
+ ]],
210
+ float clearcoat_ior = 1.56f
211
+ [[
212
+ anno::display_name("Clearcoat IOR"),
213
+ anno::description("Sets the Index of refraction for the clearcoat layer"),
214
+ anno::soft_range(1.0f, 4.0f),
215
+ anno::in_group("Clearcoat")
216
+ ]],
217
+ uniform float clearcoat_bump_factor = 1.f
218
+ [[
219
+ anno::display_name("Clearcoat Normal Map Strength"),
220
+ anno::description("Strength of normal map."),
221
+ anno::in_group("Clearcoat")
222
+ ]],
223
+
224
+ float3 clearcoat_normal_input = float3(0.0, 0.0, 0.0),
225
+ uniform texture_2d clearcoat_normalmap_texture = texture_2d()
226
+ [[
227
+ anno::display_name("Clearcoat Normal Map"),
228
+ anno::description("Enables the usage of the normalmap texture"),
229
+ anno::in_group("Clearcoat")
230
+ ]],
231
+
232
+ uniform bool clearcoat_flip_tangent_u = false
233
+ [[
234
+ anno::display_name("Clearcoat Normal Map Flip U Tangent"),
235
+ anno::in_group("Clearcoat")
236
+ ]],
237
+ uniform bool clearcoat_flip_tangent_v = true
238
+ [[
239
+ anno::display_name("Clearcoat Normal Map Flip V Tangent"),
240
+ anno::in_group("Clearcoat")
241
+ ]],
242
+
243
+
244
+ // -------------------- REFLECTIVITY ----------------------
245
+ uniform bool enable_retroreflection = false
246
+ [[
247
+ anno::display_name("Enable Retroreflection"),
248
+ anno::in_group("Reflectivity")
249
+ ]],
250
+ color retroreflection_tint = color(.182,.800,.000)
251
+ [[
252
+ anno::display_name("Retro-reflection tint"),
253
+ anno::description("The tint of the retroreflection"),
254
+ anno::in_group("Reflectivity")
255
+ ]],
256
+ uniform float normal_reflectivity = 0.5
257
+ [[
258
+ anno::display_name("Retro-reflection weight facing"),
259
+ anno::hard_range(0.0,1.),
260
+ anno::description("Reflectivity control for geometry facing the viewer"),
261
+ anno::in_group("Reflectivity")
262
+ ]],
263
+ uniform float grazing_reflectivity = 1.0
264
+ [[
265
+ anno::display_name("Retro-reflection weight edge"),
266
+ anno::hard_range(0.0,1.),
267
+ anno::description("Reflectivity control for the reflectivity at geometry edges"),
268
+ anno::in_group("Reflectivity")
269
+ ]],
270
+
271
+ // -------------------- AMBIENT OCCLUSION ----------------------
272
+ float ao_to_diffuse = 0.0
273
+ [[
274
+ anno::display_name("AO to Diffuse"),
275
+ anno::description("Controls the amount of ambient occlusion multiplied into the diffuse color channel"),
276
+ anno::in_group("AO")
277
+ ]],
278
+ float ao_input = float(1.0),
279
+ uniform texture_2d ao_texture = texture_2d()
280
+ [[
281
+ anno::display_name("Ambient Occlusion Map"),
282
+ anno::description("The Ambient Occlusion texture for the material"),
283
+ anno::in_group("AO")
284
+ ]],
285
+
286
+ // -------------------- EMISSIVE ----------------------
287
+ uniform bool enable_emission = false
288
+ [[
289
+ anno::display_name("Enable Emission"),
290
+ anno::description("Enables the emission of light from the material"),
291
+ anno::in_group("Emissive")
292
+ ]],
293
+ uniform color emissive_color = color(1.0, 0.1, 0.1)
294
+ [[
295
+ anno::enable_if("enable_emission == true"),
296
+ anno::display_name("Emissive Color"),
297
+ anno::description("The emission color"),
298
+ anno::in_group("Emissive")
299
+ ]],
300
+
301
+ color emissive_mask_input = color(1.0),
302
+ uniform texture_2d emissive_mask_texture = texture_2d()
303
+ [[
304
+ anno::enable_if("enable_emission == true"),
305
+ anno::display_name("Emissive Mask Map"),
306
+ anno::description("The texture masking the emissive color"),
307
+ anno::in_group("Emissive")
308
+ ]],
309
+ uniform float emissive_intensity = 40.f
310
+ [[
311
+ anno::enable_if("enable_emission == true"),
312
+ anno::display_name("Emissive Intensity"),
313
+ anno::description("Intensity of the emission"),
314
+ anno::in_group("Emissive")
315
+ ]],
316
+ uniform bool enable_emissive_flipbook = false
317
+ [[
318
+ anno::display_name("Enable Flipbook for emission"),
319
+ anno::description("Allows the use of animated emissive textures (e.g. video screens)"),
320
+ anno::in_group("Emissive")
321
+ ]],
322
+ uniform int2 flipbook_dim = int2(1,1)
323
+ [[
324
+ anno::enable_if("enable_emissive_flipbook == true"),
325
+ anno::display_name("Flipbook Rows/Columns"),
326
+ anno::description("How many rows and columns are in the flipbook?"),
327
+ anno::in_group("Emissive")
328
+ ]],
329
+ uniform int target_fps = 1
330
+ [[
331
+ anno::enable_if("enable_emissive_flipbook == true"),
332
+ anno::display_name("Flipbook Target FPS"),
333
+ anno::description("Playback speed in frames per second"),
334
+ anno::in_group("Emissive")
335
+ ]],
336
+
337
+ // -------------------- ALPHA ----------------------
338
+ uniform bool enable_opacity = false
339
+ [[
340
+ anno::display_name("Enable Opacity"),
341
+ anno::description("Enables or disables alpha functionality"),
342
+ anno::in_group("Alpha")
343
+ ]],
344
+ float alpha_constant = 1.0
345
+ [[
346
+ anno::enable_if("enable_opacity == true"),
347
+ anno::display_name("Opacity Fallback Constant"),
348
+ anno::hard_range(0.0, 1.0),
349
+ anno::description("The base alpha constant to use if no texture is specified"),
350
+ anno::in_group("Alpha")
351
+ ]],
352
+ uniform texture_2d opacity_texture = texture_2d()
353
+ [[
354
+ anno::enable_if("enable_opacity == true"),
355
+ anno::display_name("Opacity Map"),
356
+ anno::description("The texture specifying the opacity value to use"),
357
+ anno::in_group("Alpha")
358
+ ]],
359
+ uniform bool enable_opacity_cutout = false
360
+ [[
361
+ anno::enable_if("enable_opacity == true"),
362
+ anno::display_name("Enable Alpha Cutout"),
363
+ anno::description("Enables or disables alpha cutout functionality"),
364
+ anno::in_group("Alpha")
365
+ ]],
366
+ uniform float alpha_cutout_cutoff = 1.f
367
+ [[
368
+ anno::enable_if("enable_opacity == true"),
369
+ anno::enable_if("enable_opacity_cutout == true"),
370
+ anno::hard_range(0.0, 1.0),
371
+ anno::display_name("Alpha Cutout Cutoff"),
372
+ anno::description("The cutoff value to to render as transparent up to and opaque past"),
373
+ anno::in_group("Alpha")
374
+ ]],
375
+
376
+ // -------------------- NORMAL ----------------------
377
+ uniform float bump_factor = 1.f
378
+ [[
379
+ anno::display_name("Normal Map Strength"),
380
+ anno::description("Strength of normal map."),
381
+ anno::in_group("Normal")
382
+ ]],
383
+
384
+ float3 normal_input = state::normal(),
385
+ uniform texture_2d normalmap_texture = texture_2d()
386
+ [[
387
+ anno::display_name("Normal Map"),
388
+ anno::in_group("Normal")
389
+ ]],
390
+ uniform bool flip_tangent_u = false
391
+ [[
392
+ anno::display_name("Normal Map Flip U Tangent"),
393
+ anno::in_group("Normal")
394
+ ]],
395
+ uniform bool flip_tangent_v = true
396
+ [[
397
+ anno::display_name("Normal Map Flip V Tangent"),
398
+ anno::in_group("Normal")
399
+ ]],
400
+
401
+ // -------------------- UV ADJUSTMENTS ----------------------
402
+ uniform bool project_uvw = false
403
+ [[
404
+ anno::display_name("Enable Project UVW Coordinates"),
405
+ anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"),
406
+ anno::in_group("UV")
407
+ ]],
408
+ uniform bool world_or_object = false
409
+ [[
410
+ anno::enable_if("project_uvw == true"),
411
+ anno::display_name("Enable World Space"),
412
+ anno::description("When set to 'true' uses world space for projection, when 'false' object space is used"),
413
+ anno::in_group("UV")
414
+ ]],
415
+ uniform float2 texture_translate = float2(0.0f)
416
+ [[
417
+ anno::display_name("Texture Translate"),
418
+ anno::description("Controls position of texture."),
419
+ anno::in_group("UV")
420
+ ]],
421
+ uniform float2 texture_scale = float2(1.0f)
422
+ [[
423
+ anno::display_name("Texture Tiling"),
424
+ anno::description("Controls repetition of the texture."),
425
+ anno::in_group("UV")
426
+ ]],
427
+ uniform float2 texture_speed = float2(0.0f)
428
+ [[
429
+ anno::display_name("Texture Speed"),
430
+ anno::description("Scrolling texture animation speed in UVs per sec."),
431
+ anno::in_group("UV")
432
+ ]]
433
+ )
434
+ [[
435
+ anno::display_name("Sim PBR"),
436
+ anno::description("Supports the opaque alpha cutout material model of the Sim Renderer"),
437
+ anno::in_group("SimReady"),
438
+ anno::version( 1, 0, 0),
439
+ anno::author("NVIDIA CORPORATION"),
440
+ anno::key_words(string[]("Sim", "PBR", "opaque", "alpha", "cutout", "omniverse", "generic"))
441
+ ]]
442
+ = let {
443
+ base::texture_coordinate_system the_system = world_or_object ? base::texture_coordinate_world : base::texture_coordinate_object;
444
+
445
+ base::texture_coordinate_info uvw = project_uvw ?
446
+ base::coordinate_projection(
447
+ coordinate_system: the_system,
448
+ texture_space: 0,
449
+ projection_type: base::projection_cubic
450
+ ) : base::coordinate_source(
451
+ coordinate_system: base::texture_coordinate_uvw,
452
+ texture_space: 0
453
+ );
454
+
455
+ // Need to use a small value so the compiler doesnt optimize out this var...
456
+ float t = 0.00000001;//state::animation_time();
457
+ base::texture_coordinate_info transformed_uvw = base::transform_coordinate(
458
+ transform: base::rotation_translation_scale(
459
+ scaling: float3(texture_scale.x, texture_scale.y, 1.0),
460
+ rotation: float3(0.0, 0.0, 0.0 ),
461
+ translation: float3(texture_translate.x + t * texture_speed.x, texture_translate.y + t * texture_speed.y, 0.0)),
462
+ coordinate: uvw
463
+ );
464
+ float2 uv = float2(transformed_uvw.position.x, transformed_uvw.position.y);
465
+
466
+ // Diffuse Color Lookup and AO
467
+ float4 base_lookup = tex::texture_isvalid(diffuse_texture) ? tex::lookup_float4(tex: diffuse_texture, coord: uv) : float4(1, 1, 1, 1);
468
+
469
+ float opacityValue = tex::texture_isvalid(opacity_texture) ? tex::lookup_float4(tex: opacity_texture, coord: uv).w : alpha_constant;
470
+
471
+ // Normal calculations
472
+ float3 normal_lookup = tex::texture_isvalid(normalmap_texture) ?
473
+ base::tangent_space_normal_texture(
474
+ texture: normalmap_texture,
475
+ factor: bump_factor,
476
+ uvw: transformed_uvw,
477
+ flip_tangent_u: flip_tangent_u,
478
+ flip_tangent_v: flip_tangent_v
479
+ ) : normal_input;
480
+
481
+ float3 clearcoat_normal = tex::texture_isvalid(clearcoat_normalmap_texture) ?
482
+ base::tangent_space_normal_texture(
483
+ texture: clearcoat_normalmap_texture,
484
+ factor: clearcoat_bump_factor,
485
+ uvw: uvw,
486
+ flip_tangent_u: clearcoat_flip_tangent_u,
487
+ flip_tangent_v: clearcoat_flip_tangent_v
488
+ ) : clearcoat_normal_input;
489
+
490
+ float3 flattened_clearcoat_normal = ::math::lerp(normal_lookup, ::state::normal(), clearcoat_flatten);
491
+ float3 final_clearcoat_normal = tex::texture_isvalid(clearcoat_normalmap_texture) ? clearcoat_normal : flattened_clearcoat_normal;
492
+
493
+ float ao_lookup = tex::texture_isvalid(ao_texture) ? tex::lookup_float4(tex: ao_texture, coord: uv).x : ao_input;
494
+
495
+ color diffuse_color = tex::texture_isvalid(diffuse_texture) ? color(base_lookup.x, base_lookup.y, base_lookup.z) : diffuse_color_constant;
496
+
497
+ float3 ORM_lookup = tex::lookup_float3(
498
+ tex: ORM_texture,
499
+ coord: float2(transformed_uvw.position.x, transformed_uvw.position.y)
500
+ );
501
+
502
+ float roughness_lookup = tex::texture_isvalid(reflectionroughness_texture) ?
503
+ tex::lookup_float4(tex: reflectionroughness_texture, coord: uv).x : reflection_roughness_constant;
504
+ float anisotropy_lookup = tex::texture_isvalid(anisotropy_texture) ?
505
+ (tex::lookup_float4(tex: anisotropy_texture, coord: uv).x * 2.0f - 1.0f) : anisotropy_constant;
506
+ float metallic_lookup = tex::texture_isvalid(metallic_texture) ?
507
+ tex::lookup_float4(tex: metallic_texture, coord: uv).x : metallic_constant;
508
+ float specular_lookup = tex::texture_isvalid(specular_texture) ?
509
+ tex::lookup_float4(tex: specular_texture, coord: uv).x : specular_constant;
510
+
511
+ float roughness_selection = enable_ORM_texture ? ORM_lookup.y : roughness_lookup;
512
+ float metallic_selection = enable_ORM_texture ? ORM_lookup.z : metallic_lookup;
513
+ float ao = enable_ORM_texture ? ORM_lookup.x : ao_lookup;
514
+
515
+ float reflection_roughness = math::lerp(reflection_roughness_constant, roughness_selection, reflection_roughness_texture_influence);
516
+ float anisotropy = math::lerp(anisotropy_constant, anisotropy_lookup, anisotropy_texture_influence);
517
+ float metallic = math::lerp(metallic_constant, metallic_selection, metallic_texture_influence);
518
+
519
+ int rows = flipbook_dim.x;
520
+ int columns = flipbook_dim.y;
521
+ int numFrames = rows * columns;
522
+ varying int frameIdx = int(state::animation_time() * target_fps) % numFrames;
523
+ varying float2 baseUV = float2(transformed_uvw.position.x, transformed_uvw.position.y);
524
+ varying float2 emissiveUV = enable_emissive_flipbook ?
525
+ ((baseUV + float2(frameIdx % rows, frameIdx / rows)) / float2(rows, columns)) : baseUV;
526
+
527
+ color emissive_mask = tex::texture_isvalid(emissive_mask_texture) ?
528
+ tex::lookup_color(emissive_mask_texture, emissiveUV, tex::wrap_repeat, tex::wrap_repeat) : emissive_mask_input;
529
+
530
+ } in SimPBR_Model(
531
+ diffuse_color: diffuse_color,
532
+ diffuse_tint: diffuse_tint,
533
+ roughness: reflection_roughness,
534
+ anisotropy: anisotropy,
535
+ metallic: metallic,
536
+ specular: specular_lookup,
537
+ normal: normal_lookup,
538
+ enable_clearcoat: enable_clearcoat,
539
+ clearcoat_tint: clearcoat_tint,
540
+ clearcoat_transparency: clearcoat_transparency,
541
+ clearcoat_reflection_roughness: clearcoat_reflection_roughness,
542
+ clearcoat_weight: clearcoat_weight,
543
+ clearcoat_ior: clearcoat_ior,
544
+ clearcoat_normal: final_clearcoat_normal,
545
+ enable_retroreflection: enable_retroreflection,
546
+ retroreflection_tint: retroreflection_tint,
547
+ normal_reflectivity: normal_reflectivity,
548
+ grazing_reflectivity: grazing_reflectivity,
549
+ ao_to_diffuse: ao_to_diffuse,
550
+ ao: ao,
551
+ enable_emission: enable_emission,
552
+ emissive_color: emissive_color,
553
+ emissive_mask: emissive_mask,
554
+ emissive_intensity: emissive_intensity,
555
+ enable_opacity: enable_opacity,
556
+ alpha: opacityValue,
557
+ enable_opacity_cutout: enable_opacity_cutout,
558
+ alpha_cutout_cutoff: alpha_cutout_cutoff,
559
+ opacity_ratio: enable_transmission ? opacity_ratio : 1.0,
560
+ opacity_tint : opacity_tint,
561
+ opacity_multiplier : opacity_multiplier
562
+ );
objects/gilbert/materials/omniverse/simready_content/materials/SimPBR_Model.mdl ADDED
@@ -0,0 +1,212 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*****************************************************************************
2
+ * Copyright 1986-2020 NVIDIA Corporation. All rights reserved.
3
+ ******************************************************************************
4
+
5
+ MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,
6
+ WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,
7
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
8
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
9
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
10
+ COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA
11
+ CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
12
+ ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
13
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
14
+ THE USE OR INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN
15
+ THE MDL MATERIALS.
16
+ */
17
+
18
+ mdl 1.4;
19
+
20
+ import ::df::*;
21
+ import ::state::*;
22
+ import ::math::*;
23
+ import ::base::*;
24
+ import ::tex::*;
25
+ import ::anno::*;
26
+
27
+ using .::baking_annotations import *;
28
+
29
+ base::texture_return multiply_colors(
30
+ color color_1 = color(1.0, 1.0, 1.0),
31
+ color color_2 = color(.5, .5, .5),
32
+ float weight = 1.0
33
+ )
34
+ [[
35
+ anno::hidden()
36
+ ]]
37
+ {
38
+ return base::blend_color_layers(
39
+ layers: base::color_layer[](
40
+ base::color_layer(
41
+ layer_color: color_2,
42
+ weight: weight,
43
+ mode: base::color_layer_multiply
44
+ )
45
+ ), base: color_1
46
+ );
47
+ }
48
+
49
+ export material SimPBR_Model(
50
+ color diffuse_color = color(0.2f) [[ target_baked_argument("diffuse_texture", "diffuse_color_constant", "RGBA8_UNORM") ]],
51
+ uniform color diffuse_tint = color(1.0f),
52
+ float roughness = 0.5f [[ target_baked_argument("reflectionroughness_texture", "reflection_roughness_constant", "R8_UNORM") ]],
53
+ float anisotropy = 0.0f [[ target_baked_argument("anisotropy_texture", "anisotropy_constant", "R8_SNORM") ]],
54
+ float metallic = 0.f [[ target_baked_argument("metallic_texture", "metallic_constant", "R8_UNORM") ]],
55
+ float specular = 1.f [[ target_baked_argument("specular_texture", "specular_constant", "R8_UNORM") ]],
56
+ float3 normal = float3(0.0, 0.0, 0.0) [[ target_baked_argument("normalmap_texture", "normal_input", "RGBA8_SNORM", baking_annotations::TRANSFORM_UNORM_VECTOR) ]],
57
+ uniform bool enable_clearcoat = false,
58
+ color clearcoat_tint = color(1.0f),
59
+ float clearcoat_transparency = 1.0f,
60
+ float clearcoat_reflection_roughness = 0.0f,
61
+ float clearcoat_weight = 1.0f,
62
+ float clearcoat_ior = 1.56f,
63
+ float3 clearcoat_normal = float3(0.0, 0.0, 0.0) [[ target_baked_argument("clearcoat_normalmap_texture", "clearcoat_normal_input", "RGBA8_SNORM", baking_annotations::TRANSFORM_UNORM_VECTOR) ]],
64
+ uniform bool enable_retroreflection = false,
65
+ color retroreflection_tint = color(.182,.800,.000),
66
+ uniform float normal_reflectivity = 0.5,
67
+ uniform float grazing_reflectivity = 1.0,
68
+ float ao_to_diffuse = 0.0,
69
+ float ao = 1.0f [[ target_baked_argument("ao_texture", "ao_input", "R8_UNORM") ]],
70
+ uniform bool enable_emission = false,
71
+ uniform color emissive_color = color(1.0, 0.1, 0.1),
72
+ color emissive_mask = color(1.0, 0.1, 0.1) [[ target_baked_argument("emissive_mask_texture", "emissive_mask_input", "R8_UNORM") ]],
73
+ uniform float emissive_intensity = 40.f,
74
+ uniform bool enable_opacity = false,
75
+ float alpha = 1.0,
76
+ uniform bool enable_opacity_cutout = false,
77
+ uniform float alpha_cutout_cutoff = 1.f,
78
+ uniform float opacity_ratio = 1.f,
79
+ uniform color opacity_tint = color(1.0f),
80
+ uniform float opacity_multiplier = 1.f
81
+ )
82
+ [[
83
+ target_material_model(),
84
+ target_material_rendering("..::SimPBR::SimPBR")
85
+ ]]
86
+ = let {
87
+ color base_color = multiply_colors(diffuse_color, diffuse_tint, 1.0).tint;
88
+ color ao_weighted_base_color = multiply_colors(base_color, color(ao), ao_to_diffuse).tint;
89
+
90
+ float squared_roughness = roughness * roughness;
91
+ float roughness_u = squared_roughness * (1 + anisotropy);
92
+ float roughness_v = squared_roughness * (1 - anisotropy);
93
+
94
+ color diffuse_transmission_color = base_color * opacity_tint * opacity_multiplier;
95
+
96
+ bsdf diffuse_bsdf = df::weighted_layer(
97
+ weight: opacity_ratio,
98
+ layer: df::diffuse_reflection_bsdf(
99
+ tint: ao_weighted_base_color,
100
+ roughness: 0.0f
101
+ ),
102
+ base: df::diffuse_transmission_bsdf(tint: diffuse_transmission_color),
103
+ normal: enable_clearcoat ? normal : state::normal()
104
+ );
105
+
106
+ bsdf ggx_smith_bsdf = df::microfacet_ggx_smith_bsdf(
107
+ roughness_u: roughness_u,
108
+ roughness_v: roughness_v,
109
+ tint: color(1.0, 1.0, 1.0),
110
+ mode: df::scatter_reflect
111
+ );
112
+
113
+ bsdf custom_curve_layer_bsdf = df::custom_curve_layer(
114
+ normal_reflectivity: 0.03,
115
+ grazing_reflectivity: 1.0,
116
+ exponent: 5.0,
117
+ weight: specular,
118
+ layer: ggx_smith_bsdf,
119
+ base: diffuse_bsdf,
120
+ normal: enable_clearcoat ? normal : state::normal()
121
+ );
122
+
123
+ //
124
+ // Begin RETROREFLECTION SUPPORT
125
+ //
126
+ color final_retroreflection_color = multiply_colors(retroreflection_tint, base_color, 1.0).tint;
127
+ bsdf backscattering_glossy_bsdf = df::backscattering_glossy_reflection_bsdf(
128
+ tint: final_retroreflection_color,
129
+ roughness_u: squared_roughness
130
+ );
131
+
132
+ /*bsdf retroreflection_bsdf = df::custom_curve_layer(
133
+ normal_reflectivity: 1.-normal_reflectivity,
134
+ grazing_reflectivity: 1.-grazing_reflectivity,
135
+ base: backscattering_glossy_bsdf,
136
+ layer: custom_curve_layer_bsdf,
137
+ normal: enable_clearcoat ? normal_lookup : state::normal()
138
+ );*/
139
+
140
+ // if normal_reflectivity and grazing_reflectivity are 1 and weight is 1, just the layer is used
141
+ bsdf opt_retroreflection_bsdf = df::custom_curve_layer(
142
+ normal_reflectivity: enable_retroreflection ? 1.-normal_reflectivity : 1,
143
+ grazing_reflectivity: enable_retroreflection ? 1.-grazing_reflectivity : 1,
144
+ base: backscattering_glossy_bsdf,
145
+ layer: custom_curve_layer_bsdf,
146
+ normal: enable_clearcoat ? normal : state::normal()
147
+ );
148
+
149
+ //
150
+ // End RETROREFLECTION SUPPORT
151
+ //
152
+
153
+ bsdf directional_factor_bsdf = df::directional_factor(
154
+ normal_tint: ao_weighted_base_color,
155
+ grazing_tint: color(1.0, 1.0, 1.0),
156
+ exponent: 5.0f,
157
+ base: ggx_smith_bsdf
158
+ );
159
+
160
+ // CLEARCOAT
161
+ bsdf omni_PBR_bsdf = df::weighted_layer(
162
+ weight: metallic,
163
+ layer: directional_factor_bsdf,
164
+ base: opt_retroreflection_bsdf, //enable_retroreflection ? retroreflection_bsdf : custom_curve_layer_bsdf,
165
+ normal: enable_clearcoat ? normal : state::normal()
166
+ );
167
+
168
+ bsdf clearcoat_bsdf = df::microfacet_ggx_smith_bsdf(
169
+ roughness_u: clearcoat_reflection_roughness * clearcoat_reflection_roughness,
170
+ roughness_v: clearcoat_reflection_roughness * clearcoat_reflection_roughness,
171
+ tint: color(1.0f),
172
+ mode: df::scatter_reflect
173
+ );
174
+
175
+ // bsdf omni_PBR_coated_bsdf = df::custom_curve_layer(
176
+ // normal_reflectivity: clearcoat_reflectivity * 0.08,
177
+ // grazing_reflectivity: 1.0,
178
+ // weight: clearcoat_weight,
179
+ // layer: clearcoat_bsdf,
180
+ // base: omni_PBR_bsdf,
181
+ // normal: final_clearcoat_normal
182
+ // );
183
+
184
+ bsdf opt_opaque_clearcoat = df::weighted_layer(
185
+ weight: enable_clearcoat ? clearcoat_transparency : 1,
186
+ layer: ::df::tint(tint: enable_clearcoat ? clearcoat_tint : color(1), base: omni_PBR_bsdf),
187
+ base: ::df::diffuse_reflection_bsdf(tint: clearcoat_tint)
188
+ );
189
+
190
+ bsdf opt_omni_PBR_coated_bsdf = df::fresnel_layer(
191
+ ior: clearcoat_ior,
192
+ weight: enable_clearcoat ? clearcoat_weight : 0,
193
+ layer: clearcoat_bsdf,
194
+ base: opt_opaque_clearcoat,
195
+ normal: clearcoat_normal
196
+ );
197
+
198
+ bsdf final_bsdf = opt_omni_PBR_coated_bsdf;
199
+ } in material(
200
+ thin_walled: false,
201
+ surface: material_surface(
202
+ scattering: final_bsdf,
203
+ emission: material_emission(
204
+ df::diffuse_edf(),
205
+ intensity: enable_emission ? emissive_color * emissive_mask * color(emissive_intensity) : color(0)
206
+ )
207
+ ),
208
+ geometry: material_geometry(
209
+ normal: enable_clearcoat ? state::normal() : normal,
210
+ cutout_opacity: enable_opacity ? (enable_opacity_cutout ? (alpha < alpha_cutout_cutoff ? 0.0 : 1.0) : alpha) : 1.0
211
+ )
212
+ );
objects/gilbert/materials/omniverse/simready_content/materials/SimPBR_Translucent.mdl ADDED
@@ -0,0 +1,291 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*****************************************************************************
2
+ * Copyright 1986-2020 NVIDIA Corporation. All rights reserved.
3
+ ******************************************************************************
4
+
5
+ MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,
6
+ WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,
7
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
8
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
9
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
10
+ COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA
11
+ CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
12
+ ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
13
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
14
+ THE USE OR INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN
15
+ THE MDL MATERIALS.
16
+ */
17
+
18
+ mdl 1.6;
19
+
20
+ import ::df::*;
21
+ import ::state::*;
22
+ import ::math::*;
23
+ import ::base::*;
24
+ import ::tex::*;
25
+ import ::anno::*;
26
+
27
+ import ::nvidia::core_definitions::file_texture;
28
+ import ::nvidia::core_definitions::normalmap_texture;
29
+
30
+ export material SimPBR_Translucent(
31
+ // -------------------- SPECULAR REFLECTION/TRANSMISSION ----------------------
32
+ uniform float ior_constant = 1.1f
33
+ [[
34
+ anno::display_name("Index of Refraction"),
35
+ anno::hard_range(0.0,5.),
36
+ anno::description("Index of Refraction of the material"),
37
+ anno::in_group("Specular")
38
+ ]],
39
+ uniform float reflection_roughness_constant = 0.5f
40
+ [[
41
+ anno::display_name("Roughness Amount"),
42
+ anno::hard_range(0.0,1.),
43
+ anno::description("Higher roughness values lead to more blurry reflections"),
44
+ anno::in_group("Specular")
45
+ ]],
46
+ uniform float reflection_roughness_texture_influence = 0.0f
47
+ [[
48
+ anno::display_name("Roughness Map Influence"),
49
+ anno::hard_range(0.0, 1.),
50
+ anno::description("Blends between the constant value and the lookup of the roughness texture"),
51
+ anno::in_group("Specular")
52
+ ]],
53
+ uniform texture_2d reflectionroughness_texture = texture_2d()
54
+ [[
55
+ anno::display_name("Roughness Map"),
56
+ anno::in_group("Specular")
57
+ ]],
58
+
59
+ // -------------------- VOLUME ----------------------
60
+ color transmittance_color = color(1.0, 1.0f, 1.0f)
61
+ [[
62
+ anno::display_name("Transmittance Color"),
63
+ anno::description("Expected transmittance after the specified transmittance distance through the volume."),
64
+ anno::in_group("Volume")
65
+ ]],
66
+ float transmittance_measurement_distance = 1.0f
67
+ [[
68
+ anno::display_name("Transmittance Measurement Distance"),
69
+ anno::description("Distance to match the transmittance through the volume at."),
70
+ anno::in_group("Volume")
71
+ ]],
72
+
73
+ // -------------------- EMISSIVE ----------------------
74
+ uniform bool enable_thin_walled = false
75
+ [[
76
+ anno::display_name("Enable Thin Walled"),
77
+ anno::description("Enables thin walled logic"),
78
+ anno::in_group("Geometry")
79
+ ]],
80
+
81
+ // -------------------- EMISSIVE ----------------------
82
+ uniform bool enable_emission = false
83
+ [[
84
+ anno::display_name("Enable Emission"),
85
+ anno::description("Enables the emission of light from the material"),
86
+ anno::in_group("Emissive")
87
+ ]],
88
+ color emissive_color = color(1.0, 0.1, 0.1)
89
+ [[
90
+ anno::enable_if("enable_emission == true"),
91
+ anno::display_name("Emissive Color"),
92
+ anno::description("The emission color"),
93
+ anno::in_group("Emissive")
94
+ ]],
95
+ uniform texture_2d emissive_mask_texture = texture_2d()
96
+ [[
97
+ anno::enable_if("enable_emission == true"),
98
+ anno::display_name("Emissive Mask Map"),
99
+ anno::description("The texture masking the emissive color"),
100
+ anno::in_group("Emissive")
101
+ ]],
102
+ uniform float emissive_intensity = 40.f
103
+ [[
104
+ anno::enable_if("enable_emission == true"),
105
+ anno::display_name("Emissive Intensity"),
106
+ anno::description("Intensity of the emission"),
107
+ anno::in_group("Emissive")
108
+ ]],
109
+ uniform bool enable_emissive_flipbook = false
110
+ [[
111
+ anno::display_name("Enable Flipbook for emission"),
112
+ anno::description("Allows the use of animated emissive textures (e.g. video screens)"),
113
+ anno::in_group("Emissive")
114
+ ]],
115
+ uniform int2 flipbook_dim = int2(1,1)
116
+ [[
117
+ anno::enable_if("enable_emissive_flipbook == true"),
118
+ anno::display_name("Flipbook Rows/Columns"),
119
+ anno::description("How many rows and columns are in the flipbook?"),
120
+ anno::in_group("Emissive")
121
+ ]],
122
+ uniform int target_fps = 1
123
+ [[
124
+ anno::enable_if("enable_emissive_flipbook == true"),
125
+ anno::display_name("Flipbook Target FPS"),
126
+ anno::description("Playback speed in frames per second"),
127
+ anno::in_group("Emissive")
128
+ ]],
129
+
130
+ // -------------------- NORMAL ----------------------
131
+ uniform float bump_factor = 1.f
132
+ [[
133
+ anno::display_name("Normal Map Strength"),
134
+ anno::description("Strength of normal map."),
135
+ anno::in_group("Normal")
136
+ ]],
137
+ uniform texture_2d normalmap_texture = texture_2d()
138
+ [[
139
+ anno::display_name("Normal Map"),
140
+ anno::in_group("Normal")
141
+ ]],
142
+ uniform bool flip_tangent_u = false
143
+ [[
144
+ anno::display_name("Normal Map Flip U Tangent"),
145
+ anno::in_group("Normal")
146
+ ]],
147
+ uniform bool flip_tangent_v = true
148
+ [[
149
+ anno::display_name("Normal Map Flip V Tangent"),
150
+ anno::in_group("Normal")
151
+ ]],
152
+
153
+ // -------------------- UV ADJUSTMENTS ----------------------
154
+ uniform bool project_uvw = false
155
+ [[
156
+ anno::display_name("Enable Project UVW Coordinates"),
157
+ anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"),
158
+ anno::in_group("UV")
159
+ ]],
160
+ uniform bool world_or_object = false
161
+ [[
162
+ anno::enable_if("project_uvw == true"),
163
+ anno::display_name("Enable World Space"),
164
+ anno::description("When set to 'true' uses world space for projection, when 'false' object space is used"),
165
+ anno::in_group("UV")
166
+ ]],
167
+ uniform float2 texture_translate = float2(0.0f)
168
+ [[
169
+ anno::display_name("Texture Translate"),
170
+ anno::description("Controls position of texture."),
171
+ anno::in_group("UV")
172
+ ]],
173
+ uniform float2 texture_scale = float2(1.0f)
174
+ [[
175
+ anno::display_name("Texture Tiling"),
176
+ anno::description("Controls the repetition of the texture."),
177
+ anno::in_group("UV")
178
+ ]],
179
+ uniform float2 texture_speed = float2(0.0f)
180
+ [[
181
+ anno::display_name("Texture Speed"),
182
+ anno::description("Scrolling texture animation speed in UVs per sec."),
183
+ anno::in_group("UV")
184
+ ]]
185
+ )
186
+ [[
187
+ anno::display_name("Sim PBR Translucent"),
188
+ anno::description("Supports the translucent material model of the Sim Renderer"),
189
+ anno::in_group("SimReady"),
190
+ anno::version( 1, 0, 0),
191
+ anno::author("NVIDIA CORPORATION"),
192
+ anno::key_words(string[]("Sim", "PBR", "translucent", "omniverse", "generic"))
193
+ ]]
194
+ = let {
195
+ base::texture_coordinate_system the_system = world_or_object ? base::texture_coordinate_world : base::texture_coordinate_object;
196
+
197
+ base::texture_coordinate_info uvw = project_uvw ?
198
+ base::coordinate_projection(
199
+ coordinate_system: the_system,
200
+ texture_space: 0,
201
+ projection_type: base::projection_cubic
202
+ ) : base::coordinate_source(
203
+ coordinate_system: base::texture_coordinate_uvw,
204
+ texture_space: 0
205
+ );
206
+
207
+ // Need to use a small value so the compiler doesnt optimize out this var...
208
+ float t = 0.00000001;//state::animation_time();
209
+ base::texture_coordinate_info transformed_uvw = base::transform_coordinate(
210
+ transform: base::rotation_translation_scale(
211
+ scaling: float3(texture_scale.x, texture_scale.y, 1.0),
212
+ rotation: float3(0.0, 0.0, 0.0 ),
213
+ translation: float3(texture_translate.x + t * texture_speed.x, texture_translate.y + t * texture_speed.y, 0.0)),
214
+ coordinate: uvw
215
+ );
216
+ float2 uv = float2(transformed_uvw.position.x, transformed_uvw.position.y);
217
+
218
+ color volume_absorption_coefficient = -math::log(transmittance_color) / (transmittance_measurement_distance*0.01);
219
+
220
+ float roughness_lookup = tex::texture_isvalid(reflectionroughness_texture) ?
221
+ tex::lookup_float4(tex: reflectionroughness_texture, coord: uv).x : reflection_roughness_constant;
222
+ float reflection_roughness = math::lerp(reflection_roughness_constant, roughness_lookup, reflection_roughness_texture_influence);
223
+
224
+ float roughness_squared = reflection_roughness * reflection_roughness;
225
+ bsdf final_bsdf(enable_thin_walled ?
226
+ ::df::fresnel_layer(
227
+ ior_constant,
228
+ 1.f,
229
+ ::df::microfacet_ggx_smith_bsdf(
230
+ roughness_squared,
231
+ roughness_squared,
232
+ color(1.f, 1.f, 1.f),
233
+ color(0.f, 0.f, 0.f),
234
+ ::state::texture_tangent_u(0),
235
+ ::df::scatter_reflect,
236
+ ""
237
+ ),
238
+ ::df::specular_bsdf(
239
+ transmittance_color,
240
+ ::df::scatter_transmit,
241
+ ""
242
+ ), ::state::normal())
243
+ : ::df::microfacet_ggx_smith_bsdf(
244
+ roughness_squared,
245
+ roughness_squared,
246
+ color(1.f, 1.f, 1.f),
247
+ color(0.f, 0.f, 0.f),
248
+ ::state::texture_tangent_u(0),
249
+ ::df::scatter_reflect_transmit,
250
+ ""
251
+ ));
252
+
253
+ int rows = flipbook_dim.x;
254
+ int columns = flipbook_dim.y;
255
+ int numFrames = rows * columns;
256
+ varying int frameIdx = int(state::animation_time() * target_fps) % numFrames;
257
+ varying float2 baseUV = float2(transformed_uvw.position.x, transformed_uvw.position.y);
258
+ varying float2 emissiveUV = enable_emissive_flipbook ?
259
+ ((baseUV + float2(frameIdx % rows, frameIdx / rows)) / float2(rows, columns)) : baseUV;
260
+
261
+ color emissive_mask = tex::texture_isvalid(emissive_mask_texture) ?
262
+ tex::lookup_color(emissive_mask_texture, emissiveUV, tex::wrap_repeat, tex::wrap_repeat) : color(1.0);
263
+
264
+ // Normal calculations
265
+ float3 normal_lookup = tex::texture_isvalid(normalmap_texture) ?
266
+ base::tangent_space_normal_texture(
267
+ texture: normalmap_texture,
268
+ factor: bump_factor,
269
+ uvw: transformed_uvw,
270
+ flip_tangent_u: flip_tangent_u,
271
+ flip_tangent_v: flip_tangent_v
272
+ ) : state::normal();
273
+ } in material(
274
+ thin_walled: enable_thin_walled,
275
+ surface: material_surface(
276
+ scattering: final_bsdf,
277
+ emission: material_emission (
278
+ df::diffuse_edf(),
279
+ intensity: enable_emission ? emissive_color * emissive_mask * color(emissive_intensity) : color(0)
280
+ )
281
+ ),
282
+ ior: color(ior_constant),
283
+ volume: material_volume(
284
+ scattering: df::anisotropic_vdf(),
285
+ absorption_coefficient: volume_absorption_coefficient,
286
+ scattering_coefficient: color(0.0f, 0.0f, 0.0f)
287
+ ),
288
+ geometry: material_geometry(
289
+ normal: normal_lookup
290
+ )
291
+ );
objects/gilbert/materials/omniverse/simready_content/materials/baking_annotations.mdl ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.4;
2
+ import ::anno::*;
3
+
4
+ export const string TRANSFORM_NONE = "NONE";
5
+ export const string TRANSFORM_UNORM_VECTOR = "UNORM_VECTOR";
6
+
7
+ export const string FORMAT_RGBA8_UNORM = "RGBA8_UNORM";
8
+ export const string FORMAT_R8_UNORM = "R8_UNORM";
9
+ export const string FORMAT_RGBA16_SFLOAT = "RGBA16_SFLOAT";
10
+
11
+ export const string BLEND_MODE_OPACITY = "opacity_blend";
12
+ export const string BLEND_MODE_REPLACE = "replace";
13
+
14
+ // This annotation is used to mark a material as target material for baking.
15
+ // It is that is detected by the MDL SDK and neuray.
16
+ export annotation target_material_model();
17
+
18
+ export annotation target_material_rendering(
19
+ string rendering_material_override = "" // if set, the baked material will be rendering using this material,
20
+ // otherwise the target itself is used
21
+ );
22
+
23
+ export annotation target_baked_argument(
24
+ // the name of the baked texture parameter in the rendering material
25
+ string baked_name,
26
+
27
+ // the name of the constant parameter in the rendering material in case baking was not necessary
28
+ string constant_name = "",
29
+
30
+ // texture format to bake to
31
+ string format = "",
32
+
33
+ // transformations, like encoding normals into [0,1] range
34
+ string transform = TRANSFORM_NONE,
35
+
36
+ // blending, e.g., based on alpha or replace
37
+ string blend_mode = BLEND_MODE_OPACITY
38
+ );
objects/green_block/green_block.usd ADDED
Binary file (19.1 kB). View file
 
objects/lime01/materials/robolab/objects/fruits_veggies/materials/SimPBR_Model.mdl ADDED
@@ -0,0 +1,212 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*****************************************************************************
2
+ * Copyright 1986-2020 NVIDIA Corporation. All rights reserved.
3
+ ******************************************************************************
4
+
5
+ MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,
6
+ WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,
7
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
8
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
9
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
10
+ COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA
11
+ CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
12
+ ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
13
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
14
+ THE USE OR INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN
15
+ THE MDL MATERIALS.
16
+ */
17
+
18
+ mdl 1.4;
19
+
20
+ import ::df::*;
21
+ import ::state::*;
22
+ import ::math::*;
23
+ import ::base::*;
24
+ import ::tex::*;
25
+ import ::anno::*;
26
+
27
+ using baking_annotations import *;
28
+
29
+ base::texture_return multiply_colors(
30
+ color color_1 = color(1.0, 1.0, 1.0),
31
+ color color_2 = color(.5, .5, .5),
32
+ float weight = 1.0
33
+ )
34
+ [[
35
+ anno::hidden()
36
+ ]]
37
+ {
38
+ return base::blend_color_layers(
39
+ layers: base::color_layer[](
40
+ base::color_layer(
41
+ layer_color: color_2,
42
+ weight: weight,
43
+ mode: base::color_layer_multiply
44
+ )
45
+ ), base: color_1
46
+ );
47
+ }
48
+
49
+ export material SimPBR_Model(
50
+ color diffuse_color = color(0.2f) [[ target_baked_argument("diffuse_texture", "diffuse_color_constant", "RGBA8_UNORM") ]],
51
+ uniform color diffuse_tint = color(1.0f),
52
+ float roughness = 0.5f [[ target_baked_argument("reflectionroughness_texture", "reflection_roughness_constant", "R8_UNORM") ]],
53
+ float anisotropy = 0.0f [[ target_baked_argument("anisotropy_texture", "anisotropy_constant", "R8_SNORM") ]],
54
+ float metallic = 0.f [[ target_baked_argument("metallic_texture", "metallic_constant", "R8_UNORM") ]],
55
+ float specular = 1.f [[ target_baked_argument("specular_texture", "specular_constant", "R8_UNORM") ]],
56
+ float3 normal = float3(0.0, 0.0, 0.0) [[ target_baked_argument("normalmap_texture", "normal_input", "RGBA8_SNORM", baking_annotations::TRANSFORM_UNORM_VECTOR) ]],
57
+ uniform bool enable_clearcoat = false,
58
+ color clearcoat_tint = color(1.0f),
59
+ float clearcoat_transparency = 1.0f,
60
+ float clearcoat_reflection_roughness = 0.0f,
61
+ float clearcoat_weight = 1.0f,
62
+ float clearcoat_ior = 1.56f,
63
+ float3 clearcoat_normal = float3(0.0, 0.0, 0.0) [[ target_baked_argument("clearcoat_normalmap_texture", "clearcoat_normal_input", "RGBA8_SNORM", baking_annotations::TRANSFORM_UNORM_VECTOR) ]],
64
+ uniform bool enable_retroreflection = false,
65
+ color retroreflection_tint = color(.182,.800,.000),
66
+ uniform float normal_reflectivity = 0.5,
67
+ uniform float grazing_reflectivity = 1.0,
68
+ float ao_to_diffuse = 0.0,
69
+ float ao = 1.0f [[ target_baked_argument("ao_texture", "ao_input", "R8_UNORM") ]],
70
+ uniform bool enable_emission = false,
71
+ uniform color emissive_color = color(1.0, 0.1, 0.1),
72
+ color emissive_mask = color(1.0, 0.1, 0.1) [[ target_baked_argument("emissive_mask_texture", "emissive_mask_input", "R8_UNORM") ]],
73
+ uniform float emissive_intensity = 40.f,
74
+ uniform bool enable_opacity = false,
75
+ float alpha = 1.0,
76
+ uniform bool enable_opacity_cutout = false,
77
+ uniform float alpha_cutout_cutoff = 1.f,
78
+ uniform float opacity_ratio = 1.f,
79
+ uniform color opacity_tint = color(1.0f),
80
+ uniform float opacity_multiplier = 1.f
81
+ )
82
+ [[
83
+ target_material_model(),
84
+ target_material_rendering("..::SimPBR::SimPBR")
85
+ ]]
86
+ = let {
87
+ color base_color = multiply_colors(diffuse_color, diffuse_tint, 1.0).tint;
88
+ color ao_weighted_base_color = multiply_colors(base_color, color(ao), ao_to_diffuse).tint;
89
+
90
+ float squared_roughness = roughness * roughness;
91
+ float roughness_u = squared_roughness * (1 + anisotropy);
92
+ float roughness_v = squared_roughness * (1 - anisotropy);
93
+
94
+ color diffuse_transmission_color = base_color * opacity_tint * opacity_multiplier;
95
+
96
+ bsdf diffuse_bsdf = df::weighted_layer(
97
+ weight: opacity_ratio,
98
+ layer: df::diffuse_reflection_bsdf(
99
+ tint: ao_weighted_base_color,
100
+ roughness: 0.0f
101
+ ),
102
+ base: df::diffuse_transmission_bsdf(tint: diffuse_transmission_color),
103
+ normal: enable_clearcoat ? normal : state::normal()
104
+ );
105
+
106
+ bsdf ggx_smith_bsdf = df::microfacet_ggx_smith_bsdf(
107
+ roughness_u: roughness_u,
108
+ roughness_v: roughness_v,
109
+ tint: color(1.0, 1.0, 1.0),
110
+ mode: df::scatter_reflect
111
+ );
112
+
113
+ bsdf custom_curve_layer_bsdf = df::custom_curve_layer(
114
+ normal_reflectivity: 0.03,
115
+ grazing_reflectivity: 1.0,
116
+ exponent: 5.0,
117
+ weight: specular,
118
+ layer: ggx_smith_bsdf,
119
+ base: diffuse_bsdf,
120
+ normal: enable_clearcoat ? normal : state::normal()
121
+ );
122
+
123
+ //
124
+ // Begin RETROREFLECTION SUPPORT
125
+ //
126
+ color final_retroreflection_color = multiply_colors(retroreflection_tint, base_color, 1.0).tint;
127
+ bsdf backscattering_glossy_bsdf = df::backscattering_glossy_reflection_bsdf(
128
+ tint: final_retroreflection_color,
129
+ roughness_u: squared_roughness
130
+ );
131
+
132
+ /*bsdf retroreflection_bsdf = df::custom_curve_layer(
133
+ normal_reflectivity: 1.-normal_reflectivity,
134
+ grazing_reflectivity: 1.-grazing_reflectivity,
135
+ base: backscattering_glossy_bsdf,
136
+ layer: custom_curve_layer_bsdf,
137
+ normal: enable_clearcoat ? normal_lookup : state::normal()
138
+ );*/
139
+
140
+ // if normal_reflectivity and grazing_reflectivity are 1 and weight is 1, just the layer is used
141
+ bsdf opt_retroreflection_bsdf = df::custom_curve_layer(
142
+ normal_reflectivity: enable_retroreflection ? 1.-normal_reflectivity : 1,
143
+ grazing_reflectivity: enable_retroreflection ? 1.-grazing_reflectivity : 1,
144
+ base: backscattering_glossy_bsdf,
145
+ layer: custom_curve_layer_bsdf,
146
+ normal: enable_clearcoat ? normal : state::normal()
147
+ );
148
+
149
+ //
150
+ // End RETROREFLECTION SUPPORT
151
+ //
152
+
153
+ bsdf directional_factor_bsdf = df::directional_factor(
154
+ normal_tint: ao_weighted_base_color,
155
+ grazing_tint: color(1.0, 1.0, 1.0),
156
+ exponent: 5.0f,
157
+ base: ggx_smith_bsdf
158
+ );
159
+
160
+ // CLEARCOAT
161
+ bsdf omni_PBR_bsdf = df::weighted_layer(
162
+ weight: metallic,
163
+ layer: directional_factor_bsdf,
164
+ base: opt_retroreflection_bsdf, //enable_retroreflection ? retroreflection_bsdf : custom_curve_layer_bsdf,
165
+ normal: enable_clearcoat ? normal : state::normal()
166
+ );
167
+
168
+ bsdf clearcoat_bsdf = df::microfacet_ggx_smith_bsdf(
169
+ roughness_u: clearcoat_reflection_roughness * clearcoat_reflection_roughness,
170
+ roughness_v: clearcoat_reflection_roughness * clearcoat_reflection_roughness,
171
+ tint: color(1.0f),
172
+ mode: df::scatter_reflect
173
+ );
174
+
175
+ // bsdf omni_PBR_coated_bsdf = df::custom_curve_layer(
176
+ // normal_reflectivity: clearcoat_reflectivity * 0.08,
177
+ // grazing_reflectivity: 1.0,
178
+ // weight: clearcoat_weight,
179
+ // layer: clearcoat_bsdf,
180
+ // base: omni_PBR_bsdf,
181
+ // normal: final_clearcoat_normal
182
+ // );
183
+
184
+ bsdf opt_opaque_clearcoat = df::weighted_layer(
185
+ weight: enable_clearcoat ? clearcoat_transparency : 1,
186
+ layer: ::df::tint(tint: enable_clearcoat ? clearcoat_tint : color(1), base: omni_PBR_bsdf),
187
+ base: ::df::diffuse_reflection_bsdf(tint: clearcoat_tint)
188
+ );
189
+
190
+ bsdf opt_omni_PBR_coated_bsdf = df::fresnel_layer(
191
+ ior: clearcoat_ior,
192
+ weight: enable_clearcoat ? clearcoat_weight : 0,
193
+ layer: clearcoat_bsdf,
194
+ base: opt_opaque_clearcoat,
195
+ normal: clearcoat_normal
196
+ );
197
+
198
+ bsdf final_bsdf = opt_omni_PBR_coated_bsdf;
199
+ } in material(
200
+ thin_walled: false,
201
+ surface: material_surface(
202
+ scattering: final_bsdf,
203
+ emission: material_emission(
204
+ df::diffuse_edf(),
205
+ intensity: enable_emission ? emissive_color * emissive_mask * color(emissive_intensity) : color(0)
206
+ )
207
+ ),
208
+ geometry: material_geometry(
209
+ normal: enable_clearcoat ? state::normal() : normal,
210
+ cutout_opacity: enable_opacity ? (enable_opacity_cutout ? (alpha < alpha_cutout_cutoff ? 0.0 : 1.0) : alpha) : 1.0
211
+ )
212
+ );
objects/red_block/red_block.usd ADDED
Binary file (12.5 kB). View file
 
objects/standard_halfunit/materials/omniverse/simready_content/materials/SimPBR.mdl ADDED
@@ -0,0 +1,562 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*****************************************************************************
2
+ * Copyright 1986-2020 NVIDIA Corporation. All rights reserved.
3
+ ******************************************************************************
4
+
5
+ MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,
6
+ WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,
7
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
8
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
9
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
10
+ COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA
11
+ CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
12
+ ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
13
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
14
+ THE USE OR INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN
15
+ THE MDL MATERIALS.
16
+ */
17
+
18
+ mdl 1.4;
19
+
20
+ import ::df::*;
21
+ import ::state::*;
22
+ import ::math::*;
23
+ import ::base::*;
24
+ import ::tex::*;
25
+ import ::anno::*;
26
+
27
+ import ::nvidia::core_definitions::file_texture;
28
+ import ::nvidia::core_definitions::normalmap_texture;
29
+
30
+ using .::SimPBR_Model import *;
31
+ using .::baking_annotations import *;
32
+
33
+ export material SimPBR(
34
+ // -------------------- DIFFUSE REFLECTION ----------------------
35
+ color diffuse_color_constant = color(0.2f)
36
+ [[
37
+ anno::display_name("Albedo Base Color"),
38
+ anno::description("The base albedo color to use if no texture is specified"),
39
+ anno::in_group("Diffuse")
40
+ ]],
41
+ uniform texture_2d diffuse_texture = texture_2d()
42
+ [[
43
+ anno::display_name("Albedo Map"),
44
+ anno::description("The texture specifying the albedo value to use"),
45
+ anno::in_group("Diffuse")
46
+ ]],
47
+ uniform color diffuse_tint = color(1.0f)
48
+ [[
49
+ anno::display_name("Albedo Tint"),
50
+ anno::description("This tints the albedo color or texture contant"),
51
+ anno::in_group("Diffuse")
52
+ ]],
53
+ uniform bool enable_transmission = false
54
+ [[
55
+ anno::display_name("Enable Diffuse Transmission"),
56
+ anno::description("Enables the diffuse transmission of light through thin diffuse scattering layer"),
57
+ anno::in_group("Diffuse")
58
+ ]],
59
+ uniform float opacity_ratio = 1.f
60
+ [[
61
+ anno::enable_if("enable_transmission == true"),
62
+ anno::display_name("Opacity Ratio"),
63
+ anno::description("Amount of opacity"),
64
+ anno::in_group("Diffuse")
65
+ ]],
66
+ uniform color opacity_tint = color(1.0f)
67
+ [[
68
+ anno::enable_if("enable_transmission == true"),
69
+ anno::display_name("Diffuse transmission tint"),
70
+ anno::description("Base diffuse transmission color"),
71
+ anno::in_group("Diffuse")
72
+ ]],
73
+ uniform float opacity_multiplier = 1.f
74
+ [[
75
+ anno::enable_if("enable_transmission == true"),
76
+ anno::display_name("Diffuse transmission multiplier"),
77
+ anno::description("Base diffuse transmission multiplier"),
78
+ anno::in_group("Diffuse")
79
+ ]],
80
+
81
+ // -------------------- SPECULAR REFLECTION ----------------------
82
+ float reflection_roughness_constant = 0.5f
83
+ [[
84
+ anno::display_name("Roughness Amount"),
85
+ anno::hard_range(0.0,1.),
86
+ anno::description("Higher roughness values lead to more blurry reflections"),
87
+ anno::in_group("Specular")
88
+ ]],
89
+ uniform float reflection_roughness_texture_influence = 0.0f
90
+ [[
91
+ anno::display_name("Roughness Map Influence"),
92
+ anno::hard_range(0.0, 1.),
93
+ anno::description("Blends between the constant value and the lookup of the roughness texture"),
94
+ anno::in_group("Specular")
95
+ ]],
96
+ uniform texture_2d reflectionroughness_texture = texture_2d()
97
+ [[
98
+ anno::display_name("Roughness Map"),
99
+ anno::in_group("Specular")
100
+ ]],
101
+
102
+ float anisotropy_constant = 0.0f
103
+ [[
104
+ anno::display_name("Anisotropy Amount"),
105
+ anno::hard_range(-1.,1.),
106
+ anno::description("0 for isotropic, extents of -1 to 1 for anisotropy"),
107
+ anno::in_group("Specular")
108
+ ]],
109
+ uniform float anisotropy_texture_influence = 0.0f
110
+ [[
111
+ anno::display_name("Anisotropy Map Influence"),
112
+ anno::hard_range(0.0, 1.),
113
+ anno::description("Blends between the constant value and the lookup of the anisotropy texture"),
114
+ anno::in_group("Specular")
115
+ ]],
116
+ uniform texture_2d anisotropy_texture = texture_2d()
117
+ [[
118
+ anno::display_name("Anisotropy Map"),
119
+ anno::in_group("Specular")
120
+ ]],
121
+
122
+ float metallic_constant = 0.f
123
+ [[
124
+ anno::display_name("Metallic Amount"),
125
+ anno::hard_range(0.0,1.),
126
+ anno::description("Metallic Material"),
127
+ anno::in_group("Specular")
128
+ ]],
129
+ uniform float metallic_texture_influence = 0.0f
130
+ [[
131
+ anno::display_name("Metallic Map Influence"),
132
+ anno::hard_range(0.0, 1.),
133
+ anno::description("Blends between the constant value and the lookup of the metallic texture"),
134
+ anno::in_group("Specular")
135
+ ]],
136
+ uniform texture_2d metallic_texture = texture_2d()
137
+ [[
138
+ anno::display_name("Metallic Map"),
139
+ anno::in_group("Specular")
140
+ ]],
141
+
142
+ float specular_constant = 1.f
143
+ [[
144
+ anno::display_name("Specular amount"),
145
+ anno::hard_range(0.0, 1.0),
146
+ anno::description("Scale of the specular component"),
147
+ anno::in_group("Specular")
148
+ ]],
149
+ uniform texture_2d specular_texture = texture_2d()
150
+ [[
151
+ anno::display_name("Specular Map"),
152
+ anno::in_group("Specular")
153
+ ]],
154
+
155
+ // -------------------- ORM ----------------------
156
+ uniform bool enable_ORM_texture = true
157
+ [[
158
+ anno::display_name("Enable ORM Texture"),
159
+ anno::description("When True the ORM texture will be used to extract the Occlusion, Roughness and Metallic Map"),
160
+ anno::in_group("Reflectivity")
161
+ ]],
162
+ uniform texture_2d ORM_texture = texture_2d()
163
+ [[
164
+ anno::display_name("ORM Map"),
165
+ anno::description("Texture that hae Occlusion, Roughness and Metallic map stored in the respective r, g and b channels"),
166
+ anno::in_group("Reflectivity")
167
+ ]],
168
+
169
+ // -------------------- Clearcoat ----------------------
170
+ uniform bool enable_clearcoat = false
171
+ [[
172
+ anno::display_name("Enable Clearcoat Layer"),
173
+ anno::description("Adds a clearcoat layer on top of the material when enabled"),
174
+ anno::in_group("Clearcoat")
175
+ ]],
176
+ color clearcoat_tint = color(1.0f)
177
+ [[
178
+ anno::display_name("Clearcoat Tint"),
179
+ anno::description("Clearcoat is tinted and affects the underlying material"),
180
+ anno::in_group("Clearcoat")
181
+ ]],
182
+ float clearcoat_transparency = 1.0f
183
+ [[
184
+ anno::display_name("Clearcoat Transparency"),
185
+ anno::description("Adjusts the transparency of the clearcoat. Can be turned into a fully opaque clearcoat "
186
+ "covering the underlying layer"),
187
+ anno::in_group("Clearcoat")
188
+ ]],
189
+ float clearcoat_reflection_roughness = 0.0f
190
+ [[
191
+ anno::display_name("Clearcoat Roughness"),
192
+ anno::description("Higher roughness values lead to more blurry reflections"),
193
+ anno::hard_range(0.0f, 1.0f),
194
+ anno::in_group("Clearcoat")
195
+ ]],
196
+ float clearcoat_weight = 1.0f
197
+ [[
198
+ anno::display_name("Clearcoat Weight"),
199
+ anno::description("Sets the weight for clearcoat layer"),
200
+ anno::hard_range(0.0f, 1.0f),
201
+ anno::in_group("Clearcoat")
202
+ ]],
203
+ float clearcoat_flatten = 1.0f
204
+ [[
205
+ anno::display_name("Clearcoat Flatten"),
206
+ anno::description("Flattens the clearcoat to even out the underlying bump maps"),
207
+ anno::hard_range(0.0f, 1.0f),
208
+ anno::in_group("Clearcoat")
209
+ ]],
210
+ float clearcoat_ior = 1.56f
211
+ [[
212
+ anno::display_name("Clearcoat IOR"),
213
+ anno::description("Sets the Index of refraction for the clearcoat layer"),
214
+ anno::soft_range(1.0f, 4.0f),
215
+ anno::in_group("Clearcoat")
216
+ ]],
217
+ uniform float clearcoat_bump_factor = 1.f
218
+ [[
219
+ anno::display_name("Clearcoat Normal Map Strength"),
220
+ anno::description("Strength of normal map."),
221
+ anno::in_group("Clearcoat")
222
+ ]],
223
+
224
+ float3 clearcoat_normal_input = float3(0.0, 0.0, 0.0),
225
+ uniform texture_2d clearcoat_normalmap_texture = texture_2d()
226
+ [[
227
+ anno::display_name("Clearcoat Normal Map"),
228
+ anno::description("Enables the usage of the normalmap texture"),
229
+ anno::in_group("Clearcoat")
230
+ ]],
231
+
232
+ uniform bool clearcoat_flip_tangent_u = false
233
+ [[
234
+ anno::display_name("Clearcoat Normal Map Flip U Tangent"),
235
+ anno::in_group("Clearcoat")
236
+ ]],
237
+ uniform bool clearcoat_flip_tangent_v = true
238
+ [[
239
+ anno::display_name("Clearcoat Normal Map Flip V Tangent"),
240
+ anno::in_group("Clearcoat")
241
+ ]],
242
+
243
+
244
+ // -------------------- REFLECTIVITY ----------------------
245
+ uniform bool enable_retroreflection = false
246
+ [[
247
+ anno::display_name("Enable Retroreflection"),
248
+ anno::in_group("Reflectivity")
249
+ ]],
250
+ color retroreflection_tint = color(.182,.800,.000)
251
+ [[
252
+ anno::display_name("Retro-reflection tint"),
253
+ anno::description("The tint of the retroreflection"),
254
+ anno::in_group("Reflectivity")
255
+ ]],
256
+ uniform float normal_reflectivity = 0.5
257
+ [[
258
+ anno::display_name("Retro-reflection weight facing"),
259
+ anno::hard_range(0.0,1.),
260
+ anno::description("Reflectivity control for geometry facing the viewer"),
261
+ anno::in_group("Reflectivity")
262
+ ]],
263
+ uniform float grazing_reflectivity = 1.0
264
+ [[
265
+ anno::display_name("Retro-reflection weight edge"),
266
+ anno::hard_range(0.0,1.),
267
+ anno::description("Reflectivity control for the reflectivity at geometry edges"),
268
+ anno::in_group("Reflectivity")
269
+ ]],
270
+
271
+ // -------------------- AMBIENT OCCLUSION ----------------------
272
+ float ao_to_diffuse = 0.0
273
+ [[
274
+ anno::display_name("AO to Diffuse"),
275
+ anno::description("Controls the amount of ambient occlusion multiplied into the diffuse color channel"),
276
+ anno::in_group("AO")
277
+ ]],
278
+ float ao_input = float(1.0),
279
+ uniform texture_2d ao_texture = texture_2d()
280
+ [[
281
+ anno::display_name("Ambient Occlusion Map"),
282
+ anno::description("The Ambient Occlusion texture for the material"),
283
+ anno::in_group("AO")
284
+ ]],
285
+
286
+ // -------------------- EMISSIVE ----------------------
287
+ uniform bool enable_emission = false
288
+ [[
289
+ anno::display_name("Enable Emission"),
290
+ anno::description("Enables the emission of light from the material"),
291
+ anno::in_group("Emissive")
292
+ ]],
293
+ uniform color emissive_color = color(1.0, 0.1, 0.1)
294
+ [[
295
+ anno::enable_if("enable_emission == true"),
296
+ anno::display_name("Emissive Color"),
297
+ anno::description("The emission color"),
298
+ anno::in_group("Emissive")
299
+ ]],
300
+
301
+ color emissive_mask_input = color(1.0),
302
+ uniform texture_2d emissive_mask_texture = texture_2d()
303
+ [[
304
+ anno::enable_if("enable_emission == true"),
305
+ anno::display_name("Emissive Mask Map"),
306
+ anno::description("The texture masking the emissive color"),
307
+ anno::in_group("Emissive")
308
+ ]],
309
+ uniform float emissive_intensity = 40.f
310
+ [[
311
+ anno::enable_if("enable_emission == true"),
312
+ anno::display_name("Emissive Intensity"),
313
+ anno::description("Intensity of the emission"),
314
+ anno::in_group("Emissive")
315
+ ]],
316
+ uniform bool enable_emissive_flipbook = false
317
+ [[
318
+ anno::display_name("Enable Flipbook for emission"),
319
+ anno::description("Allows the use of animated emissive textures (e.g. video screens)"),
320
+ anno::in_group("Emissive")
321
+ ]],
322
+ uniform int2 flipbook_dim = int2(1,1)
323
+ [[
324
+ anno::enable_if("enable_emissive_flipbook == true"),
325
+ anno::display_name("Flipbook Rows/Columns"),
326
+ anno::description("How many rows and columns are in the flipbook?"),
327
+ anno::in_group("Emissive")
328
+ ]],
329
+ uniform int target_fps = 1
330
+ [[
331
+ anno::enable_if("enable_emissive_flipbook == true"),
332
+ anno::display_name("Flipbook Target FPS"),
333
+ anno::description("Playback speed in frames per second"),
334
+ anno::in_group("Emissive")
335
+ ]],
336
+
337
+ // -------------------- ALPHA ----------------------
338
+ uniform bool enable_opacity = false
339
+ [[
340
+ anno::display_name("Enable Opacity"),
341
+ anno::description("Enables or disables alpha functionality"),
342
+ anno::in_group("Alpha")
343
+ ]],
344
+ float alpha_constant = 1.0
345
+ [[
346
+ anno::enable_if("enable_opacity == true"),
347
+ anno::display_name("Opacity Fallback Constant"),
348
+ anno::hard_range(0.0, 1.0),
349
+ anno::description("The base alpha constant to use if no texture is specified"),
350
+ anno::in_group("Alpha")
351
+ ]],
352
+ uniform texture_2d opacity_texture = texture_2d()
353
+ [[
354
+ anno::enable_if("enable_opacity == true"),
355
+ anno::display_name("Opacity Map"),
356
+ anno::description("The texture specifying the opacity value to use"),
357
+ anno::in_group("Alpha")
358
+ ]],
359
+ uniform bool enable_opacity_cutout = false
360
+ [[
361
+ anno::enable_if("enable_opacity == true"),
362
+ anno::display_name("Enable Alpha Cutout"),
363
+ anno::description("Enables or disables alpha cutout functionality"),
364
+ anno::in_group("Alpha")
365
+ ]],
366
+ uniform float alpha_cutout_cutoff = 1.f
367
+ [[
368
+ anno::enable_if("enable_opacity == true"),
369
+ anno::enable_if("enable_opacity_cutout == true"),
370
+ anno::hard_range(0.0, 1.0),
371
+ anno::display_name("Alpha Cutout Cutoff"),
372
+ anno::description("The cutoff value to to render as transparent up to and opaque past"),
373
+ anno::in_group("Alpha")
374
+ ]],
375
+
376
+ // -------------------- NORMAL ----------------------
377
+ uniform float bump_factor = 1.f
378
+ [[
379
+ anno::display_name("Normal Map Strength"),
380
+ anno::description("Strength of normal map."),
381
+ anno::in_group("Normal")
382
+ ]],
383
+
384
+ float3 normal_input = state::normal(),
385
+ uniform texture_2d normalmap_texture = texture_2d()
386
+ [[
387
+ anno::display_name("Normal Map"),
388
+ anno::in_group("Normal")
389
+ ]],
390
+ uniform bool flip_tangent_u = false
391
+ [[
392
+ anno::display_name("Normal Map Flip U Tangent"),
393
+ anno::in_group("Normal")
394
+ ]],
395
+ uniform bool flip_tangent_v = true
396
+ [[
397
+ anno::display_name("Normal Map Flip V Tangent"),
398
+ anno::in_group("Normal")
399
+ ]],
400
+
401
+ // -------------------- UV ADJUSTMENTS ----------------------
402
+ uniform bool project_uvw = false
403
+ [[
404
+ anno::display_name("Enable Project UVW Coordinates"),
405
+ anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"),
406
+ anno::in_group("UV")
407
+ ]],
408
+ uniform bool world_or_object = false
409
+ [[
410
+ anno::enable_if("project_uvw == true"),
411
+ anno::display_name("Enable World Space"),
412
+ anno::description("When set to 'true' uses world space for projection, when 'false' object space is used"),
413
+ anno::in_group("UV")
414
+ ]],
415
+ uniform float2 texture_translate = float2(0.0f)
416
+ [[
417
+ anno::display_name("Texture Translate"),
418
+ anno::description("Controls position of texture."),
419
+ anno::in_group("UV")
420
+ ]],
421
+ uniform float2 texture_scale = float2(1.0f)
422
+ [[
423
+ anno::display_name("Texture Tiling"),
424
+ anno::description("Controls repetition of the texture."),
425
+ anno::in_group("UV")
426
+ ]],
427
+ uniform float2 texture_speed = float2(0.0f)
428
+ [[
429
+ anno::display_name("Texture Speed"),
430
+ anno::description("Scrolling texture animation speed in UVs per sec."),
431
+ anno::in_group("UV")
432
+ ]]
433
+ )
434
+ [[
435
+ anno::display_name("Sim PBR"),
436
+ anno::description("Supports the opaque alpha cutout material model of the Sim Renderer"),
437
+ anno::in_group("SimReady"),
438
+ anno::version( 1, 0, 0),
439
+ anno::author("NVIDIA CORPORATION"),
440
+ anno::key_words(string[]("Sim", "PBR", "opaque", "alpha", "cutout", "omniverse", "generic"))
441
+ ]]
442
+ = let {
443
+ base::texture_coordinate_system the_system = world_or_object ? base::texture_coordinate_world : base::texture_coordinate_object;
444
+
445
+ base::texture_coordinate_info uvw = project_uvw ?
446
+ base::coordinate_projection(
447
+ coordinate_system: the_system,
448
+ texture_space: 0,
449
+ projection_type: base::projection_cubic
450
+ ) : base::coordinate_source(
451
+ coordinate_system: base::texture_coordinate_uvw,
452
+ texture_space: 0
453
+ );
454
+
455
+ // Need to use a small value so the compiler doesnt optimize out this var...
456
+ float t = 0.00000001;//state::animation_time();
457
+ base::texture_coordinate_info transformed_uvw = base::transform_coordinate(
458
+ transform: base::rotation_translation_scale(
459
+ scaling: float3(texture_scale.x, texture_scale.y, 1.0),
460
+ rotation: float3(0.0, 0.0, 0.0 ),
461
+ translation: float3(texture_translate.x + t * texture_speed.x, texture_translate.y + t * texture_speed.y, 0.0)),
462
+ coordinate: uvw
463
+ );
464
+ float2 uv = float2(transformed_uvw.position.x, transformed_uvw.position.y);
465
+
466
+ // Diffuse Color Lookup and AO
467
+ float4 base_lookup = tex::texture_isvalid(diffuse_texture) ? tex::lookup_float4(tex: diffuse_texture, coord: uv) : float4(1, 1, 1, 1);
468
+
469
+ float opacityValue = tex::texture_isvalid(opacity_texture) ? tex::lookup_float4(tex: opacity_texture, coord: uv).w : alpha_constant;
470
+
471
+ // Normal calculations
472
+ float3 normal_lookup = tex::texture_isvalid(normalmap_texture) ?
473
+ base::tangent_space_normal_texture(
474
+ texture: normalmap_texture,
475
+ factor: bump_factor,
476
+ uvw: transformed_uvw,
477
+ flip_tangent_u: flip_tangent_u,
478
+ flip_tangent_v: flip_tangent_v
479
+ ) : normal_input;
480
+
481
+ float3 clearcoat_normal = tex::texture_isvalid(clearcoat_normalmap_texture) ?
482
+ base::tangent_space_normal_texture(
483
+ texture: clearcoat_normalmap_texture,
484
+ factor: clearcoat_bump_factor,
485
+ uvw: uvw,
486
+ flip_tangent_u: clearcoat_flip_tangent_u,
487
+ flip_tangent_v: clearcoat_flip_tangent_v
488
+ ) : clearcoat_normal_input;
489
+
490
+ float3 flattened_clearcoat_normal = ::math::lerp(normal_lookup, ::state::normal(), clearcoat_flatten);
491
+ float3 final_clearcoat_normal = tex::texture_isvalid(clearcoat_normalmap_texture) ? clearcoat_normal : flattened_clearcoat_normal;
492
+
493
+ float ao_lookup = tex::texture_isvalid(ao_texture) ? tex::lookup_float4(tex: ao_texture, coord: uv).x : ao_input;
494
+
495
+ color diffuse_color = tex::texture_isvalid(diffuse_texture) ? color(base_lookup.x, base_lookup.y, base_lookup.z) : diffuse_color_constant;
496
+
497
+ float3 ORM_lookup = tex::lookup_float3(
498
+ tex: ORM_texture,
499
+ coord: float2(transformed_uvw.position.x, transformed_uvw.position.y)
500
+ );
501
+
502
+ float roughness_lookup = tex::texture_isvalid(reflectionroughness_texture) ?
503
+ tex::lookup_float4(tex: reflectionroughness_texture, coord: uv).x : reflection_roughness_constant;
504
+ float anisotropy_lookup = tex::texture_isvalid(anisotropy_texture) ?
505
+ (tex::lookup_float4(tex: anisotropy_texture, coord: uv).x * 2.0f - 1.0f) : anisotropy_constant;
506
+ float metallic_lookup = tex::texture_isvalid(metallic_texture) ?
507
+ tex::lookup_float4(tex: metallic_texture, coord: uv).x : metallic_constant;
508
+ float specular_lookup = tex::texture_isvalid(specular_texture) ?
509
+ tex::lookup_float4(tex: specular_texture, coord: uv).x : specular_constant;
510
+
511
+ float roughness_selection = enable_ORM_texture ? ORM_lookup.y : roughness_lookup;
512
+ float metallic_selection = enable_ORM_texture ? ORM_lookup.z : metallic_lookup;
513
+ float ao = enable_ORM_texture ? ORM_lookup.x : ao_lookup;
514
+
515
+ float reflection_roughness = math::lerp(reflection_roughness_constant, roughness_selection, reflection_roughness_texture_influence);
516
+ float anisotropy = math::lerp(anisotropy_constant, anisotropy_lookup, anisotropy_texture_influence);
517
+ float metallic = math::lerp(metallic_constant, metallic_selection, metallic_texture_influence);
518
+
519
+ int rows = flipbook_dim.x;
520
+ int columns = flipbook_dim.y;
521
+ int numFrames = rows * columns;
522
+ varying int frameIdx = int(state::animation_time() * target_fps) % numFrames;
523
+ varying float2 baseUV = float2(transformed_uvw.position.x, transformed_uvw.position.y);
524
+ varying float2 emissiveUV = enable_emissive_flipbook ?
525
+ ((baseUV + float2(frameIdx % rows, frameIdx / rows)) / float2(rows, columns)) : baseUV;
526
+
527
+ color emissive_mask = tex::texture_isvalid(emissive_mask_texture) ?
528
+ tex::lookup_color(emissive_mask_texture, emissiveUV, tex::wrap_repeat, tex::wrap_repeat) : emissive_mask_input;
529
+
530
+ } in SimPBR_Model(
531
+ diffuse_color: diffuse_color,
532
+ diffuse_tint: diffuse_tint,
533
+ roughness: reflection_roughness,
534
+ anisotropy: anisotropy,
535
+ metallic: metallic,
536
+ specular: specular_lookup,
537
+ normal: normal_lookup,
538
+ enable_clearcoat: enable_clearcoat,
539
+ clearcoat_tint: clearcoat_tint,
540
+ clearcoat_transparency: clearcoat_transparency,
541
+ clearcoat_reflection_roughness: clearcoat_reflection_roughness,
542
+ clearcoat_weight: clearcoat_weight,
543
+ clearcoat_ior: clearcoat_ior,
544
+ clearcoat_normal: final_clearcoat_normal,
545
+ enable_retroreflection: enable_retroreflection,
546
+ retroreflection_tint: retroreflection_tint,
547
+ normal_reflectivity: normal_reflectivity,
548
+ grazing_reflectivity: grazing_reflectivity,
549
+ ao_to_diffuse: ao_to_diffuse,
550
+ ao: ao,
551
+ enable_emission: enable_emission,
552
+ emissive_color: emissive_color,
553
+ emissive_mask: emissive_mask,
554
+ emissive_intensity: emissive_intensity,
555
+ enable_opacity: enable_opacity,
556
+ alpha: opacityValue,
557
+ enable_opacity_cutout: enable_opacity_cutout,
558
+ alpha_cutout_cutoff: alpha_cutout_cutoff,
559
+ opacity_ratio: enable_transmission ? opacity_ratio : 1.0,
560
+ opacity_tint : opacity_tint,
561
+ opacity_multiplier : opacity_multiplier
562
+ );
objects/standard_halfunit/materials/omniverse/simready_content/materials/SimPBR_Model.mdl ADDED
@@ -0,0 +1,212 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*****************************************************************************
2
+ * Copyright 1986-2020 NVIDIA Corporation. All rights reserved.
3
+ ******************************************************************************
4
+
5
+ MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,
6
+ WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,
7
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
8
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
9
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
10
+ COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA
11
+ CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
12
+ ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
13
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
14
+ THE USE OR INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN
15
+ THE MDL MATERIALS.
16
+ */
17
+
18
+ mdl 1.4;
19
+
20
+ import ::df::*;
21
+ import ::state::*;
22
+ import ::math::*;
23
+ import ::base::*;
24
+ import ::tex::*;
25
+ import ::anno::*;
26
+
27
+ using .::baking_annotations import *;
28
+
29
+ base::texture_return multiply_colors(
30
+ color color_1 = color(1.0, 1.0, 1.0),
31
+ color color_2 = color(.5, .5, .5),
32
+ float weight = 1.0
33
+ )
34
+ [[
35
+ anno::hidden()
36
+ ]]
37
+ {
38
+ return base::blend_color_layers(
39
+ layers: base::color_layer[](
40
+ base::color_layer(
41
+ layer_color: color_2,
42
+ weight: weight,
43
+ mode: base::color_layer_multiply
44
+ )
45
+ ), base: color_1
46
+ );
47
+ }
48
+
49
+ export material SimPBR_Model(
50
+ color diffuse_color = color(0.2f) [[ target_baked_argument("diffuse_texture", "diffuse_color_constant", "RGBA8_UNORM") ]],
51
+ uniform color diffuse_tint = color(1.0f),
52
+ float roughness = 0.5f [[ target_baked_argument("reflectionroughness_texture", "reflection_roughness_constant", "R8_UNORM") ]],
53
+ float anisotropy = 0.0f [[ target_baked_argument("anisotropy_texture", "anisotropy_constant", "R8_SNORM") ]],
54
+ float metallic = 0.f [[ target_baked_argument("metallic_texture", "metallic_constant", "R8_UNORM") ]],
55
+ float specular = 1.f [[ target_baked_argument("specular_texture", "specular_constant", "R8_UNORM") ]],
56
+ float3 normal = float3(0.0, 0.0, 0.0) [[ target_baked_argument("normalmap_texture", "normal_input", "RGBA8_SNORM", baking_annotations::TRANSFORM_UNORM_VECTOR) ]],
57
+ uniform bool enable_clearcoat = false,
58
+ color clearcoat_tint = color(1.0f),
59
+ float clearcoat_transparency = 1.0f,
60
+ float clearcoat_reflection_roughness = 0.0f,
61
+ float clearcoat_weight = 1.0f,
62
+ float clearcoat_ior = 1.56f,
63
+ float3 clearcoat_normal = float3(0.0, 0.0, 0.0) [[ target_baked_argument("clearcoat_normalmap_texture", "clearcoat_normal_input", "RGBA8_SNORM", baking_annotations::TRANSFORM_UNORM_VECTOR) ]],
64
+ uniform bool enable_retroreflection = false,
65
+ color retroreflection_tint = color(.182,.800,.000),
66
+ uniform float normal_reflectivity = 0.5,
67
+ uniform float grazing_reflectivity = 1.0,
68
+ float ao_to_diffuse = 0.0,
69
+ float ao = 1.0f [[ target_baked_argument("ao_texture", "ao_input", "R8_UNORM") ]],
70
+ uniform bool enable_emission = false,
71
+ uniform color emissive_color = color(1.0, 0.1, 0.1),
72
+ color emissive_mask = color(1.0, 0.1, 0.1) [[ target_baked_argument("emissive_mask_texture", "emissive_mask_input", "R8_UNORM") ]],
73
+ uniform float emissive_intensity = 40.f,
74
+ uniform bool enable_opacity = false,
75
+ float alpha = 1.0,
76
+ uniform bool enable_opacity_cutout = false,
77
+ uniform float alpha_cutout_cutoff = 1.f,
78
+ uniform float opacity_ratio = 1.f,
79
+ uniform color opacity_tint = color(1.0f),
80
+ uniform float opacity_multiplier = 1.f
81
+ )
82
+ [[
83
+ target_material_model(),
84
+ target_material_rendering("..::SimPBR::SimPBR")
85
+ ]]
86
+ = let {
87
+ color base_color = multiply_colors(diffuse_color, diffuse_tint, 1.0).tint;
88
+ color ao_weighted_base_color = multiply_colors(base_color, color(ao), ao_to_diffuse).tint;
89
+
90
+ float squared_roughness = roughness * roughness;
91
+ float roughness_u = squared_roughness * (1 + anisotropy);
92
+ float roughness_v = squared_roughness * (1 - anisotropy);
93
+
94
+ color diffuse_transmission_color = base_color * opacity_tint * opacity_multiplier;
95
+
96
+ bsdf diffuse_bsdf = df::weighted_layer(
97
+ weight: opacity_ratio,
98
+ layer: df::diffuse_reflection_bsdf(
99
+ tint: ao_weighted_base_color,
100
+ roughness: 0.0f
101
+ ),
102
+ base: df::diffuse_transmission_bsdf(tint: diffuse_transmission_color),
103
+ normal: enable_clearcoat ? normal : state::normal()
104
+ );
105
+
106
+ bsdf ggx_smith_bsdf = df::microfacet_ggx_smith_bsdf(
107
+ roughness_u: roughness_u,
108
+ roughness_v: roughness_v,
109
+ tint: color(1.0, 1.0, 1.0),
110
+ mode: df::scatter_reflect
111
+ );
112
+
113
+ bsdf custom_curve_layer_bsdf = df::custom_curve_layer(
114
+ normal_reflectivity: 0.03,
115
+ grazing_reflectivity: 1.0,
116
+ exponent: 5.0,
117
+ weight: specular,
118
+ layer: ggx_smith_bsdf,
119
+ base: diffuse_bsdf,
120
+ normal: enable_clearcoat ? normal : state::normal()
121
+ );
122
+
123
+ //
124
+ // Begin RETROREFLECTION SUPPORT
125
+ //
126
+ color final_retroreflection_color = multiply_colors(retroreflection_tint, base_color, 1.0).tint;
127
+ bsdf backscattering_glossy_bsdf = df::backscattering_glossy_reflection_bsdf(
128
+ tint: final_retroreflection_color,
129
+ roughness_u: squared_roughness
130
+ );
131
+
132
+ /*bsdf retroreflection_bsdf = df::custom_curve_layer(
133
+ normal_reflectivity: 1.-normal_reflectivity,
134
+ grazing_reflectivity: 1.-grazing_reflectivity,
135
+ base: backscattering_glossy_bsdf,
136
+ layer: custom_curve_layer_bsdf,
137
+ normal: enable_clearcoat ? normal_lookup : state::normal()
138
+ );*/
139
+
140
+ // if normal_reflectivity and grazing_reflectivity are 1 and weight is 1, just the layer is used
141
+ bsdf opt_retroreflection_bsdf = df::custom_curve_layer(
142
+ normal_reflectivity: enable_retroreflection ? 1.-normal_reflectivity : 1,
143
+ grazing_reflectivity: enable_retroreflection ? 1.-grazing_reflectivity : 1,
144
+ base: backscattering_glossy_bsdf,
145
+ layer: custom_curve_layer_bsdf,
146
+ normal: enable_clearcoat ? normal : state::normal()
147
+ );
148
+
149
+ //
150
+ // End RETROREFLECTION SUPPORT
151
+ //
152
+
153
+ bsdf directional_factor_bsdf = df::directional_factor(
154
+ normal_tint: ao_weighted_base_color,
155
+ grazing_tint: color(1.0, 1.0, 1.0),
156
+ exponent: 5.0f,
157
+ base: ggx_smith_bsdf
158
+ );
159
+
160
+ // CLEARCOAT
161
+ bsdf omni_PBR_bsdf = df::weighted_layer(
162
+ weight: metallic,
163
+ layer: directional_factor_bsdf,
164
+ base: opt_retroreflection_bsdf, //enable_retroreflection ? retroreflection_bsdf : custom_curve_layer_bsdf,
165
+ normal: enable_clearcoat ? normal : state::normal()
166
+ );
167
+
168
+ bsdf clearcoat_bsdf = df::microfacet_ggx_smith_bsdf(
169
+ roughness_u: clearcoat_reflection_roughness * clearcoat_reflection_roughness,
170
+ roughness_v: clearcoat_reflection_roughness * clearcoat_reflection_roughness,
171
+ tint: color(1.0f),
172
+ mode: df::scatter_reflect
173
+ );
174
+
175
+ // bsdf omni_PBR_coated_bsdf = df::custom_curve_layer(
176
+ // normal_reflectivity: clearcoat_reflectivity * 0.08,
177
+ // grazing_reflectivity: 1.0,
178
+ // weight: clearcoat_weight,
179
+ // layer: clearcoat_bsdf,
180
+ // base: omni_PBR_bsdf,
181
+ // normal: final_clearcoat_normal
182
+ // );
183
+
184
+ bsdf opt_opaque_clearcoat = df::weighted_layer(
185
+ weight: enable_clearcoat ? clearcoat_transparency : 1,
186
+ layer: ::df::tint(tint: enable_clearcoat ? clearcoat_tint : color(1), base: omni_PBR_bsdf),
187
+ base: ::df::diffuse_reflection_bsdf(tint: clearcoat_tint)
188
+ );
189
+
190
+ bsdf opt_omni_PBR_coated_bsdf = df::fresnel_layer(
191
+ ior: clearcoat_ior,
192
+ weight: enable_clearcoat ? clearcoat_weight : 0,
193
+ layer: clearcoat_bsdf,
194
+ base: opt_opaque_clearcoat,
195
+ normal: clearcoat_normal
196
+ );
197
+
198
+ bsdf final_bsdf = opt_omni_PBR_coated_bsdf;
199
+ } in material(
200
+ thin_walled: false,
201
+ surface: material_surface(
202
+ scattering: final_bsdf,
203
+ emission: material_emission(
204
+ df::diffuse_edf(),
205
+ intensity: enable_emission ? emissive_color * emissive_mask * color(emissive_intensity) : color(0)
206
+ )
207
+ ),
208
+ geometry: material_geometry(
209
+ normal: enable_clearcoat ? state::normal() : normal,
210
+ cutout_opacity: enable_opacity ? (enable_opacity_cutout ? (alpha < alpha_cutout_cutoff ? 0.0 : 1.0) : alpha) : 1.0
211
+ )
212
+ );
objects/standard_halfunit/materials/omniverse/simready_content/materials/baking_annotations.mdl ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.4;
2
+ import ::anno::*;
3
+
4
+ export const string TRANSFORM_NONE = "NONE";
5
+ export const string TRANSFORM_UNORM_VECTOR = "UNORM_VECTOR";
6
+
7
+ export const string FORMAT_RGBA8_UNORM = "RGBA8_UNORM";
8
+ export const string FORMAT_R8_UNORM = "R8_UNORM";
9
+ export const string FORMAT_RGBA16_SFLOAT = "RGBA16_SFLOAT";
10
+
11
+ export const string BLEND_MODE_OPACITY = "opacity_blend";
12
+ export const string BLEND_MODE_REPLACE = "replace";
13
+
14
+ // This annotation is used to mark a material as target material for baking.
15
+ // It is that is detected by the MDL SDK and neuray.
16
+ export annotation target_material_model();
17
+
18
+ export annotation target_material_rendering(
19
+ string rendering_material_override = "" // if set, the baked material will be rendering using this material,
20
+ // otherwise the target itself is used
21
+ );
22
+
23
+ export annotation target_baked_argument(
24
+ // the name of the baked texture parameter in the rendering material
25
+ string baked_name,
26
+
27
+ // the name of the constant parameter in the rendering material in case baking was not necessary
28
+ string constant_name = "",
29
+
30
+ // texture format to bake to
31
+ string format = "",
32
+
33
+ // transformations, like encoding normals into [0,1] range
34
+ string transform = TRANSFORM_NONE,
35
+
36
+ // blending, e.g., based on alpha or replace
37
+ string blend_mode = BLEND_MODE_OPACITY
38
+ );
objects/table_bamboo/table_bamboo.usd ADDED
Binary file (5.58 kB). View file
 
objects/table_black/materials/remote/omniverse-content-production.s3.us-west-2.amazonaws.com/Materials/2023_1/Base/Plastics/Plastic.mdl ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.4;
2
+
3
+ using ::OmniPBR import OmniPBR;
4
+ import ::tex::gamma_mode;
5
+ import ::state::normal;
6
+
7
+ export material Plastic(*)
8
+ = OmniPBR(
9
+ diffuse_color_constant: color(1.0, 1.0, 1.0),
10
+ diffuse_texture: texture_2d(), //"./Plastic/Plastic_BaseColor.png", ::tex::gamma_srgb
11
+ albedo_desaturation: 0.f,
12
+ albedo_add: 0.f,
13
+ albedo_brightness: 1.f,
14
+ diffuse_tint: color(1.f, 1.f, 1.f), //0.15f, 0.15f, 0.15f
15
+ reflection_roughness_constant: 0.45,
16
+ reflection_roughness_texture_influence: 0.f,
17
+ reflectionroughness_texture: texture_2d(),
18
+ metallic_constant: 0.0,
19
+ metallic_texture_influence: 0.f,
20
+ metallic_texture: texture_2d(),
21
+ specular_level: 0.5f,
22
+ enable_ORM_texture: true,
23
+ ORM_texture: texture_2d(), //"./Plastic/Plastic_ORM.png", ::tex::gamma_linear
24
+ ao_to_diffuse: 0.f,
25
+ ao_texture: texture_2d(),
26
+ enable_emission: false,
27
+ emissive_color: color(0.0, 0.0, 0.0),
28
+ emissive_mask_texture: texture_2d(),
29
+ emissive_intensity: 0.0,
30
+ bump_factor: 0.5f,
31
+ normalmap_texture: texture_2d(), //"./Plastic/Plastic_Normal.png", ::tex::gamma_linear
32
+ detail_bump_factor: 1.f,
33
+ detail_normalmap_texture: texture_2d(),
34
+ project_uvw: false,
35
+ world_or_object: false,
36
+ uv_space_index: 0,
37
+ texture_translate: float2(0.f),
38
+ texture_rotate: 0.f,
39
+ texture_scale: float2(1.f),
40
+ detail_texture_translate: float2(0.f),
41
+ detail_texture_rotate: 0.f,
42
+ detail_texture_scale: float2(1.f));
objects/table_black/materials/remote/omniverse-content-production.s3.us-west-2.amazonaws.com/Materials/2023_1/Base/Plastics/Plastic_Clear.mdl ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.3;
2
+
3
+ import ::OmniGlass::OmniGlass;
4
+ import ::tex::gamma_mode;
5
+ import ::state::normal;
6
+
7
+ export material Plastic_Clear(*)
8
+ = OmniGlass::OmniGlass(
9
+ absorption_coeff: color(1.f, 1.f, 1.f),
10
+ glass_color: color(1.f, 1.f, 1.f),
11
+ use_glass_color_texture: false,
12
+ glass_color_texture: texture_2d(),
13
+ frosting_roughness: 0.f,
14
+ glass_ior: 1.46f,
15
+ thin_walled: true,
16
+ project_uvw: false,
17
+ world_or_object: false,
18
+ uv_space_index: 0,
19
+ texture_translate: float2(0.f),
20
+ texture_rotate: 0.f,
21
+ texture_scale: float2(1.f));
objects/table_black/materials/remote/omniverse-content-production.s3.us-west-2.amazonaws.com/Materials/2023_1/vMaterials_2/Paint/Carpaint/Carpaint_Solid.mdl ADDED
@@ -0,0 +1,1112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2023 NVIDIA Corporation. All rights reserved. *
3
+ ******************************************************************************
4
+
5
+ Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge,
6
+ to any person obtaining a copy of the sample definition code that uses our
7
+ Material Definition Language (the "MDL Materials"), to reproduce and distribute
8
+ the MDL Materials, including without limitation the rights to use, copy, merge,
9
+ publish, distribute, and sell modified and unmodified copies of the MDL
10
+ Materials, and to permit persons to whom the MDL Materials is furnished to do
11
+ so, in all cases solely for use with NVIDIA's Material Definition Language,
12
+ subject to the following further conditions:
13
+
14
+ 1. The above copyright notices, this list of conditions, and the disclaimer
15
+ that follows shall be retained in all copies of one or more of the MDL
16
+ Materials, including in any software with which the MDL Materials are bundled,
17
+ redistributed, and/or sold, and included either as stand-alone text files,
18
+ human-readable headers or in the appropriate machine-readable metadata fields
19
+ within text or binary files as long as those fields can be easily viewed by the
20
+ user, as applicable.
21
+ 2. The name of NVIDIA shall not be used to promote, endorse or advertise any
22
+ Modified Version without specific prior written permission, except a) to comply
23
+ with the notice requirements otherwise contained herein; or b) to acknowledge
24
+ the contribution(s) of NVIDIA.
25
+
26
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
27
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
28
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
29
+ TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR
30
+ ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL,
31
+ INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF
32
+ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE
33
+ THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.
34
+ */
35
+
36
+ mdl 1.6;
37
+ import ::df::*;
38
+ import ::math::*;
39
+ import ::anno::*;
40
+ import ::state::*;
41
+ import ::base::*;
42
+ import ::tex::*;
43
+ import ::nvidia::core_definitions::dimension;
44
+ import ::nvidia::core_definitions::blend_colors;
45
+
46
+
47
+ const string COPYRIGHT =
48
+ " Copyright 2023 NVIDIA Corporation. All rights reserved.\n"
49
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
50
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
51
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
52
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
53
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
54
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
55
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
56
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
57
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
58
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
59
+
60
+
61
+ ::base::texture_coordinate_info transform_coordinate_2(
62
+ float4x4 transform
63
+ [[ ::anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix") ]],
64
+ ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info()
65
+ [[ ::anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection") ]]
66
+ ) [[
67
+ ::anno::description("Transform a texture coordinate by a matrix") ,
68
+ ::anno::noinline()
69
+ ]]
70
+ {
71
+ // Version 2
72
+ float4 r_position = transform * float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1);
73
+ //Try aproximating it for the case that the rotation is only aroud z and assuming the texture layout is nice and z is ~constant.
74
+ //just pretend there is no other rotation happening
75
+ //get rid of scaling and translation. Then extract fields where sin and cos would be in a simple 2d transform around z.
76
+ float4 u = transform[0];
77
+ float3 ru = ::math::normalize(float3(u.x,u.y,u.z));
78
+ float cos = ru.x;
79
+ float sin = -ru.y;
80
+
81
+ return ::base::texture_coordinate_info(
82
+ float3(r_position.x,r_position.y,r_position.z),
83
+ ::math::normalize(cos * coordinate.tangent_u - sin * coordinate.tangent_v),
84
+ ::math::normalize(cos * coordinate.tangent_v + sin * coordinate.tangent_u));
85
+ }
86
+
87
+ // Takes the standard input that every material has. It combines a couple of
88
+ // functions in one convenience function.
89
+ ::base::texture_coordinate_info vmat_transform(
90
+ float2 translation = float2(0.0f, 0.0f),
91
+ float rotation = 0.0f, // rotation in degrees
92
+ float2 scaling = float2(1.0f, 1.0f),
93
+ uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw,
94
+ uniform int uv_space = 0
95
+ )
96
+ {
97
+ float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f;
98
+ float4x4 scale =
99
+ float4x4(1.0f /scaling.x, 0.f , 0.f , 0.f,
100
+ 0.f , 1.0f /scaling.y , 0.f , 0.f,
101
+ 0.f , 0.f , 1.0f, 0.f,
102
+ translation.x , translation.y , 0.0f, 1.f);
103
+
104
+ float s = ::math::sin(rotation_rad);
105
+ float c = ::math::cos(rotation_rad);
106
+ float4x4 rotate =
107
+ float4x4( c , -s , 0.0f , 0.0f,
108
+ s , c , 0.0f , 0.0f,
109
+ 0.0f, 0.0f , 1.0f , 0.0f,
110
+ 0.f , 0.0f , 0.0f , 1.f);
111
+
112
+ return transform_coordinate_2(scale*rotate, ::base::coordinate_source(system, uv_space));
113
+ }
114
+
115
+
116
+
117
+ float histogram_range(float input, float range = 1.0f, float position = 0.5f)
118
+ {
119
+ float low = ::math::clamp(1.0f - ::math::min(((1.0f - position) + range * 0.5f), (1.0f - position) * 2), 0.0f, 1.0f);
120
+ float high = ::math::clamp(::math::min((position + range * 0.5f ), position * 2.0f), 0.0f, 1.0f);
121
+ return ::math::lerp(low, high, input);
122
+ }
123
+
124
+ //
125
+ // flake noise utilities
126
+ //
127
+ int hash(int seed, int i)
128
+ {
129
+ return (i ^ seed) * 1075385539;
130
+ }
131
+ int rnd_init(int3 pos)
132
+ {
133
+ return hash(hash(hash(0, pos.x), pos.y), pos.z);
134
+ }
135
+
136
+ int rnd_next(int seed) {
137
+ // xorshift32 using signed int
138
+ seed ^= seed << 13;
139
+ seed ^= seed >>> 17;
140
+ seed ^= seed << 5;
141
+ return seed;
142
+ }
143
+
144
+ float rnd_value(int seed)
145
+ {
146
+ //return ::math::abs(float(seed) * 4.6566fe-10f);
147
+ return ::math::abs(float(seed) * 0.00000000046566f);
148
+ }
149
+
150
+ // apply random rotation (using "Fast Random Rotation Matrices" by James Arvo)
151
+ float3 rotate_pos(float3 pos, float3 xi)
152
+ {
153
+ float theta = ::math::PI * 2.0f * xi.x;
154
+ float phi = ::math::PI * 2.0f * xi.y;
155
+ float z = xi.z * 2.0f;
156
+
157
+ float r = ::math::sqrt(z);
158
+ float[2] sp_cp = ::math::sincos(phi);
159
+ float Vx = sp_cp[0] * r;
160
+ float Vy = sp_cp[1] * r;
161
+ float Vz = ::math::sqrt(2.0f - z);
162
+
163
+ float[2] st_ct = ::math::sincos(theta);
164
+ float Sx = Vx * st_ct[1] - Vy * st_ct[0];
165
+ float Sy = Vx * st_ct[0] + Vy * st_ct[1];
166
+
167
+ float3x3 M(
168
+ Vx * Sx - st_ct[1], Vx * Sy - st_ct[0], Vx * Vz,
169
+ Vy * Sx + st_ct[0], Vy * Sy - st_ct[1], Vy * Vz,
170
+ Vz * Sx, Vz * Sy, 1.0f - z);
171
+
172
+ return M * pos;
173
+ }
174
+
175
+ struct flake_noise_value {
176
+ // flake priority (in [0..1], 0: no flake, flakes with higher priority shadow flakes "below" them)
177
+ float priority;
178
+ // Stores values from the functions (once normal, another time the color)
179
+ // current pseudo random number generator seed
180
+ int rnd_seed;
181
+ float4 carrier;
182
+ };
183
+
184
+ // flake noise function with controllable regularity, flake size, and probability
185
+ flake_noise_value flake_noise(
186
+ float3 pos,
187
+ float jitter_scale = 1.0f,
188
+ float flake_diameter = 0.75f,
189
+ float flake_probability = 1.0f)
190
+ {
191
+ float3 base_pos = ::math::floor(pos);
192
+ int3 base_pos_i = int3(base_pos);
193
+
194
+ // limit the flake size to the allowed maximum (such that looking at all neighbors is sufficient)
195
+ flake_diameter = ::math::min(flake_diameter, (1.5f - 0.5f * jitter_scale) / ::math::sqrt(3.0f));
196
+
197
+ flake_noise_value val(0.0f, 0, float4(0.0f));
198
+
199
+ for (int i = -1; i < 2; ++i) {
200
+ for (int j = -1; j < 2; ++j) {
201
+ for (int k = -1; k < 2; ++k) {
202
+
203
+ int seed = rnd_init(base_pos_i + int3(i, j, k));
204
+
205
+ seed = rnd_next(seed);
206
+ if (rnd_value(seed) > flake_probability)
207
+ continue;
208
+
209
+ seed = rnd_next(seed);
210
+ float priority = rnd_value(seed);
211
+ if (priority < val.priority)
212
+ continue;
213
+
214
+ float3 flake_pos = base_pos + float3(i, j, k) + float3(0.5f);
215
+
216
+ if (jitter_scale > 0.0f) {
217
+ seed = rnd_next(seed);
218
+ flake_pos.x += (rnd_value(seed) - 0.5f) * jitter_scale;
219
+ seed = rnd_next(seed);
220
+ flake_pos.y += (rnd_value(seed) - 0.5f) * jitter_scale;
221
+ seed = rnd_next(seed);
222
+ flake_pos.z += (rnd_value(seed) - 0.5f) * jitter_scale;
223
+ }
224
+
225
+ float3 p = pos - flake_pos;
226
+ if (::math::dot(p, p) >= flake_diameter * flake_diameter * 4.0f)
227
+ continue;
228
+
229
+ float3 xi_rot;
230
+ seed = rnd_next(seed);
231
+ xi_rot.x = rnd_value(seed);
232
+ seed = rnd_next(seed);
233
+ xi_rot.y = rnd_value(seed);
234
+ seed = rnd_next(seed);
235
+ xi_rot.z = rnd_value(seed);
236
+ p = rotate_pos(p, xi_rot);
237
+
238
+ if (::math::abs(p.x) <= flake_diameter &&
239
+ ::math::abs(p.y) <= flake_diameter &&
240
+ ::math::abs(p.z) <= flake_diameter)
241
+ {
242
+ val.priority = priority;
243
+ val.rnd_seed = seed;
244
+ }
245
+ }
246
+ }
247
+ }
248
+
249
+ return val;
250
+ }
251
+
252
+ // create a flake normal by importance sampling the Beckmann distribution with given roughness
253
+ flake_noise_value flake_normal(
254
+ flake_noise_value val,
255
+ float spread)
256
+ {
257
+ if (val.priority <= 0.0f)
258
+ {
259
+ val.carrier = float4(::state::normal().x, ::state::normal().y, ::state::normal().z, 1.0f);
260
+ return val;
261
+ }
262
+
263
+ int seed = rnd_next(val.rnd_seed);
264
+ float xi0 = rnd_value(seed);
265
+ seed = rnd_next(seed);
266
+ float xi1 = rnd_value(seed);
267
+
268
+ float phi = ::math::PI * 2.0f * xi0;
269
+
270
+ float roughness = spread * spread;
271
+
272
+ float tantheta = ::math::sqrt(-roughness * roughness * ::math::log(1.0f - xi1));
273
+ float sintheta = tantheta / ::math::sqrt(1.0f + tantheta * tantheta);
274
+ float costheta = ::math::sqrt(1.0f - sintheta * sintheta);
275
+
276
+ float[2] scphi = ::math::sincos(phi);
277
+
278
+ val.rnd_seed = seed;
279
+
280
+ float3 normal = ::state::texture_tangent_u(0) * scphi[1] * sintheta +
281
+ ::state::texture_tangent_v(0) * scphi[0] * sintheta +
282
+ ::state::normal() * costheta;
283
+
284
+ val.carrier = float4(normal.x, normal.y, normal.z, 1.0f);
285
+
286
+
287
+ return val;
288
+ }
289
+
290
+
291
+ export material Carpaint_Solid(
292
+ color base_color = color(0.002125f, 0.051269f, 0.046665f) [[
293
+ ::anno::description("Sets the base color of the carpaint"),
294
+ ::anno::display_name("Base "),
295
+ ::anno::in_group("Appearance"),
296
+ ::anno::ui_order(0)
297
+ ]],
298
+ float ground_coat_influence = 0.9f [[
299
+ ::anno::description("The ground coat layer is a metallic base layer over which the base color coat, the flakes and the clearcoat are applied. Use the parameter 'Ground Coat Brightness' to adjust its brightness."),
300
+ ::anno::display_name("Base Coat Influence"),
301
+ ::anno::in_group("Appearance"),
302
+ ::anno::hard_range(0.f, 1.f),
303
+ ::anno::ui_order(1)
304
+ ]],
305
+ float ground_coat_brightness = 0.24f [[
306
+ ::anno::description("Adjusts the brightness of the metallic ground coat over which the base color coat, the flakes and the clearcoat are applied. Only has an effect, if the Ground Coat Influence is greater than 0.0"),
307
+ ::anno::display_name("Base Coat Brightness"),
308
+ ::anno::in_group("Appearance"),
309
+ ::anno::hard_range(0.f, 1.f),
310
+ ::anno::ui_order(2)
311
+ ]],
312
+ float edge_darkening = 0.96f [[
313
+ ::anno::description("The amount how much colors fade to darker color when looking at the carpaint at grazing angles. Low values make the carpaint look more flat"),
314
+ ::anno::display_name("Edge Darkening"),
315
+ ::anno::in_group("Appearance"),
316
+ ::anno::hard_range(0.f, 1.f),
317
+ ::anno::ui_order(3)
318
+ ]],
319
+ color flakes_tint = color(0.016807f, 0.171441f, 0.417885f) [[
320
+ ::anno::description("The color of the flakes"),
321
+ ::anno::display_name("Flakes Tint"),
322
+ ::anno::in_group("Flakes"),
323
+ ::anno::ui_order(4)
324
+ ]],
325
+ uniform float flakes_density = 0.29f [[
326
+ ::anno::description("Adjusts the density of the flakes. Lower number means less flake particles being applied."),
327
+ ::anno::display_name("Flakes Density"),
328
+ ::anno::in_group("Flakes"),
329
+ ::anno::hard_range(0.f, 1.f),
330
+ ::anno::ui_order(5)
331
+ ]],
332
+ float spread = 0.12f [[
333
+ ::anno::description("The amount how much flakes are pointing to random directions. It is strongly discouraged using a value of 0.0 as the flakes will be oriented exactly as the surface normal, which will result in an unnatural look. Higher values lead to a more scintillating look of the flakes."),
334
+ ::anno::display_name("Flakes Spread"),
335
+ ::anno::enable_if("flakes_density > 0.0f"),
336
+ ::anno::in_group("Flakes"),
337
+ ::anno::hard_range(0.f, 1.f),
338
+ ::anno::ui_order(6)
339
+ ]],
340
+ float flakes_roughness = 0.46f [[
341
+ ::anno::description("The roughness of the flakes itself. Higher values smoothen out the look of the flakes. Depending on the flakes being used in carpaints, use low values for a sparkling flake effect while mica flakes tend to have a higher roughness, leading to a smoother more pearlescent look on the final carpaint"),
342
+ ::anno::display_name("Flakes Roughness"),
343
+ ::anno::enable_if("flakes_density > 0.0f"),
344
+ ::anno::in_group("Flakes"),
345
+ ::anno::hard_range(0.f, 1.f),
346
+ ::anno::ui_order(7)
347
+ ]],
348
+ float flakes_size = 0.1f [[
349
+ ::anno::description("Size of the metal flakes in millimeters."),
350
+ ::anno::display_name("Flakes Size (mm)"),
351
+ ::anno::enable_if("flakes_density > 0.0f"),
352
+ ::anno::soft_range(0.f, 1.f),
353
+ ::anno::in_group("Flakes"),
354
+ ::anno::ui_order(8)
355
+ ]],
356
+ float candy_flip = 0.f [[
357
+ ::anno::description("Changes the tint of the coating to fade towards the flake color to produce a candy paint effect. "),
358
+ ::anno::display_name("Candy Coating"),
359
+ ::anno::in_group("Flakes"),
360
+ ::anno::hard_range(0.f, 1.f),
361
+ ::anno::ui_order(9)
362
+ ]],
363
+ float flake_layer_visibility = 0.f [[
364
+ ::anno::description("Adjusts how much the flakes contribute to the final look. Lowering the value makes the flakes appear more transparent. At value of 0.0 no flakes are not rendered at all"),
365
+ ::anno::display_name("Flakes Visibility"),
366
+ ::anno::enable_if("flakes_density > 0.0f"),
367
+ ::anno::in_group("Flakes"),
368
+ ::anno::hard_range(0.f, 1.f),
369
+ ::anno::ui_order(10)
370
+ ]],
371
+ uniform texture_2d roughness_texture = texture_2d("./textures/smudges_scratches_A_rough.jpg", ::tex::gamma_linear) [[
372
+ ::anno::description("Texture to use for adding variation to the roughness on the clearcoat"),
373
+ ::anno::display_name("Roughness Texture"),
374
+ ::anno::in_group("Clearcoat"),
375
+ ::anno::ui_order(11)
376
+ ]],
377
+ float clearcoat_rough = 0.f [[
378
+ ::anno::description("The roughness of the clearcoat"),
379
+ ::anno::display_name("Clearcoat Roughness"),
380
+ ::anno::in_group("Clearcoat"),
381
+ ::anno::hard_range(0.f, 1.f),
382
+ ::anno::ui_order(12)
383
+ ]],
384
+ float roughness_variation = 0.f [[
385
+ ::anno::description("The amount of variation to apply to the roughness. This parameter only has an effect when the clearcoat roughness is not zero or one"),
386
+ ::anno::display_name("Clearcoat Roughness Variation"),
387
+ ::anno::in_group("Clearcoat"),
388
+ ::anno::hard_range(0.f, 1.f),
389
+ ::anno::ui_order(13)
390
+ ]],
391
+ float clearcoat_ior = 1.600f [[
392
+ ::anno::description("The index of refraction for the clearcoat layer"),
393
+ ::anno::display_name("Clearcoat Index of Refraction"),
394
+ ::anno::in_group("Clearcoat"),
395
+ ::anno::soft_range(1.f, 3.f),
396
+ ::anno::hard_range(1.f, 5.f),
397
+ ::anno::ui_order(14)
398
+ ]],
399
+ float clearcoat_visibility = 1.f [[
400
+ ::anno::description("While the full value is the correct physical behavior of the clearcoat, lowering the value to reduce the amount of reflection for artistic purposes"),
401
+ ::anno::display_name("Clearcoat Visibility"),
402
+ ::anno::in_group("Clearcoat"),
403
+ ::anno::hard_range(0.f, 1.f),
404
+ ::anno::ui_order(15)
405
+ ]],
406
+ uniform float orange_peel_strength = 0.f [[
407
+ ::anno::description("Strength of the bump mapping effect"),
408
+ ::anno::display_name("Coat Orange Peel Strength"),
409
+ ::anno::in_group("Clearcoat"),
410
+ ::anno::soft_range(0.f, 1.f),
411
+ ::anno::hard_range(0.f, 1.f),
412
+ ::anno::ui_order(16)
413
+ ]],
414
+ uniform float orange_peel_size = 1.f [[
415
+ ::anno::description("Size of the biggest feature of the pattern"),
416
+ ::anno::display_name("Coat Orange Peel Size"),
417
+ ::anno::soft_range(0.f, 1.f),
418
+ ::anno::in_group("Clearcoat"),
419
+ ::anno::ui_order(17)
420
+ ]],
421
+ float2 texture_translate = float2(0.f) [[
422
+ ::anno::description("Controls the position of the texture."),
423
+ ::anno::display_name("Texture Translate"),
424
+ ::anno::in_group("Transform"),
425
+ ::anno::ui_order(18)
426
+ ]],
427
+ float texture_rotate = 0.f [[
428
+ ::anno::description("Rotates angle of the texture in degrees."),
429
+ ::anno::display_name("Texture Rotate"),
430
+ ::anno::in_group("Transform"),
431
+ ::anno::soft_range(0.f, 360.f),
432
+ ::anno::ui_order(19)
433
+ ]],
434
+ float2 texture_scale = float2(1.f) [[
435
+ ::anno::description("Larger numbers increase the size."),
436
+ ::anno::display_name("Texture Scale"),
437
+ ::anno::in_group("Transform"),
438
+ ::nvidia::core_definitions::dimension(float2(1.0, 1.0)),
439
+ ::anno::ui_order(20)
440
+ ]],
441
+ uniform bool roundcorners_enable = false [[
442
+ ::anno::description("Enables the round corneer effect. Comes at a slight performance cost as additional raytracing calls are rquired to evaluate the round corner effect"),
443
+ ::anno::display_name("Enable Round Corners"),
444
+ ::anno::in_group("Round Corners"),
445
+ ::anno::ui_order(22)
446
+ ]],
447
+ uniform float roundcorners_radius_mm = 1.5f [[
448
+ ::anno::description("Radius of the rounded corners in millimeters"),
449
+ ::anno::display_name("Round Corner Radius (mm)"),
450
+ ::anno::in_group("Round Corners"),
451
+ ::anno::soft_range(0.f, 10.f),
452
+ ::anno::ui_order(23)
453
+ ]],
454
+ uniform bool roundcorners_across_materials = false [[
455
+ ::anno::description("Applies the round corner effect across different materials when enabled."),
456
+ ::anno::display_name("Across Materials"),
457
+ ::anno::in_group("Round Corners"),
458
+ ::anno::ui_order(27)
459
+ ]],
460
+ uniform int uv_space_index = 0 [[
461
+ ::anno::description("Use selected UV space for material."),
462
+ ::anno::display_name("UV Space Index"),
463
+ ::anno::in_group("Advanced"),
464
+ ::anno::ui_order(28)
465
+ ]]
466
+
467
+
468
+ )
469
+ [[
470
+ ::anno::author("NVIDIA"),
471
+ ::anno::display_name("Carpaint Solid"),
472
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
473
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "clearcoat", "automotive", "design")),
474
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Carpaint_Solid.png"),
475
+ ::anno::copyright_notice(COPYRIGHT)
476
+ ]]
477
+ =
478
+ let {
479
+ bool tmp0 = false;
480
+ // Tried Scaling factors for flakes to fit 1mm size both in Substance Designer and (Iray for) Rhino
481
+ // Rhino scaling factor: 1492.537313432835
482
+ // Substance Designer Scaling factor: 1158.6829010512
483
+ float flakes_size_m = (1492.537313432835f/flakes_size); // Flake scaling adjustment, so that flake size is in mm
484
+ float flake_layer_visibility_m = 1.0f - flake_layer_visibility;
485
+
486
+ ::base::texture_coordinate_info coord_info = ::base::coordinate_source(::base::texture_coordinate_object, 0);
487
+
488
+ float scale_trans = ::state::transform_scale(::state::coordinate_object, ::state::coordinate_world, 1.0f);
489
+
490
+ float3 source_coord = coord_info.position * ::state::meters_per_scene_unit() * scale_trans;
491
+
492
+ ::base::texture_coordinate_info transformed_coord = ::base::transform_coordinate(
493
+ ::base::rotation_translation_scale(float3(0.0f), float3(0.0f), float3(scale_trans)),
494
+ coord_info
495
+ );
496
+
497
+ material_surface tmp1(::df::fresnel_layer(clearcoat_ior, clearcoat_visibility, ::df::simple_glossy_bsdf(histogram_range(::base::file_texture(roughness_texture, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, roughness_variation, clearcoat_rough) * histogram_range(::base::file_texture(roughness_texture, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, roughness_variation, clearcoat_rough), histogram_range(::base::file_texture(roughness_texture, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, roughness_variation, clearcoat_rough) * histogram_range(::base::file_texture(roughness_texture, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, roughness_variation, clearcoat_rough), nvidia::core_definitions::blend_colors(color(1.f, 1.f, 1.f), flakes_tint, ::base::color_layer_blend, candy_flip).tint, nvidia::core_definitions::blend_colors(color(1.f, 1.f, 1.f), flakes_tint, ::base::color_layer_blend, candy_flip).tint, ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::directional_factor(color(1.f, 1.f, 1.f), color(1.f - edge_darkening), 1.f, flakes_density > 0.f ? ::df::weighted_layer(::math::lerp(flake_noise(source_coord * flakes_size_m, 0.5f, 1.f, flakes_density * flakes_density).priority > 0.001f ? 1.0f : 0.0f , 0.f, flake_layer_visibility_m), ::df::microfacet_ggx_smith_bsdf(flakes_roughness * 0.340000004f, flakes_roughness * 0.340000004f, flakes_tint, color(0.f, 0.f, 0.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::directional_factor(base_color, color(1.f - edge_darkening), 1.f, ::df::weighted_layer(ground_coat_influence * 0.5f, ::df::microfacet_ggx_vcavities_bsdf(0.40959999f, 0.40959999f, color(ground_coat_brightness * 0.949999988f + 0.0500000007f), color(ground_coat_brightness * 0.949999988f + 0.0500000007f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::diffuse_reflection_bsdf(base_color, 0.f), ::state::normal())), float3(flake_normal(flake_noise(source_coord * flakes_size_m, 0.5f, 1.f, flakes_density * flakes_density ), spread).carrier.x, flake_normal(flake_noise(source_coord * flakes_size_m, 0.5f, 1.f, flakes_density * flakes_density ), spread).carrier.y, flake_normal(flake_noise(source_coord * flakes_size_m, 0.5f, 1.f, flakes_density * flakes_density ), spread).carrier.z)) : ::df::directional_factor(base_color, color(1.f - edge_darkening), 1.f, ::df::weighted_layer(ground_coat_influence * 0.5f, ::df::microfacet_ggx_vcavities_bsdf(0.40959999f, 0.40959999f, color(ground_coat_brightness * 0.949999988f + 0.0500000007f), color(ground_coat_brightness * 0.949999988f + 0.0500000007f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::diffuse_reflection_bsdf(base_color, 0.f), ::state::normal()))), orange_peel_strength > 0.f ? ::base::perlin_noise_bump_texture(transformed_coord, orange_peel_strength, orange_peel_size, false, false, 0.f, 2, false, false, float3(0.f), 1.f, 0.f, 1.f, ::state::normal()) : ::state::normal()), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
498
+ material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
499
+ color tmp3 = color(1.f, 1.f, 1.f);
500
+ material_volume tmp4 = material_volume(scattering: vdf(), absorption_coefficient: color(0.f, 0.f, 0.f), scattering_coefficient: color(0.f, 0.f, 0.f));
501
+ material_geometry tmp5(float3(0.f), 1.f, roundcorners_enable ? ::state::rounded_corner_normal(roundcorners_radius_mm * 0.00100000005f, roundcorners_across_materials, 1.f) : ::state::normal());
502
+ hair_bsdf tmp6 = hair_bsdf();
503
+ } in
504
+ material(
505
+ thin_walled: tmp0,
506
+ surface: tmp1,
507
+ backface: tmp2,
508
+ ior: tmp3,
509
+ volume: tmp4,
510
+ geometry: tmp5,
511
+ hair: tmp6);
512
+
513
+
514
+ // ------------------- 2 (Plain White) -------------------
515
+ export material White(*)
516
+ [[
517
+ ::anno::author("NVIDIA"),
518
+ ::anno::display_name("Carpaint Solid - White"),
519
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
520
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "white", "light", "neutral")),
521
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.White.png"),
522
+ ::anno::copyright_notice(COPYRIGHT)
523
+ ]]
524
+ = Carpaint_Solid(
525
+ base_color: color(0.768151f, 0.768151f, 0.768151f),
526
+ ground_coat_influence: 0.0f,
527
+ ground_coat_brightness: 0.24f,
528
+ edge_darkening: 0.56f,
529
+ flakes_tint: color(0.552011f, 0.552011f, 0.552011f),
530
+ flakes_density: 0.0f,
531
+ spread: 0.47f,
532
+ flakes_roughness: 0.34f,
533
+ flakes_size: 0.5f,
534
+ candy_flip: 0.0f,
535
+ flake_layer_visibility: 1.0f,
536
+ // roughness_texture:
537
+ clearcoat_rough: 0.05f,
538
+ roughness_variation: 0.34f,
539
+ clearcoat_ior: 1.6f,
540
+ clearcoat_visibility: 1.0f,
541
+ orange_peel_strength: 0.0f,
542
+ orange_peel_size: 0.01f
543
+ );
544
+
545
+ // ------------------- 3 (vintage White) -------------------
546
+ export material Vintage_White(*)
547
+ [[
548
+ ::anno::author("NVIDIA"),
549
+ ::anno::display_name("Carpaint Solid - Vintage White"),
550
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
551
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "vintage", "white", "light", "neutral")),
552
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Vintage_White.png"),
553
+ ::anno::copyright_notice(COPYRIGHT)
554
+ ]]
555
+ = Carpaint_Solid(
556
+ base_color: color(0.672443f, 0.630757f, 0.502886f),
557
+ ground_coat_influence: 0.0f,
558
+ ground_coat_brightness: 0.24f,
559
+ edge_darkening: 0.28f,
560
+ flakes_tint: color(0.603827f, 0.665387f, 0.693872f),
561
+ flakes_density: 0.0f,
562
+ spread: 0.41f,
563
+ flakes_roughness: 0.32f,
564
+ flakes_size: 0.5f,
565
+ candy_flip: 0.0f,
566
+ flake_layer_visibility: 0.0f,
567
+ // roughness_texture:
568
+ clearcoat_rough: 0.05f,
569
+ roughness_variation: 0.34f,
570
+ clearcoat_ior: 1.6f,
571
+ clearcoat_visibility: 1.0f,
572
+ orange_peel_strength: 0.06f,
573
+ orange_peel_size: 0.01f
574
+ );
575
+
576
+
577
+ // ------------------- 4 (Black) -------------------
578
+ export material Black(*)
579
+ [[
580
+ ::anno::author("NVIDIA"),
581
+ ::anno::display_name("Carpaint Solid - Black"),
582
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
583
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "black", "dark", "neutral")),
584
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Black.png"),
585
+ ::anno::copyright_notice(COPYRIGHT)
586
+ ]]
587
+ = Carpaint_Solid(
588
+ base_color: color(0.006049f, 0.006049f, 0.006049f),
589
+ ground_coat_influence: 0.97f,
590
+ ground_coat_brightness: 0.17f,
591
+ edge_darkening: 0.57f,
592
+ flakes_tint: color(0.552011f, 0.552011f, 0.552011f),
593
+ flakes_density: 0.0f,
594
+ spread: 0.47f,
595
+ flakes_roughness: 0.34f,
596
+ flakes_size: 0.5f,
597
+ candy_flip: 0.0f,
598
+ flake_layer_visibility: 0.0f,
599
+ // roughness_texture:
600
+ clearcoat_rough: 0.05f,
601
+ roughness_variation: 0.36f,
602
+ clearcoat_ior: 1.6f,
603
+ clearcoat_visibility: 1.0f,
604
+ orange_peel_strength: 0.0f,
605
+ orange_peel_size: 0.01f
606
+ );
607
+
608
+ // ------------------- 5 (Black Matte) -------------------
609
+ export material Black_Matte(*)
610
+ [[
611
+ ::anno::author("NVIDIA"),
612
+ ::anno::display_name("Carpaint Solid - Black Matte"),
613
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
614
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "black", "dark", "neutral")),
615
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Black_Matte.png"),
616
+ ::anno::copyright_notice(COPYRIGHT)
617
+ ]]
618
+ = Carpaint_Solid(
619
+ base_color: color(0.006995f, 0.006995f, 0.006995f),
620
+ ground_coat_influence: 0.11f,
621
+ ground_coat_brightness: 0.64f,
622
+ edge_darkening: 0.0f,
623
+ flakes_tint: color(0.577580f, 0.577580f, 0.577580f),
624
+ flakes_density: 0.12f,
625
+ spread: 0.39f,
626
+ flakes_roughness: 0.5f,
627
+ flakes_size: 0.5f,
628
+ candy_flip: 0.0f,
629
+ flake_layer_visibility: 0.0f,
630
+ // roughness_texture:
631
+ clearcoat_rough: 0.48f,
632
+ roughness_variation: 0.14f,
633
+ clearcoat_ior: 1.6f,
634
+ clearcoat_visibility: 1.0f,
635
+ orange_peel_strength: 0.0f,
636
+ orange_peel_size: 0.01f
637
+ );
638
+
639
+ // ------------------- 6 -------------------
640
+ export material Agent_Gray(*)
641
+ [[
642
+ ::anno::author("NVIDIA"),
643
+ ::anno::display_name("Carpaint Solid - Agent Gray"),
644
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
645
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "gray", "neutral")),
646
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Agent_Gray.png"),
647
+ ::anno::copyright_notice(COPYRIGHT)
648
+ ]]
649
+ = Carpaint_Solid(
650
+ base_color: color(0.234551f, 0.254152f, 0.234551f),
651
+ ground_coat_influence: 0.11f,
652
+ ground_coat_brightness: 0.64f,
653
+ edge_darkening: 0.0f,
654
+ flakes_tint: color(0.644480f, 0.701102f, 0.644480f),
655
+ flakes_density: 0.2f,
656
+ spread: 0.25f,
657
+ flakes_roughness: 0.5f,
658
+ flakes_size: 0.5f,
659
+ candy_flip: 0.0f,
660
+ flake_layer_visibility: 0.0f,
661
+ // roughness_texture:
662
+ clearcoat_rough: 0.06f,
663
+ roughness_variation: 0.36f,
664
+ clearcoat_ior: 1.6f,
665
+ clearcoat_visibility: 1.0f,
666
+ orange_peel_strength: 0.0f,
667
+ orange_peel_size: 0.01f
668
+ );
669
+
670
+
671
+ // ------------------- 7 (Agent Gray Matte)-------------------
672
+ export material Agent_Gray_Matte(*)
673
+ [[
674
+ ::anno::author("NVIDIA"),
675
+ ::anno::display_name("Carpaint Solid - Agent Gray Matte"),
676
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
677
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "matte", "gray", "neutral")),
678
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Agent_Gray_Matte.png"),
679
+ ::anno::copyright_notice(COPYRIGHT)
680
+ ]]
681
+ = Carpaint_Solid(
682
+ base_color: color(0.234551f, 0.254152f, 0.234551f),
683
+ ground_coat_influence: 0.11f,
684
+ ground_coat_brightness: 0.64f,
685
+ edge_darkening: 0.0f,
686
+ flakes_tint: color(0.644480f, 0.701102f, 0.644480f),
687
+ flakes_density: 0.21f,
688
+ spread: 0.25f,
689
+ flakes_roughness: 0.5f,
690
+ flakes_size: 0.5f,
691
+ candy_flip: 0.0f,
692
+ flake_layer_visibility: 0.0f,
693
+ // roughness_texture:
694
+ clearcoat_rough: 0.4f,
695
+ roughness_variation: 0.14f,
696
+ clearcoat_ior: 1.6f,
697
+ clearcoat_visibility: 1.0f,
698
+ orange_peel_strength: 0.0f,
699
+ orange_peel_size: 0.01f
700
+ );
701
+
702
+ // ------------------- 8 (Blood Red)-------------------
703
+ export material Blood_Red(*)
704
+ [[
705
+ ::anno::author("NVIDIA"),
706
+ ::anno::display_name("Carpaint Solid - Blood Red"),
707
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
708
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "red", "warm", "saturated")),
709
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Blood_Red.png"),
710
+ ::anno::copyright_notice(COPYRIGHT)
711
+ ]]
712
+ = Carpaint_Solid(
713
+ base_color: color(0.462077f, 0.022174f, 0.015209f),
714
+ ground_coat_influence: 0.03f,
715
+ ground_coat_brightness: 0.24f,
716
+ edge_darkening: 0.56f,
717
+ flakes_tint: color(0.552011f, 0.552011f, 0.552011f),
718
+ flakes_density: 0.0f,
719
+ spread: 0.47f,
720
+ flakes_roughness: 0.34f,
721
+ flakes_size: 0.5f,
722
+ candy_flip: 0.0f,
723
+ flake_layer_visibility: 0.0f,
724
+ // roughness_texture:
725
+ clearcoat_rough: 0.05f,
726
+ roughness_variation: 0.36f,
727
+ clearcoat_ior: 1.6f,
728
+ clearcoat_visibility: 1.0f,
729
+ orange_peel_strength: 0.0f,
730
+ orange_peel_size: 0.01f
731
+ );
732
+
733
+ // ------------------- 9 (Tarreri Red)-------------------
734
+ export material Tarreri_Red(*)
735
+ [[
736
+ ::anno::author("NVIDIA"),
737
+ ::anno::display_name("Carpaint Solid - Tarreri Red"),
738
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
739
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "red", "warm", "saturated")),
740
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Tarreri_Red.png"),
741
+ ::anno::copyright_notice(COPYRIGHT)
742
+ ]]
743
+ = Carpaint_Solid(
744
+ base_color: color(0.672443f, 0.038204f, 0.026241f),
745
+ ground_coat_influence: 0.03f,
746
+ ground_coat_brightness: 0.24f,
747
+ edge_darkening: 0.56f,
748
+ flakes_tint: color(0.672443f, 0.095307f, 0.078187f),
749
+ flakes_density: 0.0f,
750
+ spread: 0.47f,
751
+ flakes_roughness: 0.34f,
752
+ flakes_size: 0.5f,
753
+ candy_flip: 0.0f,
754
+ flake_layer_visibility: 0.0f,
755
+ // roughness_texture:
756
+ clearcoat_rough: 0.05f,
757
+ roughness_variation: 0.36f,
758
+ clearcoat_ior: 1.6f,
759
+ clearcoat_visibility: 1.0f,
760
+ orange_peel_strength: 0.0f,
761
+ orange_peel_size: 0.01f
762
+ );
763
+
764
+
765
+ // ------------------- 10 (Dark Decent Red)-------------------
766
+ export material Dark_Decent_Red(*)
767
+ [[
768
+ ::anno::author("NVIDIA"),
769
+ ::anno::display_name("Carpaint Solid - Dark Decent Red"),
770
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
771
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "red", "warm", "dark")),
772
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Dark_Decent_Red.png"),
773
+ ::anno::copyright_notice(COPYRIGHT)
774
+ ]]
775
+ = Carpaint_Solid(
776
+ base_color: color(0.135633f, 0.012983f, 0.027321f),
777
+ ground_coat_influence: 0.19f,
778
+ ground_coat_brightness: 0.24f,
779
+ edge_darkening: 0.1f,
780
+ flakes_tint: color(0.135633f, 0.012983f, 0.027321f),
781
+ flakes_density: 0.0f,
782
+ spread: 0.38f,
783
+ flakes_roughness: 0.18f,
784
+ flakes_size: 0.5f,
785
+ candy_flip: 0.0f,
786
+ flake_layer_visibility: 0.0f,
787
+ // roughness_texture:
788
+ clearcoat_rough: 0.05f,
789
+ roughness_variation: 0.36f,
790
+ clearcoat_ior: 1.6f,
791
+ clearcoat_visibility: 1.0f,
792
+ orange_peel_strength: 0.0f,
793
+ orange_peel_size: 0.01f
794
+ );
795
+
796
+ // ------------------- 11 (Vintage Maroon)-------------------
797
+ export material Vintage_Maroon(*)
798
+ [[
799
+ ::anno::author("NVIDIA"),
800
+ ::anno::display_name("Carpaint Solid - Vintage Maroon"),
801
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
802
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "dark", "brown", "red")),
803
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Vintage_Maroon.png"),
804
+ ::anno::copyright_notice(COPYRIGHT)
805
+ ]]
806
+ = Carpaint_Solid(
807
+ base_color: color(0.283149f, 0.054480f, 0.063010f),
808
+ ground_coat_influence: 0.19f,
809
+ ground_coat_brightness: 0.24f,
810
+ edge_darkening: 0.1f,
811
+ flakes_tint: color(0.283149f, 0.054480f, 0.063010f),
812
+ flakes_density: 0.0f,
813
+ spread: 0.38f,
814
+ flakes_roughness: 0.3f,
815
+ flakes_size: 0.5f,
816
+ candy_flip: 0.0f,
817
+ flake_layer_visibility: 0.0f,
818
+ // roughness_texture:
819
+ clearcoat_rough: 0.05f,
820
+ roughness_variation: 0.36f,
821
+ clearcoat_ior: 1.6f,
822
+ clearcoat_visibility: 1.0f,
823
+ orange_peel_strength: 0.0f,
824
+ orange_peel_size: 0.01f
825
+ );
826
+
827
+ // ------------------- 12 -------------------
828
+ export material Orange(*)
829
+ [[
830
+ ::anno::author("NVIDIA"),
831
+ ::anno::display_name("Carpaint Solid - Orange"),
832
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
833
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "orange", "warm", "saturated")),
834
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Orange.png"),
835
+ ::anno::copyright_notice(COPYRIGHT)
836
+ ]]
837
+ = Carpaint_Solid(
838
+ base_color: color(0.623960f, 0.262251f, 0.022174f),
839
+ ground_coat_influence: 0.11f,
840
+ ground_coat_brightness: 0.64f,
841
+ edge_darkening: 0.0f,
842
+ flakes_tint: color(0.017642f, 0.262251f, 0.623960f),
843
+ flakes_density: 0.59f,
844
+ spread: 0.25f,
845
+ flakes_roughness: 0.5f,
846
+ flakes_size: 0.5f,
847
+ candy_flip: 0.0f,
848
+ flake_layer_visibility: 0.0f,
849
+ // roughness_texture:
850
+ clearcoat_rough: 0.06f,
851
+ roughness_variation: 0.36f,
852
+ clearcoat_ior: 1.6f,
853
+ clearcoat_visibility: 1.0f,
854
+ orange_peel_strength: 0.0f,
855
+ orange_peel_size: 0.01f
856
+ );
857
+
858
+
859
+ // ------------------- 13 (Brown Matte) -------------------
860
+ export material Brown_Matte(*)
861
+ [[
862
+ ::anno::author("NVIDIA"),
863
+ ::anno::display_name("Carpaint Solid - Brown Matte"),
864
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
865
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "brown", "matte")),
866
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Brown_Matte.png"),
867
+ ::anno::copyright_notice(COPYRIGHT)
868
+ ]]
869
+ = Carpaint_Solid(
870
+ base_color: color(0.300544f, 0.250158f, 0.187821f),
871
+ ground_coat_influence: 0.11f,
872
+ ground_coat_brightness: 0.64f,
873
+ edge_darkening: 0.0f,
874
+ flakes_tint: color(0.300544f, 0.250158f, 0.187821f),
875
+ flakes_density: 0.0f,
876
+ spread: 0.39f,
877
+ flakes_roughness: 0.5f,
878
+ flakes_size: 0.5f,
879
+ candy_flip: 0.0f,
880
+ flake_layer_visibility: 0.0f,
881
+ // roughness_texture:
882
+ clearcoat_rough: 0.5f,
883
+ roughness_variation: 0.14f,
884
+ clearcoat_ior: 1.6f,
885
+ clearcoat_visibility: 1.0f,
886
+ orange_peel_strength: 0.0f,
887
+ orange_peel_size: 0.01f
888
+ );
889
+
890
+
891
+ // ------------------- 14 (Bumblebee) -------------------
892
+ export material Bumblebee(*)
893
+ [[
894
+ ::anno::author("NVIDIA"),
895
+ ::anno::display_name("Carpaint Solid - Bumblebee"),
896
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
897
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "yellow", "warm", "light", "saturated")),
898
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Bumblebee.png"),
899
+ ::anno::copyright_notice(COPYRIGHT)
900
+ ]]
901
+ = Carpaint_Solid(
902
+ base_color: color(0.775822f, 0.564712f, 0.030713f),
903
+ ground_coat_influence: 0.09f,
904
+ ground_coat_brightness: 0.64f,
905
+ edge_darkening: 0.1f,
906
+ flakes_tint: color(1.000000f, 0.479320f, 0.095307f),
907
+ flakes_density: 0.0f,
908
+ spread: 0.54f,
909
+ flakes_roughness: 0.37f,
910
+ flakes_size: 0.5f,
911
+ candy_flip: 0.0f,
912
+ flake_layer_visibility: 0.0f,
913
+ // roughness_texture:
914
+ clearcoat_rough: 0.06f,
915
+ roughness_variation: 0.14f,
916
+ clearcoat_ior: 1.6f,
917
+ clearcoat_visibility: 1.0f,
918
+ orange_peel_strength: 0.0f,
919
+ orange_peel_size: 0.01f
920
+ );
921
+
922
+
923
+ // ------------------- 15 (Wasp) -------------------
924
+ export material Wasp(*)
925
+ [[
926
+ ::anno::author("NVIDIA"),
927
+ ::anno::display_name("Carpaint Solid - Wasp"),
928
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
929
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "yellow", "warm", "light", "saturated")),
930
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Wasp.png"),
931
+ ::anno::copyright_notice(COPYRIGHT)
932
+ ]]
933
+ = Carpaint_Solid(
934
+ base_color: color(0.701102f, 0.603827f, 0.022174f),
935
+ ground_coat_influence: 0.0f,
936
+ ground_coat_brightness: 0.5f,
937
+ edge_darkening: 0.12f,
938
+ flakes_tint: color(1.000000f, 0.479320f, 0.076185f),
939
+ flakes_density: 0.0f,
940
+ spread: 0.54f,
941
+ flakes_roughness: 0.37f,
942
+ flakes_size: 0.5f,
943
+ candy_flip: 0.0f,
944
+ flake_layer_visibility: 0.0f,
945
+ // roughness_texture:
946
+ clearcoat_rough: 0.06f,
947
+ roughness_variation: 0.14f,
948
+ clearcoat_ior: 1.6f,
949
+ clearcoat_visibility: 1.0f,
950
+ orange_peel_strength: 0.0f,
951
+ orange_peel_size: 0.01f
952
+ );
953
+
954
+ // ------------------- 16 (Feline Dark Green)-------------------
955
+ export material Feline_Dark_Green(*)
956
+ [[
957
+ ::anno::author("NVIDIA"),
958
+ ::anno::display_name("Carpaint Solid - Feline Dark Green"),
959
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
960
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "green", "dark")),
961
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Feline_Dark_Green.png"),
962
+ ::anno::copyright_notice(COPYRIGHT)
963
+ ]]
964
+ = Carpaint_Solid(
965
+ base_color: color(0.010330f, 0.099899f, 0.043735f),
966
+ ground_coat_influence: 0.19f,
967
+ ground_coat_brightness: 0.24f,
968
+ edge_darkening: 0.1f,
969
+ flakes_tint: color(0.010330f, 0.099899f, 0.043735f),
970
+ flakes_density: 0.0f,
971
+ spread: 0.38f,
972
+ flakes_roughness: 0.3f,
973
+ flakes_size: 0.5f,
974
+ candy_flip: 0.0f,
975
+ flake_layer_visibility: 0.0f,
976
+ // roughness_texture:
977
+ clearcoat_rough: 0.05f,
978
+ roughness_variation: 0.36f,
979
+ clearcoat_ior: 1.6f,
980
+ clearcoat_visibility: 1.0f,
981
+ orange_peel_strength: 0.0f,
982
+ orange_peel_size: 0.01f
983
+ );
984
+
985
+
986
+ // ------------------- 17 (Hunting Green Matte) -------------------
987
+ export material Hunting_Green_Matte(*)
988
+ [[
989
+ ::anno::author("NVIDIA"),
990
+ ::anno::display_name("Carpaint Solid - Hunting Green Matte"),
991
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
992
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "green", "dark", "matte")),
993
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Hunting_Green_Matte.png"),
994
+ ::anno::copyright_notice(COPYRIGHT)
995
+ ]]
996
+ = Carpaint_Solid(
997
+ base_color: color(0.162029f, 0.187821f, 0.114435f),
998
+ ground_coat_influence: 0.11f,
999
+ ground_coat_brightness: 0.64f,
1000
+ edge_darkening: 0.0f,
1001
+ flakes_tint: color(0.318547f, 0.456411f, 0.127438f),
1002
+ flakes_density: 0.0f,
1003
+ spread: 0.3f,
1004
+ flakes_roughness: 0.5f,
1005
+ flakes_size: 0.5f,
1006
+ candy_flip: 0.0f,
1007
+ flake_layer_visibility: 0.0f,
1008
+ // roughness_texture:
1009
+ clearcoat_rough: 0.4f,
1010
+ roughness_variation: 0.14f,
1011
+ clearcoat_ior: 1.6f,
1012
+ clearcoat_visibility: 1.0f,
1013
+ orange_peel_strength: 0.0f,
1014
+ orange_peel_size: 0.01f
1015
+ );
1016
+
1017
+
1018
+ // ------------------- 18 (Vintage Sky Blue) -------------------
1019
+ export material Vintage_Sky_Blue(*)
1020
+ [[
1021
+ ::anno::author("NVIDIA"),
1022
+ ::anno::display_name("Carpaint Solid - Vintage Sky Blue"),
1023
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
1024
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "blue", "light", "cool")),
1025
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Vintage_Sky_Blue.png"),
1026
+ ::anno::copyright_notice(COPYRIGHT)
1027
+ ]]
1028
+ = Carpaint_Solid(
1029
+ base_color: color(0.318547f, 0.564712f, 0.603827f),
1030
+ ground_coat_influence: 0.06f,
1031
+ ground_coat_brightness: 0.24f,
1032
+ edge_darkening: 0.0f,
1033
+ flakes_tint: color(0.603827f, 127.338437f, 0.693872f),
1034
+ flakes_density: 0.0f,
1035
+ spread: 0.41f,
1036
+ flakes_roughness: 0.32f,
1037
+ flakes_size: 0.5f,
1038
+ candy_flip: 0.0f,
1039
+ flake_layer_visibility: 0.0f,
1040
+ // roughness_texture:
1041
+ clearcoat_rough: 0.06f,
1042
+ roughness_variation: 0.34f,
1043
+ clearcoat_ior: 1.6f,
1044
+ clearcoat_visibility: 1.0f,
1045
+ orange_peel_strength: 0.06f,
1046
+ orange_peel_size: 0.01f
1047
+ );
1048
+
1049
+
1050
+ // ------------------- 19 (Blue)-------------------
1051
+ export material Blue(*)
1052
+ [[
1053
+ ::anno::author("NVIDIA"),
1054
+ ::anno::display_name("Carpaint Solid - Blue"),
1055
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
1056
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "blue", "cool", "saturated")),
1057
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Blue.png"),
1058
+ ::anno::copyright_notice(COPYRIGHT)
1059
+ ]]
1060
+ = Carpaint_Solid(
1061
+ base_color: color(0.012983f, 0.296138f, 0.462077f),
1062
+ ground_coat_influence: 0.00f,
1063
+ ground_coat_brightness: 0.24f,
1064
+ edge_darkening: 0.0f,
1065
+ flakes_tint: color(0.012983f, 0.234551f, 0.665387f),
1066
+ flakes_density: 0.5f,
1067
+ spread: 0.47f,
1068
+ flakes_roughness: 0.34f,
1069
+ flakes_size: 0.5f,
1070
+ candy_flip: 0.0f,
1071
+ flake_layer_visibility: 0.0f,
1072
+ // roughness_texture:
1073
+ clearcoat_rough: 0.06f,
1074
+ roughness_variation: 0.36f,
1075
+ clearcoat_ior: 1.6f,
1076
+ clearcoat_visibility: 1.0f,
1077
+ orange_peel_strength: 0.0f,
1078
+ orange_peel_size: 0.01f
1079
+ );
1080
+
1081
+
1082
+
1083
+ // ------------------- 20 (Dark Decent Blue) -------------------
1084
+ export material Dark_Decent_Blue(*)
1085
+ [[
1086
+ ::anno::author("NVIDIA"),
1087
+ ::anno::display_name("Carpaint Solid - Dark Decent Blue"),
1088
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
1089
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "blue", "cool", "dark")),
1090
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Dark_Decent_Blue.png"),
1091
+ ::anno::copyright_notice(COPYRIGHT)
1092
+ ]]
1093
+ = Carpaint_Solid(
1094
+ base_color: color(0.013702f, 0.046665f, 0.147027f),
1095
+ ground_coat_influence: 0.19f,
1096
+ ground_coat_brightness: 0.24f,
1097
+ edge_darkening: 0.1f,
1098
+ flakes_tint: color(0.012983f, 0.234551f, 0.665387f),
1099
+ flakes_density: 0.5f,
1100
+ spread: 0.25f,
1101
+ flakes_roughness: 0.34f,
1102
+ flakes_size: 0.5f,
1103
+ candy_flip: 0.0f,
1104
+ flake_layer_visibility: 0.0f,
1105
+ // roughness_texture:
1106
+ clearcoat_rough: 0.06f,
1107
+ roughness_variation: 0.36f,
1108
+ clearcoat_ior: 1.6f,
1109
+ clearcoat_visibility: 1.0f,
1110
+ orange_peel_strength: 0.0f,
1111
+ orange_peel_size: 0.01f
1112
+ );
objects/table_black/materials/remote/omniverse-content-production.s3.us-west-2.amazonaws.com/Materials/2023_1/vMaterials_2/Plastic/Plastic_Thick_Translucent.mdl ADDED
@@ -0,0 +1,673 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*****************************************************************************
2
+ * Copyright 2023 NVIDIA Corporation. All rights reserved.
3
+ ******************************************************************************
4
+
5
+ MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,
6
+ WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,
7
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
8
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
9
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
10
+ COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA
11
+ CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
12
+ ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
13
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
14
+ THE USE OR INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN
15
+ THE MDL MATERIALS.
16
+ */
17
+
18
+
19
+ // This file contains samples of very fast rendering SSS plastics for iray
20
+ //
21
+
22
+ mdl 1.4;
23
+ import ::df::*;
24
+ import ::math::*;
25
+ import ::anno::*;
26
+
27
+
28
+ const string COPYRIGHT =
29
+ " Copyright 2023 NVIDIA Corporation. All rights reserved.\n"
30
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
31
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
32
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
33
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
34
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
35
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
36
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
37
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
38
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
39
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
40
+
41
+
42
+
43
+ // Template for absorption and scattering, do not use directly
44
+ material volume_absorption(
45
+ color absorption = color(0.8665f, 0.7769f, 0.1559f),
46
+ color scattering = color(.5f),
47
+ float distance_scale = .03f,
48
+ float directional_bias = 0.0f,
49
+ uniform float ior = 1.2f
50
+
51
+ )
52
+ [[
53
+ ::anno::author("NVIDIA ARC"),
54
+ ::anno::display_name("Volume Absorption"),
55
+ ::anno::description("Pure volume absorption material"),
56
+ ::anno::author("NVIDIA"),
57
+ ::anno::copyright_notice(COPYRIGHT),
58
+ ::anno::hidden()
59
+
60
+ ]] = material (
61
+ ior: color(ior),
62
+ surface: material_surface (
63
+ scattering: ::df::specular_bsdf (
64
+ tint: color (1.0f, 1.0f, 1.0f),
65
+ mode: ::df::scatter_reflect_transmit
66
+ )
67
+ ),
68
+ volume: material_volume (
69
+ scattering: ::df::anisotropic_vdf(
70
+ directional_bias: directional_bias
71
+ ),
72
+ absorption_coefficient: (distance_scale <= 0)? color(0): ::math::log(absorption) / -distance_scale,
73
+ scattering_coefficient: (distance_scale <= 0)? color(0): ::math::log(scattering) / -distance_scale
74
+ )
75
+ );
76
+
77
+ // plastic_full_weighted_mix
78
+ // Plastic material using diffuse reflection, diffuse transmission
79
+ // and SSS. Due to the diffuse transmission the volume absorption will
80
+ // render faster and converge smoother than when using specular transmission.
81
+ export material Plastic_Thick_Translucent(
82
+ color diffuse_color = color(0.6940f, 0.5831f, 0.0493f)
83
+ [[
84
+ ::anno::display_name("Diffuse Color"),
85
+ ::anno::description("The diffuse color of the plastic material"),
86
+ ::anno::in_group("Appearance")
87
+ ]],
88
+ float diffuse_weight = 0.3f
89
+ [[
90
+ ::anno::display_name("Diffuse Weight"),
91
+ ::anno::description("The weight of the diffuse color of the plastic material. It is recommended to keep "
92
+ "the value around 0.5, lower values make the material appear more transparent while higher values make "
93
+ "it more opaque."),
94
+ ::anno::in_group("Appearance"),
95
+ ::anno::hard_range(0.f, 1.f)
96
+ ]],
97
+ color absorption = color(0.8665f, 0.7769f, 0.1559f)
98
+ [[
99
+ ::anno::display_name("Absorption Color"),
100
+ ::anno::description("Sets the absorption color (this is color when light goes extinct)of the plastic material"),
101
+ ::anno::in_group("Appearance")
102
+ ]],
103
+ color scattering = color(.5f)
104
+ [[
105
+ ::anno::display_name("Scattering Color"),
106
+ ::anno::description("Sets the absorption color (this is color when light goes extinct)of the plastic material"),
107
+ ::anno::in_group("Appearance")
108
+ ]],
109
+ float distance_scale = 1.5f
110
+ [[
111
+ ::anno::display_name("Distance Scale"),
112
+ ::anno::description("Scales how quickly light is absorbed. Set this value low enough to see "
113
+ "some light extinction taking place. Tip: Set 'diffuse_weight' to 0.0 while adjusting this "
114
+ "material parameter for your scene"),
115
+ ::anno::in_group("Appearance")
116
+ ]],
117
+
118
+ color diffuse_transmission_tint = color(1.0000f, 0.7249f, 0.1972f)
119
+ [[
120
+ ::anno::display_name("Diffuse Transmission Color"),
121
+ ::anno::description("The tinting of light scattering through the plastic material"),
122
+ ::anno::in_group("Appearance")
123
+ ]],
124
+
125
+ float reflection_roughness = 0.0f
126
+ [[
127
+ ::anno::display_name("Roughness"),
128
+ ::anno::description("The roughness of the reflection on the plastic"),
129
+ ::anno::in_group("Appearance"),
130
+ ::anno::hard_range(0.f, 1.f)
131
+ ]]
132
+ )
133
+ [[
134
+ ::anno::author("NVIDIA ARC"),
135
+ ::anno::display_name("Plastic Full Control"),
136
+ ::anno::description("Plastic Material finegrained controls of its appearance"),
137
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.Plastic_Thick_Translucent.png"),
138
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny")),
139
+ ::anno::copyright_notice(COPYRIGHT),
140
+ ::anno::hidden()
141
+ ]] = let {
142
+ float reflection_weight = 1.0f;
143
+ float normal_reflectivity = 0.04f;
144
+ float grazing_reflectivity = 1.0f;
145
+ float reflectivity_exponent = 5.0f;
146
+ uniform float ior = 1.4f;
147
+
148
+ material plastic = volume_absorption(
149
+ absorption: absorption,
150
+ scattering: scattering,
151
+ distance_scale: distance_scale,
152
+ ior: ior
153
+ );
154
+
155
+ bsdf transdiff = ::df::diffuse_transmission_bsdf(
156
+ tint: diffuse_transmission_tint
157
+ );
158
+
159
+ bsdf diffuse = ::df::diffuse_reflection_bsdf(
160
+ tint: diffuse_color
161
+ );
162
+
163
+ bsdf diffuse_mix_layer = ::df::weighted_layer(
164
+ base: transdiff,
165
+ layer: diffuse,
166
+ weight: diffuse_weight
167
+
168
+ );
169
+
170
+ bsdf glossy_reflection = ::df::simple_glossy_bsdf(
171
+ tint: color(1.0f),
172
+ roughness_u: reflection_roughness,
173
+ mode: ::df::scatter_reflect
174
+ );
175
+
176
+ bsdf final_layer = ::df::custom_curve_layer(
177
+ normal_reflectivity: normal_reflectivity,
178
+ grazing_reflectivity: grazing_reflectivity,
179
+ layer: glossy_reflection,
180
+ base: diffuse_mix_layer,
181
+ weight: reflection_weight,
182
+ exponent: reflectivity_exponent
183
+ );
184
+
185
+ } in material (
186
+ surface: material_surface(
187
+ scattering: final_layer
188
+ ),
189
+
190
+ volume: plastic.volume
191
+ );
192
+
193
+
194
+ export material plastic_simple_controls(
195
+ color diffuse_color = color(0.6940f, 0.5831f, 0.0493f)
196
+ [[
197
+ ::anno::display_name("Diffuse Color"),
198
+ ::anno::description("The diffuse color of the plastic material"),
199
+ ::anno::in_group("Appearance")
200
+ ]],
201
+ float diffuse_weight = 0.5f
202
+ [[
203
+ ::anno::display_name("Diffuse Weight"),
204
+ ::anno::description("The weight of the diffuse color of the plastic material. It is recommended to keep "
205
+ "the value around 0.5, lower values make the material appear more transparent while higher values make "
206
+ "it more opaque."),
207
+ ::anno::in_group("Appearance"),
208
+ ::anno::hard_range(0.f, 1.f)
209
+ ]],
210
+ color transmissive_color = color(0.8665f, 0.7769f, 0.1559f)
211
+ [[
212
+ ::anno::display_name("Transmissive Color"),
213
+ ::anno::description("The tinting of light scattering through the plastic material"),
214
+ ::anno::in_group("Appearance")
215
+ ]],
216
+ float reflection_roughness = 0.0f
217
+ [[
218
+ ::anno::display_name("Roughness"),
219
+ ::anno::description("The roughness of the reflection on the plastic"),
220
+ ::anno::in_group("Appearance"),
221
+ ::anno::hard_range(0.f, 1.f)
222
+ ]],
223
+ float distance_scale = 0.005f
224
+ [[
225
+ ::anno::display_name("Distance Scale"),
226
+ ::anno::description("Scales how quickly light is absorbed. Set this value low enough to see "
227
+ "some light extinction taking place. Tip: Set 'diffuse_weight' to 0.0 while adjusting this "
228
+ "material parameter for your scene"),
229
+ ::anno::in_group("Appearance")
230
+ ]]
231
+
232
+ )
233
+ [[
234
+ ::anno::author("NVIDIA ARC"),
235
+ ::anno::display_name("Plastic"),
236
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
237
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
238
+ "(which can be verified by setting 'Diffuse Weight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
239
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny")),
240
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_simple_controls.png"),
241
+ ::anno::copyright_notice(COPYRIGHT),
242
+ ::anno::hidden()
243
+ ]] = Plastic_Thick_Translucent(
244
+ absorption: ::math::pow(transmissive_color, 0.2f),
245
+ scattering: color(0.5f),
246
+ distance_scale: distance_scale,
247
+ diffuse_transmission_tint: ::math::pow(transmissive_color, 0.2f),
248
+ diffuse_color: diffuse_color,
249
+ diffuse_weight: diffuse_weight,
250
+ reflection_roughness: reflection_roughness
251
+
252
+ );
253
+
254
+
255
+
256
+ // 01 - Black
257
+ export material plastic_black(*)
258
+ [[
259
+ ::anno::author("NVIDIA ARC"),
260
+ ::anno::display_name("Plastic Black"),
261
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
262
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
263
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
264
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "dark", "black", "neutral")),
265
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_black.png"),
266
+ ::anno::copyright_notice(COPYRIGHT)
267
+ ]] = plastic_simple_controls(
268
+ diffuse_color: color(0.034230f),
269
+ diffuse_weight: .5f,
270
+ transmissive_color: color(0.034230f),
271
+ distance_scale: 0.002f,
272
+ reflection_roughness: 0.05f
273
+ );
274
+
275
+
276
+ // 02 - Dark Gray
277
+ export material plastic_dark_gray(*)
278
+ [[
279
+ ::anno::author("NVIDIA ARC"),
280
+ ::anno::display_name("Plastic Dark Gray"),
281
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
282
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
283
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
284
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "dark", "gray", "neutral")),
285
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_dark_gray.png"),
286
+ ::anno::copyright_notice(COPYRIGHT)
287
+ ]] = plastic_simple_controls(
288
+ diffuse_color: color(0.127530f),
289
+ diffuse_weight: .5f,
290
+ transmissive_color: color(0.089194f),
291
+ distance_scale: 0.002f,
292
+ reflection_roughness: 0.05f
293
+ );
294
+
295
+
296
+ // 03 - Light Gray
297
+ export material plastic_light_gray(*)
298
+ [[
299
+ ::anno::author("NVIDIA ARC"),
300
+ ::anno::display_name("Plastic Light Gray"),
301
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
302
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
303
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
304
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "light", "gray", "neutral")),
305
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_light_gray.png"),
306
+ ::anno::copyright_notice(COPYRIGHT)
307
+ ]] = plastic_simple_controls(
308
+ diffuse_color: color(0.464741f),
309
+ diffuse_weight: .5f,
310
+ transmissive_color: color(0.358654f),
311
+ distance_scale: 0.002f,
312
+ reflection_roughness: 0.05f
313
+ );
314
+
315
+
316
+ // 04 - White
317
+ export material plastic_white(*)
318
+ [[
319
+ ::anno::author("NVIDIA ARC"),
320
+ ::anno::display_name("Plastic White"),
321
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
322
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
323
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
324
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "light", "white", "neutral")),
325
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_white.png"),
326
+ ::anno::copyright_notice(COPYRIGHT)
327
+ ]] = plastic_simple_controls(
328
+ diffuse_color: color(0.915750f),
329
+ diffuse_weight: .5f,
330
+ transmissive_color: color(0.812241f),
331
+ distance_scale: 0.002f,
332
+ reflection_roughness: 0.05f
333
+ );
334
+
335
+
336
+ // 05 - Ivory White
337
+ export material plastic_ivory_white(*)
338
+ [[
339
+ ::anno::author("NVIDIA ARC"),
340
+ ::anno::display_name("Plastic Ivory White"),
341
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
342
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
343
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
344
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "white", "bright", "ivory", "warm")),
345
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_ivory_white.png"),
346
+ ::anno::copyright_notice(COPYRIGHT)
347
+ ]] = plastic_simple_controls(
348
+ diffuse_color: color(0.899385f, 0.843370f, 0.694081f),
349
+ diffuse_weight: .5f,
350
+ transmissive_color: color(0.722672f, 0.708298f, 0.547994f),
351
+ distance_scale: 0.002f,
352
+ reflection_roughness: 0.05f
353
+ );
354
+
355
+
356
+ // 06 - Lemon
357
+ export material plastic_lemon(*)
358
+ [[
359
+ ::anno::author("NVIDIA ARC"),
360
+ ::anno::display_name("Plastic Lemon"),
361
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
362
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
363
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
364
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "lemon", "yellow", "light", "warm")),
365
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_lemon.png"),
366
+ ::anno::copyright_notice(COPYRIGHT)
367
+ ]] = plastic_simple_controls(
368
+ diffuse_color: color(0.859174f, 0.875138f, 0.039947f),
369
+ diffuse_weight: .5f,
370
+ transmissive_color: color(0.98211f, 0.843370f, 0.031551f),
371
+ distance_scale: 0.002f,
372
+ reflection_roughness: 0.05f
373
+ );
374
+
375
+
376
+ // 07 - Yellow Orange
377
+ export material plastic_yellow_orange(*)
378
+ [[
379
+ ::anno::author("NVIDIA ARC"),
380
+ ::anno::display_name("Plastic Yellow"),
381
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
382
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
383
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
384
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "light", "orange", "yellow", "warm")),
385
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_yellow_orange.png"),
386
+ ::anno::copyright_notice(COPYRIGHT)
387
+ ]] = plastic_simple_controls(
388
+ diffuse_color: color(0.875138f, 0.612066f, 0.039947f),
389
+ diffuse_weight: .5f,
390
+ transmissive_color: color(0.899385f, 0.373615f, 0.030257f),
391
+ distance_scale: 0.002f,
392
+ reflection_roughness: 0.05f
393
+ );
394
+
395
+
396
+ // 08 - Orange
397
+ export material plastic_orange(*)
398
+ [[
399
+ ::anno::author("NVIDIA ARC"),
400
+ ::anno::display_name("Plastic Orange"),
401
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
402
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
403
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
404
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "orange", "warm")),
405
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_orange.png"),
406
+ ::anno::copyright_notice(COPYRIGHT)
407
+ ]] = plastic_simple_controls(
408
+ diffuse_color: color(0.875138f, 0.353741f, 0.030257f),
409
+ diffuse_weight: .5f,
410
+ transmissive_color: color(0.891262f, 0.420508f, 0.022013f),
411
+ distance_scale: 0.002f,
412
+ reflection_roughness: 0.05f
413
+ );
414
+
415
+
416
+ // 09 - Dark Orange
417
+ export material plastic_dark_orange(*)
418
+ [[
419
+ ::anno::author("NVIDIA ARC"),
420
+ ::anno::display_name("Plastic Dark Orange"),
421
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
422
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
423
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
424
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "dark", "orange", "warm")),
425
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_dark_orange.png"),
426
+ ::anno::copyright_notice(COPYRIGHT)
427
+ ]] = plastic_simple_controls(
428
+ diffuse_color: color(0.535642f, 0.127530f, 0.022013f),
429
+ diffuse_weight: .5f,
430
+ transmissive_color: color(0.827726f, 0.267358f, 0.022013f),
431
+ distance_scale: 0.002f,
432
+ reflection_roughness: 0.05f
433
+ );
434
+
435
+
436
+ // 10 - Red
437
+ export material plastic_red(*)
438
+ [[
439
+ ::anno::author("NVIDIA ARC"),
440
+ ::anno::display_name("Plastic Red"),
441
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
442
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
443
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
444
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "red", "cherry", "warm")),
445
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_red.png"),
446
+ ::anno::copyright_notice(COPYRIGHT)
447
+ ]] = plastic_simple_controls(
448
+ diffuse_color: color(0.547994f, 0.027755f, 0.027755f),
449
+ diffuse_weight: .5f,
450
+ transmissive_color: color(0.875138f, 0.022013f, 0.022013f),
451
+ distance_scale: 0.002f,
452
+ reflection_roughness: 0.05f
453
+ );
454
+
455
+
456
+ // 11 - Magenta
457
+ export material plastic_magenta(*)
458
+ [[
459
+ ::anno::author("NVIDIA ARC"),
460
+ ::anno::display_name("Plastic Magenta"),
461
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
462
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
463
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
464
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "magenta")),
465
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_magenta.png"),
466
+ ::anno::copyright_notice(COPYRIGHT)
467
+ ]] = plastic_simple_controls(
468
+ diffuse_color: color(0.547994f, 0.047776f, 0.554227f),
469
+ diffuse_weight: .5f,
470
+ transmissive_color: color(0.722672f, 0.030257f, 0.566810f),
471
+ distance_scale: 0.002f,
472
+ reflection_roughness: 0.05f
473
+ );
474
+
475
+
476
+ // 12 - Purple
477
+ export material plastic_purple(*)
478
+ [[
479
+ ::anno::author("NVIDIA ARC"),
480
+ ::anno::display_name("Plastic Purple"),
481
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
482
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
483
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
484
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "purple")),
485
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_purple.png"),
486
+ ::anno::copyright_notice(COPYRIGHT)
487
+ ]] = plastic_simple_controls(
488
+ diffuse_color: color(0.193972f, 0.017936f, 0.464741f),
489
+ diffuse_weight: .5f,
490
+ transmissive_color: color(0.701170f, 0.018913f, 0.645555f),
491
+ distance_scale: 0.002f,
492
+ reflection_roughness: 0.05f
493
+ );
494
+
495
+
496
+ // 13 - Dark Blue
497
+ export material plastic_dark_blue(*)
498
+ [[
499
+ ::anno::author("NVIDIA ARC"),
500
+ ::anno::display_name("Plastic Dark Blue"),
501
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
502
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
503
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
504
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "dark", "blue", "cool")),
505
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_dark_blue.png"),
506
+ ::anno::copyright_notice(COPYRIGHT)
507
+ ]] = plastic_simple_controls(
508
+ diffuse_color: color(0.027755f, 0.058187f, 0.311180f),
509
+ diffuse_weight: .5f,
510
+ transmissive_color: color(0.027755f, 0.058187f, 0.311180f),
511
+ distance_scale: 0.002f,
512
+ reflection_roughness: 0.05f
513
+ );
514
+
515
+
516
+ // 14 - Blue
517
+ export material plastic_blue(*)
518
+ [[
519
+ ::anno::author("NVIDIA ARC"),
520
+ ::anno::display_name("Plastic Blue"),
521
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
522
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
523
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
524
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "blue", "cool")),
525
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_blue.png"),
526
+ ::anno::copyright_notice(COPYRIGHT)
527
+ ]] = plastic_simple_controls(
528
+ diffuse_color: color(0.034230f, 0.173439f, 0.843370f),
529
+ diffuse_weight: .5f,
530
+ transmissive_color: color(0.034230f, 0.124741f, 0.659224f),
531
+ distance_scale: 0.002f,
532
+ reflection_roughness: 0.05f
533
+ );
534
+
535
+
536
+ // 15 - Sky Blue
537
+ export material plastic_sky_blue(*)
538
+ [[
539
+ ::anno::author("NVIDIA ARC"),
540
+ ::anno::display_name("Plastic Sky Blue"),
541
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
542
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
543
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
544
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "blue", "sky", "cool")),
545
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_sky_blue.png"),
546
+ ::anno::copyright_notice(COPYRIGHT)
547
+ ]] = plastic_simple_controls(
548
+ diffuse_color: color(0.061907f, 0.535642f, 0.875138f),
549
+ diffuse_weight: .5f,
550
+ transmissive_color: color(0.028991f, 0.358654f, 0.673049f),
551
+ distance_scale: 0.002f,
552
+ reflection_roughness: 0.05f
553
+ );
554
+
555
+
556
+ // 16 - Light Blue
557
+ export material plastic_light_blue(*)
558
+ [[
559
+ ::anno::author("NVIDIA ARC"),
560
+ ::anno::display_name("Plastic Light Blue"),
561
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
562
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
563
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
564
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "light", "blue", "cool")),
565
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_light_blue.png"),
566
+ ::anno::copyright_notice(COPYRIGHT)
567
+ ]] = plastic_simple_controls(
568
+ diffuse_color: color(0.263175f, 0.774227f, 0.827726f),
569
+ diffuse_weight: .5f,
570
+ transmissive_color: color(0.163641f, 0.592438f, 0.759300f),
571
+ distance_scale: 0.002f,
572
+ reflection_roughness: 0.05f
573
+ );
574
+
575
+
576
+ // 17 - Teal
577
+ export material plastic_teal(*)
578
+ [[
579
+ ::anno::author("NVIDIA ARC"),
580
+ ::anno::display_name("Plastic Teal"),
581
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
582
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
583
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
584
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "teal", "cool")),
585
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_teal.png"),
586
+ ::anno::copyright_notice(COPYRIGHT)
587
+ ]] = plastic_simple_controls(
588
+ diffuse_color: color(0.037029f, 0.579547f, 0.329729f),
589
+ diffuse_weight: .5f,
590
+ transmissive_color: color(0.022013f, 0.476177f, 0.353741f),
591
+ distance_scale: 0.002f,
592
+ reflection_roughness: 0.05f
593
+ );
594
+
595
+
596
+ // 18 - Dark Green
597
+ export material plastic_dark_green(*)
598
+ [[
599
+ ::anno::author("NVIDIA ARC"),
600
+ ::anno::display_name("Plastic Dark Green"),
601
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
602
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
603
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
604
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "dark", "green")),
605
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_dark_green.png"),
606
+ ::anno::copyright_notice(COPYRIGHT)
607
+ ]] = plastic_simple_controls(
608
+ diffuse_color: color(0.034230f, 0.141980f, 0.034230f),
609
+ diffuse_weight: .5f,
610
+ transmissive_color: color(0.016988f, 0.141980f, 0.016988f),
611
+ distance_scale: 0.002f,
612
+ reflection_roughness: 0.05f
613
+ );
614
+
615
+
616
+ // 19 - Green
617
+ export material plastic_green(*)
618
+ [[
619
+ ::anno::author("NVIDIA ARC"),
620
+ ::anno::display_name("Plastic Green"),
621
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
622
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
623
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
624
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "green")),
625
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_green.png"),
626
+ ::anno::copyright_notice(COPYRIGHT)
627
+ ]] = plastic_simple_controls(
628
+ diffuse_color: color(0.016988f, 0.311180f, 0.016988f),
629
+ diffuse_weight: .5f,
630
+ transmissive_color: color(0.012664f, 0.358654f, 0.012664f),
631
+ distance_scale: 0.002f,
632
+ reflection_roughness: 0.05f
633
+ );
634
+
635
+
636
+ // 20 - Light Green
637
+ export material plastic_light_green(*)
638
+ [[
639
+ ::anno::author("NVIDIA ARC"),
640
+ ::anno::display_name("Plastic Light Green"),
641
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
642
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
643
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
644
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "light", "green")),
645
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_light_green.png"),
646
+ ::anno::copyright_notice(COPYRIGHT)
647
+ ]] = plastic_simple_controls(
648
+ diffuse_color: color(0.030257f, 0.687031f, 0.027755f),
649
+ diffuse_weight: .5f,
650
+ transmissive_color: color(0.030257f, 0.701170f, 0.027755f),
651
+ distance_scale: 0.002f,
652
+ reflection_roughness: 0.05f
653
+ );
654
+
655
+
656
+ // 21 - Lime Green
657
+ export material plastic_lime_green(*)
658
+ [[
659
+ ::anno::author("NVIDIA ARC"),
660
+ ::anno::display_name("Plastic Lime Green"),
661
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
662
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
663
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
664
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "lime", "green", "light")),
665
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_lime_green.png"),
666
+ ::anno::copyright_notice(COPYRIGHT)
667
+ ]] = plastic_simple_controls(
668
+ diffuse_color: color(0.186989f, 0.605484f, 0.027755f),
669
+ diffuse_weight: .5f,
670
+ transmissive_color: color(0.204710f, 0.701170f, 0.022013f),
671
+ distance_scale: 0.002f,
672
+ reflection_roughness: 0.05f
673
+ );
objects/table_black/materials/remote/omniverse-content-production.s3.us-west-2.amazonaws.com/Materials/2023_1/vMaterials_2/Plastic/Plastic_Thick_Translucent_Flakes.mdl ADDED
@@ -0,0 +1,1025 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2023 NVIDIA Corporation. All rights reserved.
3
+ ******************************************************************************
4
+
5
+ Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge,
6
+ to any person obtaining a copy of the sample definition code that uses our
7
+ Material Definition Language (the "MDL Materials"), to reproduce and distribute
8
+ the MDL Materials, including without limitation the rights to use, copy, merge,
9
+ publish, distribute, and sell modified and unmodified copies of the MDL
10
+ Materials, and to permit persons to whom the MDL Materials is furnished to do
11
+ so, in all cases solely for use with NVIDIA's Material Definition Language,
12
+ subject to the following further conditions:
13
+
14
+ 1. The above copyright notices, this list of conditions, and the disclaimer
15
+ that follows shall be retained in all copies of one or more of the MDL
16
+ Materials, including in any software with which the MDL Materials are bundled,
17
+ redistributed, and/or sold, and included either as stand-alone text files,
18
+ human-readable headers or in the appropriate machine-readable metadata fields
19
+ within text or binary files as long as those fields can be easily viewed by the
20
+ user, as applicable.
21
+ 2. The name of NVIDIA shall not be used to promote, endorse or advertise any
22
+ Modified Version without specific prior written permission, except a) to comply
23
+ with the notice requirements otherwise contained herein; or b) to acknowledge
24
+ the contribution(s) of NVIDIA.
25
+
26
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
27
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
28
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
29
+ TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR
30
+ ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL,
31
+ INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF
32
+ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE
33
+ THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.
34
+ */
35
+
36
+ // This file contains samples of very fast rendering SSS plastics for iray
37
+ //
38
+
39
+ mdl 1.4;
40
+ import ::df::*;
41
+ import ::math::*;
42
+ import ::anno::*;
43
+ import ::state::*;
44
+ import ::base::*;
45
+ import ::nvidia::core_definitions::dimension;
46
+
47
+
48
+ const string COPYRIGHT =
49
+ " Copyright 2023 NVIDIA Corporation. All rights reserved.\n"
50
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
51
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
52
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
53
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
54
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
55
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
56
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
57
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
58
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
59
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
60
+
61
+
62
+ const string DESCRIPTION =
63
+ "Translucent plastic material with integrated metal flakes. Features: Effective light scattering for dense "
64
+ "plastic materials and metal flakes. The material was built to scatter light within the range of a few "
65
+ "centimeters. If light scattering cannot be seen (which can be verified by setting 'Diffuse Weight' to 0.0), "
66
+ "check the scene units scale or increase 'Distance Scale'.";
67
+
68
+
69
+ //
70
+ // flake noise utilities
71
+ //
72
+ int hash(int seed, int i)
73
+ {
74
+ return (i ^ seed) * 1075385539;
75
+ }
76
+ int rnd_init(int3 pos)
77
+ {
78
+ return hash(hash(hash(0, pos.x), pos.y), pos.z);
79
+ }
80
+
81
+ int rnd_next(int seed) {
82
+ // xorshift32 using signed int
83
+ seed ^= seed << 13;
84
+ seed ^= seed >>> 17;
85
+ seed ^= seed << 5;
86
+ return seed;
87
+ }
88
+
89
+ float rnd_value(int seed)
90
+ {
91
+ return ::math::abs(float(seed) * 4.6566e-10f);
92
+ }
93
+
94
+ // apply random rotation (using "Fast Random Rotation Matrices" by James Arvo)
95
+ float3 rotate_pos(float3 pos, float3 xi)
96
+ {
97
+ float theta = ::math::PI * 2.0f * xi.x;
98
+ float phi = ::math::PI * 2.0f * xi.y;
99
+ float z = xi.z * 2.0f;
100
+
101
+ float r = ::math::sqrt(z);
102
+ float[2] sp_cp = ::math::sincos(phi);
103
+ float Vx = sp_cp[0] * r;
104
+ float Vy = sp_cp[1] * r;
105
+ float Vz = ::math::sqrt(2.0f - z);
106
+
107
+ float[2] st_ct = ::math::sincos(theta);
108
+ float Sx = Vx * st_ct[1] - Vy * st_ct[0];
109
+ float Sy = Vx * st_ct[0] + Vy * st_ct[1];
110
+
111
+ float3x3 M(
112
+ Vx * Sx - st_ct[1], Vx * Sy - st_ct[0], Vx * Vz,
113
+ Vy * Sx + st_ct[0], Vy * Sy - st_ct[1], Vy * Vz,
114
+ Vz * Sx, Vz * Sy, 1.0f - z);
115
+
116
+ return M * pos;
117
+ }
118
+
119
+ struct flake_noise_value {
120
+ // flake priority (in [0..1], 0: no flake, flakes with higher priority shadow flakes "below" them)
121
+ float priority;
122
+ // Stores values from the functions (once normal, another time the color)
123
+ // current pseudo random number generator seed
124
+ int rnd_seed;
125
+ float4 carrier;
126
+ };
127
+
128
+ // flake noise function with controllable regularity, flake size, and probability
129
+ flake_noise_value flake_noise(
130
+ float3 pos,
131
+ float jitter_scale = 1.0f,
132
+ float flake_diameter = 0.75f,
133
+ float flake_probability = 1.0f)
134
+ {
135
+ float3 base_pos = ::math::floor(pos);
136
+ int3 base_pos_i = int3(base_pos);
137
+
138
+ // limit the flake size to the allowed maximum (such that looking at all neighbors is sufficient)
139
+ flake_diameter = ::math::min(flake_diameter, (1.5f - 0.5f * jitter_scale) / ::math::sqrt(3.0f));
140
+
141
+ flake_noise_value val(0.0f, 0, float4(0.0));
142
+
143
+ for (int i = -1; i < 2; ++i) {
144
+ for (int j = -1; j < 2; ++j) {
145
+ for (int k = -1; k < 2; ++k) {
146
+
147
+ int seed = rnd_init(base_pos_i + int3(i, j, k));
148
+
149
+ seed = rnd_next(seed);
150
+ if (rnd_value(seed) > flake_probability)
151
+ continue;
152
+
153
+ seed = rnd_next(seed);
154
+ float priority = rnd_value(seed);
155
+ if (priority < val.priority)
156
+ continue;
157
+
158
+ float3 flake_pos = base_pos + float3(i, j, k) + float3(0.5f);
159
+
160
+ if (jitter_scale > 0.0f) {
161
+ seed = rnd_next(seed);
162
+ flake_pos.x += (rnd_value(seed) - 0.5f) * jitter_scale;
163
+ seed = rnd_next(seed);
164
+ flake_pos.y += (rnd_value(seed) - 0.5f) * jitter_scale;
165
+ seed = rnd_next(seed);
166
+ flake_pos.z += (rnd_value(seed) - 0.5f) * jitter_scale;
167
+ }
168
+
169
+ float3 p = pos - flake_pos;
170
+ if (::math::dot(p, p) >= flake_diameter * flake_diameter * 4.0f)
171
+ continue;
172
+
173
+ float3 xi_rot;
174
+ seed = rnd_next(seed);
175
+ xi_rot.x = rnd_value(seed);
176
+ seed = rnd_next(seed);
177
+ xi_rot.y = rnd_value(seed);
178
+ seed = rnd_next(seed);
179
+ xi_rot.z = rnd_value(seed);
180
+ p = rotate_pos(p, xi_rot);
181
+
182
+ if (::math::abs(p.x) <= flake_diameter &&
183
+ ::math::abs(p.y) <= flake_diameter &&
184
+ ::math::abs(p.z) <= flake_diameter)
185
+ {
186
+ val.priority = priority;
187
+ val.rnd_seed = seed;
188
+ }
189
+ }
190
+ }
191
+ }
192
+
193
+ return val;
194
+ }
195
+
196
+
197
+ // constants for numerical fitted curve to observed flake noise density behavior
198
+ // 1. no jitter, maximum flake diameter
199
+ const float4 ABCD = float4(-26.19771808f, 26.39663835f, 85.53857017f, -102.35069432f);
200
+ const float2 EF = float2(-101.42634862f, 118.45082288f);
201
+ // 2. jitter scale of 0.5f, maximum flake diameter
202
+ const float4 ABCD_J = float4(-0.87962159f, 0.91006603f, 0.76088203f, -0.24953308f);
203
+ const float2 EF_J = float2(-3.11456809f, 2.63430594f);
204
+ // compute a flake probability for a given flake coverage density x
205
+ float density_to_probability(
206
+ float4 abcd,
207
+ float2 ef,
208
+ float x)
209
+ {
210
+ float xx = x * x;
211
+ return (abcd.x * xx + abcd.y * x) / (abcd.z * xx * x + abcd.w * xx + ef.x * x + ef.y);
212
+ }
213
+
214
+ // statistically controlled (area/volume coverage density) flake noise
215
+ flake_noise_value flake_noise(
216
+ float3 position,
217
+ float density = 0.5f,
218
+ bool jittered = false) // jittered: slightly slower and slightly less uniform
219
+ {
220
+ float probability = density_to_probability(jittered ? ABCD_J : ABCD, jittered ? EF_J : EF, ::math::saturate(density));
221
+
222
+ return flake_noise(pos: position, jitter_scale: jittered ? 0.5f : 0.0f, flake_diameter: (jittered ? 1.25f : 1.5f) / ::math::sqrt(3.0f), flake_probability: probability);
223
+ }
224
+
225
+ // create a flake normal by importance sampling the Beckmann distribution with given roughness
226
+ flake_noise_value flake_normal(
227
+ flake_noise_value val,
228
+ float spread)
229
+ {
230
+ if (val.priority <= 0.0f)
231
+ {
232
+ val.carrier = float4(::state::normal().x, ::state::normal().y, ::state::normal().z, 1.0);
233
+ return val;
234
+ }
235
+
236
+ // int seed0 = rnd_next(val.rnd_seed);
237
+ // float xi0 = rnd_value(seed0);
238
+ // float xi1 = rnd_value(rnd_next(seed0));
239
+
240
+ int seed = rnd_next(val.rnd_seed);
241
+ float xi0 = rnd_value(seed);
242
+ seed = rnd_next(seed);
243
+ float xi1 = rnd_value(seed);
244
+
245
+ float phi = ::math::PI * 2.0f * xi0;
246
+
247
+ float roughness = spread * spread;
248
+
249
+ float tantheta = ::math::sqrt(-roughness * roughness * ::math::log(1.0f - xi1));
250
+ float sintheta = tantheta / ::math::sqrt(1.0f + tantheta * tantheta);
251
+ float costheta = ::math::sqrt(1.0f - sintheta * sintheta);
252
+
253
+ float[2] scphi = ::math::sincos(phi);
254
+
255
+ val.rnd_seed = seed;
256
+
257
+ // return
258
+ // ::state::texture_tangent_u(0) * scphi[1] * sintheta +
259
+ // ::state::texture_tangent_v(0) * scphi[0] * sintheta +
260
+ // ::state::normal() * costheta;
261
+ float3 normal = ::state::texture_tangent_u(0) * scphi[1] * sintheta +
262
+ ::state::texture_tangent_v(0) * scphi[0] * sintheta +
263
+ ::state::normal() * costheta;
264
+
265
+ val.carrier = float4(normal.x, normal.y, normal.z, 1.0);
266
+
267
+
268
+ return val;
269
+ }
270
+
271
+ flake_noise_value random_flake_color(flake_noise_value val)
272
+ {
273
+ int seed = rnd_next(val.rnd_seed);
274
+ float r = rnd_value(seed);
275
+ seed = rnd_next(seed);
276
+ float g = rnd_value(seed);
277
+ seed = rnd_next(seed);
278
+ float b = rnd_value(seed);
279
+ seed = rnd_next(seed);
280
+ float a = rnd_value(seed);
281
+
282
+ val.carrier = float4(r, g, b, a);
283
+ return val;
284
+ }
285
+
286
+
287
+ // Template for absorption and scattering, do not use directly
288
+ material volume_absorption(
289
+ color absorption = color(0.8665, 0.7769, 0.1559),
290
+ color scattering = color(.5),
291
+ float distance_scale = .03,
292
+ float directional_bias = 0.0,
293
+ uniform float ior = 1.2
294
+
295
+ )
296
+ [[
297
+ ::anno::author("NVIDIA vMaterials"),
298
+ ::anno::display_name("Volume Absorption"),
299
+ ::anno::description("Pure volume absorption material"),
300
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.volume_absorption.png"),
301
+ ::anno::copyright_notice(COPYRIGHT),
302
+ ::anno::hidden()
303
+
304
+ ]] = material (
305
+ ior: color(ior),
306
+ surface: material_surface (
307
+ scattering: ::df::specular_bsdf (
308
+ tint: color (1.0, 1.0, 1.0),
309
+ mode: ::df::scatter_reflect_transmit
310
+ )
311
+ ),
312
+ volume: material_volume (
313
+ scattering: ::df::anisotropic_vdf(
314
+ directional_bias: directional_bias
315
+ ),
316
+ absorption_coefficient: (distance_scale <= 0)? color(0): ::math::log(absorption) / -distance_scale,
317
+ scattering_coefficient: (distance_scale <= 0)? color(0): ::math::log(scattering) / -distance_scale
318
+ )
319
+ );
320
+
321
+ // metallic_plastic_full_weighted_mix( )
322
+ // Plastic material using diffuse reflection, diffuse transmission
323
+ // and SSS. Due to the diffuse transmission the volume absorption will
324
+ // render faster and converge smoother than when using specular transmission.
325
+ export material Plastic_Thick_Translucent_Flakes(
326
+ color diffuse_color = color(0.6940f, 0.5831f, 0.0493f)
327
+ [[
328
+ ::anno::display_name("Diffuse Color"),
329
+ ::anno::description("The diffuse color of the plastic material"),
330
+ ::anno::in_group("Appearance")
331
+ ]],
332
+ float diffuse_weight = 0.3f
333
+ [[
334
+ ::anno::display_name("Diffuse Weight"),
335
+ ::anno::description("The weight of the diffuse color of the plastic material. It is recommended to keep "
336
+ "the value around 0.5, lower values make the material appear more transparent while higher values make "
337
+ "it more opaque."),
338
+ ::anno::in_group("Appearance"),
339
+ ::anno::hard_range(0.f, 1.f)
340
+ ]],
341
+ color absorption = color(0.8665f, 0.7769f, 0.1559f)
342
+ [[
343
+ ::anno::display_name("Absorption Color"),
344
+ ::anno::description("Sets the absorption color (this is color when light goes extinct)of the plastic material"),
345
+ ::anno::in_group("Appearance")
346
+ ]],
347
+ color scattering = color(.5f)
348
+ [[
349
+ ::anno::display_name("Scattering Color"),
350
+ ::anno::description("Sets the absorption color (this is color when light goes extinct)of the plastic material"),
351
+ ::anno::in_group("Appearance")
352
+ ]],
353
+ float distance_scale = 1.5f
354
+ [[
355
+ ::anno::display_name("Distance Scale"),
356
+ ::anno::description("Scales how quickly light is absorbed. Set this value low enough to see "
357
+ "some light extinction taking place. Tip: Set 'diffuse_weight' to 0.0 while adjusting this "
358
+ "material parameter for your scene"),
359
+ ::anno::in_group("Appearance")
360
+ ]],
361
+
362
+ color diffuse_transmission_tint = color(1.0000f, 0.7249f, 0.1972f)
363
+ [[
364
+ ::anno::display_name("Diffuse Transmission Color"),
365
+ ::anno::description("The tinting of light scattering through the plastic material"),
366
+ ::anno::in_group("Appearance")
367
+ ]],
368
+
369
+ float reflection_roughness = 0.0f
370
+ [[
371
+ ::anno::display_name("Roughness"),
372
+ ::anno::description("The roughness of the reflection on the plastic"),
373
+ ::anno::in_group("Appearance"),
374
+ ::anno::hard_range(0.f, 1.f)
375
+ ]],
376
+
377
+ // Flakes Controls
378
+ color flake_color_1 = color(1.0f, 1.0f, 1.0f)
379
+ [[
380
+ ::anno::display_name("Flakes Color"),
381
+ ::anno::description("Flakes Color"),
382
+ ::anno::in_group("Flakes")
383
+ ]],
384
+ bool enable_color_randomization = true
385
+ [[
386
+ ::anno::display_name("Flakes Color Randomization"),
387
+ ::anno::description("Enables that a random flakes color will be chosen. Using 'Flakes Color Randomness' allows "
388
+ "to blend between the chosen reflection color for the flakes and an purely random chosen color."),
389
+ ::anno::in_group("Flakes")
390
+ ]],
391
+ float flake_color_randomness = 1.0f
392
+ [[
393
+ ::anno::display_name("Flakes Color Randomness"),
394
+ ::anno::description("Incresing this value will blend towards a randomly chosen flakes color."),
395
+ ::anno::in_group("Flakes"),
396
+ ::anno::hard_range(0.f, 1.f),
397
+ ::anno::enable_if("enable_color_randomization == true")
398
+ ]],
399
+ uniform float flake_size = 0.1f
400
+ [[
401
+ ::anno::display_name("Flakes Size"),
402
+ ::anno::description("The size of the flakes in the material"),
403
+ ::anno::in_group("Flakes")
404
+ ]],
405
+ uniform float3 texture_scale = float3 ( 1.f , 1.f, 1.f)
406
+ [[
407
+ //::anno::hidden(),
408
+ ::anno::display_name("Scale"),
409
+ ::anno::description("Larger numbers increase the texture size."),
410
+ ::nvidia::core_definitions::dimension(float3(1.0f, 1.0f, 1.0f)),
411
+ ::anno::in_group("Transform")
412
+ ]],
413
+ uniform float flake_amount = 0.1f
414
+ [[
415
+ ::anno::display_name("Flakes Amount"),
416
+ ::anno::description("The number of flakes used in the material, 0 meaning no flakes, 1 meaning that flakes "
417
+ "cover the entire surface"),
418
+ ::anno::in_group("Flakes"),
419
+ ::anno::hard_range(0.f, 1.f)
420
+ ]],
421
+
422
+ float flake_spread = 0.7f
423
+ [[
424
+ ::anno::display_name("Flakes Spread"),
425
+ ::anno::description("The amount of randomness in the orientation of the flakes. When set to zero, flakes are "
426
+ "oriented along the surface normal. Higher values tilt the flakes stronger in a random direction."),
427
+ ::anno::in_group("Flakes"),
428
+ ::anno::hard_range(0.f, 1.f)
429
+ ]]
430
+ )
431
+ [[
432
+ ::anno::author("NVIDIA vMaterials"),
433
+ ::anno::display_name("Plastic Full Control"),
434
+ ::anno::description(DESCRIPTION),
435
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.Plastic_Thick_Translucent_Flakes.png"),
436
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment")),
437
+ ::anno::copyright_notice(COPYRIGHT),
438
+ ::anno::hidden()
439
+ ]] = let {
440
+ // Hardcoded plastic parameters
441
+ float reflection_weight = 1.0f;
442
+ float normal_reflectivity = 0.04f;
443
+ float grazing_reflectivity = 1.0f;
444
+ float reflectivity_exponent = 5.0f;
445
+ uniform float ior = 1.4f;
446
+
447
+ // Hardcoded flake parameters
448
+ uniform float flake_roughness = 0.4f;
449
+ float flake_transparency_randomness = 1.0f;
450
+ float flakes_opacity = 0.8;
451
+
452
+ // Flakes
453
+
454
+ float3 flake_uvw_scale = float3(1.0f);
455
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(
456
+ coordinate_system: ::base::texture_coordinate_world,
457
+ texture_space: 0
458
+ );
459
+
460
+ ::base::texture_coordinate_info transformed_uvw = uvw;
461
+ float3 flake_uvw = (texture_scale * transformed_uvw.position * flake_uvw_scale) / (flake_size * 0.001f);
462
+
463
+ flake_noise_value val = flake_noise(flake_uvw, flake_amount, true);
464
+ bool is_flake = val.priority > 0.0f;
465
+ flake_noise_value val2 = flake_normal(val, flake_spread);
466
+ float3 flake_normal = float3(val2.carrier.x, val2.carrier.y, val2.carrier.z);
467
+ flake_noise_value val3 = random_flake_color(val2);
468
+
469
+ color random_color = color(val3.carrier.x, val3.carrier.y, val3.carrier.z);
470
+ float flakes_transparency_value = ::math::lerp(flakes_opacity, val3.carrier.w * flakes_opacity, flake_transparency_randomness);
471
+
472
+ color flake_color = enable_color_randomization ?
473
+ ::math::lerp(flake_color_1, random_color, flake_color_randomness) : flake_color_1;
474
+
475
+ bsdf flakes = ::df::simple_glossy_bsdf(mode: ::df::scatter_reflect, roughness_u: flake_roughness * flake_roughness, tint: flake_color);
476
+
477
+
478
+ // Plastic
479
+
480
+ material plastic = volume_absorption(
481
+ absorption: absorption,
482
+ scattering: scattering,
483
+ distance_scale: distance_scale,
484
+ ior: ior
485
+ );
486
+
487
+ bsdf transdiff = ::df::diffuse_transmission_bsdf(
488
+ tint: diffuse_transmission_tint
489
+ );
490
+
491
+ bsdf diffuse = ::df::diffuse_reflection_bsdf(
492
+ tint: diffuse_color
493
+ );
494
+
495
+ bsdf diffuse_mix_layer = ::df::weighted_layer(
496
+ base: transdiff,
497
+ layer: diffuse,
498
+ weight: diffuse_weight
499
+
500
+ );
501
+
502
+ bsdf plastic_with_flakes = ::df::weighted_layer(
503
+ base: diffuse_mix_layer,
504
+ layer: flakes,
505
+ weight: is_flake ? flakes_transparency_value : 0.0f,
506
+ normal: flake_normal
507
+ );
508
+
509
+ bsdf glossy_reflection = ::df::simple_glossy_bsdf(
510
+ tint: color(1.0),
511
+ roughness_u: reflection_roughness,
512
+ mode: ::df::scatter_reflect
513
+ );
514
+
515
+ bsdf final_layer = ::df::custom_curve_layer(
516
+ normal_reflectivity: normal_reflectivity,
517
+ grazing_reflectivity: grazing_reflectivity,
518
+ layer: glossy_reflection,
519
+ base: plastic_with_flakes,
520
+ weight: reflection_weight,
521
+ exponent: reflectivity_exponent
522
+ );
523
+
524
+ } in material (
525
+ surface: material_surface(
526
+ scattering: final_layer
527
+ ),
528
+
529
+ volume: plastic.volume
530
+ );
531
+
532
+
533
+ export material metallic_plastic_simple_controls(
534
+ color diffuse_color = color(0.6940, 0.5831, 0.0493)
535
+ [[
536
+ ::anno::display_name("Diffuse Color"),
537
+ ::anno::description("The diffuse color of the plastic material"),
538
+ ::anno::in_group("Appearance")
539
+ ]],
540
+ float diffuse_weight = 0.5
541
+ [[
542
+ ::anno::display_name("Diffuse Weight"),
543
+ ::anno::description("The weight of the diffuse color of the plastic material. It is recommended to keep "
544
+ "the value around 0.5, lower values make the material appear more transparent while higher values make "
545
+ "it more opaque."),
546
+ ::anno::in_group("Appearance"),
547
+ ::anno::hard_range(0.f, 1.f)
548
+ ]],
549
+ color transmissive_color = color(0.8665, 0.7769, 0.1559)
550
+ [[
551
+ ::anno::display_name("Transmissive Color"),
552
+ ::anno::description("The tinting of light scattering through the plastic material"),
553
+ ::anno::in_group("Appearance")
554
+ ]],
555
+ float reflection_roughness = 0.0
556
+ [[
557
+ ::anno::display_name("Roughness"),
558
+ ::anno::description("The roughness of the reflection on the plastic"),
559
+ ::anno::in_group("Appearance"),
560
+ ::anno::hard_range(0.f, 1.f)
561
+ ]],
562
+ float distance_scale = 0.005
563
+ [[
564
+ ::anno::display_name("Distance Scale"),
565
+ ::anno::description("Scales how quickly light is absorbed. Set this value low enough to see "
566
+ "some light extinction taking place. Tip: Set 'diffuse_weight' to 0.0 while adjusting this "
567
+ "material parameter for your scene"),
568
+ ::anno::in_group("Appearance")
569
+ ]],
570
+
571
+ // Flakes Controls
572
+ color flake_color_1 = color(1.0f, 1.0f, 1.0f)
573
+ [[
574
+ ::anno::display_name("Flakes Color"),
575
+ ::anno::description("Flakes Color"),
576
+ ::anno::in_group("Flakes")
577
+ ]],
578
+ bool enable_color_randomization = true
579
+ [[
580
+ ::anno::display_name("Flakes Color Randomization"),
581
+ ::anno::description("Enables that a random flakes color will be chosen. Using 'Flakes Color Randomness' allows "
582
+ "to blend between the chosen reflection color for the flakes and an purely random chosen color."),
583
+ ::anno::in_group("Flakes")
584
+ ]],
585
+ float flake_color_randomness = 1.0
586
+ [[
587
+ ::anno::display_name("Flakes Color Randomness"),
588
+ ::anno::description("Incresing this value will blend towards a randomly chosen flakes color."),
589
+ ::anno::in_group("Flakes"),
590
+ ::anno::hard_range(0.f, 1.f),
591
+ ::anno::enable_if("enable_color_randomization == true")
592
+ ]],
593
+ uniform float flake_size = 0.1f
594
+ [[
595
+ ::anno::display_name("Flakes Size"),
596
+ ::anno::description("The size of the flakes in the material"),
597
+ ::anno::in_group("Flakes")
598
+ ]],
599
+ uniform float3 texture_scale = float3 ( 1.f , 1.f, 1.f)
600
+ [[
601
+ //::anno::hidden(),
602
+ ::anno::display_name("Scale"),
603
+ ::anno::description("Larger numbers increase the texture size."),
604
+ ::nvidia::core_definitions::dimension(float3(1.0f, 1.0f, 1.0f)),
605
+ ::anno::in_group("Transform")
606
+ ]],
607
+ uniform float flake_amount = 0.1f
608
+ [[
609
+ ::anno::display_name("Flakes Amount"),
610
+ ::anno::description("The number of flakes used in the material, 0 meaning no flakes, 1 meaning that flakes cover the entire surface"),
611
+ ::anno::in_group("Flakes"),
612
+ ::anno::hard_range(0.f, 1.f)
613
+ ]],
614
+ float flake_spread = 0.7f
615
+ [[
616
+ ::anno::display_name("Flakes Spread"),
617
+ ::anno::description("The amount of randomness in the orientation of the flakes. When set to zero, flakes are oriented along the surface normal. Higher values tilt the flakes stronger in a random direction."),
618
+ ::anno::in_group("Flakes"),
619
+ ::anno::hard_range(0.f, 1.f)
620
+ ]]
621
+
622
+ )
623
+ [[
624
+ ::anno::author("NVIDIA ARC"),
625
+ ::anno::display_name("Plastic"),
626
+ ::anno::description(DESCRIPTION),
627
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment")),
628
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_simple_controls.png"),
629
+ ::anno::copyright_notice(COPYRIGHT),
630
+ ::anno::hidden()
631
+ ]] = Plastic_Thick_Translucent_Flakes(
632
+ absorption: ::math::pow(transmissive_color, 0.2),
633
+ scattering: color(0.5),
634
+ distance_scale: distance_scale,
635
+ diffuse_transmission_tint: ::math::pow(transmissive_color, 0.2),
636
+ diffuse_color: diffuse_color,
637
+ diffuse_weight: diffuse_weight,
638
+ reflection_roughness: reflection_roughness,
639
+
640
+ flake_color_1: flake_color_1,
641
+ enable_color_randomization: enable_color_randomization,
642
+ flake_color_randomness: flake_color_randomness,
643
+ flake_size: flake_size,
644
+ texture_scale: texture_scale,
645
+ flake_amount: flake_amount,
646
+ flake_spread: flake_spread
647
+ );
648
+
649
+
650
+ // 01 - Black
651
+ export material plastic_black(*)
652
+ [[
653
+ ::anno::author("NVIDIA ARC"),
654
+ ::anno::display_name("Metallic Plastic Black"),
655
+ ::anno::description(DESCRIPTION),
656
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "dark", "black", "neutral")),
657
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_black.png"),
658
+ ::anno::copyright_notice(COPYRIGHT)
659
+ ]] = metallic_plastic_simple_controls(
660
+ diffuse_color: color(0.034230),
661
+ diffuse_weight: .5,
662
+ transmissive_color: color(0.034230),
663
+ distance_scale: 0.002,
664
+ reflection_roughness: 0.05
665
+ );
666
+
667
+
668
+ // 02 - Dark Gray
669
+ export material plastic_dark_gray(*)
670
+ [[
671
+ ::anno::author("NVIDIA ARC"),
672
+ ::anno::display_name("Metallic Plastic Dark Gray"),
673
+ ::anno::description(DESCRIPTION),
674
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "dark", "gray", "neutral")),
675
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_dark_gray.png"),
676
+ ::anno::copyright_notice(COPYRIGHT)
677
+ ]] = metallic_plastic_simple_controls(
678
+ diffuse_color: color(0.127530),
679
+ diffuse_weight: .5,
680
+ transmissive_color: color(0.089194),
681
+ distance_scale: 0.002,
682
+ reflection_roughness: 0.05
683
+ );
684
+
685
+
686
+ // 03 - Light Gray
687
+ export material plastic_light_gray(*)
688
+ [[
689
+ ::anno::author("NVIDIA ARC"),
690
+ ::anno::display_name("Metallic Plastic Light Gray"),
691
+ ::anno::description(DESCRIPTION),
692
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "light", "gray", "neutral")),
693
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_light_gray.png"),
694
+ ::anno::copyright_notice(COPYRIGHT)
695
+ ]] = metallic_plastic_simple_controls(
696
+ diffuse_color: color(0.464741),
697
+ diffuse_weight: .5,
698
+ transmissive_color: color(0.358654),
699
+ distance_scale: 0.002,
700
+ reflection_roughness: 0.05
701
+ );
702
+
703
+
704
+ // 04 - White
705
+ export material plastic_white(*)
706
+ [[
707
+ ::anno::author("NVIDIA ARC"),
708
+ ::anno::display_name("Metallic Plastic White"),
709
+ ::anno::description(DESCRIPTION),
710
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "light", "white", "neutral")),
711
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_white.png"),
712
+ ::anno::copyright_notice(COPYRIGHT)
713
+ ]] = metallic_plastic_simple_controls(
714
+ diffuse_color: color(0.915750),
715
+ diffuse_weight: .5,
716
+ transmissive_color: color(0.812241),
717
+ distance_scale: 0.002,
718
+ reflection_roughness: 0.05
719
+ );
720
+
721
+
722
+ // 05 - Ivory White
723
+ export material plastic_ivory_white(*)
724
+ [[
725
+ ::anno::author("NVIDIA ARC"),
726
+ ::anno::display_name("Metallic Plastic Ivory White"),
727
+ ::anno::description(DESCRIPTION),
728
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "white", "bright", "ivory", "warm")),
729
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_ivory_white.png"),
730
+ ::anno::copyright_notice(COPYRIGHT)
731
+ ]] = metallic_plastic_simple_controls(
732
+ diffuse_color: color(0.899385, 0.843370, 0.694081),
733
+ diffuse_weight: .5,
734
+ transmissive_color: color(0.722672, 0.708298, 0.547994),
735
+ distance_scale: 0.002,
736
+ reflection_roughness: 0.05
737
+ );
738
+
739
+
740
+ // 06 - Lemon
741
+ export material plastic_lemon(*)
742
+ [[
743
+ ::anno::author("NVIDIA ARC"),
744
+ ::anno::display_name("Metallic Plastic Lemon"),
745
+ ::anno::description(DESCRIPTION),
746
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "lemon", "yellow", "light", "warm")),
747
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_lemon.png"),
748
+ ::anno::copyright_notice(COPYRIGHT)
749
+ ]] = metallic_plastic_simple_controls(
750
+ diffuse_color: color(0.859174, 0.875138, 0.039947),
751
+ diffuse_weight: .5,
752
+ transmissive_color: color(0.98211, 0.843370, 0.031551),
753
+ distance_scale: 0.002,
754
+ reflection_roughness: 0.05
755
+ );
756
+
757
+
758
+ // 07 - Yellow Orange
759
+ export material plastic_yellow_orange(*)
760
+ [[
761
+ ::anno::author("NVIDIA ARC"),
762
+ ::anno::display_name("Metallic Plastic Yellow"),
763
+ ::anno::description(DESCRIPTION),
764
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "light", "orange", "yellow", "warm")),
765
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_yellow_orange.png"),
766
+ ::anno::copyright_notice(COPYRIGHT)
767
+ ]] = metallic_plastic_simple_controls(
768
+ diffuse_color: color(0.875138, 0.612066, 0.039947),
769
+ diffuse_weight: .5,
770
+ transmissive_color: color(0.899385, 0.373615, 0.030257),
771
+ distance_scale: 0.002,
772
+ reflection_roughness: 0.05
773
+ );
774
+
775
+
776
+ // 08 - Orange
777
+ export material plastic_orange(*)
778
+ [[
779
+ ::anno::author("NVIDIA ARC"),
780
+ ::anno::display_name("Metallic Plastic Orange"),
781
+ ::anno::description(DESCRIPTION),
782
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "orange", "warm")),
783
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_orange.png"),
784
+ ::anno::copyright_notice(COPYRIGHT)
785
+ ]] = metallic_plastic_simple_controls(
786
+ diffuse_color: color(0.875138, 0.353741, 0.030257),
787
+ diffuse_weight: .5,
788
+ transmissive_color: color(0.891262, 0.420508, 0.022013),
789
+ distance_scale: 0.002,
790
+ reflection_roughness: 0.05
791
+ );
792
+
793
+
794
+ // 09 - Dark Orange
795
+ export material plastic_dark_orange(*)
796
+ [[
797
+ ::anno::author("NVIDIA ARC"),
798
+ ::anno::display_name("Metallic Plastic Dark Orange"),
799
+ ::anno::description(DESCRIPTION),
800
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "dark", "orange", "warm")),
801
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_dark_orange.png"),
802
+ ::anno::copyright_notice(COPYRIGHT)
803
+ ]] = metallic_plastic_simple_controls(
804
+ diffuse_color: color(0.535642, 0.127530, 0.022013),
805
+ diffuse_weight: .5,
806
+ transmissive_color: color(0.827726, 0.267358, 0.022013),
807
+ distance_scale: 0.002,
808
+ reflection_roughness: 0.05
809
+ );
810
+
811
+
812
+ // 10 - Red
813
+ export material plastic_red(*)
814
+ [[
815
+ ::anno::author("NVIDIA ARC"),
816
+ ::anno::display_name("Metallic Plastic Red"),
817
+ ::anno::description(DESCRIPTION),
818
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "red", "cherry", "warm")),
819
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_red.png"),
820
+ ::anno::copyright_notice(COPYRIGHT)
821
+ ]] = metallic_plastic_simple_controls(
822
+ diffuse_color: color(0.547994, 0.027755, 0.027755),
823
+ diffuse_weight: .5,
824
+ transmissive_color: color(0.875138, 0.022013, 0.022013),
825
+ distance_scale: 0.002,
826
+ reflection_roughness: 0.05
827
+ );
828
+
829
+
830
+ // 11 - Magenta
831
+ export material plastic_magenta(*)
832
+ [[
833
+ ::anno::author("NVIDIA ARC"),
834
+ ::anno::display_name("Metallic Plastic Magenta"),
835
+ ::anno::description(DESCRIPTION),
836
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "magenta")),
837
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_magenta.png"),
838
+ ::anno::copyright_notice(COPYRIGHT)
839
+ ]] = metallic_plastic_simple_controls(
840
+ diffuse_color: color(0.547994, 0.047776, 0.554227),
841
+ diffuse_weight: .5,
842
+ transmissive_color: color(0.722672, 0.030257, 0.566810),
843
+ distance_scale: 0.002,
844
+ reflection_roughness: 0.05
845
+ );
846
+
847
+
848
+ // 12 - Purple
849
+ export material plastic_purple(*)
850
+ [[
851
+ ::anno::author("NVIDIA ARC"),
852
+ ::anno::display_name("Metallic Plastic Purple"),
853
+ ::anno::description(DESCRIPTION),
854
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "purple")),
855
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_purple.png"),
856
+ ::anno::copyright_notice(COPYRIGHT)
857
+ ]] = metallic_plastic_simple_controls(
858
+ diffuse_color: color(0.193972, 0.017936, 0.464741),
859
+ diffuse_weight: .5,
860
+ transmissive_color: color(0.701170, 0.018913, 0.645555),
861
+ distance_scale: 0.002,
862
+ reflection_roughness: 0.05
863
+ );
864
+
865
+
866
+ // 13 - Dark Blue
867
+ export material plastic_dark_blue(*)
868
+ [[
869
+ ::anno::author("NVIDIA ARC"),
870
+ ::anno::display_name("Metallic Plastic Dark Blue"),
871
+ ::anno::description(DESCRIPTION),
872
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "dark", "blue", "cool")),
873
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_dark_blue.png"),
874
+ ::anno::copyright_notice(COPYRIGHT)
875
+ ]] = metallic_plastic_simple_controls(
876
+ diffuse_color: color(0.027755, 0.058187, 0.311180),
877
+ diffuse_weight: .5,
878
+ transmissive_color: color(0.027755, 0.058187, 0.311180),
879
+ distance_scale: 0.002,
880
+ reflection_roughness: 0.05
881
+ );
882
+
883
+
884
+ // 14 - Blue
885
+ export material plastic_blue(*)
886
+ [[
887
+ ::anno::author("NVIDIA ARC"),
888
+ ::anno::display_name("Metallic Plastic Blue"),
889
+ ::anno::description(DESCRIPTION),
890
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "blue", "cool")),
891
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_blue.png"),
892
+ ::anno::copyright_notice(COPYRIGHT)
893
+ ]] = metallic_plastic_simple_controls(
894
+ diffuse_color: color(0.034230, 0.173439, 0.843370),
895
+ diffuse_weight: .5,
896
+ transmissive_color: color(0.034230, 0.124741, 0.659224),
897
+ distance_scale: 0.002,
898
+ reflection_roughness: 0.05
899
+ );
900
+
901
+
902
+ // 15 - Sky Blue
903
+ export material plastic_sky_blue(*)
904
+ [[
905
+ ::anno::author("NVIDIA ARC"),
906
+ ::anno::display_name("Metallic Plastic Sky Blue"),
907
+ ::anno::description(DESCRIPTION),
908
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "blue", "sky", "cool")),
909
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_sky_blue.png"),
910
+ ::anno::copyright_notice(COPYRIGHT)
911
+ ]] = metallic_plastic_simple_controls(
912
+ diffuse_color: color(0.061907, 0.535642, 0.875138),
913
+ diffuse_weight: .5,
914
+ transmissive_color: color(0.028991, 0.358654, 0.673049),
915
+ distance_scale: 0.002,
916
+ reflection_roughness: 0.05
917
+ );
918
+
919
+
920
+ // 16 - Light Blue
921
+ export material plastic_light_blue(*)
922
+ [[
923
+ ::anno::author("NVIDIA ARC"),
924
+ ::anno::display_name("Metallic Plastic Light Blue"),
925
+ ::anno::description(DESCRIPTION),
926
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "light", "blue", "cool")),
927
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_light_blue.png"),
928
+ ::anno::copyright_notice(COPYRIGHT)
929
+ ]] = metallic_plastic_simple_controls(
930
+ diffuse_color: color(0.263175, 0.774227, 0.827726),
931
+ diffuse_weight: .5,
932
+ transmissive_color: color(0.163641, 0.592438, 0.759300),
933
+ distance_scale: 0.002,
934
+ reflection_roughness: 0.05
935
+ );
936
+
937
+
938
+ // 17 - Teal
939
+ export material plastic_teal(*)
940
+ [[
941
+ ::anno::author("NVIDIA ARC"),
942
+ ::anno::display_name("Metallic Plastic Teal"),
943
+ ::anno::description(DESCRIPTION),
944
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "teal", "cool")),
945
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_teal.png"),
946
+ ::anno::copyright_notice(COPYRIGHT)
947
+ ]] = metallic_plastic_simple_controls(
948
+ diffuse_color: color(0.037029, 0.579547, 0.329729),
949
+ diffuse_weight: .5,
950
+ transmissive_color: color(0.022013, 0.476177, 0.353741),
951
+ distance_scale: 0.002,
952
+ reflection_roughness: 0.05
953
+ );
954
+
955
+
956
+ // 18 - Dark Green
957
+ export material plastic_dark_green(*)
958
+ [[
959
+ ::anno::author("NVIDIA ARC"),
960
+ ::anno::display_name("Metallic Plastic Dark Green"),
961
+ ::anno::description(DESCRIPTION),
962
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "dark", "green")),
963
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_dark_green.png"),
964
+ ::anno::copyright_notice(COPYRIGHT)
965
+ ]] = metallic_plastic_simple_controls(
966
+ diffuse_color: color(0.034230, 0.141980, 0.034230),
967
+ diffuse_weight: .5,
968
+ transmissive_color: color(0.016988, 0.141980, 0.016988),
969
+ distance_scale: 0.002,
970
+ reflection_roughness: 0.05
971
+ );
972
+
973
+
974
+ // 19 - Green
975
+ export material plastic_green(*)
976
+ [[
977
+ ::anno::author("NVIDIA ARC"),
978
+ ::anno::display_name("Metallic Plastic Green"),
979
+ ::anno::description(DESCRIPTION),
980
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "green")),
981
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_green.png"),
982
+ ::anno::copyright_notice(COPYRIGHT)
983
+ ]] = metallic_plastic_simple_controls(
984
+ diffuse_color: color(0.016988, 0.311180, 0.016988),
985
+ diffuse_weight: .5,
986
+ transmissive_color: color(0.012664, 0.358654, 0.012664),
987
+ distance_scale: 0.002,
988
+ reflection_roughness: 0.05
989
+ );
990
+
991
+
992
+ // 20 - Light Green
993
+ export material plastic_light_green(*)
994
+ [[
995
+ ::anno::author("NVIDIA ARC"),
996
+ ::anno::display_name("Metallic Plastic Light Green"),
997
+ ::anno::description(DESCRIPTION),
998
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "light", "green")),
999
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_light_green.png"),
1000
+ ::anno::copyright_notice(COPYRIGHT)
1001
+ ]] = metallic_plastic_simple_controls(
1002
+ diffuse_color: color(0.030257, 0.687031, 0.027755),
1003
+ diffuse_weight: .5,
1004
+ transmissive_color: color(0.030257, 0.701170, 0.027755),
1005
+ distance_scale: 0.002,
1006
+ reflection_roughness: 0.05
1007
+ );
1008
+
1009
+
1010
+ // 21 - Lime Green
1011
+ export material plastic_lime_green(*)
1012
+ [[
1013
+ ::anno::author("NVIDIA ARC"),
1014
+ ::anno::display_name("Metallic Plastic Lime Green"),
1015
+ ::anno::description(DESCRIPTION),
1016
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "lime", "green", "light")),
1017
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_lime_green.png"),
1018
+ ::anno::copyright_notice(COPYRIGHT)
1019
+ ]] = metallic_plastic_simple_controls(
1020
+ diffuse_color: color(0.186989, 0.605484, 0.027755),
1021
+ diffuse_weight: .5,
1022
+ transmissive_color: color(0.204710, 0.701170, 0.022013),
1023
+ distance_scale: 0.002,
1024
+ reflection_roughness: 0.05
1025
+ );
objects/table_maple/materials/remote/omniverse-content-production.s3.us-west-2.amazonaws.com/Materials/2023_1/Base/Plastics/Plastic.mdl ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.4;
2
+
3
+ using ::OmniPBR import OmniPBR;
4
+ import ::tex::gamma_mode;
5
+ import ::state::normal;
6
+
7
+ export material Plastic(*)
8
+ = OmniPBR(
9
+ diffuse_color_constant: color(1.0, 1.0, 1.0),
10
+ diffuse_texture: texture_2d(), //"./Plastic/Plastic_BaseColor.png", ::tex::gamma_srgb
11
+ albedo_desaturation: 0.f,
12
+ albedo_add: 0.f,
13
+ albedo_brightness: 1.f,
14
+ diffuse_tint: color(1.f, 1.f, 1.f), //0.15f, 0.15f, 0.15f
15
+ reflection_roughness_constant: 0.45,
16
+ reflection_roughness_texture_influence: 0.f,
17
+ reflectionroughness_texture: texture_2d(),
18
+ metallic_constant: 0.0,
19
+ metallic_texture_influence: 0.f,
20
+ metallic_texture: texture_2d(),
21
+ specular_level: 0.5f,
22
+ enable_ORM_texture: true,
23
+ ORM_texture: texture_2d(), //"./Plastic/Plastic_ORM.png", ::tex::gamma_linear
24
+ ao_to_diffuse: 0.f,
25
+ ao_texture: texture_2d(),
26
+ enable_emission: false,
27
+ emissive_color: color(0.0, 0.0, 0.0),
28
+ emissive_mask_texture: texture_2d(),
29
+ emissive_intensity: 0.0,
30
+ bump_factor: 0.5f,
31
+ normalmap_texture: texture_2d(), //"./Plastic/Plastic_Normal.png", ::tex::gamma_linear
32
+ detail_bump_factor: 1.f,
33
+ detail_normalmap_texture: texture_2d(),
34
+ project_uvw: false,
35
+ world_or_object: false,
36
+ uv_space_index: 0,
37
+ texture_translate: float2(0.f),
38
+ texture_rotate: 0.f,
39
+ texture_scale: float2(1.f),
40
+ detail_texture_translate: float2(0.f),
41
+ detail_texture_rotate: 0.f,
42
+ detail_texture_scale: float2(1.f));
objects/table_maple/materials/remote/omniverse-content-production.s3.us-west-2.amazonaws.com/Materials/2023_1/Base/Plastics/Plastic_Clear.mdl ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.3;
2
+
3
+ import ::OmniGlass::OmniGlass;
4
+ import ::tex::gamma_mode;
5
+ import ::state::normal;
6
+
7
+ export material Plastic_Clear(*)
8
+ = OmniGlass::OmniGlass(
9
+ absorption_coeff: color(1.f, 1.f, 1.f),
10
+ glass_color: color(1.f, 1.f, 1.f),
11
+ use_glass_color_texture: false,
12
+ glass_color_texture: texture_2d(),
13
+ frosting_roughness: 0.f,
14
+ glass_ior: 1.46f,
15
+ thin_walled: true,
16
+ project_uvw: false,
17
+ world_or_object: false,
18
+ uv_space_index: 0,
19
+ texture_translate: float2(0.f),
20
+ texture_rotate: 0.f,
21
+ texture_scale: float2(1.f));
objects/table_maple/materials/remote/omniverse-content-production.s3.us-west-2.amazonaws.com/Materials/2023_1/vMaterials_2/Paint/Carpaint/Carpaint_Solid.mdl ADDED
@@ -0,0 +1,1112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2023 NVIDIA Corporation. All rights reserved. *
3
+ ******************************************************************************
4
+
5
+ Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge,
6
+ to any person obtaining a copy of the sample definition code that uses our
7
+ Material Definition Language (the "MDL Materials"), to reproduce and distribute
8
+ the MDL Materials, including without limitation the rights to use, copy, merge,
9
+ publish, distribute, and sell modified and unmodified copies of the MDL
10
+ Materials, and to permit persons to whom the MDL Materials is furnished to do
11
+ so, in all cases solely for use with NVIDIA's Material Definition Language,
12
+ subject to the following further conditions:
13
+
14
+ 1. The above copyright notices, this list of conditions, and the disclaimer
15
+ that follows shall be retained in all copies of one or more of the MDL
16
+ Materials, including in any software with which the MDL Materials are bundled,
17
+ redistributed, and/or sold, and included either as stand-alone text files,
18
+ human-readable headers or in the appropriate machine-readable metadata fields
19
+ within text or binary files as long as those fields can be easily viewed by the
20
+ user, as applicable.
21
+ 2. The name of NVIDIA shall not be used to promote, endorse or advertise any
22
+ Modified Version without specific prior written permission, except a) to comply
23
+ with the notice requirements otherwise contained herein; or b) to acknowledge
24
+ the contribution(s) of NVIDIA.
25
+
26
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
27
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
28
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
29
+ TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR
30
+ ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL,
31
+ INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF
32
+ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE
33
+ THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.
34
+ */
35
+
36
+ mdl 1.6;
37
+ import ::df::*;
38
+ import ::math::*;
39
+ import ::anno::*;
40
+ import ::state::*;
41
+ import ::base::*;
42
+ import ::tex::*;
43
+ import ::nvidia::core_definitions::dimension;
44
+ import ::nvidia::core_definitions::blend_colors;
45
+
46
+
47
+ const string COPYRIGHT =
48
+ " Copyright 2023 NVIDIA Corporation. All rights reserved.\n"
49
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
50
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
51
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
52
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
53
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
54
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
55
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
56
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
57
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
58
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
59
+
60
+
61
+ ::base::texture_coordinate_info transform_coordinate_2(
62
+ float4x4 transform
63
+ [[ ::anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix") ]],
64
+ ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info()
65
+ [[ ::anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection") ]]
66
+ ) [[
67
+ ::anno::description("Transform a texture coordinate by a matrix") ,
68
+ ::anno::noinline()
69
+ ]]
70
+ {
71
+ // Version 2
72
+ float4 r_position = transform * float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1);
73
+ //Try aproximating it for the case that the rotation is only aroud z and assuming the texture layout is nice and z is ~constant.
74
+ //just pretend there is no other rotation happening
75
+ //get rid of scaling and translation. Then extract fields where sin and cos would be in a simple 2d transform around z.
76
+ float4 u = transform[0];
77
+ float3 ru = ::math::normalize(float3(u.x,u.y,u.z));
78
+ float cos = ru.x;
79
+ float sin = -ru.y;
80
+
81
+ return ::base::texture_coordinate_info(
82
+ float3(r_position.x,r_position.y,r_position.z),
83
+ ::math::normalize(cos * coordinate.tangent_u - sin * coordinate.tangent_v),
84
+ ::math::normalize(cos * coordinate.tangent_v + sin * coordinate.tangent_u));
85
+ }
86
+
87
+ // Takes the standard input that every material has. It combines a couple of
88
+ // functions in one convenience function.
89
+ ::base::texture_coordinate_info vmat_transform(
90
+ float2 translation = float2(0.0f, 0.0f),
91
+ float rotation = 0.0f, // rotation in degrees
92
+ float2 scaling = float2(1.0f, 1.0f),
93
+ uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw,
94
+ uniform int uv_space = 0
95
+ )
96
+ {
97
+ float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f;
98
+ float4x4 scale =
99
+ float4x4(1.0f /scaling.x, 0.f , 0.f , 0.f,
100
+ 0.f , 1.0f /scaling.y , 0.f , 0.f,
101
+ 0.f , 0.f , 1.0f, 0.f,
102
+ translation.x , translation.y , 0.0f, 1.f);
103
+
104
+ float s = ::math::sin(rotation_rad);
105
+ float c = ::math::cos(rotation_rad);
106
+ float4x4 rotate =
107
+ float4x4( c , -s , 0.0f , 0.0f,
108
+ s , c , 0.0f , 0.0f,
109
+ 0.0f, 0.0f , 1.0f , 0.0f,
110
+ 0.f , 0.0f , 0.0f , 1.f);
111
+
112
+ return transform_coordinate_2(scale*rotate, ::base::coordinate_source(system, uv_space));
113
+ }
114
+
115
+
116
+
117
+ float histogram_range(float input, float range = 1.0f, float position = 0.5f)
118
+ {
119
+ float low = ::math::clamp(1.0f - ::math::min(((1.0f - position) + range * 0.5f), (1.0f - position) * 2), 0.0f, 1.0f);
120
+ float high = ::math::clamp(::math::min((position + range * 0.5f ), position * 2.0f), 0.0f, 1.0f);
121
+ return ::math::lerp(low, high, input);
122
+ }
123
+
124
+ //
125
+ // flake noise utilities
126
+ //
127
+ int hash(int seed, int i)
128
+ {
129
+ return (i ^ seed) * 1075385539;
130
+ }
131
+ int rnd_init(int3 pos)
132
+ {
133
+ return hash(hash(hash(0, pos.x), pos.y), pos.z);
134
+ }
135
+
136
+ int rnd_next(int seed) {
137
+ // xorshift32 using signed int
138
+ seed ^= seed << 13;
139
+ seed ^= seed >>> 17;
140
+ seed ^= seed << 5;
141
+ return seed;
142
+ }
143
+
144
+ float rnd_value(int seed)
145
+ {
146
+ //return ::math::abs(float(seed) * 4.6566fe-10f);
147
+ return ::math::abs(float(seed) * 0.00000000046566f);
148
+ }
149
+
150
+ // apply random rotation (using "Fast Random Rotation Matrices" by James Arvo)
151
+ float3 rotate_pos(float3 pos, float3 xi)
152
+ {
153
+ float theta = ::math::PI * 2.0f * xi.x;
154
+ float phi = ::math::PI * 2.0f * xi.y;
155
+ float z = xi.z * 2.0f;
156
+
157
+ float r = ::math::sqrt(z);
158
+ float[2] sp_cp = ::math::sincos(phi);
159
+ float Vx = sp_cp[0] * r;
160
+ float Vy = sp_cp[1] * r;
161
+ float Vz = ::math::sqrt(2.0f - z);
162
+
163
+ float[2] st_ct = ::math::sincos(theta);
164
+ float Sx = Vx * st_ct[1] - Vy * st_ct[0];
165
+ float Sy = Vx * st_ct[0] + Vy * st_ct[1];
166
+
167
+ float3x3 M(
168
+ Vx * Sx - st_ct[1], Vx * Sy - st_ct[0], Vx * Vz,
169
+ Vy * Sx + st_ct[0], Vy * Sy - st_ct[1], Vy * Vz,
170
+ Vz * Sx, Vz * Sy, 1.0f - z);
171
+
172
+ return M * pos;
173
+ }
174
+
175
+ struct flake_noise_value {
176
+ // flake priority (in [0..1], 0: no flake, flakes with higher priority shadow flakes "below" them)
177
+ float priority;
178
+ // Stores values from the functions (once normal, another time the color)
179
+ // current pseudo random number generator seed
180
+ int rnd_seed;
181
+ float4 carrier;
182
+ };
183
+
184
+ // flake noise function with controllable regularity, flake size, and probability
185
+ flake_noise_value flake_noise(
186
+ float3 pos,
187
+ float jitter_scale = 1.0f,
188
+ float flake_diameter = 0.75f,
189
+ float flake_probability = 1.0f)
190
+ {
191
+ float3 base_pos = ::math::floor(pos);
192
+ int3 base_pos_i = int3(base_pos);
193
+
194
+ // limit the flake size to the allowed maximum (such that looking at all neighbors is sufficient)
195
+ flake_diameter = ::math::min(flake_diameter, (1.5f - 0.5f * jitter_scale) / ::math::sqrt(3.0f));
196
+
197
+ flake_noise_value val(0.0f, 0, float4(0.0f));
198
+
199
+ for (int i = -1; i < 2; ++i) {
200
+ for (int j = -1; j < 2; ++j) {
201
+ for (int k = -1; k < 2; ++k) {
202
+
203
+ int seed = rnd_init(base_pos_i + int3(i, j, k));
204
+
205
+ seed = rnd_next(seed);
206
+ if (rnd_value(seed) > flake_probability)
207
+ continue;
208
+
209
+ seed = rnd_next(seed);
210
+ float priority = rnd_value(seed);
211
+ if (priority < val.priority)
212
+ continue;
213
+
214
+ float3 flake_pos = base_pos + float3(i, j, k) + float3(0.5f);
215
+
216
+ if (jitter_scale > 0.0f) {
217
+ seed = rnd_next(seed);
218
+ flake_pos.x += (rnd_value(seed) - 0.5f) * jitter_scale;
219
+ seed = rnd_next(seed);
220
+ flake_pos.y += (rnd_value(seed) - 0.5f) * jitter_scale;
221
+ seed = rnd_next(seed);
222
+ flake_pos.z += (rnd_value(seed) - 0.5f) * jitter_scale;
223
+ }
224
+
225
+ float3 p = pos - flake_pos;
226
+ if (::math::dot(p, p) >= flake_diameter * flake_diameter * 4.0f)
227
+ continue;
228
+
229
+ float3 xi_rot;
230
+ seed = rnd_next(seed);
231
+ xi_rot.x = rnd_value(seed);
232
+ seed = rnd_next(seed);
233
+ xi_rot.y = rnd_value(seed);
234
+ seed = rnd_next(seed);
235
+ xi_rot.z = rnd_value(seed);
236
+ p = rotate_pos(p, xi_rot);
237
+
238
+ if (::math::abs(p.x) <= flake_diameter &&
239
+ ::math::abs(p.y) <= flake_diameter &&
240
+ ::math::abs(p.z) <= flake_diameter)
241
+ {
242
+ val.priority = priority;
243
+ val.rnd_seed = seed;
244
+ }
245
+ }
246
+ }
247
+ }
248
+
249
+ return val;
250
+ }
251
+
252
+ // create a flake normal by importance sampling the Beckmann distribution with given roughness
253
+ flake_noise_value flake_normal(
254
+ flake_noise_value val,
255
+ float spread)
256
+ {
257
+ if (val.priority <= 0.0f)
258
+ {
259
+ val.carrier = float4(::state::normal().x, ::state::normal().y, ::state::normal().z, 1.0f);
260
+ return val;
261
+ }
262
+
263
+ int seed = rnd_next(val.rnd_seed);
264
+ float xi0 = rnd_value(seed);
265
+ seed = rnd_next(seed);
266
+ float xi1 = rnd_value(seed);
267
+
268
+ float phi = ::math::PI * 2.0f * xi0;
269
+
270
+ float roughness = spread * spread;
271
+
272
+ float tantheta = ::math::sqrt(-roughness * roughness * ::math::log(1.0f - xi1));
273
+ float sintheta = tantheta / ::math::sqrt(1.0f + tantheta * tantheta);
274
+ float costheta = ::math::sqrt(1.0f - sintheta * sintheta);
275
+
276
+ float[2] scphi = ::math::sincos(phi);
277
+
278
+ val.rnd_seed = seed;
279
+
280
+ float3 normal = ::state::texture_tangent_u(0) * scphi[1] * sintheta +
281
+ ::state::texture_tangent_v(0) * scphi[0] * sintheta +
282
+ ::state::normal() * costheta;
283
+
284
+ val.carrier = float4(normal.x, normal.y, normal.z, 1.0f);
285
+
286
+
287
+ return val;
288
+ }
289
+
290
+
291
+ export material Carpaint_Solid(
292
+ color base_color = color(0.002125f, 0.051269f, 0.046665f) [[
293
+ ::anno::description("Sets the base color of the carpaint"),
294
+ ::anno::display_name("Base "),
295
+ ::anno::in_group("Appearance"),
296
+ ::anno::ui_order(0)
297
+ ]],
298
+ float ground_coat_influence = 0.9f [[
299
+ ::anno::description("The ground coat layer is a metallic base layer over which the base color coat, the flakes and the clearcoat are applied. Use the parameter 'Ground Coat Brightness' to adjust its brightness."),
300
+ ::anno::display_name("Base Coat Influence"),
301
+ ::anno::in_group("Appearance"),
302
+ ::anno::hard_range(0.f, 1.f),
303
+ ::anno::ui_order(1)
304
+ ]],
305
+ float ground_coat_brightness = 0.24f [[
306
+ ::anno::description("Adjusts the brightness of the metallic ground coat over which the base color coat, the flakes and the clearcoat are applied. Only has an effect, if the Ground Coat Influence is greater than 0.0"),
307
+ ::anno::display_name("Base Coat Brightness"),
308
+ ::anno::in_group("Appearance"),
309
+ ::anno::hard_range(0.f, 1.f),
310
+ ::anno::ui_order(2)
311
+ ]],
312
+ float edge_darkening = 0.96f [[
313
+ ::anno::description("The amount how much colors fade to darker color when looking at the carpaint at grazing angles. Low values make the carpaint look more flat"),
314
+ ::anno::display_name("Edge Darkening"),
315
+ ::anno::in_group("Appearance"),
316
+ ::anno::hard_range(0.f, 1.f),
317
+ ::anno::ui_order(3)
318
+ ]],
319
+ color flakes_tint = color(0.016807f, 0.171441f, 0.417885f) [[
320
+ ::anno::description("The color of the flakes"),
321
+ ::anno::display_name("Flakes Tint"),
322
+ ::anno::in_group("Flakes"),
323
+ ::anno::ui_order(4)
324
+ ]],
325
+ uniform float flakes_density = 0.29f [[
326
+ ::anno::description("Adjusts the density of the flakes. Lower number means less flake particles being applied."),
327
+ ::anno::display_name("Flakes Density"),
328
+ ::anno::in_group("Flakes"),
329
+ ::anno::hard_range(0.f, 1.f),
330
+ ::anno::ui_order(5)
331
+ ]],
332
+ float spread = 0.12f [[
333
+ ::anno::description("The amount how much flakes are pointing to random directions. It is strongly discouraged using a value of 0.0 as the flakes will be oriented exactly as the surface normal, which will result in an unnatural look. Higher values lead to a more scintillating look of the flakes."),
334
+ ::anno::display_name("Flakes Spread"),
335
+ ::anno::enable_if("flakes_density > 0.0f"),
336
+ ::anno::in_group("Flakes"),
337
+ ::anno::hard_range(0.f, 1.f),
338
+ ::anno::ui_order(6)
339
+ ]],
340
+ float flakes_roughness = 0.46f [[
341
+ ::anno::description("The roughness of the flakes itself. Higher values smoothen out the look of the flakes. Depending on the flakes being used in carpaints, use low values for a sparkling flake effect while mica flakes tend to have a higher roughness, leading to a smoother more pearlescent look on the final carpaint"),
342
+ ::anno::display_name("Flakes Roughness"),
343
+ ::anno::enable_if("flakes_density > 0.0f"),
344
+ ::anno::in_group("Flakes"),
345
+ ::anno::hard_range(0.f, 1.f),
346
+ ::anno::ui_order(7)
347
+ ]],
348
+ float flakes_size = 0.1f [[
349
+ ::anno::description("Size of the metal flakes in millimeters."),
350
+ ::anno::display_name("Flakes Size (mm)"),
351
+ ::anno::enable_if("flakes_density > 0.0f"),
352
+ ::anno::soft_range(0.f, 1.f),
353
+ ::anno::in_group("Flakes"),
354
+ ::anno::ui_order(8)
355
+ ]],
356
+ float candy_flip = 0.f [[
357
+ ::anno::description("Changes the tint of the coating to fade towards the flake color to produce a candy paint effect. "),
358
+ ::anno::display_name("Candy Coating"),
359
+ ::anno::in_group("Flakes"),
360
+ ::anno::hard_range(0.f, 1.f),
361
+ ::anno::ui_order(9)
362
+ ]],
363
+ float flake_layer_visibility = 0.f [[
364
+ ::anno::description("Adjusts how much the flakes contribute to the final look. Lowering the value makes the flakes appear more transparent. At value of 0.0 no flakes are not rendered at all"),
365
+ ::anno::display_name("Flakes Visibility"),
366
+ ::anno::enable_if("flakes_density > 0.0f"),
367
+ ::anno::in_group("Flakes"),
368
+ ::anno::hard_range(0.f, 1.f),
369
+ ::anno::ui_order(10)
370
+ ]],
371
+ uniform texture_2d roughness_texture = texture_2d("./textures/smudges_scratches_A_rough.jpg", ::tex::gamma_linear) [[
372
+ ::anno::description("Texture to use for adding variation to the roughness on the clearcoat"),
373
+ ::anno::display_name("Roughness Texture"),
374
+ ::anno::in_group("Clearcoat"),
375
+ ::anno::ui_order(11)
376
+ ]],
377
+ float clearcoat_rough = 0.f [[
378
+ ::anno::description("The roughness of the clearcoat"),
379
+ ::anno::display_name("Clearcoat Roughness"),
380
+ ::anno::in_group("Clearcoat"),
381
+ ::anno::hard_range(0.f, 1.f),
382
+ ::anno::ui_order(12)
383
+ ]],
384
+ float roughness_variation = 0.f [[
385
+ ::anno::description("The amount of variation to apply to the roughness. This parameter only has an effect when the clearcoat roughness is not zero or one"),
386
+ ::anno::display_name("Clearcoat Roughness Variation"),
387
+ ::anno::in_group("Clearcoat"),
388
+ ::anno::hard_range(0.f, 1.f),
389
+ ::anno::ui_order(13)
390
+ ]],
391
+ float clearcoat_ior = 1.600f [[
392
+ ::anno::description("The index of refraction for the clearcoat layer"),
393
+ ::anno::display_name("Clearcoat Index of Refraction"),
394
+ ::anno::in_group("Clearcoat"),
395
+ ::anno::soft_range(1.f, 3.f),
396
+ ::anno::hard_range(1.f, 5.f),
397
+ ::anno::ui_order(14)
398
+ ]],
399
+ float clearcoat_visibility = 1.f [[
400
+ ::anno::description("While the full value is the correct physical behavior of the clearcoat, lowering the value to reduce the amount of reflection for artistic purposes"),
401
+ ::anno::display_name("Clearcoat Visibility"),
402
+ ::anno::in_group("Clearcoat"),
403
+ ::anno::hard_range(0.f, 1.f),
404
+ ::anno::ui_order(15)
405
+ ]],
406
+ uniform float orange_peel_strength = 0.f [[
407
+ ::anno::description("Strength of the bump mapping effect"),
408
+ ::anno::display_name("Coat Orange Peel Strength"),
409
+ ::anno::in_group("Clearcoat"),
410
+ ::anno::soft_range(0.f, 1.f),
411
+ ::anno::hard_range(0.f, 1.f),
412
+ ::anno::ui_order(16)
413
+ ]],
414
+ uniform float orange_peel_size = 1.f [[
415
+ ::anno::description("Size of the biggest feature of the pattern"),
416
+ ::anno::display_name("Coat Orange Peel Size"),
417
+ ::anno::soft_range(0.f, 1.f),
418
+ ::anno::in_group("Clearcoat"),
419
+ ::anno::ui_order(17)
420
+ ]],
421
+ float2 texture_translate = float2(0.f) [[
422
+ ::anno::description("Controls the position of the texture."),
423
+ ::anno::display_name("Texture Translate"),
424
+ ::anno::in_group("Transform"),
425
+ ::anno::ui_order(18)
426
+ ]],
427
+ float texture_rotate = 0.f [[
428
+ ::anno::description("Rotates angle of the texture in degrees."),
429
+ ::anno::display_name("Texture Rotate"),
430
+ ::anno::in_group("Transform"),
431
+ ::anno::soft_range(0.f, 360.f),
432
+ ::anno::ui_order(19)
433
+ ]],
434
+ float2 texture_scale = float2(1.f) [[
435
+ ::anno::description("Larger numbers increase the size."),
436
+ ::anno::display_name("Texture Scale"),
437
+ ::anno::in_group("Transform"),
438
+ ::nvidia::core_definitions::dimension(float2(1.0, 1.0)),
439
+ ::anno::ui_order(20)
440
+ ]],
441
+ uniform bool roundcorners_enable = false [[
442
+ ::anno::description("Enables the round corneer effect. Comes at a slight performance cost as additional raytracing calls are rquired to evaluate the round corner effect"),
443
+ ::anno::display_name("Enable Round Corners"),
444
+ ::anno::in_group("Round Corners"),
445
+ ::anno::ui_order(22)
446
+ ]],
447
+ uniform float roundcorners_radius_mm = 1.5f [[
448
+ ::anno::description("Radius of the rounded corners in millimeters"),
449
+ ::anno::display_name("Round Corner Radius (mm)"),
450
+ ::anno::in_group("Round Corners"),
451
+ ::anno::soft_range(0.f, 10.f),
452
+ ::anno::ui_order(23)
453
+ ]],
454
+ uniform bool roundcorners_across_materials = false [[
455
+ ::anno::description("Applies the round corner effect across different materials when enabled."),
456
+ ::anno::display_name("Across Materials"),
457
+ ::anno::in_group("Round Corners"),
458
+ ::anno::ui_order(27)
459
+ ]],
460
+ uniform int uv_space_index = 0 [[
461
+ ::anno::description("Use selected UV space for material."),
462
+ ::anno::display_name("UV Space Index"),
463
+ ::anno::in_group("Advanced"),
464
+ ::anno::ui_order(28)
465
+ ]]
466
+
467
+
468
+ )
469
+ [[
470
+ ::anno::author("NVIDIA"),
471
+ ::anno::display_name("Carpaint Solid"),
472
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
473
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "clearcoat", "automotive", "design")),
474
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Carpaint_Solid.png"),
475
+ ::anno::copyright_notice(COPYRIGHT)
476
+ ]]
477
+ =
478
+ let {
479
+ bool tmp0 = false;
480
+ // Tried Scaling factors for flakes to fit 1mm size both in Substance Designer and (Iray for) Rhino
481
+ // Rhino scaling factor: 1492.537313432835
482
+ // Substance Designer Scaling factor: 1158.6829010512
483
+ float flakes_size_m = (1492.537313432835f/flakes_size); // Flake scaling adjustment, so that flake size is in mm
484
+ float flake_layer_visibility_m = 1.0f - flake_layer_visibility;
485
+
486
+ ::base::texture_coordinate_info coord_info = ::base::coordinate_source(::base::texture_coordinate_object, 0);
487
+
488
+ float scale_trans = ::state::transform_scale(::state::coordinate_object, ::state::coordinate_world, 1.0f);
489
+
490
+ float3 source_coord = coord_info.position * ::state::meters_per_scene_unit() * scale_trans;
491
+
492
+ ::base::texture_coordinate_info transformed_coord = ::base::transform_coordinate(
493
+ ::base::rotation_translation_scale(float3(0.0f), float3(0.0f), float3(scale_trans)),
494
+ coord_info
495
+ );
496
+
497
+ material_surface tmp1(::df::fresnel_layer(clearcoat_ior, clearcoat_visibility, ::df::simple_glossy_bsdf(histogram_range(::base::file_texture(roughness_texture, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, roughness_variation, clearcoat_rough) * histogram_range(::base::file_texture(roughness_texture, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, roughness_variation, clearcoat_rough), histogram_range(::base::file_texture(roughness_texture, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, roughness_variation, clearcoat_rough) * histogram_range(::base::file_texture(roughness_texture, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, roughness_variation, clearcoat_rough), nvidia::core_definitions::blend_colors(color(1.f, 1.f, 1.f), flakes_tint, ::base::color_layer_blend, candy_flip).tint, nvidia::core_definitions::blend_colors(color(1.f, 1.f, 1.f), flakes_tint, ::base::color_layer_blend, candy_flip).tint, ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::directional_factor(color(1.f, 1.f, 1.f), color(1.f - edge_darkening), 1.f, flakes_density > 0.f ? ::df::weighted_layer(::math::lerp(flake_noise(source_coord * flakes_size_m, 0.5f, 1.f, flakes_density * flakes_density).priority > 0.001f ? 1.0f : 0.0f , 0.f, flake_layer_visibility_m), ::df::microfacet_ggx_smith_bsdf(flakes_roughness * 0.340000004f, flakes_roughness * 0.340000004f, flakes_tint, color(0.f, 0.f, 0.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::directional_factor(base_color, color(1.f - edge_darkening), 1.f, ::df::weighted_layer(ground_coat_influence * 0.5f, ::df::microfacet_ggx_vcavities_bsdf(0.40959999f, 0.40959999f, color(ground_coat_brightness * 0.949999988f + 0.0500000007f), color(ground_coat_brightness * 0.949999988f + 0.0500000007f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::diffuse_reflection_bsdf(base_color, 0.f), ::state::normal())), float3(flake_normal(flake_noise(source_coord * flakes_size_m, 0.5f, 1.f, flakes_density * flakes_density ), spread).carrier.x, flake_normal(flake_noise(source_coord * flakes_size_m, 0.5f, 1.f, flakes_density * flakes_density ), spread).carrier.y, flake_normal(flake_noise(source_coord * flakes_size_m, 0.5f, 1.f, flakes_density * flakes_density ), spread).carrier.z)) : ::df::directional_factor(base_color, color(1.f - edge_darkening), 1.f, ::df::weighted_layer(ground_coat_influence * 0.5f, ::df::microfacet_ggx_vcavities_bsdf(0.40959999f, 0.40959999f, color(ground_coat_brightness * 0.949999988f + 0.0500000007f), color(ground_coat_brightness * 0.949999988f + 0.0500000007f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::diffuse_reflection_bsdf(base_color, 0.f), ::state::normal()))), orange_peel_strength > 0.f ? ::base::perlin_noise_bump_texture(transformed_coord, orange_peel_strength, orange_peel_size, false, false, 0.f, 2, false, false, float3(0.f), 1.f, 0.f, 1.f, ::state::normal()) : ::state::normal()), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
498
+ material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
499
+ color tmp3 = color(1.f, 1.f, 1.f);
500
+ material_volume tmp4 = material_volume(scattering: vdf(), absorption_coefficient: color(0.f, 0.f, 0.f), scattering_coefficient: color(0.f, 0.f, 0.f));
501
+ material_geometry tmp5(float3(0.f), 1.f, roundcorners_enable ? ::state::rounded_corner_normal(roundcorners_radius_mm * 0.00100000005f, roundcorners_across_materials, 1.f) : ::state::normal());
502
+ hair_bsdf tmp6 = hair_bsdf();
503
+ } in
504
+ material(
505
+ thin_walled: tmp0,
506
+ surface: tmp1,
507
+ backface: tmp2,
508
+ ior: tmp3,
509
+ volume: tmp4,
510
+ geometry: tmp5,
511
+ hair: tmp6);
512
+
513
+
514
+ // ------------------- 2 (Plain White) -------------------
515
+ export material White(*)
516
+ [[
517
+ ::anno::author("NVIDIA"),
518
+ ::anno::display_name("Carpaint Solid - White"),
519
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
520
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "white", "light", "neutral")),
521
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.White.png"),
522
+ ::anno::copyright_notice(COPYRIGHT)
523
+ ]]
524
+ = Carpaint_Solid(
525
+ base_color: color(0.768151f, 0.768151f, 0.768151f),
526
+ ground_coat_influence: 0.0f,
527
+ ground_coat_brightness: 0.24f,
528
+ edge_darkening: 0.56f,
529
+ flakes_tint: color(0.552011f, 0.552011f, 0.552011f),
530
+ flakes_density: 0.0f,
531
+ spread: 0.47f,
532
+ flakes_roughness: 0.34f,
533
+ flakes_size: 0.5f,
534
+ candy_flip: 0.0f,
535
+ flake_layer_visibility: 1.0f,
536
+ // roughness_texture:
537
+ clearcoat_rough: 0.05f,
538
+ roughness_variation: 0.34f,
539
+ clearcoat_ior: 1.6f,
540
+ clearcoat_visibility: 1.0f,
541
+ orange_peel_strength: 0.0f,
542
+ orange_peel_size: 0.01f
543
+ );
544
+
545
+ // ------------------- 3 (vintage White) -------------------
546
+ export material Vintage_White(*)
547
+ [[
548
+ ::anno::author("NVIDIA"),
549
+ ::anno::display_name("Carpaint Solid - Vintage White"),
550
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
551
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "vintage", "white", "light", "neutral")),
552
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Vintage_White.png"),
553
+ ::anno::copyright_notice(COPYRIGHT)
554
+ ]]
555
+ = Carpaint_Solid(
556
+ base_color: color(0.672443f, 0.630757f, 0.502886f),
557
+ ground_coat_influence: 0.0f,
558
+ ground_coat_brightness: 0.24f,
559
+ edge_darkening: 0.28f,
560
+ flakes_tint: color(0.603827f, 0.665387f, 0.693872f),
561
+ flakes_density: 0.0f,
562
+ spread: 0.41f,
563
+ flakes_roughness: 0.32f,
564
+ flakes_size: 0.5f,
565
+ candy_flip: 0.0f,
566
+ flake_layer_visibility: 0.0f,
567
+ // roughness_texture:
568
+ clearcoat_rough: 0.05f,
569
+ roughness_variation: 0.34f,
570
+ clearcoat_ior: 1.6f,
571
+ clearcoat_visibility: 1.0f,
572
+ orange_peel_strength: 0.06f,
573
+ orange_peel_size: 0.01f
574
+ );
575
+
576
+
577
+ // ------------------- 4 (Black) -------------------
578
+ export material Black(*)
579
+ [[
580
+ ::anno::author("NVIDIA"),
581
+ ::anno::display_name("Carpaint Solid - Black"),
582
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
583
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "black", "dark", "neutral")),
584
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Black.png"),
585
+ ::anno::copyright_notice(COPYRIGHT)
586
+ ]]
587
+ = Carpaint_Solid(
588
+ base_color: color(0.006049f, 0.006049f, 0.006049f),
589
+ ground_coat_influence: 0.97f,
590
+ ground_coat_brightness: 0.17f,
591
+ edge_darkening: 0.57f,
592
+ flakes_tint: color(0.552011f, 0.552011f, 0.552011f),
593
+ flakes_density: 0.0f,
594
+ spread: 0.47f,
595
+ flakes_roughness: 0.34f,
596
+ flakes_size: 0.5f,
597
+ candy_flip: 0.0f,
598
+ flake_layer_visibility: 0.0f,
599
+ // roughness_texture:
600
+ clearcoat_rough: 0.05f,
601
+ roughness_variation: 0.36f,
602
+ clearcoat_ior: 1.6f,
603
+ clearcoat_visibility: 1.0f,
604
+ orange_peel_strength: 0.0f,
605
+ orange_peel_size: 0.01f
606
+ );
607
+
608
+ // ------------------- 5 (Black Matte) -------------------
609
+ export material Black_Matte(*)
610
+ [[
611
+ ::anno::author("NVIDIA"),
612
+ ::anno::display_name("Carpaint Solid - Black Matte"),
613
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
614
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "black", "dark", "neutral")),
615
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Black_Matte.png"),
616
+ ::anno::copyright_notice(COPYRIGHT)
617
+ ]]
618
+ = Carpaint_Solid(
619
+ base_color: color(0.006995f, 0.006995f, 0.006995f),
620
+ ground_coat_influence: 0.11f,
621
+ ground_coat_brightness: 0.64f,
622
+ edge_darkening: 0.0f,
623
+ flakes_tint: color(0.577580f, 0.577580f, 0.577580f),
624
+ flakes_density: 0.12f,
625
+ spread: 0.39f,
626
+ flakes_roughness: 0.5f,
627
+ flakes_size: 0.5f,
628
+ candy_flip: 0.0f,
629
+ flake_layer_visibility: 0.0f,
630
+ // roughness_texture:
631
+ clearcoat_rough: 0.48f,
632
+ roughness_variation: 0.14f,
633
+ clearcoat_ior: 1.6f,
634
+ clearcoat_visibility: 1.0f,
635
+ orange_peel_strength: 0.0f,
636
+ orange_peel_size: 0.01f
637
+ );
638
+
639
+ // ------------------- 6 -------------------
640
+ export material Agent_Gray(*)
641
+ [[
642
+ ::anno::author("NVIDIA"),
643
+ ::anno::display_name("Carpaint Solid - Agent Gray"),
644
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
645
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "gray", "neutral")),
646
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Agent_Gray.png"),
647
+ ::anno::copyright_notice(COPYRIGHT)
648
+ ]]
649
+ = Carpaint_Solid(
650
+ base_color: color(0.234551f, 0.254152f, 0.234551f),
651
+ ground_coat_influence: 0.11f,
652
+ ground_coat_brightness: 0.64f,
653
+ edge_darkening: 0.0f,
654
+ flakes_tint: color(0.644480f, 0.701102f, 0.644480f),
655
+ flakes_density: 0.2f,
656
+ spread: 0.25f,
657
+ flakes_roughness: 0.5f,
658
+ flakes_size: 0.5f,
659
+ candy_flip: 0.0f,
660
+ flake_layer_visibility: 0.0f,
661
+ // roughness_texture:
662
+ clearcoat_rough: 0.06f,
663
+ roughness_variation: 0.36f,
664
+ clearcoat_ior: 1.6f,
665
+ clearcoat_visibility: 1.0f,
666
+ orange_peel_strength: 0.0f,
667
+ orange_peel_size: 0.01f
668
+ );
669
+
670
+
671
+ // ------------------- 7 (Agent Gray Matte)-------------------
672
+ export material Agent_Gray_Matte(*)
673
+ [[
674
+ ::anno::author("NVIDIA"),
675
+ ::anno::display_name("Carpaint Solid - Agent Gray Matte"),
676
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
677
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "matte", "gray", "neutral")),
678
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Agent_Gray_Matte.png"),
679
+ ::anno::copyright_notice(COPYRIGHT)
680
+ ]]
681
+ = Carpaint_Solid(
682
+ base_color: color(0.234551f, 0.254152f, 0.234551f),
683
+ ground_coat_influence: 0.11f,
684
+ ground_coat_brightness: 0.64f,
685
+ edge_darkening: 0.0f,
686
+ flakes_tint: color(0.644480f, 0.701102f, 0.644480f),
687
+ flakes_density: 0.21f,
688
+ spread: 0.25f,
689
+ flakes_roughness: 0.5f,
690
+ flakes_size: 0.5f,
691
+ candy_flip: 0.0f,
692
+ flake_layer_visibility: 0.0f,
693
+ // roughness_texture:
694
+ clearcoat_rough: 0.4f,
695
+ roughness_variation: 0.14f,
696
+ clearcoat_ior: 1.6f,
697
+ clearcoat_visibility: 1.0f,
698
+ orange_peel_strength: 0.0f,
699
+ orange_peel_size: 0.01f
700
+ );
701
+
702
+ // ------------------- 8 (Blood Red)-------------------
703
+ export material Blood_Red(*)
704
+ [[
705
+ ::anno::author("NVIDIA"),
706
+ ::anno::display_name("Carpaint Solid - Blood Red"),
707
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
708
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "red", "warm", "saturated")),
709
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Blood_Red.png"),
710
+ ::anno::copyright_notice(COPYRIGHT)
711
+ ]]
712
+ = Carpaint_Solid(
713
+ base_color: color(0.462077f, 0.022174f, 0.015209f),
714
+ ground_coat_influence: 0.03f,
715
+ ground_coat_brightness: 0.24f,
716
+ edge_darkening: 0.56f,
717
+ flakes_tint: color(0.552011f, 0.552011f, 0.552011f),
718
+ flakes_density: 0.0f,
719
+ spread: 0.47f,
720
+ flakes_roughness: 0.34f,
721
+ flakes_size: 0.5f,
722
+ candy_flip: 0.0f,
723
+ flake_layer_visibility: 0.0f,
724
+ // roughness_texture:
725
+ clearcoat_rough: 0.05f,
726
+ roughness_variation: 0.36f,
727
+ clearcoat_ior: 1.6f,
728
+ clearcoat_visibility: 1.0f,
729
+ orange_peel_strength: 0.0f,
730
+ orange_peel_size: 0.01f
731
+ );
732
+
733
+ // ------------------- 9 (Tarreri Red)-------------------
734
+ export material Tarreri_Red(*)
735
+ [[
736
+ ::anno::author("NVIDIA"),
737
+ ::anno::display_name("Carpaint Solid - Tarreri Red"),
738
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
739
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "red", "warm", "saturated")),
740
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Tarreri_Red.png"),
741
+ ::anno::copyright_notice(COPYRIGHT)
742
+ ]]
743
+ = Carpaint_Solid(
744
+ base_color: color(0.672443f, 0.038204f, 0.026241f),
745
+ ground_coat_influence: 0.03f,
746
+ ground_coat_brightness: 0.24f,
747
+ edge_darkening: 0.56f,
748
+ flakes_tint: color(0.672443f, 0.095307f, 0.078187f),
749
+ flakes_density: 0.0f,
750
+ spread: 0.47f,
751
+ flakes_roughness: 0.34f,
752
+ flakes_size: 0.5f,
753
+ candy_flip: 0.0f,
754
+ flake_layer_visibility: 0.0f,
755
+ // roughness_texture:
756
+ clearcoat_rough: 0.05f,
757
+ roughness_variation: 0.36f,
758
+ clearcoat_ior: 1.6f,
759
+ clearcoat_visibility: 1.0f,
760
+ orange_peel_strength: 0.0f,
761
+ orange_peel_size: 0.01f
762
+ );
763
+
764
+
765
+ // ------------------- 10 (Dark Decent Red)-------------------
766
+ export material Dark_Decent_Red(*)
767
+ [[
768
+ ::anno::author("NVIDIA"),
769
+ ::anno::display_name("Carpaint Solid - Dark Decent Red"),
770
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
771
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "red", "warm", "dark")),
772
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Dark_Decent_Red.png"),
773
+ ::anno::copyright_notice(COPYRIGHT)
774
+ ]]
775
+ = Carpaint_Solid(
776
+ base_color: color(0.135633f, 0.012983f, 0.027321f),
777
+ ground_coat_influence: 0.19f,
778
+ ground_coat_brightness: 0.24f,
779
+ edge_darkening: 0.1f,
780
+ flakes_tint: color(0.135633f, 0.012983f, 0.027321f),
781
+ flakes_density: 0.0f,
782
+ spread: 0.38f,
783
+ flakes_roughness: 0.18f,
784
+ flakes_size: 0.5f,
785
+ candy_flip: 0.0f,
786
+ flake_layer_visibility: 0.0f,
787
+ // roughness_texture:
788
+ clearcoat_rough: 0.05f,
789
+ roughness_variation: 0.36f,
790
+ clearcoat_ior: 1.6f,
791
+ clearcoat_visibility: 1.0f,
792
+ orange_peel_strength: 0.0f,
793
+ orange_peel_size: 0.01f
794
+ );
795
+
796
+ // ------------------- 11 (Vintage Maroon)-------------------
797
+ export material Vintage_Maroon(*)
798
+ [[
799
+ ::anno::author("NVIDIA"),
800
+ ::anno::display_name("Carpaint Solid - Vintage Maroon"),
801
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
802
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "dark", "brown", "red")),
803
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Vintage_Maroon.png"),
804
+ ::anno::copyright_notice(COPYRIGHT)
805
+ ]]
806
+ = Carpaint_Solid(
807
+ base_color: color(0.283149f, 0.054480f, 0.063010f),
808
+ ground_coat_influence: 0.19f,
809
+ ground_coat_brightness: 0.24f,
810
+ edge_darkening: 0.1f,
811
+ flakes_tint: color(0.283149f, 0.054480f, 0.063010f),
812
+ flakes_density: 0.0f,
813
+ spread: 0.38f,
814
+ flakes_roughness: 0.3f,
815
+ flakes_size: 0.5f,
816
+ candy_flip: 0.0f,
817
+ flake_layer_visibility: 0.0f,
818
+ // roughness_texture:
819
+ clearcoat_rough: 0.05f,
820
+ roughness_variation: 0.36f,
821
+ clearcoat_ior: 1.6f,
822
+ clearcoat_visibility: 1.0f,
823
+ orange_peel_strength: 0.0f,
824
+ orange_peel_size: 0.01f
825
+ );
826
+
827
+ // ------------------- 12 -------------------
828
+ export material Orange(*)
829
+ [[
830
+ ::anno::author("NVIDIA"),
831
+ ::anno::display_name("Carpaint Solid - Orange"),
832
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
833
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "orange", "warm", "saturated")),
834
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Orange.png"),
835
+ ::anno::copyright_notice(COPYRIGHT)
836
+ ]]
837
+ = Carpaint_Solid(
838
+ base_color: color(0.623960f, 0.262251f, 0.022174f),
839
+ ground_coat_influence: 0.11f,
840
+ ground_coat_brightness: 0.64f,
841
+ edge_darkening: 0.0f,
842
+ flakes_tint: color(0.017642f, 0.262251f, 0.623960f),
843
+ flakes_density: 0.59f,
844
+ spread: 0.25f,
845
+ flakes_roughness: 0.5f,
846
+ flakes_size: 0.5f,
847
+ candy_flip: 0.0f,
848
+ flake_layer_visibility: 0.0f,
849
+ // roughness_texture:
850
+ clearcoat_rough: 0.06f,
851
+ roughness_variation: 0.36f,
852
+ clearcoat_ior: 1.6f,
853
+ clearcoat_visibility: 1.0f,
854
+ orange_peel_strength: 0.0f,
855
+ orange_peel_size: 0.01f
856
+ );
857
+
858
+
859
+ // ------------------- 13 (Brown Matte) -------------------
860
+ export material Brown_Matte(*)
861
+ [[
862
+ ::anno::author("NVIDIA"),
863
+ ::anno::display_name("Carpaint Solid - Brown Matte"),
864
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
865
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "brown", "matte")),
866
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Brown_Matte.png"),
867
+ ::anno::copyright_notice(COPYRIGHT)
868
+ ]]
869
+ = Carpaint_Solid(
870
+ base_color: color(0.300544f, 0.250158f, 0.187821f),
871
+ ground_coat_influence: 0.11f,
872
+ ground_coat_brightness: 0.64f,
873
+ edge_darkening: 0.0f,
874
+ flakes_tint: color(0.300544f, 0.250158f, 0.187821f),
875
+ flakes_density: 0.0f,
876
+ spread: 0.39f,
877
+ flakes_roughness: 0.5f,
878
+ flakes_size: 0.5f,
879
+ candy_flip: 0.0f,
880
+ flake_layer_visibility: 0.0f,
881
+ // roughness_texture:
882
+ clearcoat_rough: 0.5f,
883
+ roughness_variation: 0.14f,
884
+ clearcoat_ior: 1.6f,
885
+ clearcoat_visibility: 1.0f,
886
+ orange_peel_strength: 0.0f,
887
+ orange_peel_size: 0.01f
888
+ );
889
+
890
+
891
+ // ------------------- 14 (Bumblebee) -------------------
892
+ export material Bumblebee(*)
893
+ [[
894
+ ::anno::author("NVIDIA"),
895
+ ::anno::display_name("Carpaint Solid - Bumblebee"),
896
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
897
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "yellow", "warm", "light", "saturated")),
898
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Bumblebee.png"),
899
+ ::anno::copyright_notice(COPYRIGHT)
900
+ ]]
901
+ = Carpaint_Solid(
902
+ base_color: color(0.775822f, 0.564712f, 0.030713f),
903
+ ground_coat_influence: 0.09f,
904
+ ground_coat_brightness: 0.64f,
905
+ edge_darkening: 0.1f,
906
+ flakes_tint: color(1.000000f, 0.479320f, 0.095307f),
907
+ flakes_density: 0.0f,
908
+ spread: 0.54f,
909
+ flakes_roughness: 0.37f,
910
+ flakes_size: 0.5f,
911
+ candy_flip: 0.0f,
912
+ flake_layer_visibility: 0.0f,
913
+ // roughness_texture:
914
+ clearcoat_rough: 0.06f,
915
+ roughness_variation: 0.14f,
916
+ clearcoat_ior: 1.6f,
917
+ clearcoat_visibility: 1.0f,
918
+ orange_peel_strength: 0.0f,
919
+ orange_peel_size: 0.01f
920
+ );
921
+
922
+
923
+ // ------------------- 15 (Wasp) -------------------
924
+ export material Wasp(*)
925
+ [[
926
+ ::anno::author("NVIDIA"),
927
+ ::anno::display_name("Carpaint Solid - Wasp"),
928
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
929
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "yellow", "warm", "light", "saturated")),
930
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Wasp.png"),
931
+ ::anno::copyright_notice(COPYRIGHT)
932
+ ]]
933
+ = Carpaint_Solid(
934
+ base_color: color(0.701102f, 0.603827f, 0.022174f),
935
+ ground_coat_influence: 0.0f,
936
+ ground_coat_brightness: 0.5f,
937
+ edge_darkening: 0.12f,
938
+ flakes_tint: color(1.000000f, 0.479320f, 0.076185f),
939
+ flakes_density: 0.0f,
940
+ spread: 0.54f,
941
+ flakes_roughness: 0.37f,
942
+ flakes_size: 0.5f,
943
+ candy_flip: 0.0f,
944
+ flake_layer_visibility: 0.0f,
945
+ // roughness_texture:
946
+ clearcoat_rough: 0.06f,
947
+ roughness_variation: 0.14f,
948
+ clearcoat_ior: 1.6f,
949
+ clearcoat_visibility: 1.0f,
950
+ orange_peel_strength: 0.0f,
951
+ orange_peel_size: 0.01f
952
+ );
953
+
954
+ // ------------------- 16 (Feline Dark Green)-------------------
955
+ export material Feline_Dark_Green(*)
956
+ [[
957
+ ::anno::author("NVIDIA"),
958
+ ::anno::display_name("Carpaint Solid - Feline Dark Green"),
959
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
960
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "green", "dark")),
961
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Feline_Dark_Green.png"),
962
+ ::anno::copyright_notice(COPYRIGHT)
963
+ ]]
964
+ = Carpaint_Solid(
965
+ base_color: color(0.010330f, 0.099899f, 0.043735f),
966
+ ground_coat_influence: 0.19f,
967
+ ground_coat_brightness: 0.24f,
968
+ edge_darkening: 0.1f,
969
+ flakes_tint: color(0.010330f, 0.099899f, 0.043735f),
970
+ flakes_density: 0.0f,
971
+ spread: 0.38f,
972
+ flakes_roughness: 0.3f,
973
+ flakes_size: 0.5f,
974
+ candy_flip: 0.0f,
975
+ flake_layer_visibility: 0.0f,
976
+ // roughness_texture:
977
+ clearcoat_rough: 0.05f,
978
+ roughness_variation: 0.36f,
979
+ clearcoat_ior: 1.6f,
980
+ clearcoat_visibility: 1.0f,
981
+ orange_peel_strength: 0.0f,
982
+ orange_peel_size: 0.01f
983
+ );
984
+
985
+
986
+ // ------------------- 17 (Hunting Green Matte) -------------------
987
+ export material Hunting_Green_Matte(*)
988
+ [[
989
+ ::anno::author("NVIDIA"),
990
+ ::anno::display_name("Carpaint Solid - Hunting Green Matte"),
991
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
992
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "green", "dark", "matte")),
993
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Hunting_Green_Matte.png"),
994
+ ::anno::copyright_notice(COPYRIGHT)
995
+ ]]
996
+ = Carpaint_Solid(
997
+ base_color: color(0.162029f, 0.187821f, 0.114435f),
998
+ ground_coat_influence: 0.11f,
999
+ ground_coat_brightness: 0.64f,
1000
+ edge_darkening: 0.0f,
1001
+ flakes_tint: color(0.318547f, 0.456411f, 0.127438f),
1002
+ flakes_density: 0.0f,
1003
+ spread: 0.3f,
1004
+ flakes_roughness: 0.5f,
1005
+ flakes_size: 0.5f,
1006
+ candy_flip: 0.0f,
1007
+ flake_layer_visibility: 0.0f,
1008
+ // roughness_texture:
1009
+ clearcoat_rough: 0.4f,
1010
+ roughness_variation: 0.14f,
1011
+ clearcoat_ior: 1.6f,
1012
+ clearcoat_visibility: 1.0f,
1013
+ orange_peel_strength: 0.0f,
1014
+ orange_peel_size: 0.01f
1015
+ );
1016
+
1017
+
1018
+ // ------------------- 18 (Vintage Sky Blue) -------------------
1019
+ export material Vintage_Sky_Blue(*)
1020
+ [[
1021
+ ::anno::author("NVIDIA"),
1022
+ ::anno::display_name("Carpaint Solid - Vintage Sky Blue"),
1023
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
1024
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "blue", "light", "cool")),
1025
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Vintage_Sky_Blue.png"),
1026
+ ::anno::copyright_notice(COPYRIGHT)
1027
+ ]]
1028
+ = Carpaint_Solid(
1029
+ base_color: color(0.318547f, 0.564712f, 0.603827f),
1030
+ ground_coat_influence: 0.06f,
1031
+ ground_coat_brightness: 0.24f,
1032
+ edge_darkening: 0.0f,
1033
+ flakes_tint: color(0.603827f, 127.338437f, 0.693872f),
1034
+ flakes_density: 0.0f,
1035
+ spread: 0.41f,
1036
+ flakes_roughness: 0.32f,
1037
+ flakes_size: 0.5f,
1038
+ candy_flip: 0.0f,
1039
+ flake_layer_visibility: 0.0f,
1040
+ // roughness_texture:
1041
+ clearcoat_rough: 0.06f,
1042
+ roughness_variation: 0.34f,
1043
+ clearcoat_ior: 1.6f,
1044
+ clearcoat_visibility: 1.0f,
1045
+ orange_peel_strength: 0.06f,
1046
+ orange_peel_size: 0.01f
1047
+ );
1048
+
1049
+
1050
+ // ------------------- 19 (Blue)-------------------
1051
+ export material Blue(*)
1052
+ [[
1053
+ ::anno::author("NVIDIA"),
1054
+ ::anno::display_name("Carpaint Solid - Blue"),
1055
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
1056
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "blue", "cool", "saturated")),
1057
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Blue.png"),
1058
+ ::anno::copyright_notice(COPYRIGHT)
1059
+ ]]
1060
+ = Carpaint_Solid(
1061
+ base_color: color(0.012983f, 0.296138f, 0.462077f),
1062
+ ground_coat_influence: 0.00f,
1063
+ ground_coat_brightness: 0.24f,
1064
+ edge_darkening: 0.0f,
1065
+ flakes_tint: color(0.012983f, 0.234551f, 0.665387f),
1066
+ flakes_density: 0.5f,
1067
+ spread: 0.47f,
1068
+ flakes_roughness: 0.34f,
1069
+ flakes_size: 0.5f,
1070
+ candy_flip: 0.0f,
1071
+ flake_layer_visibility: 0.0f,
1072
+ // roughness_texture:
1073
+ clearcoat_rough: 0.06f,
1074
+ roughness_variation: 0.36f,
1075
+ clearcoat_ior: 1.6f,
1076
+ clearcoat_visibility: 1.0f,
1077
+ orange_peel_strength: 0.0f,
1078
+ orange_peel_size: 0.01f
1079
+ );
1080
+
1081
+
1082
+
1083
+ // ------------------- 20 (Dark Decent Blue) -------------------
1084
+ export material Dark_Decent_Blue(*)
1085
+ [[
1086
+ ::anno::author("NVIDIA"),
1087
+ ::anno::display_name("Carpaint Solid - Dark Decent Blue"),
1088
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
1089
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "blue", "cool", "dark")),
1090
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Dark_Decent_Blue.png"),
1091
+ ::anno::copyright_notice(COPYRIGHT)
1092
+ ]]
1093
+ = Carpaint_Solid(
1094
+ base_color: color(0.013702f, 0.046665f, 0.147027f),
1095
+ ground_coat_influence: 0.19f,
1096
+ ground_coat_brightness: 0.24f,
1097
+ edge_darkening: 0.1f,
1098
+ flakes_tint: color(0.012983f, 0.234551f, 0.665387f),
1099
+ flakes_density: 0.5f,
1100
+ spread: 0.25f,
1101
+ flakes_roughness: 0.34f,
1102
+ flakes_size: 0.5f,
1103
+ candy_flip: 0.0f,
1104
+ flake_layer_visibility: 0.0f,
1105
+ // roughness_texture:
1106
+ clearcoat_rough: 0.06f,
1107
+ roughness_variation: 0.36f,
1108
+ clearcoat_ior: 1.6f,
1109
+ clearcoat_visibility: 1.0f,
1110
+ orange_peel_strength: 0.0f,
1111
+ orange_peel_size: 0.01f
1112
+ );
objects/table_maple/materials/remote/omniverse-content-production.s3.us-west-2.amazonaws.com/Materials/2023_1/vMaterials_2/Plastic/Plastic_Thick_Translucent.mdl ADDED
@@ -0,0 +1,673 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*****************************************************************************
2
+ * Copyright 2023 NVIDIA Corporation. All rights reserved.
3
+ ******************************************************************************
4
+
5
+ MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,
6
+ WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,
7
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
8
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
9
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
10
+ COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA
11
+ CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
12
+ ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
13
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
14
+ THE USE OR INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN
15
+ THE MDL MATERIALS.
16
+ */
17
+
18
+
19
+ // This file contains samples of very fast rendering SSS plastics for iray
20
+ //
21
+
22
+ mdl 1.4;
23
+ import ::df::*;
24
+ import ::math::*;
25
+ import ::anno::*;
26
+
27
+
28
+ const string COPYRIGHT =
29
+ " Copyright 2023 NVIDIA Corporation. All rights reserved.\n"
30
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
31
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
32
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
33
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
34
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
35
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
36
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
37
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
38
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
39
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
40
+
41
+
42
+
43
+ // Template for absorption and scattering, do not use directly
44
+ material volume_absorption(
45
+ color absorption = color(0.8665f, 0.7769f, 0.1559f),
46
+ color scattering = color(.5f),
47
+ float distance_scale = .03f,
48
+ float directional_bias = 0.0f,
49
+ uniform float ior = 1.2f
50
+
51
+ )
52
+ [[
53
+ ::anno::author("NVIDIA ARC"),
54
+ ::anno::display_name("Volume Absorption"),
55
+ ::anno::description("Pure volume absorption material"),
56
+ ::anno::author("NVIDIA"),
57
+ ::anno::copyright_notice(COPYRIGHT),
58
+ ::anno::hidden()
59
+
60
+ ]] = material (
61
+ ior: color(ior),
62
+ surface: material_surface (
63
+ scattering: ::df::specular_bsdf (
64
+ tint: color (1.0f, 1.0f, 1.0f),
65
+ mode: ::df::scatter_reflect_transmit
66
+ )
67
+ ),
68
+ volume: material_volume (
69
+ scattering: ::df::anisotropic_vdf(
70
+ directional_bias: directional_bias
71
+ ),
72
+ absorption_coefficient: (distance_scale <= 0)? color(0): ::math::log(absorption) / -distance_scale,
73
+ scattering_coefficient: (distance_scale <= 0)? color(0): ::math::log(scattering) / -distance_scale
74
+ )
75
+ );
76
+
77
+ // plastic_full_weighted_mix
78
+ // Plastic material using diffuse reflection, diffuse transmission
79
+ // and SSS. Due to the diffuse transmission the volume absorption will
80
+ // render faster and converge smoother than when using specular transmission.
81
+ export material Plastic_Thick_Translucent(
82
+ color diffuse_color = color(0.6940f, 0.5831f, 0.0493f)
83
+ [[
84
+ ::anno::display_name("Diffuse Color"),
85
+ ::anno::description("The diffuse color of the plastic material"),
86
+ ::anno::in_group("Appearance")
87
+ ]],
88
+ float diffuse_weight = 0.3f
89
+ [[
90
+ ::anno::display_name("Diffuse Weight"),
91
+ ::anno::description("The weight of the diffuse color of the plastic material. It is recommended to keep "
92
+ "the value around 0.5, lower values make the material appear more transparent while higher values make "
93
+ "it more opaque."),
94
+ ::anno::in_group("Appearance"),
95
+ ::anno::hard_range(0.f, 1.f)
96
+ ]],
97
+ color absorption = color(0.8665f, 0.7769f, 0.1559f)
98
+ [[
99
+ ::anno::display_name("Absorption Color"),
100
+ ::anno::description("Sets the absorption color (this is color when light goes extinct)of the plastic material"),
101
+ ::anno::in_group("Appearance")
102
+ ]],
103
+ color scattering = color(.5f)
104
+ [[
105
+ ::anno::display_name("Scattering Color"),
106
+ ::anno::description("Sets the absorption color (this is color when light goes extinct)of the plastic material"),
107
+ ::anno::in_group("Appearance")
108
+ ]],
109
+ float distance_scale = 1.5f
110
+ [[
111
+ ::anno::display_name("Distance Scale"),
112
+ ::anno::description("Scales how quickly light is absorbed. Set this value low enough to see "
113
+ "some light extinction taking place. Tip: Set 'diffuse_weight' to 0.0 while adjusting this "
114
+ "material parameter for your scene"),
115
+ ::anno::in_group("Appearance")
116
+ ]],
117
+
118
+ color diffuse_transmission_tint = color(1.0000f, 0.7249f, 0.1972f)
119
+ [[
120
+ ::anno::display_name("Diffuse Transmission Color"),
121
+ ::anno::description("The tinting of light scattering through the plastic material"),
122
+ ::anno::in_group("Appearance")
123
+ ]],
124
+
125
+ float reflection_roughness = 0.0f
126
+ [[
127
+ ::anno::display_name("Roughness"),
128
+ ::anno::description("The roughness of the reflection on the plastic"),
129
+ ::anno::in_group("Appearance"),
130
+ ::anno::hard_range(0.f, 1.f)
131
+ ]]
132
+ )
133
+ [[
134
+ ::anno::author("NVIDIA ARC"),
135
+ ::anno::display_name("Plastic Full Control"),
136
+ ::anno::description("Plastic Material finegrained controls of its appearance"),
137
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.Plastic_Thick_Translucent.png"),
138
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny")),
139
+ ::anno::copyright_notice(COPYRIGHT),
140
+ ::anno::hidden()
141
+ ]] = let {
142
+ float reflection_weight = 1.0f;
143
+ float normal_reflectivity = 0.04f;
144
+ float grazing_reflectivity = 1.0f;
145
+ float reflectivity_exponent = 5.0f;
146
+ uniform float ior = 1.4f;
147
+
148
+ material plastic = volume_absorption(
149
+ absorption: absorption,
150
+ scattering: scattering,
151
+ distance_scale: distance_scale,
152
+ ior: ior
153
+ );
154
+
155
+ bsdf transdiff = ::df::diffuse_transmission_bsdf(
156
+ tint: diffuse_transmission_tint
157
+ );
158
+
159
+ bsdf diffuse = ::df::diffuse_reflection_bsdf(
160
+ tint: diffuse_color
161
+ );
162
+
163
+ bsdf diffuse_mix_layer = ::df::weighted_layer(
164
+ base: transdiff,
165
+ layer: diffuse,
166
+ weight: diffuse_weight
167
+
168
+ );
169
+
170
+ bsdf glossy_reflection = ::df::simple_glossy_bsdf(
171
+ tint: color(1.0f),
172
+ roughness_u: reflection_roughness,
173
+ mode: ::df::scatter_reflect
174
+ );
175
+
176
+ bsdf final_layer = ::df::custom_curve_layer(
177
+ normal_reflectivity: normal_reflectivity,
178
+ grazing_reflectivity: grazing_reflectivity,
179
+ layer: glossy_reflection,
180
+ base: diffuse_mix_layer,
181
+ weight: reflection_weight,
182
+ exponent: reflectivity_exponent
183
+ );
184
+
185
+ } in material (
186
+ surface: material_surface(
187
+ scattering: final_layer
188
+ ),
189
+
190
+ volume: plastic.volume
191
+ );
192
+
193
+
194
+ export material plastic_simple_controls(
195
+ color diffuse_color = color(0.6940f, 0.5831f, 0.0493f)
196
+ [[
197
+ ::anno::display_name("Diffuse Color"),
198
+ ::anno::description("The diffuse color of the plastic material"),
199
+ ::anno::in_group("Appearance")
200
+ ]],
201
+ float diffuse_weight = 0.5f
202
+ [[
203
+ ::anno::display_name("Diffuse Weight"),
204
+ ::anno::description("The weight of the diffuse color of the plastic material. It is recommended to keep "
205
+ "the value around 0.5, lower values make the material appear more transparent while higher values make "
206
+ "it more opaque."),
207
+ ::anno::in_group("Appearance"),
208
+ ::anno::hard_range(0.f, 1.f)
209
+ ]],
210
+ color transmissive_color = color(0.8665f, 0.7769f, 0.1559f)
211
+ [[
212
+ ::anno::display_name("Transmissive Color"),
213
+ ::anno::description("The tinting of light scattering through the plastic material"),
214
+ ::anno::in_group("Appearance")
215
+ ]],
216
+ float reflection_roughness = 0.0f
217
+ [[
218
+ ::anno::display_name("Roughness"),
219
+ ::anno::description("The roughness of the reflection on the plastic"),
220
+ ::anno::in_group("Appearance"),
221
+ ::anno::hard_range(0.f, 1.f)
222
+ ]],
223
+ float distance_scale = 0.005f
224
+ [[
225
+ ::anno::display_name("Distance Scale"),
226
+ ::anno::description("Scales how quickly light is absorbed. Set this value low enough to see "
227
+ "some light extinction taking place. Tip: Set 'diffuse_weight' to 0.0 while adjusting this "
228
+ "material parameter for your scene"),
229
+ ::anno::in_group("Appearance")
230
+ ]]
231
+
232
+ )
233
+ [[
234
+ ::anno::author("NVIDIA ARC"),
235
+ ::anno::display_name("Plastic"),
236
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
237
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
238
+ "(which can be verified by setting 'Diffuse Weight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
239
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny")),
240
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_simple_controls.png"),
241
+ ::anno::copyright_notice(COPYRIGHT),
242
+ ::anno::hidden()
243
+ ]] = Plastic_Thick_Translucent(
244
+ absorption: ::math::pow(transmissive_color, 0.2f),
245
+ scattering: color(0.5f),
246
+ distance_scale: distance_scale,
247
+ diffuse_transmission_tint: ::math::pow(transmissive_color, 0.2f),
248
+ diffuse_color: diffuse_color,
249
+ diffuse_weight: diffuse_weight,
250
+ reflection_roughness: reflection_roughness
251
+
252
+ );
253
+
254
+
255
+
256
+ // 01 - Black
257
+ export material plastic_black(*)
258
+ [[
259
+ ::anno::author("NVIDIA ARC"),
260
+ ::anno::display_name("Plastic Black"),
261
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
262
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
263
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
264
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "dark", "black", "neutral")),
265
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_black.png"),
266
+ ::anno::copyright_notice(COPYRIGHT)
267
+ ]] = plastic_simple_controls(
268
+ diffuse_color: color(0.034230f),
269
+ diffuse_weight: .5f,
270
+ transmissive_color: color(0.034230f),
271
+ distance_scale: 0.002f,
272
+ reflection_roughness: 0.05f
273
+ );
274
+
275
+
276
+ // 02 - Dark Gray
277
+ export material plastic_dark_gray(*)
278
+ [[
279
+ ::anno::author("NVIDIA ARC"),
280
+ ::anno::display_name("Plastic Dark Gray"),
281
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
282
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
283
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
284
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "dark", "gray", "neutral")),
285
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_dark_gray.png"),
286
+ ::anno::copyright_notice(COPYRIGHT)
287
+ ]] = plastic_simple_controls(
288
+ diffuse_color: color(0.127530f),
289
+ diffuse_weight: .5f,
290
+ transmissive_color: color(0.089194f),
291
+ distance_scale: 0.002f,
292
+ reflection_roughness: 0.05f
293
+ );
294
+
295
+
296
+ // 03 - Light Gray
297
+ export material plastic_light_gray(*)
298
+ [[
299
+ ::anno::author("NVIDIA ARC"),
300
+ ::anno::display_name("Plastic Light Gray"),
301
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
302
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
303
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
304
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "light", "gray", "neutral")),
305
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_light_gray.png"),
306
+ ::anno::copyright_notice(COPYRIGHT)
307
+ ]] = plastic_simple_controls(
308
+ diffuse_color: color(0.464741f),
309
+ diffuse_weight: .5f,
310
+ transmissive_color: color(0.358654f),
311
+ distance_scale: 0.002f,
312
+ reflection_roughness: 0.05f
313
+ );
314
+
315
+
316
+ // 04 - White
317
+ export material plastic_white(*)
318
+ [[
319
+ ::anno::author("NVIDIA ARC"),
320
+ ::anno::display_name("Plastic White"),
321
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
322
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
323
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
324
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "light", "white", "neutral")),
325
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_white.png"),
326
+ ::anno::copyright_notice(COPYRIGHT)
327
+ ]] = plastic_simple_controls(
328
+ diffuse_color: color(0.915750f),
329
+ diffuse_weight: .5f,
330
+ transmissive_color: color(0.812241f),
331
+ distance_scale: 0.002f,
332
+ reflection_roughness: 0.05f
333
+ );
334
+
335
+
336
+ // 05 - Ivory White
337
+ export material plastic_ivory_white(*)
338
+ [[
339
+ ::anno::author("NVIDIA ARC"),
340
+ ::anno::display_name("Plastic Ivory White"),
341
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
342
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
343
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
344
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "white", "bright", "ivory", "warm")),
345
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_ivory_white.png"),
346
+ ::anno::copyright_notice(COPYRIGHT)
347
+ ]] = plastic_simple_controls(
348
+ diffuse_color: color(0.899385f, 0.843370f, 0.694081f),
349
+ diffuse_weight: .5f,
350
+ transmissive_color: color(0.722672f, 0.708298f, 0.547994f),
351
+ distance_scale: 0.002f,
352
+ reflection_roughness: 0.05f
353
+ );
354
+
355
+
356
+ // 06 - Lemon
357
+ export material plastic_lemon(*)
358
+ [[
359
+ ::anno::author("NVIDIA ARC"),
360
+ ::anno::display_name("Plastic Lemon"),
361
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
362
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
363
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
364
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "lemon", "yellow", "light", "warm")),
365
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_lemon.png"),
366
+ ::anno::copyright_notice(COPYRIGHT)
367
+ ]] = plastic_simple_controls(
368
+ diffuse_color: color(0.859174f, 0.875138f, 0.039947f),
369
+ diffuse_weight: .5f,
370
+ transmissive_color: color(0.98211f, 0.843370f, 0.031551f),
371
+ distance_scale: 0.002f,
372
+ reflection_roughness: 0.05f
373
+ );
374
+
375
+
376
+ // 07 - Yellow Orange
377
+ export material plastic_yellow_orange(*)
378
+ [[
379
+ ::anno::author("NVIDIA ARC"),
380
+ ::anno::display_name("Plastic Yellow"),
381
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
382
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
383
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
384
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "light", "orange", "yellow", "warm")),
385
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_yellow_orange.png"),
386
+ ::anno::copyright_notice(COPYRIGHT)
387
+ ]] = plastic_simple_controls(
388
+ diffuse_color: color(0.875138f, 0.612066f, 0.039947f),
389
+ diffuse_weight: .5f,
390
+ transmissive_color: color(0.899385f, 0.373615f, 0.030257f),
391
+ distance_scale: 0.002f,
392
+ reflection_roughness: 0.05f
393
+ );
394
+
395
+
396
+ // 08 - Orange
397
+ export material plastic_orange(*)
398
+ [[
399
+ ::anno::author("NVIDIA ARC"),
400
+ ::anno::display_name("Plastic Orange"),
401
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
402
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
403
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
404
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "orange", "warm")),
405
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_orange.png"),
406
+ ::anno::copyright_notice(COPYRIGHT)
407
+ ]] = plastic_simple_controls(
408
+ diffuse_color: color(0.875138f, 0.353741f, 0.030257f),
409
+ diffuse_weight: .5f,
410
+ transmissive_color: color(0.891262f, 0.420508f, 0.022013f),
411
+ distance_scale: 0.002f,
412
+ reflection_roughness: 0.05f
413
+ );
414
+
415
+
416
+ // 09 - Dark Orange
417
+ export material plastic_dark_orange(*)
418
+ [[
419
+ ::anno::author("NVIDIA ARC"),
420
+ ::anno::display_name("Plastic Dark Orange"),
421
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
422
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
423
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
424
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "dark", "orange", "warm")),
425
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_dark_orange.png"),
426
+ ::anno::copyright_notice(COPYRIGHT)
427
+ ]] = plastic_simple_controls(
428
+ diffuse_color: color(0.535642f, 0.127530f, 0.022013f),
429
+ diffuse_weight: .5f,
430
+ transmissive_color: color(0.827726f, 0.267358f, 0.022013f),
431
+ distance_scale: 0.002f,
432
+ reflection_roughness: 0.05f
433
+ );
434
+
435
+
436
+ // 10 - Red
437
+ export material plastic_red(*)
438
+ [[
439
+ ::anno::author("NVIDIA ARC"),
440
+ ::anno::display_name("Plastic Red"),
441
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
442
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
443
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
444
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "red", "cherry", "warm")),
445
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_red.png"),
446
+ ::anno::copyright_notice(COPYRIGHT)
447
+ ]] = plastic_simple_controls(
448
+ diffuse_color: color(0.547994f, 0.027755f, 0.027755f),
449
+ diffuse_weight: .5f,
450
+ transmissive_color: color(0.875138f, 0.022013f, 0.022013f),
451
+ distance_scale: 0.002f,
452
+ reflection_roughness: 0.05f
453
+ );
454
+
455
+
456
+ // 11 - Magenta
457
+ export material plastic_magenta(*)
458
+ [[
459
+ ::anno::author("NVIDIA ARC"),
460
+ ::anno::display_name("Plastic Magenta"),
461
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
462
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
463
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
464
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "magenta")),
465
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_magenta.png"),
466
+ ::anno::copyright_notice(COPYRIGHT)
467
+ ]] = plastic_simple_controls(
468
+ diffuse_color: color(0.547994f, 0.047776f, 0.554227f),
469
+ diffuse_weight: .5f,
470
+ transmissive_color: color(0.722672f, 0.030257f, 0.566810f),
471
+ distance_scale: 0.002f,
472
+ reflection_roughness: 0.05f
473
+ );
474
+
475
+
476
+ // 12 - Purple
477
+ export material plastic_purple(*)
478
+ [[
479
+ ::anno::author("NVIDIA ARC"),
480
+ ::anno::display_name("Plastic Purple"),
481
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
482
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
483
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
484
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "purple")),
485
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_purple.png"),
486
+ ::anno::copyright_notice(COPYRIGHT)
487
+ ]] = plastic_simple_controls(
488
+ diffuse_color: color(0.193972f, 0.017936f, 0.464741f),
489
+ diffuse_weight: .5f,
490
+ transmissive_color: color(0.701170f, 0.018913f, 0.645555f),
491
+ distance_scale: 0.002f,
492
+ reflection_roughness: 0.05f
493
+ );
494
+
495
+
496
+ // 13 - Dark Blue
497
+ export material plastic_dark_blue(*)
498
+ [[
499
+ ::anno::author("NVIDIA ARC"),
500
+ ::anno::display_name("Plastic Dark Blue"),
501
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
502
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
503
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
504
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "dark", "blue", "cool")),
505
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_dark_blue.png"),
506
+ ::anno::copyright_notice(COPYRIGHT)
507
+ ]] = plastic_simple_controls(
508
+ diffuse_color: color(0.027755f, 0.058187f, 0.311180f),
509
+ diffuse_weight: .5f,
510
+ transmissive_color: color(0.027755f, 0.058187f, 0.311180f),
511
+ distance_scale: 0.002f,
512
+ reflection_roughness: 0.05f
513
+ );
514
+
515
+
516
+ // 14 - Blue
517
+ export material plastic_blue(*)
518
+ [[
519
+ ::anno::author("NVIDIA ARC"),
520
+ ::anno::display_name("Plastic Blue"),
521
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
522
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
523
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
524
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "blue", "cool")),
525
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_blue.png"),
526
+ ::anno::copyright_notice(COPYRIGHT)
527
+ ]] = plastic_simple_controls(
528
+ diffuse_color: color(0.034230f, 0.173439f, 0.843370f),
529
+ diffuse_weight: .5f,
530
+ transmissive_color: color(0.034230f, 0.124741f, 0.659224f),
531
+ distance_scale: 0.002f,
532
+ reflection_roughness: 0.05f
533
+ );
534
+
535
+
536
+ // 15 - Sky Blue
537
+ export material plastic_sky_blue(*)
538
+ [[
539
+ ::anno::author("NVIDIA ARC"),
540
+ ::anno::display_name("Plastic Sky Blue"),
541
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
542
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
543
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
544
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "blue", "sky", "cool")),
545
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_sky_blue.png"),
546
+ ::anno::copyright_notice(COPYRIGHT)
547
+ ]] = plastic_simple_controls(
548
+ diffuse_color: color(0.061907f, 0.535642f, 0.875138f),
549
+ diffuse_weight: .5f,
550
+ transmissive_color: color(0.028991f, 0.358654f, 0.673049f),
551
+ distance_scale: 0.002f,
552
+ reflection_roughness: 0.05f
553
+ );
554
+
555
+
556
+ // 16 - Light Blue
557
+ export material plastic_light_blue(*)
558
+ [[
559
+ ::anno::author("NVIDIA ARC"),
560
+ ::anno::display_name("Plastic Light Blue"),
561
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
562
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
563
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
564
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "light", "blue", "cool")),
565
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_light_blue.png"),
566
+ ::anno::copyright_notice(COPYRIGHT)
567
+ ]] = plastic_simple_controls(
568
+ diffuse_color: color(0.263175f, 0.774227f, 0.827726f),
569
+ diffuse_weight: .5f,
570
+ transmissive_color: color(0.163641f, 0.592438f, 0.759300f),
571
+ distance_scale: 0.002f,
572
+ reflection_roughness: 0.05f
573
+ );
574
+
575
+
576
+ // 17 - Teal
577
+ export material plastic_teal(*)
578
+ [[
579
+ ::anno::author("NVIDIA ARC"),
580
+ ::anno::display_name("Plastic Teal"),
581
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
582
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
583
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
584
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "teal", "cool")),
585
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_teal.png"),
586
+ ::anno::copyright_notice(COPYRIGHT)
587
+ ]] = plastic_simple_controls(
588
+ diffuse_color: color(0.037029f, 0.579547f, 0.329729f),
589
+ diffuse_weight: .5f,
590
+ transmissive_color: color(0.022013f, 0.476177f, 0.353741f),
591
+ distance_scale: 0.002f,
592
+ reflection_roughness: 0.05f
593
+ );
594
+
595
+
596
+ // 18 - Dark Green
597
+ export material plastic_dark_green(*)
598
+ [[
599
+ ::anno::author("NVIDIA ARC"),
600
+ ::anno::display_name("Plastic Dark Green"),
601
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
602
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
603
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
604
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "dark", "green")),
605
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_dark_green.png"),
606
+ ::anno::copyright_notice(COPYRIGHT)
607
+ ]] = plastic_simple_controls(
608
+ diffuse_color: color(0.034230f, 0.141980f, 0.034230f),
609
+ diffuse_weight: .5f,
610
+ transmissive_color: color(0.016988f, 0.141980f, 0.016988f),
611
+ distance_scale: 0.002f,
612
+ reflection_roughness: 0.05f
613
+ );
614
+
615
+
616
+ // 19 - Green
617
+ export material plastic_green(*)
618
+ [[
619
+ ::anno::author("NVIDIA ARC"),
620
+ ::anno::display_name("Plastic Green"),
621
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
622
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
623
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
624
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "green")),
625
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_green.png"),
626
+ ::anno::copyright_notice(COPYRIGHT)
627
+ ]] = plastic_simple_controls(
628
+ diffuse_color: color(0.016988f, 0.311180f, 0.016988f),
629
+ diffuse_weight: .5f,
630
+ transmissive_color: color(0.012664f, 0.358654f, 0.012664f),
631
+ distance_scale: 0.002f,
632
+ reflection_roughness: 0.05f
633
+ );
634
+
635
+
636
+ // 20 - Light Green
637
+ export material plastic_light_green(*)
638
+ [[
639
+ ::anno::author("NVIDIA ARC"),
640
+ ::anno::display_name("Plastic Light Green"),
641
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
642
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
643
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
644
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "light", "green")),
645
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_light_green.png"),
646
+ ::anno::copyright_notice(COPYRIGHT)
647
+ ]] = plastic_simple_controls(
648
+ diffuse_color: color(0.030257f, 0.687031f, 0.027755f),
649
+ diffuse_weight: .5f,
650
+ transmissive_color: color(0.030257f, 0.701170f, 0.027755f),
651
+ distance_scale: 0.002f,
652
+ reflection_roughness: 0.05f
653
+ );
654
+
655
+
656
+ // 21 - Lime Green
657
+ export material plastic_lime_green(*)
658
+ [[
659
+ ::anno::author("NVIDIA ARC"),
660
+ ::anno::display_name("Plastic Lime Green"),
661
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
662
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
663
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
664
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "lime", "green", "light")),
665
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_lime_green.png"),
666
+ ::anno::copyright_notice(COPYRIGHT)
667
+ ]] = plastic_simple_controls(
668
+ diffuse_color: color(0.186989f, 0.605484f, 0.027755f),
669
+ diffuse_weight: .5f,
670
+ transmissive_color: color(0.204710f, 0.701170f, 0.022013f),
671
+ distance_scale: 0.002f,
672
+ reflection_roughness: 0.05f
673
+ );
objects/table_maple/materials/remote/omniverse-content-production.s3.us-west-2.amazonaws.com/Materials/2023_1/vMaterials_2/Plastic/Plastic_Thick_Translucent_Flakes.mdl ADDED
@@ -0,0 +1,1025 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2023 NVIDIA Corporation. All rights reserved.
3
+ ******************************************************************************
4
+
5
+ Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge,
6
+ to any person obtaining a copy of the sample definition code that uses our
7
+ Material Definition Language (the "MDL Materials"), to reproduce and distribute
8
+ the MDL Materials, including without limitation the rights to use, copy, merge,
9
+ publish, distribute, and sell modified and unmodified copies of the MDL
10
+ Materials, and to permit persons to whom the MDL Materials is furnished to do
11
+ so, in all cases solely for use with NVIDIA's Material Definition Language,
12
+ subject to the following further conditions:
13
+
14
+ 1. The above copyright notices, this list of conditions, and the disclaimer
15
+ that follows shall be retained in all copies of one or more of the MDL
16
+ Materials, including in any software with which the MDL Materials are bundled,
17
+ redistributed, and/or sold, and included either as stand-alone text files,
18
+ human-readable headers or in the appropriate machine-readable metadata fields
19
+ within text or binary files as long as those fields can be easily viewed by the
20
+ user, as applicable.
21
+ 2. The name of NVIDIA shall not be used to promote, endorse or advertise any
22
+ Modified Version without specific prior written permission, except a) to comply
23
+ with the notice requirements otherwise contained herein; or b) to acknowledge
24
+ the contribution(s) of NVIDIA.
25
+
26
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
27
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
28
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
29
+ TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR
30
+ ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL,
31
+ INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF
32
+ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE
33
+ THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.
34
+ */
35
+
36
+ // This file contains samples of very fast rendering SSS plastics for iray
37
+ //
38
+
39
+ mdl 1.4;
40
+ import ::df::*;
41
+ import ::math::*;
42
+ import ::anno::*;
43
+ import ::state::*;
44
+ import ::base::*;
45
+ import ::nvidia::core_definitions::dimension;
46
+
47
+
48
+ const string COPYRIGHT =
49
+ " Copyright 2023 NVIDIA Corporation. All rights reserved.\n"
50
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
51
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
52
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
53
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
54
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
55
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
56
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
57
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
58
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
59
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
60
+
61
+
62
+ const string DESCRIPTION =
63
+ "Translucent plastic material with integrated metal flakes. Features: Effective light scattering for dense "
64
+ "plastic materials and metal flakes. The material was built to scatter light within the range of a few "
65
+ "centimeters. If light scattering cannot be seen (which can be verified by setting 'Diffuse Weight' to 0.0), "
66
+ "check the scene units scale or increase 'Distance Scale'.";
67
+
68
+
69
+ //
70
+ // flake noise utilities
71
+ //
72
+ int hash(int seed, int i)
73
+ {
74
+ return (i ^ seed) * 1075385539;
75
+ }
76
+ int rnd_init(int3 pos)
77
+ {
78
+ return hash(hash(hash(0, pos.x), pos.y), pos.z);
79
+ }
80
+
81
+ int rnd_next(int seed) {
82
+ // xorshift32 using signed int
83
+ seed ^= seed << 13;
84
+ seed ^= seed >>> 17;
85
+ seed ^= seed << 5;
86
+ return seed;
87
+ }
88
+
89
+ float rnd_value(int seed)
90
+ {
91
+ return ::math::abs(float(seed) * 4.6566e-10f);
92
+ }
93
+
94
+ // apply random rotation (using "Fast Random Rotation Matrices" by James Arvo)
95
+ float3 rotate_pos(float3 pos, float3 xi)
96
+ {
97
+ float theta = ::math::PI * 2.0f * xi.x;
98
+ float phi = ::math::PI * 2.0f * xi.y;
99
+ float z = xi.z * 2.0f;
100
+
101
+ float r = ::math::sqrt(z);
102
+ float[2] sp_cp = ::math::sincos(phi);
103
+ float Vx = sp_cp[0] * r;
104
+ float Vy = sp_cp[1] * r;
105
+ float Vz = ::math::sqrt(2.0f - z);
106
+
107
+ float[2] st_ct = ::math::sincos(theta);
108
+ float Sx = Vx * st_ct[1] - Vy * st_ct[0];
109
+ float Sy = Vx * st_ct[0] + Vy * st_ct[1];
110
+
111
+ float3x3 M(
112
+ Vx * Sx - st_ct[1], Vx * Sy - st_ct[0], Vx * Vz,
113
+ Vy * Sx + st_ct[0], Vy * Sy - st_ct[1], Vy * Vz,
114
+ Vz * Sx, Vz * Sy, 1.0f - z);
115
+
116
+ return M * pos;
117
+ }
118
+
119
+ struct flake_noise_value {
120
+ // flake priority (in [0..1], 0: no flake, flakes with higher priority shadow flakes "below" them)
121
+ float priority;
122
+ // Stores values from the functions (once normal, another time the color)
123
+ // current pseudo random number generator seed
124
+ int rnd_seed;
125
+ float4 carrier;
126
+ };
127
+
128
+ // flake noise function with controllable regularity, flake size, and probability
129
+ flake_noise_value flake_noise(
130
+ float3 pos,
131
+ float jitter_scale = 1.0f,
132
+ float flake_diameter = 0.75f,
133
+ float flake_probability = 1.0f)
134
+ {
135
+ float3 base_pos = ::math::floor(pos);
136
+ int3 base_pos_i = int3(base_pos);
137
+
138
+ // limit the flake size to the allowed maximum (such that looking at all neighbors is sufficient)
139
+ flake_diameter = ::math::min(flake_diameter, (1.5f - 0.5f * jitter_scale) / ::math::sqrt(3.0f));
140
+
141
+ flake_noise_value val(0.0f, 0, float4(0.0));
142
+
143
+ for (int i = -1; i < 2; ++i) {
144
+ for (int j = -1; j < 2; ++j) {
145
+ for (int k = -1; k < 2; ++k) {
146
+
147
+ int seed = rnd_init(base_pos_i + int3(i, j, k));
148
+
149
+ seed = rnd_next(seed);
150
+ if (rnd_value(seed) > flake_probability)
151
+ continue;
152
+
153
+ seed = rnd_next(seed);
154
+ float priority = rnd_value(seed);
155
+ if (priority < val.priority)
156
+ continue;
157
+
158
+ float3 flake_pos = base_pos + float3(i, j, k) + float3(0.5f);
159
+
160
+ if (jitter_scale > 0.0f) {
161
+ seed = rnd_next(seed);
162
+ flake_pos.x += (rnd_value(seed) - 0.5f) * jitter_scale;
163
+ seed = rnd_next(seed);
164
+ flake_pos.y += (rnd_value(seed) - 0.5f) * jitter_scale;
165
+ seed = rnd_next(seed);
166
+ flake_pos.z += (rnd_value(seed) - 0.5f) * jitter_scale;
167
+ }
168
+
169
+ float3 p = pos - flake_pos;
170
+ if (::math::dot(p, p) >= flake_diameter * flake_diameter * 4.0f)
171
+ continue;
172
+
173
+ float3 xi_rot;
174
+ seed = rnd_next(seed);
175
+ xi_rot.x = rnd_value(seed);
176
+ seed = rnd_next(seed);
177
+ xi_rot.y = rnd_value(seed);
178
+ seed = rnd_next(seed);
179
+ xi_rot.z = rnd_value(seed);
180
+ p = rotate_pos(p, xi_rot);
181
+
182
+ if (::math::abs(p.x) <= flake_diameter &&
183
+ ::math::abs(p.y) <= flake_diameter &&
184
+ ::math::abs(p.z) <= flake_diameter)
185
+ {
186
+ val.priority = priority;
187
+ val.rnd_seed = seed;
188
+ }
189
+ }
190
+ }
191
+ }
192
+
193
+ return val;
194
+ }
195
+
196
+
197
+ // constants for numerical fitted curve to observed flake noise density behavior
198
+ // 1. no jitter, maximum flake diameter
199
+ const float4 ABCD = float4(-26.19771808f, 26.39663835f, 85.53857017f, -102.35069432f);
200
+ const float2 EF = float2(-101.42634862f, 118.45082288f);
201
+ // 2. jitter scale of 0.5f, maximum flake diameter
202
+ const float4 ABCD_J = float4(-0.87962159f, 0.91006603f, 0.76088203f, -0.24953308f);
203
+ const float2 EF_J = float2(-3.11456809f, 2.63430594f);
204
+ // compute a flake probability for a given flake coverage density x
205
+ float density_to_probability(
206
+ float4 abcd,
207
+ float2 ef,
208
+ float x)
209
+ {
210
+ float xx = x * x;
211
+ return (abcd.x * xx + abcd.y * x) / (abcd.z * xx * x + abcd.w * xx + ef.x * x + ef.y);
212
+ }
213
+
214
+ // statistically controlled (area/volume coverage density) flake noise
215
+ flake_noise_value flake_noise(
216
+ float3 position,
217
+ float density = 0.5f,
218
+ bool jittered = false) // jittered: slightly slower and slightly less uniform
219
+ {
220
+ float probability = density_to_probability(jittered ? ABCD_J : ABCD, jittered ? EF_J : EF, ::math::saturate(density));
221
+
222
+ return flake_noise(pos: position, jitter_scale: jittered ? 0.5f : 0.0f, flake_diameter: (jittered ? 1.25f : 1.5f) / ::math::sqrt(3.0f), flake_probability: probability);
223
+ }
224
+
225
+ // create a flake normal by importance sampling the Beckmann distribution with given roughness
226
+ flake_noise_value flake_normal(
227
+ flake_noise_value val,
228
+ float spread)
229
+ {
230
+ if (val.priority <= 0.0f)
231
+ {
232
+ val.carrier = float4(::state::normal().x, ::state::normal().y, ::state::normal().z, 1.0);
233
+ return val;
234
+ }
235
+
236
+ // int seed0 = rnd_next(val.rnd_seed);
237
+ // float xi0 = rnd_value(seed0);
238
+ // float xi1 = rnd_value(rnd_next(seed0));
239
+
240
+ int seed = rnd_next(val.rnd_seed);
241
+ float xi0 = rnd_value(seed);
242
+ seed = rnd_next(seed);
243
+ float xi1 = rnd_value(seed);
244
+
245
+ float phi = ::math::PI * 2.0f * xi0;
246
+
247
+ float roughness = spread * spread;
248
+
249
+ float tantheta = ::math::sqrt(-roughness * roughness * ::math::log(1.0f - xi1));
250
+ float sintheta = tantheta / ::math::sqrt(1.0f + tantheta * tantheta);
251
+ float costheta = ::math::sqrt(1.0f - sintheta * sintheta);
252
+
253
+ float[2] scphi = ::math::sincos(phi);
254
+
255
+ val.rnd_seed = seed;
256
+
257
+ // return
258
+ // ::state::texture_tangent_u(0) * scphi[1] * sintheta +
259
+ // ::state::texture_tangent_v(0) * scphi[0] * sintheta +
260
+ // ::state::normal() * costheta;
261
+ float3 normal = ::state::texture_tangent_u(0) * scphi[1] * sintheta +
262
+ ::state::texture_tangent_v(0) * scphi[0] * sintheta +
263
+ ::state::normal() * costheta;
264
+
265
+ val.carrier = float4(normal.x, normal.y, normal.z, 1.0);
266
+
267
+
268
+ return val;
269
+ }
270
+
271
+ flake_noise_value random_flake_color(flake_noise_value val)
272
+ {
273
+ int seed = rnd_next(val.rnd_seed);
274
+ float r = rnd_value(seed);
275
+ seed = rnd_next(seed);
276
+ float g = rnd_value(seed);
277
+ seed = rnd_next(seed);
278
+ float b = rnd_value(seed);
279
+ seed = rnd_next(seed);
280
+ float a = rnd_value(seed);
281
+
282
+ val.carrier = float4(r, g, b, a);
283
+ return val;
284
+ }
285
+
286
+
287
+ // Template for absorption and scattering, do not use directly
288
+ material volume_absorption(
289
+ color absorption = color(0.8665, 0.7769, 0.1559),
290
+ color scattering = color(.5),
291
+ float distance_scale = .03,
292
+ float directional_bias = 0.0,
293
+ uniform float ior = 1.2
294
+
295
+ )
296
+ [[
297
+ ::anno::author("NVIDIA vMaterials"),
298
+ ::anno::display_name("Volume Absorption"),
299
+ ::anno::description("Pure volume absorption material"),
300
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.volume_absorption.png"),
301
+ ::anno::copyright_notice(COPYRIGHT),
302
+ ::anno::hidden()
303
+
304
+ ]] = material (
305
+ ior: color(ior),
306
+ surface: material_surface (
307
+ scattering: ::df::specular_bsdf (
308
+ tint: color (1.0, 1.0, 1.0),
309
+ mode: ::df::scatter_reflect_transmit
310
+ )
311
+ ),
312
+ volume: material_volume (
313
+ scattering: ::df::anisotropic_vdf(
314
+ directional_bias: directional_bias
315
+ ),
316
+ absorption_coefficient: (distance_scale <= 0)? color(0): ::math::log(absorption) / -distance_scale,
317
+ scattering_coefficient: (distance_scale <= 0)? color(0): ::math::log(scattering) / -distance_scale
318
+ )
319
+ );
320
+
321
+ // metallic_plastic_full_weighted_mix( )
322
+ // Plastic material using diffuse reflection, diffuse transmission
323
+ // and SSS. Due to the diffuse transmission the volume absorption will
324
+ // render faster and converge smoother than when using specular transmission.
325
+ export material Plastic_Thick_Translucent_Flakes(
326
+ color diffuse_color = color(0.6940f, 0.5831f, 0.0493f)
327
+ [[
328
+ ::anno::display_name("Diffuse Color"),
329
+ ::anno::description("The diffuse color of the plastic material"),
330
+ ::anno::in_group("Appearance")
331
+ ]],
332
+ float diffuse_weight = 0.3f
333
+ [[
334
+ ::anno::display_name("Diffuse Weight"),
335
+ ::anno::description("The weight of the diffuse color of the plastic material. It is recommended to keep "
336
+ "the value around 0.5, lower values make the material appear more transparent while higher values make "
337
+ "it more opaque."),
338
+ ::anno::in_group("Appearance"),
339
+ ::anno::hard_range(0.f, 1.f)
340
+ ]],
341
+ color absorption = color(0.8665f, 0.7769f, 0.1559f)
342
+ [[
343
+ ::anno::display_name("Absorption Color"),
344
+ ::anno::description("Sets the absorption color (this is color when light goes extinct)of the plastic material"),
345
+ ::anno::in_group("Appearance")
346
+ ]],
347
+ color scattering = color(.5f)
348
+ [[
349
+ ::anno::display_name("Scattering Color"),
350
+ ::anno::description("Sets the absorption color (this is color when light goes extinct)of the plastic material"),
351
+ ::anno::in_group("Appearance")
352
+ ]],
353
+ float distance_scale = 1.5f
354
+ [[
355
+ ::anno::display_name("Distance Scale"),
356
+ ::anno::description("Scales how quickly light is absorbed. Set this value low enough to see "
357
+ "some light extinction taking place. Tip: Set 'diffuse_weight' to 0.0 while adjusting this "
358
+ "material parameter for your scene"),
359
+ ::anno::in_group("Appearance")
360
+ ]],
361
+
362
+ color diffuse_transmission_tint = color(1.0000f, 0.7249f, 0.1972f)
363
+ [[
364
+ ::anno::display_name("Diffuse Transmission Color"),
365
+ ::anno::description("The tinting of light scattering through the plastic material"),
366
+ ::anno::in_group("Appearance")
367
+ ]],
368
+
369
+ float reflection_roughness = 0.0f
370
+ [[
371
+ ::anno::display_name("Roughness"),
372
+ ::anno::description("The roughness of the reflection on the plastic"),
373
+ ::anno::in_group("Appearance"),
374
+ ::anno::hard_range(0.f, 1.f)
375
+ ]],
376
+
377
+ // Flakes Controls
378
+ color flake_color_1 = color(1.0f, 1.0f, 1.0f)
379
+ [[
380
+ ::anno::display_name("Flakes Color"),
381
+ ::anno::description("Flakes Color"),
382
+ ::anno::in_group("Flakes")
383
+ ]],
384
+ bool enable_color_randomization = true
385
+ [[
386
+ ::anno::display_name("Flakes Color Randomization"),
387
+ ::anno::description("Enables that a random flakes color will be chosen. Using 'Flakes Color Randomness' allows "
388
+ "to blend between the chosen reflection color for the flakes and an purely random chosen color."),
389
+ ::anno::in_group("Flakes")
390
+ ]],
391
+ float flake_color_randomness = 1.0f
392
+ [[
393
+ ::anno::display_name("Flakes Color Randomness"),
394
+ ::anno::description("Incresing this value will blend towards a randomly chosen flakes color."),
395
+ ::anno::in_group("Flakes"),
396
+ ::anno::hard_range(0.f, 1.f),
397
+ ::anno::enable_if("enable_color_randomization == true")
398
+ ]],
399
+ uniform float flake_size = 0.1f
400
+ [[
401
+ ::anno::display_name("Flakes Size"),
402
+ ::anno::description("The size of the flakes in the material"),
403
+ ::anno::in_group("Flakes")
404
+ ]],
405
+ uniform float3 texture_scale = float3 ( 1.f , 1.f, 1.f)
406
+ [[
407
+ //::anno::hidden(),
408
+ ::anno::display_name("Scale"),
409
+ ::anno::description("Larger numbers increase the texture size."),
410
+ ::nvidia::core_definitions::dimension(float3(1.0f, 1.0f, 1.0f)),
411
+ ::anno::in_group("Transform")
412
+ ]],
413
+ uniform float flake_amount = 0.1f
414
+ [[
415
+ ::anno::display_name("Flakes Amount"),
416
+ ::anno::description("The number of flakes used in the material, 0 meaning no flakes, 1 meaning that flakes "
417
+ "cover the entire surface"),
418
+ ::anno::in_group("Flakes"),
419
+ ::anno::hard_range(0.f, 1.f)
420
+ ]],
421
+
422
+ float flake_spread = 0.7f
423
+ [[
424
+ ::anno::display_name("Flakes Spread"),
425
+ ::anno::description("The amount of randomness in the orientation of the flakes. When set to zero, flakes are "
426
+ "oriented along the surface normal. Higher values tilt the flakes stronger in a random direction."),
427
+ ::anno::in_group("Flakes"),
428
+ ::anno::hard_range(0.f, 1.f)
429
+ ]]
430
+ )
431
+ [[
432
+ ::anno::author("NVIDIA vMaterials"),
433
+ ::anno::display_name("Plastic Full Control"),
434
+ ::anno::description(DESCRIPTION),
435
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.Plastic_Thick_Translucent_Flakes.png"),
436
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment")),
437
+ ::anno::copyright_notice(COPYRIGHT),
438
+ ::anno::hidden()
439
+ ]] = let {
440
+ // Hardcoded plastic parameters
441
+ float reflection_weight = 1.0f;
442
+ float normal_reflectivity = 0.04f;
443
+ float grazing_reflectivity = 1.0f;
444
+ float reflectivity_exponent = 5.0f;
445
+ uniform float ior = 1.4f;
446
+
447
+ // Hardcoded flake parameters
448
+ uniform float flake_roughness = 0.4f;
449
+ float flake_transparency_randomness = 1.0f;
450
+ float flakes_opacity = 0.8;
451
+
452
+ // Flakes
453
+
454
+ float3 flake_uvw_scale = float3(1.0f);
455
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(
456
+ coordinate_system: ::base::texture_coordinate_world,
457
+ texture_space: 0
458
+ );
459
+
460
+ ::base::texture_coordinate_info transformed_uvw = uvw;
461
+ float3 flake_uvw = (texture_scale * transformed_uvw.position * flake_uvw_scale) / (flake_size * 0.001f);
462
+
463
+ flake_noise_value val = flake_noise(flake_uvw, flake_amount, true);
464
+ bool is_flake = val.priority > 0.0f;
465
+ flake_noise_value val2 = flake_normal(val, flake_spread);
466
+ float3 flake_normal = float3(val2.carrier.x, val2.carrier.y, val2.carrier.z);
467
+ flake_noise_value val3 = random_flake_color(val2);
468
+
469
+ color random_color = color(val3.carrier.x, val3.carrier.y, val3.carrier.z);
470
+ float flakes_transparency_value = ::math::lerp(flakes_opacity, val3.carrier.w * flakes_opacity, flake_transparency_randomness);
471
+
472
+ color flake_color = enable_color_randomization ?
473
+ ::math::lerp(flake_color_1, random_color, flake_color_randomness) : flake_color_1;
474
+
475
+ bsdf flakes = ::df::simple_glossy_bsdf(mode: ::df::scatter_reflect, roughness_u: flake_roughness * flake_roughness, tint: flake_color);
476
+
477
+
478
+ // Plastic
479
+
480
+ material plastic = volume_absorption(
481
+ absorption: absorption,
482
+ scattering: scattering,
483
+ distance_scale: distance_scale,
484
+ ior: ior
485
+ );
486
+
487
+ bsdf transdiff = ::df::diffuse_transmission_bsdf(
488
+ tint: diffuse_transmission_tint
489
+ );
490
+
491
+ bsdf diffuse = ::df::diffuse_reflection_bsdf(
492
+ tint: diffuse_color
493
+ );
494
+
495
+ bsdf diffuse_mix_layer = ::df::weighted_layer(
496
+ base: transdiff,
497
+ layer: diffuse,
498
+ weight: diffuse_weight
499
+
500
+ );
501
+
502
+ bsdf plastic_with_flakes = ::df::weighted_layer(
503
+ base: diffuse_mix_layer,
504
+ layer: flakes,
505
+ weight: is_flake ? flakes_transparency_value : 0.0f,
506
+ normal: flake_normal
507
+ );
508
+
509
+ bsdf glossy_reflection = ::df::simple_glossy_bsdf(
510
+ tint: color(1.0),
511
+ roughness_u: reflection_roughness,
512
+ mode: ::df::scatter_reflect
513
+ );
514
+
515
+ bsdf final_layer = ::df::custom_curve_layer(
516
+ normal_reflectivity: normal_reflectivity,
517
+ grazing_reflectivity: grazing_reflectivity,
518
+ layer: glossy_reflection,
519
+ base: plastic_with_flakes,
520
+ weight: reflection_weight,
521
+ exponent: reflectivity_exponent
522
+ );
523
+
524
+ } in material (
525
+ surface: material_surface(
526
+ scattering: final_layer
527
+ ),
528
+
529
+ volume: plastic.volume
530
+ );
531
+
532
+
533
+ export material metallic_plastic_simple_controls(
534
+ color diffuse_color = color(0.6940, 0.5831, 0.0493)
535
+ [[
536
+ ::anno::display_name("Diffuse Color"),
537
+ ::anno::description("The diffuse color of the plastic material"),
538
+ ::anno::in_group("Appearance")
539
+ ]],
540
+ float diffuse_weight = 0.5
541
+ [[
542
+ ::anno::display_name("Diffuse Weight"),
543
+ ::anno::description("The weight of the diffuse color of the plastic material. It is recommended to keep "
544
+ "the value around 0.5, lower values make the material appear more transparent while higher values make "
545
+ "it more opaque."),
546
+ ::anno::in_group("Appearance"),
547
+ ::anno::hard_range(0.f, 1.f)
548
+ ]],
549
+ color transmissive_color = color(0.8665, 0.7769, 0.1559)
550
+ [[
551
+ ::anno::display_name("Transmissive Color"),
552
+ ::anno::description("The tinting of light scattering through the plastic material"),
553
+ ::anno::in_group("Appearance")
554
+ ]],
555
+ float reflection_roughness = 0.0
556
+ [[
557
+ ::anno::display_name("Roughness"),
558
+ ::anno::description("The roughness of the reflection on the plastic"),
559
+ ::anno::in_group("Appearance"),
560
+ ::anno::hard_range(0.f, 1.f)
561
+ ]],
562
+ float distance_scale = 0.005
563
+ [[
564
+ ::anno::display_name("Distance Scale"),
565
+ ::anno::description("Scales how quickly light is absorbed. Set this value low enough to see "
566
+ "some light extinction taking place. Tip: Set 'diffuse_weight' to 0.0 while adjusting this "
567
+ "material parameter for your scene"),
568
+ ::anno::in_group("Appearance")
569
+ ]],
570
+
571
+ // Flakes Controls
572
+ color flake_color_1 = color(1.0f, 1.0f, 1.0f)
573
+ [[
574
+ ::anno::display_name("Flakes Color"),
575
+ ::anno::description("Flakes Color"),
576
+ ::anno::in_group("Flakes")
577
+ ]],
578
+ bool enable_color_randomization = true
579
+ [[
580
+ ::anno::display_name("Flakes Color Randomization"),
581
+ ::anno::description("Enables that a random flakes color will be chosen. Using 'Flakes Color Randomness' allows "
582
+ "to blend between the chosen reflection color for the flakes and an purely random chosen color."),
583
+ ::anno::in_group("Flakes")
584
+ ]],
585
+ float flake_color_randomness = 1.0
586
+ [[
587
+ ::anno::display_name("Flakes Color Randomness"),
588
+ ::anno::description("Incresing this value will blend towards a randomly chosen flakes color."),
589
+ ::anno::in_group("Flakes"),
590
+ ::anno::hard_range(0.f, 1.f),
591
+ ::anno::enable_if("enable_color_randomization == true")
592
+ ]],
593
+ uniform float flake_size = 0.1f
594
+ [[
595
+ ::anno::display_name("Flakes Size"),
596
+ ::anno::description("The size of the flakes in the material"),
597
+ ::anno::in_group("Flakes")
598
+ ]],
599
+ uniform float3 texture_scale = float3 ( 1.f , 1.f, 1.f)
600
+ [[
601
+ //::anno::hidden(),
602
+ ::anno::display_name("Scale"),
603
+ ::anno::description("Larger numbers increase the texture size."),
604
+ ::nvidia::core_definitions::dimension(float3(1.0f, 1.0f, 1.0f)),
605
+ ::anno::in_group("Transform")
606
+ ]],
607
+ uniform float flake_amount = 0.1f
608
+ [[
609
+ ::anno::display_name("Flakes Amount"),
610
+ ::anno::description("The number of flakes used in the material, 0 meaning no flakes, 1 meaning that flakes cover the entire surface"),
611
+ ::anno::in_group("Flakes"),
612
+ ::anno::hard_range(0.f, 1.f)
613
+ ]],
614
+ float flake_spread = 0.7f
615
+ [[
616
+ ::anno::display_name("Flakes Spread"),
617
+ ::anno::description("The amount of randomness in the orientation of the flakes. When set to zero, flakes are oriented along the surface normal. Higher values tilt the flakes stronger in a random direction."),
618
+ ::anno::in_group("Flakes"),
619
+ ::anno::hard_range(0.f, 1.f)
620
+ ]]
621
+
622
+ )
623
+ [[
624
+ ::anno::author("NVIDIA ARC"),
625
+ ::anno::display_name("Plastic"),
626
+ ::anno::description(DESCRIPTION),
627
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment")),
628
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_simple_controls.png"),
629
+ ::anno::copyright_notice(COPYRIGHT),
630
+ ::anno::hidden()
631
+ ]] = Plastic_Thick_Translucent_Flakes(
632
+ absorption: ::math::pow(transmissive_color, 0.2),
633
+ scattering: color(0.5),
634
+ distance_scale: distance_scale,
635
+ diffuse_transmission_tint: ::math::pow(transmissive_color, 0.2),
636
+ diffuse_color: diffuse_color,
637
+ diffuse_weight: diffuse_weight,
638
+ reflection_roughness: reflection_roughness,
639
+
640
+ flake_color_1: flake_color_1,
641
+ enable_color_randomization: enable_color_randomization,
642
+ flake_color_randomness: flake_color_randomness,
643
+ flake_size: flake_size,
644
+ texture_scale: texture_scale,
645
+ flake_amount: flake_amount,
646
+ flake_spread: flake_spread
647
+ );
648
+
649
+
650
+ // 01 - Black
651
+ export material plastic_black(*)
652
+ [[
653
+ ::anno::author("NVIDIA ARC"),
654
+ ::anno::display_name("Metallic Plastic Black"),
655
+ ::anno::description(DESCRIPTION),
656
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "dark", "black", "neutral")),
657
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_black.png"),
658
+ ::anno::copyright_notice(COPYRIGHT)
659
+ ]] = metallic_plastic_simple_controls(
660
+ diffuse_color: color(0.034230),
661
+ diffuse_weight: .5,
662
+ transmissive_color: color(0.034230),
663
+ distance_scale: 0.002,
664
+ reflection_roughness: 0.05
665
+ );
666
+
667
+
668
+ // 02 - Dark Gray
669
+ export material plastic_dark_gray(*)
670
+ [[
671
+ ::anno::author("NVIDIA ARC"),
672
+ ::anno::display_name("Metallic Plastic Dark Gray"),
673
+ ::anno::description(DESCRIPTION),
674
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "dark", "gray", "neutral")),
675
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_dark_gray.png"),
676
+ ::anno::copyright_notice(COPYRIGHT)
677
+ ]] = metallic_plastic_simple_controls(
678
+ diffuse_color: color(0.127530),
679
+ diffuse_weight: .5,
680
+ transmissive_color: color(0.089194),
681
+ distance_scale: 0.002,
682
+ reflection_roughness: 0.05
683
+ );
684
+
685
+
686
+ // 03 - Light Gray
687
+ export material plastic_light_gray(*)
688
+ [[
689
+ ::anno::author("NVIDIA ARC"),
690
+ ::anno::display_name("Metallic Plastic Light Gray"),
691
+ ::anno::description(DESCRIPTION),
692
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "light", "gray", "neutral")),
693
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_light_gray.png"),
694
+ ::anno::copyright_notice(COPYRIGHT)
695
+ ]] = metallic_plastic_simple_controls(
696
+ diffuse_color: color(0.464741),
697
+ diffuse_weight: .5,
698
+ transmissive_color: color(0.358654),
699
+ distance_scale: 0.002,
700
+ reflection_roughness: 0.05
701
+ );
702
+
703
+
704
+ // 04 - White
705
+ export material plastic_white(*)
706
+ [[
707
+ ::anno::author("NVIDIA ARC"),
708
+ ::anno::display_name("Metallic Plastic White"),
709
+ ::anno::description(DESCRIPTION),
710
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "light", "white", "neutral")),
711
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_white.png"),
712
+ ::anno::copyright_notice(COPYRIGHT)
713
+ ]] = metallic_plastic_simple_controls(
714
+ diffuse_color: color(0.915750),
715
+ diffuse_weight: .5,
716
+ transmissive_color: color(0.812241),
717
+ distance_scale: 0.002,
718
+ reflection_roughness: 0.05
719
+ );
720
+
721
+
722
+ // 05 - Ivory White
723
+ export material plastic_ivory_white(*)
724
+ [[
725
+ ::anno::author("NVIDIA ARC"),
726
+ ::anno::display_name("Metallic Plastic Ivory White"),
727
+ ::anno::description(DESCRIPTION),
728
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "white", "bright", "ivory", "warm")),
729
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_ivory_white.png"),
730
+ ::anno::copyright_notice(COPYRIGHT)
731
+ ]] = metallic_plastic_simple_controls(
732
+ diffuse_color: color(0.899385, 0.843370, 0.694081),
733
+ diffuse_weight: .5,
734
+ transmissive_color: color(0.722672, 0.708298, 0.547994),
735
+ distance_scale: 0.002,
736
+ reflection_roughness: 0.05
737
+ );
738
+
739
+
740
+ // 06 - Lemon
741
+ export material plastic_lemon(*)
742
+ [[
743
+ ::anno::author("NVIDIA ARC"),
744
+ ::anno::display_name("Metallic Plastic Lemon"),
745
+ ::anno::description(DESCRIPTION),
746
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "lemon", "yellow", "light", "warm")),
747
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_lemon.png"),
748
+ ::anno::copyright_notice(COPYRIGHT)
749
+ ]] = metallic_plastic_simple_controls(
750
+ diffuse_color: color(0.859174, 0.875138, 0.039947),
751
+ diffuse_weight: .5,
752
+ transmissive_color: color(0.98211, 0.843370, 0.031551),
753
+ distance_scale: 0.002,
754
+ reflection_roughness: 0.05
755
+ );
756
+
757
+
758
+ // 07 - Yellow Orange
759
+ export material plastic_yellow_orange(*)
760
+ [[
761
+ ::anno::author("NVIDIA ARC"),
762
+ ::anno::display_name("Metallic Plastic Yellow"),
763
+ ::anno::description(DESCRIPTION),
764
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "light", "orange", "yellow", "warm")),
765
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_yellow_orange.png"),
766
+ ::anno::copyright_notice(COPYRIGHT)
767
+ ]] = metallic_plastic_simple_controls(
768
+ diffuse_color: color(0.875138, 0.612066, 0.039947),
769
+ diffuse_weight: .5,
770
+ transmissive_color: color(0.899385, 0.373615, 0.030257),
771
+ distance_scale: 0.002,
772
+ reflection_roughness: 0.05
773
+ );
774
+
775
+
776
+ // 08 - Orange
777
+ export material plastic_orange(*)
778
+ [[
779
+ ::anno::author("NVIDIA ARC"),
780
+ ::anno::display_name("Metallic Plastic Orange"),
781
+ ::anno::description(DESCRIPTION),
782
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "orange", "warm")),
783
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_orange.png"),
784
+ ::anno::copyright_notice(COPYRIGHT)
785
+ ]] = metallic_plastic_simple_controls(
786
+ diffuse_color: color(0.875138, 0.353741, 0.030257),
787
+ diffuse_weight: .5,
788
+ transmissive_color: color(0.891262, 0.420508, 0.022013),
789
+ distance_scale: 0.002,
790
+ reflection_roughness: 0.05
791
+ );
792
+
793
+
794
+ // 09 - Dark Orange
795
+ export material plastic_dark_orange(*)
796
+ [[
797
+ ::anno::author("NVIDIA ARC"),
798
+ ::anno::display_name("Metallic Plastic Dark Orange"),
799
+ ::anno::description(DESCRIPTION),
800
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "dark", "orange", "warm")),
801
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_dark_orange.png"),
802
+ ::anno::copyright_notice(COPYRIGHT)
803
+ ]] = metallic_plastic_simple_controls(
804
+ diffuse_color: color(0.535642, 0.127530, 0.022013),
805
+ diffuse_weight: .5,
806
+ transmissive_color: color(0.827726, 0.267358, 0.022013),
807
+ distance_scale: 0.002,
808
+ reflection_roughness: 0.05
809
+ );
810
+
811
+
812
+ // 10 - Red
813
+ export material plastic_red(*)
814
+ [[
815
+ ::anno::author("NVIDIA ARC"),
816
+ ::anno::display_name("Metallic Plastic Red"),
817
+ ::anno::description(DESCRIPTION),
818
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "red", "cherry", "warm")),
819
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_red.png"),
820
+ ::anno::copyright_notice(COPYRIGHT)
821
+ ]] = metallic_plastic_simple_controls(
822
+ diffuse_color: color(0.547994, 0.027755, 0.027755),
823
+ diffuse_weight: .5,
824
+ transmissive_color: color(0.875138, 0.022013, 0.022013),
825
+ distance_scale: 0.002,
826
+ reflection_roughness: 0.05
827
+ );
828
+
829
+
830
+ // 11 - Magenta
831
+ export material plastic_magenta(*)
832
+ [[
833
+ ::anno::author("NVIDIA ARC"),
834
+ ::anno::display_name("Metallic Plastic Magenta"),
835
+ ::anno::description(DESCRIPTION),
836
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "magenta")),
837
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_magenta.png"),
838
+ ::anno::copyright_notice(COPYRIGHT)
839
+ ]] = metallic_plastic_simple_controls(
840
+ diffuse_color: color(0.547994, 0.047776, 0.554227),
841
+ diffuse_weight: .5,
842
+ transmissive_color: color(0.722672, 0.030257, 0.566810),
843
+ distance_scale: 0.002,
844
+ reflection_roughness: 0.05
845
+ );
846
+
847
+
848
+ // 12 - Purple
849
+ export material plastic_purple(*)
850
+ [[
851
+ ::anno::author("NVIDIA ARC"),
852
+ ::anno::display_name("Metallic Plastic Purple"),
853
+ ::anno::description(DESCRIPTION),
854
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "purple")),
855
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_purple.png"),
856
+ ::anno::copyright_notice(COPYRIGHT)
857
+ ]] = metallic_plastic_simple_controls(
858
+ diffuse_color: color(0.193972, 0.017936, 0.464741),
859
+ diffuse_weight: .5,
860
+ transmissive_color: color(0.701170, 0.018913, 0.645555),
861
+ distance_scale: 0.002,
862
+ reflection_roughness: 0.05
863
+ );
864
+
865
+
866
+ // 13 - Dark Blue
867
+ export material plastic_dark_blue(*)
868
+ [[
869
+ ::anno::author("NVIDIA ARC"),
870
+ ::anno::display_name("Metallic Plastic Dark Blue"),
871
+ ::anno::description(DESCRIPTION),
872
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "dark", "blue", "cool")),
873
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_dark_blue.png"),
874
+ ::anno::copyright_notice(COPYRIGHT)
875
+ ]] = metallic_plastic_simple_controls(
876
+ diffuse_color: color(0.027755, 0.058187, 0.311180),
877
+ diffuse_weight: .5,
878
+ transmissive_color: color(0.027755, 0.058187, 0.311180),
879
+ distance_scale: 0.002,
880
+ reflection_roughness: 0.05
881
+ );
882
+
883
+
884
+ // 14 - Blue
885
+ export material plastic_blue(*)
886
+ [[
887
+ ::anno::author("NVIDIA ARC"),
888
+ ::anno::display_name("Metallic Plastic Blue"),
889
+ ::anno::description(DESCRIPTION),
890
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "blue", "cool")),
891
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_blue.png"),
892
+ ::anno::copyright_notice(COPYRIGHT)
893
+ ]] = metallic_plastic_simple_controls(
894
+ diffuse_color: color(0.034230, 0.173439, 0.843370),
895
+ diffuse_weight: .5,
896
+ transmissive_color: color(0.034230, 0.124741, 0.659224),
897
+ distance_scale: 0.002,
898
+ reflection_roughness: 0.05
899
+ );
900
+
901
+
902
+ // 15 - Sky Blue
903
+ export material plastic_sky_blue(*)
904
+ [[
905
+ ::anno::author("NVIDIA ARC"),
906
+ ::anno::display_name("Metallic Plastic Sky Blue"),
907
+ ::anno::description(DESCRIPTION),
908
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "blue", "sky", "cool")),
909
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_sky_blue.png"),
910
+ ::anno::copyright_notice(COPYRIGHT)
911
+ ]] = metallic_plastic_simple_controls(
912
+ diffuse_color: color(0.061907, 0.535642, 0.875138),
913
+ diffuse_weight: .5,
914
+ transmissive_color: color(0.028991, 0.358654, 0.673049),
915
+ distance_scale: 0.002,
916
+ reflection_roughness: 0.05
917
+ );
918
+
919
+
920
+ // 16 - Light Blue
921
+ export material plastic_light_blue(*)
922
+ [[
923
+ ::anno::author("NVIDIA ARC"),
924
+ ::anno::display_name("Metallic Plastic Light Blue"),
925
+ ::anno::description(DESCRIPTION),
926
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "light", "blue", "cool")),
927
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_light_blue.png"),
928
+ ::anno::copyright_notice(COPYRIGHT)
929
+ ]] = metallic_plastic_simple_controls(
930
+ diffuse_color: color(0.263175, 0.774227, 0.827726),
931
+ diffuse_weight: .5,
932
+ transmissive_color: color(0.163641, 0.592438, 0.759300),
933
+ distance_scale: 0.002,
934
+ reflection_roughness: 0.05
935
+ );
936
+
937
+
938
+ // 17 - Teal
939
+ export material plastic_teal(*)
940
+ [[
941
+ ::anno::author("NVIDIA ARC"),
942
+ ::anno::display_name("Metallic Plastic Teal"),
943
+ ::anno::description(DESCRIPTION),
944
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "teal", "cool")),
945
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_teal.png"),
946
+ ::anno::copyright_notice(COPYRIGHT)
947
+ ]] = metallic_plastic_simple_controls(
948
+ diffuse_color: color(0.037029, 0.579547, 0.329729),
949
+ diffuse_weight: .5,
950
+ transmissive_color: color(0.022013, 0.476177, 0.353741),
951
+ distance_scale: 0.002,
952
+ reflection_roughness: 0.05
953
+ );
954
+
955
+
956
+ // 18 - Dark Green
957
+ export material plastic_dark_green(*)
958
+ [[
959
+ ::anno::author("NVIDIA ARC"),
960
+ ::anno::display_name("Metallic Plastic Dark Green"),
961
+ ::anno::description(DESCRIPTION),
962
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "dark", "green")),
963
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_dark_green.png"),
964
+ ::anno::copyright_notice(COPYRIGHT)
965
+ ]] = metallic_plastic_simple_controls(
966
+ diffuse_color: color(0.034230, 0.141980, 0.034230),
967
+ diffuse_weight: .5,
968
+ transmissive_color: color(0.016988, 0.141980, 0.016988),
969
+ distance_scale: 0.002,
970
+ reflection_roughness: 0.05
971
+ );
972
+
973
+
974
+ // 19 - Green
975
+ export material plastic_green(*)
976
+ [[
977
+ ::anno::author("NVIDIA ARC"),
978
+ ::anno::display_name("Metallic Plastic Green"),
979
+ ::anno::description(DESCRIPTION),
980
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "green")),
981
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_green.png"),
982
+ ::anno::copyright_notice(COPYRIGHT)
983
+ ]] = metallic_plastic_simple_controls(
984
+ diffuse_color: color(0.016988, 0.311180, 0.016988),
985
+ diffuse_weight: .5,
986
+ transmissive_color: color(0.012664, 0.358654, 0.012664),
987
+ distance_scale: 0.002,
988
+ reflection_roughness: 0.05
989
+ );
990
+
991
+
992
+ // 20 - Light Green
993
+ export material plastic_light_green(*)
994
+ [[
995
+ ::anno::author("NVIDIA ARC"),
996
+ ::anno::display_name("Metallic Plastic Light Green"),
997
+ ::anno::description(DESCRIPTION),
998
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "light", "green")),
999
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_light_green.png"),
1000
+ ::anno::copyright_notice(COPYRIGHT)
1001
+ ]] = metallic_plastic_simple_controls(
1002
+ diffuse_color: color(0.030257, 0.687031, 0.027755),
1003
+ diffuse_weight: .5,
1004
+ transmissive_color: color(0.030257, 0.701170, 0.027755),
1005
+ distance_scale: 0.002,
1006
+ reflection_roughness: 0.05
1007
+ );
1008
+
1009
+
1010
+ // 21 - Lime Green
1011
+ export material plastic_lime_green(*)
1012
+ [[
1013
+ ::anno::author("NVIDIA ARC"),
1014
+ ::anno::display_name("Metallic Plastic Lime Green"),
1015
+ ::anno::description(DESCRIPTION),
1016
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "lime", "green", "light")),
1017
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_lime_green.png"),
1018
+ ::anno::copyright_notice(COPYRIGHT)
1019
+ ]] = metallic_plastic_simple_controls(
1020
+ diffuse_color: color(0.186989, 0.605484, 0.027755),
1021
+ diffuse_weight: .5,
1022
+ transmissive_color: color(0.204710, 0.701170, 0.022013),
1023
+ distance_scale: 0.002,
1024
+ reflection_roughness: 0.05
1025
+ );
objects/table_oak/materials/remote/omniverse-content-production.s3.us-west-2.amazonaws.com/Materials/2023_1/Base/Plastics/Plastic.mdl ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.4;
2
+
3
+ using ::OmniPBR import OmniPBR;
4
+ import ::tex::gamma_mode;
5
+ import ::state::normal;
6
+
7
+ export material Plastic(*)
8
+ = OmniPBR(
9
+ diffuse_color_constant: color(1.0, 1.0, 1.0),
10
+ diffuse_texture: texture_2d(), //"./Plastic/Plastic_BaseColor.png", ::tex::gamma_srgb
11
+ albedo_desaturation: 0.f,
12
+ albedo_add: 0.f,
13
+ albedo_brightness: 1.f,
14
+ diffuse_tint: color(1.f, 1.f, 1.f), //0.15f, 0.15f, 0.15f
15
+ reflection_roughness_constant: 0.45,
16
+ reflection_roughness_texture_influence: 0.f,
17
+ reflectionroughness_texture: texture_2d(),
18
+ metallic_constant: 0.0,
19
+ metallic_texture_influence: 0.f,
20
+ metallic_texture: texture_2d(),
21
+ specular_level: 0.5f,
22
+ enable_ORM_texture: true,
23
+ ORM_texture: texture_2d(), //"./Plastic/Plastic_ORM.png", ::tex::gamma_linear
24
+ ao_to_diffuse: 0.f,
25
+ ao_texture: texture_2d(),
26
+ enable_emission: false,
27
+ emissive_color: color(0.0, 0.0, 0.0),
28
+ emissive_mask_texture: texture_2d(),
29
+ emissive_intensity: 0.0,
30
+ bump_factor: 0.5f,
31
+ normalmap_texture: texture_2d(), //"./Plastic/Plastic_Normal.png", ::tex::gamma_linear
32
+ detail_bump_factor: 1.f,
33
+ detail_normalmap_texture: texture_2d(),
34
+ project_uvw: false,
35
+ world_or_object: false,
36
+ uv_space_index: 0,
37
+ texture_translate: float2(0.f),
38
+ texture_rotate: 0.f,
39
+ texture_scale: float2(1.f),
40
+ detail_texture_translate: float2(0.f),
41
+ detail_texture_rotate: 0.f,
42
+ detail_texture_scale: float2(1.f));
objects/table_oak/materials/remote/omniverse-content-production.s3.us-west-2.amazonaws.com/Materials/2023_1/Base/Plastics/Plastic_Clear.mdl ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.3;
2
+
3
+ import ::OmniGlass::OmniGlass;
4
+ import ::tex::gamma_mode;
5
+ import ::state::normal;
6
+
7
+ export material Plastic_Clear(*)
8
+ = OmniGlass::OmniGlass(
9
+ absorption_coeff: color(1.f, 1.f, 1.f),
10
+ glass_color: color(1.f, 1.f, 1.f),
11
+ use_glass_color_texture: false,
12
+ glass_color_texture: texture_2d(),
13
+ frosting_roughness: 0.f,
14
+ glass_ior: 1.46f,
15
+ thin_walled: true,
16
+ project_uvw: false,
17
+ world_or_object: false,
18
+ uv_space_index: 0,
19
+ texture_translate: float2(0.f),
20
+ texture_rotate: 0.f,
21
+ texture_scale: float2(1.f));
objects/table_oak/materials/remote/omniverse-content-production.s3.us-west-2.amazonaws.com/Materials/2023_1/vMaterials_2/Paint/Carpaint/Carpaint_Solid.mdl ADDED
@@ -0,0 +1,1112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2023 NVIDIA Corporation. All rights reserved. *
3
+ ******************************************************************************
4
+
5
+ Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge,
6
+ to any person obtaining a copy of the sample definition code that uses our
7
+ Material Definition Language (the "MDL Materials"), to reproduce and distribute
8
+ the MDL Materials, including without limitation the rights to use, copy, merge,
9
+ publish, distribute, and sell modified and unmodified copies of the MDL
10
+ Materials, and to permit persons to whom the MDL Materials is furnished to do
11
+ so, in all cases solely for use with NVIDIA's Material Definition Language,
12
+ subject to the following further conditions:
13
+
14
+ 1. The above copyright notices, this list of conditions, and the disclaimer
15
+ that follows shall be retained in all copies of one or more of the MDL
16
+ Materials, including in any software with which the MDL Materials are bundled,
17
+ redistributed, and/or sold, and included either as stand-alone text files,
18
+ human-readable headers or in the appropriate machine-readable metadata fields
19
+ within text or binary files as long as those fields can be easily viewed by the
20
+ user, as applicable.
21
+ 2. The name of NVIDIA shall not be used to promote, endorse or advertise any
22
+ Modified Version without specific prior written permission, except a) to comply
23
+ with the notice requirements otherwise contained herein; or b) to acknowledge
24
+ the contribution(s) of NVIDIA.
25
+
26
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
27
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
28
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
29
+ TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR
30
+ ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL,
31
+ INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF
32
+ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE
33
+ THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.
34
+ */
35
+
36
+ mdl 1.6;
37
+ import ::df::*;
38
+ import ::math::*;
39
+ import ::anno::*;
40
+ import ::state::*;
41
+ import ::base::*;
42
+ import ::tex::*;
43
+ import ::nvidia::core_definitions::dimension;
44
+ import ::nvidia::core_definitions::blend_colors;
45
+
46
+
47
+ const string COPYRIGHT =
48
+ " Copyright 2023 NVIDIA Corporation. All rights reserved.\n"
49
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
50
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
51
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
52
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
53
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
54
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
55
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
56
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
57
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
58
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
59
+
60
+
61
+ ::base::texture_coordinate_info transform_coordinate_2(
62
+ float4x4 transform
63
+ [[ ::anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix") ]],
64
+ ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info()
65
+ [[ ::anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection") ]]
66
+ ) [[
67
+ ::anno::description("Transform a texture coordinate by a matrix") ,
68
+ ::anno::noinline()
69
+ ]]
70
+ {
71
+ // Version 2
72
+ float4 r_position = transform * float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1);
73
+ //Try aproximating it for the case that the rotation is only aroud z and assuming the texture layout is nice and z is ~constant.
74
+ //just pretend there is no other rotation happening
75
+ //get rid of scaling and translation. Then extract fields where sin and cos would be in a simple 2d transform around z.
76
+ float4 u = transform[0];
77
+ float3 ru = ::math::normalize(float3(u.x,u.y,u.z));
78
+ float cos = ru.x;
79
+ float sin = -ru.y;
80
+
81
+ return ::base::texture_coordinate_info(
82
+ float3(r_position.x,r_position.y,r_position.z),
83
+ ::math::normalize(cos * coordinate.tangent_u - sin * coordinate.tangent_v),
84
+ ::math::normalize(cos * coordinate.tangent_v + sin * coordinate.tangent_u));
85
+ }
86
+
87
+ // Takes the standard input that every material has. It combines a couple of
88
+ // functions in one convenience function.
89
+ ::base::texture_coordinate_info vmat_transform(
90
+ float2 translation = float2(0.0f, 0.0f),
91
+ float rotation = 0.0f, // rotation in degrees
92
+ float2 scaling = float2(1.0f, 1.0f),
93
+ uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw,
94
+ uniform int uv_space = 0
95
+ )
96
+ {
97
+ float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f;
98
+ float4x4 scale =
99
+ float4x4(1.0f /scaling.x, 0.f , 0.f , 0.f,
100
+ 0.f , 1.0f /scaling.y , 0.f , 0.f,
101
+ 0.f , 0.f , 1.0f, 0.f,
102
+ translation.x , translation.y , 0.0f, 1.f);
103
+
104
+ float s = ::math::sin(rotation_rad);
105
+ float c = ::math::cos(rotation_rad);
106
+ float4x4 rotate =
107
+ float4x4( c , -s , 0.0f , 0.0f,
108
+ s , c , 0.0f , 0.0f,
109
+ 0.0f, 0.0f , 1.0f , 0.0f,
110
+ 0.f , 0.0f , 0.0f , 1.f);
111
+
112
+ return transform_coordinate_2(scale*rotate, ::base::coordinate_source(system, uv_space));
113
+ }
114
+
115
+
116
+
117
+ float histogram_range(float input, float range = 1.0f, float position = 0.5f)
118
+ {
119
+ float low = ::math::clamp(1.0f - ::math::min(((1.0f - position) + range * 0.5f), (1.0f - position) * 2), 0.0f, 1.0f);
120
+ float high = ::math::clamp(::math::min((position + range * 0.5f ), position * 2.0f), 0.0f, 1.0f);
121
+ return ::math::lerp(low, high, input);
122
+ }
123
+
124
+ //
125
+ // flake noise utilities
126
+ //
127
+ int hash(int seed, int i)
128
+ {
129
+ return (i ^ seed) * 1075385539;
130
+ }
131
+ int rnd_init(int3 pos)
132
+ {
133
+ return hash(hash(hash(0, pos.x), pos.y), pos.z);
134
+ }
135
+
136
+ int rnd_next(int seed) {
137
+ // xorshift32 using signed int
138
+ seed ^= seed << 13;
139
+ seed ^= seed >>> 17;
140
+ seed ^= seed << 5;
141
+ return seed;
142
+ }
143
+
144
+ float rnd_value(int seed)
145
+ {
146
+ //return ::math::abs(float(seed) * 4.6566fe-10f);
147
+ return ::math::abs(float(seed) * 0.00000000046566f);
148
+ }
149
+
150
+ // apply random rotation (using "Fast Random Rotation Matrices" by James Arvo)
151
+ float3 rotate_pos(float3 pos, float3 xi)
152
+ {
153
+ float theta = ::math::PI * 2.0f * xi.x;
154
+ float phi = ::math::PI * 2.0f * xi.y;
155
+ float z = xi.z * 2.0f;
156
+
157
+ float r = ::math::sqrt(z);
158
+ float[2] sp_cp = ::math::sincos(phi);
159
+ float Vx = sp_cp[0] * r;
160
+ float Vy = sp_cp[1] * r;
161
+ float Vz = ::math::sqrt(2.0f - z);
162
+
163
+ float[2] st_ct = ::math::sincos(theta);
164
+ float Sx = Vx * st_ct[1] - Vy * st_ct[0];
165
+ float Sy = Vx * st_ct[0] + Vy * st_ct[1];
166
+
167
+ float3x3 M(
168
+ Vx * Sx - st_ct[1], Vx * Sy - st_ct[0], Vx * Vz,
169
+ Vy * Sx + st_ct[0], Vy * Sy - st_ct[1], Vy * Vz,
170
+ Vz * Sx, Vz * Sy, 1.0f - z);
171
+
172
+ return M * pos;
173
+ }
174
+
175
+ struct flake_noise_value {
176
+ // flake priority (in [0..1], 0: no flake, flakes with higher priority shadow flakes "below" them)
177
+ float priority;
178
+ // Stores values from the functions (once normal, another time the color)
179
+ // current pseudo random number generator seed
180
+ int rnd_seed;
181
+ float4 carrier;
182
+ };
183
+
184
+ // flake noise function with controllable regularity, flake size, and probability
185
+ flake_noise_value flake_noise(
186
+ float3 pos,
187
+ float jitter_scale = 1.0f,
188
+ float flake_diameter = 0.75f,
189
+ float flake_probability = 1.0f)
190
+ {
191
+ float3 base_pos = ::math::floor(pos);
192
+ int3 base_pos_i = int3(base_pos);
193
+
194
+ // limit the flake size to the allowed maximum (such that looking at all neighbors is sufficient)
195
+ flake_diameter = ::math::min(flake_diameter, (1.5f - 0.5f * jitter_scale) / ::math::sqrt(3.0f));
196
+
197
+ flake_noise_value val(0.0f, 0, float4(0.0f));
198
+
199
+ for (int i = -1; i < 2; ++i) {
200
+ for (int j = -1; j < 2; ++j) {
201
+ for (int k = -1; k < 2; ++k) {
202
+
203
+ int seed = rnd_init(base_pos_i + int3(i, j, k));
204
+
205
+ seed = rnd_next(seed);
206
+ if (rnd_value(seed) > flake_probability)
207
+ continue;
208
+
209
+ seed = rnd_next(seed);
210
+ float priority = rnd_value(seed);
211
+ if (priority < val.priority)
212
+ continue;
213
+
214
+ float3 flake_pos = base_pos + float3(i, j, k) + float3(0.5f);
215
+
216
+ if (jitter_scale > 0.0f) {
217
+ seed = rnd_next(seed);
218
+ flake_pos.x += (rnd_value(seed) - 0.5f) * jitter_scale;
219
+ seed = rnd_next(seed);
220
+ flake_pos.y += (rnd_value(seed) - 0.5f) * jitter_scale;
221
+ seed = rnd_next(seed);
222
+ flake_pos.z += (rnd_value(seed) - 0.5f) * jitter_scale;
223
+ }
224
+
225
+ float3 p = pos - flake_pos;
226
+ if (::math::dot(p, p) >= flake_diameter * flake_diameter * 4.0f)
227
+ continue;
228
+
229
+ float3 xi_rot;
230
+ seed = rnd_next(seed);
231
+ xi_rot.x = rnd_value(seed);
232
+ seed = rnd_next(seed);
233
+ xi_rot.y = rnd_value(seed);
234
+ seed = rnd_next(seed);
235
+ xi_rot.z = rnd_value(seed);
236
+ p = rotate_pos(p, xi_rot);
237
+
238
+ if (::math::abs(p.x) <= flake_diameter &&
239
+ ::math::abs(p.y) <= flake_diameter &&
240
+ ::math::abs(p.z) <= flake_diameter)
241
+ {
242
+ val.priority = priority;
243
+ val.rnd_seed = seed;
244
+ }
245
+ }
246
+ }
247
+ }
248
+
249
+ return val;
250
+ }
251
+
252
+ // create a flake normal by importance sampling the Beckmann distribution with given roughness
253
+ flake_noise_value flake_normal(
254
+ flake_noise_value val,
255
+ float spread)
256
+ {
257
+ if (val.priority <= 0.0f)
258
+ {
259
+ val.carrier = float4(::state::normal().x, ::state::normal().y, ::state::normal().z, 1.0f);
260
+ return val;
261
+ }
262
+
263
+ int seed = rnd_next(val.rnd_seed);
264
+ float xi0 = rnd_value(seed);
265
+ seed = rnd_next(seed);
266
+ float xi1 = rnd_value(seed);
267
+
268
+ float phi = ::math::PI * 2.0f * xi0;
269
+
270
+ float roughness = spread * spread;
271
+
272
+ float tantheta = ::math::sqrt(-roughness * roughness * ::math::log(1.0f - xi1));
273
+ float sintheta = tantheta / ::math::sqrt(1.0f + tantheta * tantheta);
274
+ float costheta = ::math::sqrt(1.0f - sintheta * sintheta);
275
+
276
+ float[2] scphi = ::math::sincos(phi);
277
+
278
+ val.rnd_seed = seed;
279
+
280
+ float3 normal = ::state::texture_tangent_u(0) * scphi[1] * sintheta +
281
+ ::state::texture_tangent_v(0) * scphi[0] * sintheta +
282
+ ::state::normal() * costheta;
283
+
284
+ val.carrier = float4(normal.x, normal.y, normal.z, 1.0f);
285
+
286
+
287
+ return val;
288
+ }
289
+
290
+
291
+ export material Carpaint_Solid(
292
+ color base_color = color(0.002125f, 0.051269f, 0.046665f) [[
293
+ ::anno::description("Sets the base color of the carpaint"),
294
+ ::anno::display_name("Base "),
295
+ ::anno::in_group("Appearance"),
296
+ ::anno::ui_order(0)
297
+ ]],
298
+ float ground_coat_influence = 0.9f [[
299
+ ::anno::description("The ground coat layer is a metallic base layer over which the base color coat, the flakes and the clearcoat are applied. Use the parameter 'Ground Coat Brightness' to adjust its brightness."),
300
+ ::anno::display_name("Base Coat Influence"),
301
+ ::anno::in_group("Appearance"),
302
+ ::anno::hard_range(0.f, 1.f),
303
+ ::anno::ui_order(1)
304
+ ]],
305
+ float ground_coat_brightness = 0.24f [[
306
+ ::anno::description("Adjusts the brightness of the metallic ground coat over which the base color coat, the flakes and the clearcoat are applied. Only has an effect, if the Ground Coat Influence is greater than 0.0"),
307
+ ::anno::display_name("Base Coat Brightness"),
308
+ ::anno::in_group("Appearance"),
309
+ ::anno::hard_range(0.f, 1.f),
310
+ ::anno::ui_order(2)
311
+ ]],
312
+ float edge_darkening = 0.96f [[
313
+ ::anno::description("The amount how much colors fade to darker color when looking at the carpaint at grazing angles. Low values make the carpaint look more flat"),
314
+ ::anno::display_name("Edge Darkening"),
315
+ ::anno::in_group("Appearance"),
316
+ ::anno::hard_range(0.f, 1.f),
317
+ ::anno::ui_order(3)
318
+ ]],
319
+ color flakes_tint = color(0.016807f, 0.171441f, 0.417885f) [[
320
+ ::anno::description("The color of the flakes"),
321
+ ::anno::display_name("Flakes Tint"),
322
+ ::anno::in_group("Flakes"),
323
+ ::anno::ui_order(4)
324
+ ]],
325
+ uniform float flakes_density = 0.29f [[
326
+ ::anno::description("Adjusts the density of the flakes. Lower number means less flake particles being applied."),
327
+ ::anno::display_name("Flakes Density"),
328
+ ::anno::in_group("Flakes"),
329
+ ::anno::hard_range(0.f, 1.f),
330
+ ::anno::ui_order(5)
331
+ ]],
332
+ float spread = 0.12f [[
333
+ ::anno::description("The amount how much flakes are pointing to random directions. It is strongly discouraged using a value of 0.0 as the flakes will be oriented exactly as the surface normal, which will result in an unnatural look. Higher values lead to a more scintillating look of the flakes."),
334
+ ::anno::display_name("Flakes Spread"),
335
+ ::anno::enable_if("flakes_density > 0.0f"),
336
+ ::anno::in_group("Flakes"),
337
+ ::anno::hard_range(0.f, 1.f),
338
+ ::anno::ui_order(6)
339
+ ]],
340
+ float flakes_roughness = 0.46f [[
341
+ ::anno::description("The roughness of the flakes itself. Higher values smoothen out the look of the flakes. Depending on the flakes being used in carpaints, use low values for a sparkling flake effect while mica flakes tend to have a higher roughness, leading to a smoother more pearlescent look on the final carpaint"),
342
+ ::anno::display_name("Flakes Roughness"),
343
+ ::anno::enable_if("flakes_density > 0.0f"),
344
+ ::anno::in_group("Flakes"),
345
+ ::anno::hard_range(0.f, 1.f),
346
+ ::anno::ui_order(7)
347
+ ]],
348
+ float flakes_size = 0.1f [[
349
+ ::anno::description("Size of the metal flakes in millimeters."),
350
+ ::anno::display_name("Flakes Size (mm)"),
351
+ ::anno::enable_if("flakes_density > 0.0f"),
352
+ ::anno::soft_range(0.f, 1.f),
353
+ ::anno::in_group("Flakes"),
354
+ ::anno::ui_order(8)
355
+ ]],
356
+ float candy_flip = 0.f [[
357
+ ::anno::description("Changes the tint of the coating to fade towards the flake color to produce a candy paint effect. "),
358
+ ::anno::display_name("Candy Coating"),
359
+ ::anno::in_group("Flakes"),
360
+ ::anno::hard_range(0.f, 1.f),
361
+ ::anno::ui_order(9)
362
+ ]],
363
+ float flake_layer_visibility = 0.f [[
364
+ ::anno::description("Adjusts how much the flakes contribute to the final look. Lowering the value makes the flakes appear more transparent. At value of 0.0 no flakes are not rendered at all"),
365
+ ::anno::display_name("Flakes Visibility"),
366
+ ::anno::enable_if("flakes_density > 0.0f"),
367
+ ::anno::in_group("Flakes"),
368
+ ::anno::hard_range(0.f, 1.f),
369
+ ::anno::ui_order(10)
370
+ ]],
371
+ uniform texture_2d roughness_texture = texture_2d("./textures/smudges_scratches_A_rough.jpg", ::tex::gamma_linear) [[
372
+ ::anno::description("Texture to use for adding variation to the roughness on the clearcoat"),
373
+ ::anno::display_name("Roughness Texture"),
374
+ ::anno::in_group("Clearcoat"),
375
+ ::anno::ui_order(11)
376
+ ]],
377
+ float clearcoat_rough = 0.f [[
378
+ ::anno::description("The roughness of the clearcoat"),
379
+ ::anno::display_name("Clearcoat Roughness"),
380
+ ::anno::in_group("Clearcoat"),
381
+ ::anno::hard_range(0.f, 1.f),
382
+ ::anno::ui_order(12)
383
+ ]],
384
+ float roughness_variation = 0.f [[
385
+ ::anno::description("The amount of variation to apply to the roughness. This parameter only has an effect when the clearcoat roughness is not zero or one"),
386
+ ::anno::display_name("Clearcoat Roughness Variation"),
387
+ ::anno::in_group("Clearcoat"),
388
+ ::anno::hard_range(0.f, 1.f),
389
+ ::anno::ui_order(13)
390
+ ]],
391
+ float clearcoat_ior = 1.600f [[
392
+ ::anno::description("The index of refraction for the clearcoat layer"),
393
+ ::anno::display_name("Clearcoat Index of Refraction"),
394
+ ::anno::in_group("Clearcoat"),
395
+ ::anno::soft_range(1.f, 3.f),
396
+ ::anno::hard_range(1.f, 5.f),
397
+ ::anno::ui_order(14)
398
+ ]],
399
+ float clearcoat_visibility = 1.f [[
400
+ ::anno::description("While the full value is the correct physical behavior of the clearcoat, lowering the value to reduce the amount of reflection for artistic purposes"),
401
+ ::anno::display_name("Clearcoat Visibility"),
402
+ ::anno::in_group("Clearcoat"),
403
+ ::anno::hard_range(0.f, 1.f),
404
+ ::anno::ui_order(15)
405
+ ]],
406
+ uniform float orange_peel_strength = 0.f [[
407
+ ::anno::description("Strength of the bump mapping effect"),
408
+ ::anno::display_name("Coat Orange Peel Strength"),
409
+ ::anno::in_group("Clearcoat"),
410
+ ::anno::soft_range(0.f, 1.f),
411
+ ::anno::hard_range(0.f, 1.f),
412
+ ::anno::ui_order(16)
413
+ ]],
414
+ uniform float orange_peel_size = 1.f [[
415
+ ::anno::description("Size of the biggest feature of the pattern"),
416
+ ::anno::display_name("Coat Orange Peel Size"),
417
+ ::anno::soft_range(0.f, 1.f),
418
+ ::anno::in_group("Clearcoat"),
419
+ ::anno::ui_order(17)
420
+ ]],
421
+ float2 texture_translate = float2(0.f) [[
422
+ ::anno::description("Controls the position of the texture."),
423
+ ::anno::display_name("Texture Translate"),
424
+ ::anno::in_group("Transform"),
425
+ ::anno::ui_order(18)
426
+ ]],
427
+ float texture_rotate = 0.f [[
428
+ ::anno::description("Rotates angle of the texture in degrees."),
429
+ ::anno::display_name("Texture Rotate"),
430
+ ::anno::in_group("Transform"),
431
+ ::anno::soft_range(0.f, 360.f),
432
+ ::anno::ui_order(19)
433
+ ]],
434
+ float2 texture_scale = float2(1.f) [[
435
+ ::anno::description("Larger numbers increase the size."),
436
+ ::anno::display_name("Texture Scale"),
437
+ ::anno::in_group("Transform"),
438
+ ::nvidia::core_definitions::dimension(float2(1.0, 1.0)),
439
+ ::anno::ui_order(20)
440
+ ]],
441
+ uniform bool roundcorners_enable = false [[
442
+ ::anno::description("Enables the round corneer effect. Comes at a slight performance cost as additional raytracing calls are rquired to evaluate the round corner effect"),
443
+ ::anno::display_name("Enable Round Corners"),
444
+ ::anno::in_group("Round Corners"),
445
+ ::anno::ui_order(22)
446
+ ]],
447
+ uniform float roundcorners_radius_mm = 1.5f [[
448
+ ::anno::description("Radius of the rounded corners in millimeters"),
449
+ ::anno::display_name("Round Corner Radius (mm)"),
450
+ ::anno::in_group("Round Corners"),
451
+ ::anno::soft_range(0.f, 10.f),
452
+ ::anno::ui_order(23)
453
+ ]],
454
+ uniform bool roundcorners_across_materials = false [[
455
+ ::anno::description("Applies the round corner effect across different materials when enabled."),
456
+ ::anno::display_name("Across Materials"),
457
+ ::anno::in_group("Round Corners"),
458
+ ::anno::ui_order(27)
459
+ ]],
460
+ uniform int uv_space_index = 0 [[
461
+ ::anno::description("Use selected UV space for material."),
462
+ ::anno::display_name("UV Space Index"),
463
+ ::anno::in_group("Advanced"),
464
+ ::anno::ui_order(28)
465
+ ]]
466
+
467
+
468
+ )
469
+ [[
470
+ ::anno::author("NVIDIA"),
471
+ ::anno::display_name("Carpaint Solid"),
472
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
473
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "clearcoat", "automotive", "design")),
474
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Carpaint_Solid.png"),
475
+ ::anno::copyright_notice(COPYRIGHT)
476
+ ]]
477
+ =
478
+ let {
479
+ bool tmp0 = false;
480
+ // Tried Scaling factors for flakes to fit 1mm size both in Substance Designer and (Iray for) Rhino
481
+ // Rhino scaling factor: 1492.537313432835
482
+ // Substance Designer Scaling factor: 1158.6829010512
483
+ float flakes_size_m = (1492.537313432835f/flakes_size); // Flake scaling adjustment, so that flake size is in mm
484
+ float flake_layer_visibility_m = 1.0f - flake_layer_visibility;
485
+
486
+ ::base::texture_coordinate_info coord_info = ::base::coordinate_source(::base::texture_coordinate_object, 0);
487
+
488
+ float scale_trans = ::state::transform_scale(::state::coordinate_object, ::state::coordinate_world, 1.0f);
489
+
490
+ float3 source_coord = coord_info.position * ::state::meters_per_scene_unit() * scale_trans;
491
+
492
+ ::base::texture_coordinate_info transformed_coord = ::base::transform_coordinate(
493
+ ::base::rotation_translation_scale(float3(0.0f), float3(0.0f), float3(scale_trans)),
494
+ coord_info
495
+ );
496
+
497
+ material_surface tmp1(::df::fresnel_layer(clearcoat_ior, clearcoat_visibility, ::df::simple_glossy_bsdf(histogram_range(::base::file_texture(roughness_texture, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, roughness_variation, clearcoat_rough) * histogram_range(::base::file_texture(roughness_texture, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, roughness_variation, clearcoat_rough), histogram_range(::base::file_texture(roughness_texture, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, roughness_variation, clearcoat_rough) * histogram_range(::base::file_texture(roughness_texture, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, roughness_variation, clearcoat_rough), nvidia::core_definitions::blend_colors(color(1.f, 1.f, 1.f), flakes_tint, ::base::color_layer_blend, candy_flip).tint, nvidia::core_definitions::blend_colors(color(1.f, 1.f, 1.f), flakes_tint, ::base::color_layer_blend, candy_flip).tint, ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::directional_factor(color(1.f, 1.f, 1.f), color(1.f - edge_darkening), 1.f, flakes_density > 0.f ? ::df::weighted_layer(::math::lerp(flake_noise(source_coord * flakes_size_m, 0.5f, 1.f, flakes_density * flakes_density).priority > 0.001f ? 1.0f : 0.0f , 0.f, flake_layer_visibility_m), ::df::microfacet_ggx_smith_bsdf(flakes_roughness * 0.340000004f, flakes_roughness * 0.340000004f, flakes_tint, color(0.f, 0.f, 0.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::directional_factor(base_color, color(1.f - edge_darkening), 1.f, ::df::weighted_layer(ground_coat_influence * 0.5f, ::df::microfacet_ggx_vcavities_bsdf(0.40959999f, 0.40959999f, color(ground_coat_brightness * 0.949999988f + 0.0500000007f), color(ground_coat_brightness * 0.949999988f + 0.0500000007f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::diffuse_reflection_bsdf(base_color, 0.f), ::state::normal())), float3(flake_normal(flake_noise(source_coord * flakes_size_m, 0.5f, 1.f, flakes_density * flakes_density ), spread).carrier.x, flake_normal(flake_noise(source_coord * flakes_size_m, 0.5f, 1.f, flakes_density * flakes_density ), spread).carrier.y, flake_normal(flake_noise(source_coord * flakes_size_m, 0.5f, 1.f, flakes_density * flakes_density ), spread).carrier.z)) : ::df::directional_factor(base_color, color(1.f - edge_darkening), 1.f, ::df::weighted_layer(ground_coat_influence * 0.5f, ::df::microfacet_ggx_vcavities_bsdf(0.40959999f, 0.40959999f, color(ground_coat_brightness * 0.949999988f + 0.0500000007f), color(ground_coat_brightness * 0.949999988f + 0.0500000007f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::diffuse_reflection_bsdf(base_color, 0.f), ::state::normal()))), orange_peel_strength > 0.f ? ::base::perlin_noise_bump_texture(transformed_coord, orange_peel_strength, orange_peel_size, false, false, 0.f, 2, false, false, float3(0.f), 1.f, 0.f, 1.f, ::state::normal()) : ::state::normal()), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
498
+ material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
499
+ color tmp3 = color(1.f, 1.f, 1.f);
500
+ material_volume tmp4 = material_volume(scattering: vdf(), absorption_coefficient: color(0.f, 0.f, 0.f), scattering_coefficient: color(0.f, 0.f, 0.f));
501
+ material_geometry tmp5(float3(0.f), 1.f, roundcorners_enable ? ::state::rounded_corner_normal(roundcorners_radius_mm * 0.00100000005f, roundcorners_across_materials, 1.f) : ::state::normal());
502
+ hair_bsdf tmp6 = hair_bsdf();
503
+ } in
504
+ material(
505
+ thin_walled: tmp0,
506
+ surface: tmp1,
507
+ backface: tmp2,
508
+ ior: tmp3,
509
+ volume: tmp4,
510
+ geometry: tmp5,
511
+ hair: tmp6);
512
+
513
+
514
+ // ------------------- 2 (Plain White) -------------------
515
+ export material White(*)
516
+ [[
517
+ ::anno::author("NVIDIA"),
518
+ ::anno::display_name("Carpaint Solid - White"),
519
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
520
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "white", "light", "neutral")),
521
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.White.png"),
522
+ ::anno::copyright_notice(COPYRIGHT)
523
+ ]]
524
+ = Carpaint_Solid(
525
+ base_color: color(0.768151f, 0.768151f, 0.768151f),
526
+ ground_coat_influence: 0.0f,
527
+ ground_coat_brightness: 0.24f,
528
+ edge_darkening: 0.56f,
529
+ flakes_tint: color(0.552011f, 0.552011f, 0.552011f),
530
+ flakes_density: 0.0f,
531
+ spread: 0.47f,
532
+ flakes_roughness: 0.34f,
533
+ flakes_size: 0.5f,
534
+ candy_flip: 0.0f,
535
+ flake_layer_visibility: 1.0f,
536
+ // roughness_texture:
537
+ clearcoat_rough: 0.05f,
538
+ roughness_variation: 0.34f,
539
+ clearcoat_ior: 1.6f,
540
+ clearcoat_visibility: 1.0f,
541
+ orange_peel_strength: 0.0f,
542
+ orange_peel_size: 0.01f
543
+ );
544
+
545
+ // ------------------- 3 (vintage White) -------------------
546
+ export material Vintage_White(*)
547
+ [[
548
+ ::anno::author("NVIDIA"),
549
+ ::anno::display_name("Carpaint Solid - Vintage White"),
550
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
551
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "vintage", "white", "light", "neutral")),
552
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Vintage_White.png"),
553
+ ::anno::copyright_notice(COPYRIGHT)
554
+ ]]
555
+ = Carpaint_Solid(
556
+ base_color: color(0.672443f, 0.630757f, 0.502886f),
557
+ ground_coat_influence: 0.0f,
558
+ ground_coat_brightness: 0.24f,
559
+ edge_darkening: 0.28f,
560
+ flakes_tint: color(0.603827f, 0.665387f, 0.693872f),
561
+ flakes_density: 0.0f,
562
+ spread: 0.41f,
563
+ flakes_roughness: 0.32f,
564
+ flakes_size: 0.5f,
565
+ candy_flip: 0.0f,
566
+ flake_layer_visibility: 0.0f,
567
+ // roughness_texture:
568
+ clearcoat_rough: 0.05f,
569
+ roughness_variation: 0.34f,
570
+ clearcoat_ior: 1.6f,
571
+ clearcoat_visibility: 1.0f,
572
+ orange_peel_strength: 0.06f,
573
+ orange_peel_size: 0.01f
574
+ );
575
+
576
+
577
+ // ------------------- 4 (Black) -------------------
578
+ export material Black(*)
579
+ [[
580
+ ::anno::author("NVIDIA"),
581
+ ::anno::display_name("Carpaint Solid - Black"),
582
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
583
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "black", "dark", "neutral")),
584
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Black.png"),
585
+ ::anno::copyright_notice(COPYRIGHT)
586
+ ]]
587
+ = Carpaint_Solid(
588
+ base_color: color(0.006049f, 0.006049f, 0.006049f),
589
+ ground_coat_influence: 0.97f,
590
+ ground_coat_brightness: 0.17f,
591
+ edge_darkening: 0.57f,
592
+ flakes_tint: color(0.552011f, 0.552011f, 0.552011f),
593
+ flakes_density: 0.0f,
594
+ spread: 0.47f,
595
+ flakes_roughness: 0.34f,
596
+ flakes_size: 0.5f,
597
+ candy_flip: 0.0f,
598
+ flake_layer_visibility: 0.0f,
599
+ // roughness_texture:
600
+ clearcoat_rough: 0.05f,
601
+ roughness_variation: 0.36f,
602
+ clearcoat_ior: 1.6f,
603
+ clearcoat_visibility: 1.0f,
604
+ orange_peel_strength: 0.0f,
605
+ orange_peel_size: 0.01f
606
+ );
607
+
608
+ // ------------------- 5 (Black Matte) -------------------
609
+ export material Black_Matte(*)
610
+ [[
611
+ ::anno::author("NVIDIA"),
612
+ ::anno::display_name("Carpaint Solid - Black Matte"),
613
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
614
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "black", "dark", "neutral")),
615
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Black_Matte.png"),
616
+ ::anno::copyright_notice(COPYRIGHT)
617
+ ]]
618
+ = Carpaint_Solid(
619
+ base_color: color(0.006995f, 0.006995f, 0.006995f),
620
+ ground_coat_influence: 0.11f,
621
+ ground_coat_brightness: 0.64f,
622
+ edge_darkening: 0.0f,
623
+ flakes_tint: color(0.577580f, 0.577580f, 0.577580f),
624
+ flakes_density: 0.12f,
625
+ spread: 0.39f,
626
+ flakes_roughness: 0.5f,
627
+ flakes_size: 0.5f,
628
+ candy_flip: 0.0f,
629
+ flake_layer_visibility: 0.0f,
630
+ // roughness_texture:
631
+ clearcoat_rough: 0.48f,
632
+ roughness_variation: 0.14f,
633
+ clearcoat_ior: 1.6f,
634
+ clearcoat_visibility: 1.0f,
635
+ orange_peel_strength: 0.0f,
636
+ orange_peel_size: 0.01f
637
+ );
638
+
639
+ // ------------------- 6 -------------------
640
+ export material Agent_Gray(*)
641
+ [[
642
+ ::anno::author("NVIDIA"),
643
+ ::anno::display_name("Carpaint Solid - Agent Gray"),
644
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
645
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "gray", "neutral")),
646
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Agent_Gray.png"),
647
+ ::anno::copyright_notice(COPYRIGHT)
648
+ ]]
649
+ = Carpaint_Solid(
650
+ base_color: color(0.234551f, 0.254152f, 0.234551f),
651
+ ground_coat_influence: 0.11f,
652
+ ground_coat_brightness: 0.64f,
653
+ edge_darkening: 0.0f,
654
+ flakes_tint: color(0.644480f, 0.701102f, 0.644480f),
655
+ flakes_density: 0.2f,
656
+ spread: 0.25f,
657
+ flakes_roughness: 0.5f,
658
+ flakes_size: 0.5f,
659
+ candy_flip: 0.0f,
660
+ flake_layer_visibility: 0.0f,
661
+ // roughness_texture:
662
+ clearcoat_rough: 0.06f,
663
+ roughness_variation: 0.36f,
664
+ clearcoat_ior: 1.6f,
665
+ clearcoat_visibility: 1.0f,
666
+ orange_peel_strength: 0.0f,
667
+ orange_peel_size: 0.01f
668
+ );
669
+
670
+
671
+ // ------------------- 7 (Agent Gray Matte)-------------------
672
+ export material Agent_Gray_Matte(*)
673
+ [[
674
+ ::anno::author("NVIDIA"),
675
+ ::anno::display_name("Carpaint Solid - Agent Gray Matte"),
676
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
677
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "matte", "gray", "neutral")),
678
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Agent_Gray_Matte.png"),
679
+ ::anno::copyright_notice(COPYRIGHT)
680
+ ]]
681
+ = Carpaint_Solid(
682
+ base_color: color(0.234551f, 0.254152f, 0.234551f),
683
+ ground_coat_influence: 0.11f,
684
+ ground_coat_brightness: 0.64f,
685
+ edge_darkening: 0.0f,
686
+ flakes_tint: color(0.644480f, 0.701102f, 0.644480f),
687
+ flakes_density: 0.21f,
688
+ spread: 0.25f,
689
+ flakes_roughness: 0.5f,
690
+ flakes_size: 0.5f,
691
+ candy_flip: 0.0f,
692
+ flake_layer_visibility: 0.0f,
693
+ // roughness_texture:
694
+ clearcoat_rough: 0.4f,
695
+ roughness_variation: 0.14f,
696
+ clearcoat_ior: 1.6f,
697
+ clearcoat_visibility: 1.0f,
698
+ orange_peel_strength: 0.0f,
699
+ orange_peel_size: 0.01f
700
+ );
701
+
702
+ // ------------------- 8 (Blood Red)-------------------
703
+ export material Blood_Red(*)
704
+ [[
705
+ ::anno::author("NVIDIA"),
706
+ ::anno::display_name("Carpaint Solid - Blood Red"),
707
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
708
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "red", "warm", "saturated")),
709
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Blood_Red.png"),
710
+ ::anno::copyright_notice(COPYRIGHT)
711
+ ]]
712
+ = Carpaint_Solid(
713
+ base_color: color(0.462077f, 0.022174f, 0.015209f),
714
+ ground_coat_influence: 0.03f,
715
+ ground_coat_brightness: 0.24f,
716
+ edge_darkening: 0.56f,
717
+ flakes_tint: color(0.552011f, 0.552011f, 0.552011f),
718
+ flakes_density: 0.0f,
719
+ spread: 0.47f,
720
+ flakes_roughness: 0.34f,
721
+ flakes_size: 0.5f,
722
+ candy_flip: 0.0f,
723
+ flake_layer_visibility: 0.0f,
724
+ // roughness_texture:
725
+ clearcoat_rough: 0.05f,
726
+ roughness_variation: 0.36f,
727
+ clearcoat_ior: 1.6f,
728
+ clearcoat_visibility: 1.0f,
729
+ orange_peel_strength: 0.0f,
730
+ orange_peel_size: 0.01f
731
+ );
732
+
733
+ // ------------------- 9 (Tarreri Red)-------------------
734
+ export material Tarreri_Red(*)
735
+ [[
736
+ ::anno::author("NVIDIA"),
737
+ ::anno::display_name("Carpaint Solid - Tarreri Red"),
738
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
739
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "red", "warm", "saturated")),
740
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Tarreri_Red.png"),
741
+ ::anno::copyright_notice(COPYRIGHT)
742
+ ]]
743
+ = Carpaint_Solid(
744
+ base_color: color(0.672443f, 0.038204f, 0.026241f),
745
+ ground_coat_influence: 0.03f,
746
+ ground_coat_brightness: 0.24f,
747
+ edge_darkening: 0.56f,
748
+ flakes_tint: color(0.672443f, 0.095307f, 0.078187f),
749
+ flakes_density: 0.0f,
750
+ spread: 0.47f,
751
+ flakes_roughness: 0.34f,
752
+ flakes_size: 0.5f,
753
+ candy_flip: 0.0f,
754
+ flake_layer_visibility: 0.0f,
755
+ // roughness_texture:
756
+ clearcoat_rough: 0.05f,
757
+ roughness_variation: 0.36f,
758
+ clearcoat_ior: 1.6f,
759
+ clearcoat_visibility: 1.0f,
760
+ orange_peel_strength: 0.0f,
761
+ orange_peel_size: 0.01f
762
+ );
763
+
764
+
765
+ // ------------------- 10 (Dark Decent Red)-------------------
766
+ export material Dark_Decent_Red(*)
767
+ [[
768
+ ::anno::author("NVIDIA"),
769
+ ::anno::display_name("Carpaint Solid - Dark Decent Red"),
770
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
771
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "red", "warm", "dark")),
772
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Dark_Decent_Red.png"),
773
+ ::anno::copyright_notice(COPYRIGHT)
774
+ ]]
775
+ = Carpaint_Solid(
776
+ base_color: color(0.135633f, 0.012983f, 0.027321f),
777
+ ground_coat_influence: 0.19f,
778
+ ground_coat_brightness: 0.24f,
779
+ edge_darkening: 0.1f,
780
+ flakes_tint: color(0.135633f, 0.012983f, 0.027321f),
781
+ flakes_density: 0.0f,
782
+ spread: 0.38f,
783
+ flakes_roughness: 0.18f,
784
+ flakes_size: 0.5f,
785
+ candy_flip: 0.0f,
786
+ flake_layer_visibility: 0.0f,
787
+ // roughness_texture:
788
+ clearcoat_rough: 0.05f,
789
+ roughness_variation: 0.36f,
790
+ clearcoat_ior: 1.6f,
791
+ clearcoat_visibility: 1.0f,
792
+ orange_peel_strength: 0.0f,
793
+ orange_peel_size: 0.01f
794
+ );
795
+
796
+ // ------------------- 11 (Vintage Maroon)-------------------
797
+ export material Vintage_Maroon(*)
798
+ [[
799
+ ::anno::author("NVIDIA"),
800
+ ::anno::display_name("Carpaint Solid - Vintage Maroon"),
801
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
802
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "dark", "brown", "red")),
803
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Vintage_Maroon.png"),
804
+ ::anno::copyright_notice(COPYRIGHT)
805
+ ]]
806
+ = Carpaint_Solid(
807
+ base_color: color(0.283149f, 0.054480f, 0.063010f),
808
+ ground_coat_influence: 0.19f,
809
+ ground_coat_brightness: 0.24f,
810
+ edge_darkening: 0.1f,
811
+ flakes_tint: color(0.283149f, 0.054480f, 0.063010f),
812
+ flakes_density: 0.0f,
813
+ spread: 0.38f,
814
+ flakes_roughness: 0.3f,
815
+ flakes_size: 0.5f,
816
+ candy_flip: 0.0f,
817
+ flake_layer_visibility: 0.0f,
818
+ // roughness_texture:
819
+ clearcoat_rough: 0.05f,
820
+ roughness_variation: 0.36f,
821
+ clearcoat_ior: 1.6f,
822
+ clearcoat_visibility: 1.0f,
823
+ orange_peel_strength: 0.0f,
824
+ orange_peel_size: 0.01f
825
+ );
826
+
827
+ // ------------------- 12 -------------------
828
+ export material Orange(*)
829
+ [[
830
+ ::anno::author("NVIDIA"),
831
+ ::anno::display_name("Carpaint Solid - Orange"),
832
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
833
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "orange", "warm", "saturated")),
834
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Orange.png"),
835
+ ::anno::copyright_notice(COPYRIGHT)
836
+ ]]
837
+ = Carpaint_Solid(
838
+ base_color: color(0.623960f, 0.262251f, 0.022174f),
839
+ ground_coat_influence: 0.11f,
840
+ ground_coat_brightness: 0.64f,
841
+ edge_darkening: 0.0f,
842
+ flakes_tint: color(0.017642f, 0.262251f, 0.623960f),
843
+ flakes_density: 0.59f,
844
+ spread: 0.25f,
845
+ flakes_roughness: 0.5f,
846
+ flakes_size: 0.5f,
847
+ candy_flip: 0.0f,
848
+ flake_layer_visibility: 0.0f,
849
+ // roughness_texture:
850
+ clearcoat_rough: 0.06f,
851
+ roughness_variation: 0.36f,
852
+ clearcoat_ior: 1.6f,
853
+ clearcoat_visibility: 1.0f,
854
+ orange_peel_strength: 0.0f,
855
+ orange_peel_size: 0.01f
856
+ );
857
+
858
+
859
+ // ------------------- 13 (Brown Matte) -------------------
860
+ export material Brown_Matte(*)
861
+ [[
862
+ ::anno::author("NVIDIA"),
863
+ ::anno::display_name("Carpaint Solid - Brown Matte"),
864
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
865
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "brown", "matte")),
866
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Brown_Matte.png"),
867
+ ::anno::copyright_notice(COPYRIGHT)
868
+ ]]
869
+ = Carpaint_Solid(
870
+ base_color: color(0.300544f, 0.250158f, 0.187821f),
871
+ ground_coat_influence: 0.11f,
872
+ ground_coat_brightness: 0.64f,
873
+ edge_darkening: 0.0f,
874
+ flakes_tint: color(0.300544f, 0.250158f, 0.187821f),
875
+ flakes_density: 0.0f,
876
+ spread: 0.39f,
877
+ flakes_roughness: 0.5f,
878
+ flakes_size: 0.5f,
879
+ candy_flip: 0.0f,
880
+ flake_layer_visibility: 0.0f,
881
+ // roughness_texture:
882
+ clearcoat_rough: 0.5f,
883
+ roughness_variation: 0.14f,
884
+ clearcoat_ior: 1.6f,
885
+ clearcoat_visibility: 1.0f,
886
+ orange_peel_strength: 0.0f,
887
+ orange_peel_size: 0.01f
888
+ );
889
+
890
+
891
+ // ------------------- 14 (Bumblebee) -------------------
892
+ export material Bumblebee(*)
893
+ [[
894
+ ::anno::author("NVIDIA"),
895
+ ::anno::display_name("Carpaint Solid - Bumblebee"),
896
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
897
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "yellow", "warm", "light", "saturated")),
898
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Bumblebee.png"),
899
+ ::anno::copyright_notice(COPYRIGHT)
900
+ ]]
901
+ = Carpaint_Solid(
902
+ base_color: color(0.775822f, 0.564712f, 0.030713f),
903
+ ground_coat_influence: 0.09f,
904
+ ground_coat_brightness: 0.64f,
905
+ edge_darkening: 0.1f,
906
+ flakes_tint: color(1.000000f, 0.479320f, 0.095307f),
907
+ flakes_density: 0.0f,
908
+ spread: 0.54f,
909
+ flakes_roughness: 0.37f,
910
+ flakes_size: 0.5f,
911
+ candy_flip: 0.0f,
912
+ flake_layer_visibility: 0.0f,
913
+ // roughness_texture:
914
+ clearcoat_rough: 0.06f,
915
+ roughness_variation: 0.14f,
916
+ clearcoat_ior: 1.6f,
917
+ clearcoat_visibility: 1.0f,
918
+ orange_peel_strength: 0.0f,
919
+ orange_peel_size: 0.01f
920
+ );
921
+
922
+
923
+ // ------------------- 15 (Wasp) -------------------
924
+ export material Wasp(*)
925
+ [[
926
+ ::anno::author("NVIDIA"),
927
+ ::anno::display_name("Carpaint Solid - Wasp"),
928
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
929
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "yellow", "warm", "light", "saturated")),
930
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Wasp.png"),
931
+ ::anno::copyright_notice(COPYRIGHT)
932
+ ]]
933
+ = Carpaint_Solid(
934
+ base_color: color(0.701102f, 0.603827f, 0.022174f),
935
+ ground_coat_influence: 0.0f,
936
+ ground_coat_brightness: 0.5f,
937
+ edge_darkening: 0.12f,
938
+ flakes_tint: color(1.000000f, 0.479320f, 0.076185f),
939
+ flakes_density: 0.0f,
940
+ spread: 0.54f,
941
+ flakes_roughness: 0.37f,
942
+ flakes_size: 0.5f,
943
+ candy_flip: 0.0f,
944
+ flake_layer_visibility: 0.0f,
945
+ // roughness_texture:
946
+ clearcoat_rough: 0.06f,
947
+ roughness_variation: 0.14f,
948
+ clearcoat_ior: 1.6f,
949
+ clearcoat_visibility: 1.0f,
950
+ orange_peel_strength: 0.0f,
951
+ orange_peel_size: 0.01f
952
+ );
953
+
954
+ // ------------------- 16 (Feline Dark Green)-------------------
955
+ export material Feline_Dark_Green(*)
956
+ [[
957
+ ::anno::author("NVIDIA"),
958
+ ::anno::display_name("Carpaint Solid - Feline Dark Green"),
959
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
960
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "green", "dark")),
961
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Feline_Dark_Green.png"),
962
+ ::anno::copyright_notice(COPYRIGHT)
963
+ ]]
964
+ = Carpaint_Solid(
965
+ base_color: color(0.010330f, 0.099899f, 0.043735f),
966
+ ground_coat_influence: 0.19f,
967
+ ground_coat_brightness: 0.24f,
968
+ edge_darkening: 0.1f,
969
+ flakes_tint: color(0.010330f, 0.099899f, 0.043735f),
970
+ flakes_density: 0.0f,
971
+ spread: 0.38f,
972
+ flakes_roughness: 0.3f,
973
+ flakes_size: 0.5f,
974
+ candy_flip: 0.0f,
975
+ flake_layer_visibility: 0.0f,
976
+ // roughness_texture:
977
+ clearcoat_rough: 0.05f,
978
+ roughness_variation: 0.36f,
979
+ clearcoat_ior: 1.6f,
980
+ clearcoat_visibility: 1.0f,
981
+ orange_peel_strength: 0.0f,
982
+ orange_peel_size: 0.01f
983
+ );
984
+
985
+
986
+ // ------------------- 17 (Hunting Green Matte) -------------------
987
+ export material Hunting_Green_Matte(*)
988
+ [[
989
+ ::anno::author("NVIDIA"),
990
+ ::anno::display_name("Carpaint Solid - Hunting Green Matte"),
991
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
992
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "green", "dark", "matte")),
993
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Hunting_Green_Matte.png"),
994
+ ::anno::copyright_notice(COPYRIGHT)
995
+ ]]
996
+ = Carpaint_Solid(
997
+ base_color: color(0.162029f, 0.187821f, 0.114435f),
998
+ ground_coat_influence: 0.11f,
999
+ ground_coat_brightness: 0.64f,
1000
+ edge_darkening: 0.0f,
1001
+ flakes_tint: color(0.318547f, 0.456411f, 0.127438f),
1002
+ flakes_density: 0.0f,
1003
+ spread: 0.3f,
1004
+ flakes_roughness: 0.5f,
1005
+ flakes_size: 0.5f,
1006
+ candy_flip: 0.0f,
1007
+ flake_layer_visibility: 0.0f,
1008
+ // roughness_texture:
1009
+ clearcoat_rough: 0.4f,
1010
+ roughness_variation: 0.14f,
1011
+ clearcoat_ior: 1.6f,
1012
+ clearcoat_visibility: 1.0f,
1013
+ orange_peel_strength: 0.0f,
1014
+ orange_peel_size: 0.01f
1015
+ );
1016
+
1017
+
1018
+ // ------------------- 18 (Vintage Sky Blue) -------------------
1019
+ export material Vintage_Sky_Blue(*)
1020
+ [[
1021
+ ::anno::author("NVIDIA"),
1022
+ ::anno::display_name("Carpaint Solid - Vintage Sky Blue"),
1023
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
1024
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "blue", "light", "cool")),
1025
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Vintage_Sky_Blue.png"),
1026
+ ::anno::copyright_notice(COPYRIGHT)
1027
+ ]]
1028
+ = Carpaint_Solid(
1029
+ base_color: color(0.318547f, 0.564712f, 0.603827f),
1030
+ ground_coat_influence: 0.06f,
1031
+ ground_coat_brightness: 0.24f,
1032
+ edge_darkening: 0.0f,
1033
+ flakes_tint: color(0.603827f, 127.338437f, 0.693872f),
1034
+ flakes_density: 0.0f,
1035
+ spread: 0.41f,
1036
+ flakes_roughness: 0.32f,
1037
+ flakes_size: 0.5f,
1038
+ candy_flip: 0.0f,
1039
+ flake_layer_visibility: 0.0f,
1040
+ // roughness_texture:
1041
+ clearcoat_rough: 0.06f,
1042
+ roughness_variation: 0.34f,
1043
+ clearcoat_ior: 1.6f,
1044
+ clearcoat_visibility: 1.0f,
1045
+ orange_peel_strength: 0.06f,
1046
+ orange_peel_size: 0.01f
1047
+ );
1048
+
1049
+
1050
+ // ------------------- 19 (Blue)-------------------
1051
+ export material Blue(*)
1052
+ [[
1053
+ ::anno::author("NVIDIA"),
1054
+ ::anno::display_name("Carpaint Solid - Blue"),
1055
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
1056
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "blue", "cool", "saturated")),
1057
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Blue.png"),
1058
+ ::anno::copyright_notice(COPYRIGHT)
1059
+ ]]
1060
+ = Carpaint_Solid(
1061
+ base_color: color(0.012983f, 0.296138f, 0.462077f),
1062
+ ground_coat_influence: 0.00f,
1063
+ ground_coat_brightness: 0.24f,
1064
+ edge_darkening: 0.0f,
1065
+ flakes_tint: color(0.012983f, 0.234551f, 0.665387f),
1066
+ flakes_density: 0.5f,
1067
+ spread: 0.47f,
1068
+ flakes_roughness: 0.34f,
1069
+ flakes_size: 0.5f,
1070
+ candy_flip: 0.0f,
1071
+ flake_layer_visibility: 0.0f,
1072
+ // roughness_texture:
1073
+ clearcoat_rough: 0.06f,
1074
+ roughness_variation: 0.36f,
1075
+ clearcoat_ior: 1.6f,
1076
+ clearcoat_visibility: 1.0f,
1077
+ orange_peel_strength: 0.0f,
1078
+ orange_peel_size: 0.01f
1079
+ );
1080
+
1081
+
1082
+
1083
+ // ------------------- 20 (Dark Decent Blue) -------------------
1084
+ export material Dark_Decent_Blue(*)
1085
+ [[
1086
+ ::anno::author("NVIDIA"),
1087
+ ::anno::display_name("Carpaint Solid - Dark Decent Blue"),
1088
+ ::anno::description("Multilayered carpaint material with metallic flakes"),
1089
+ ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "blue", "cool", "dark")),
1090
+ ::anno::thumbnail("./.thumbs/Carpaint_Solid.Dark_Decent_Blue.png"),
1091
+ ::anno::copyright_notice(COPYRIGHT)
1092
+ ]]
1093
+ = Carpaint_Solid(
1094
+ base_color: color(0.013702f, 0.046665f, 0.147027f),
1095
+ ground_coat_influence: 0.19f,
1096
+ ground_coat_brightness: 0.24f,
1097
+ edge_darkening: 0.1f,
1098
+ flakes_tint: color(0.012983f, 0.234551f, 0.665387f),
1099
+ flakes_density: 0.5f,
1100
+ spread: 0.25f,
1101
+ flakes_roughness: 0.34f,
1102
+ flakes_size: 0.5f,
1103
+ candy_flip: 0.0f,
1104
+ flake_layer_visibility: 0.0f,
1105
+ // roughness_texture:
1106
+ clearcoat_rough: 0.06f,
1107
+ roughness_variation: 0.36f,
1108
+ clearcoat_ior: 1.6f,
1109
+ clearcoat_visibility: 1.0f,
1110
+ orange_peel_strength: 0.0f,
1111
+ orange_peel_size: 0.01f
1112
+ );
objects/table_oak/materials/remote/omniverse-content-production.s3.us-west-2.amazonaws.com/Materials/2023_1/vMaterials_2/Plastic/Plastic_Thick_Translucent.mdl ADDED
@@ -0,0 +1,673 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*****************************************************************************
2
+ * Copyright 2023 NVIDIA Corporation. All rights reserved.
3
+ ******************************************************************************
4
+
5
+ MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,
6
+ WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,
7
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
8
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
9
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
10
+ COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA
11
+ CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
12
+ ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
13
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
14
+ THE USE OR INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN
15
+ THE MDL MATERIALS.
16
+ */
17
+
18
+
19
+ // This file contains samples of very fast rendering SSS plastics for iray
20
+ //
21
+
22
+ mdl 1.4;
23
+ import ::df::*;
24
+ import ::math::*;
25
+ import ::anno::*;
26
+
27
+
28
+ const string COPYRIGHT =
29
+ " Copyright 2023 NVIDIA Corporation. All rights reserved.\n"
30
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
31
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
32
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
33
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
34
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
35
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
36
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
37
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
38
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
39
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
40
+
41
+
42
+
43
+ // Template for absorption and scattering, do not use directly
44
+ material volume_absorption(
45
+ color absorption = color(0.8665f, 0.7769f, 0.1559f),
46
+ color scattering = color(.5f),
47
+ float distance_scale = .03f,
48
+ float directional_bias = 0.0f,
49
+ uniform float ior = 1.2f
50
+
51
+ )
52
+ [[
53
+ ::anno::author("NVIDIA ARC"),
54
+ ::anno::display_name("Volume Absorption"),
55
+ ::anno::description("Pure volume absorption material"),
56
+ ::anno::author("NVIDIA"),
57
+ ::anno::copyright_notice(COPYRIGHT),
58
+ ::anno::hidden()
59
+
60
+ ]] = material (
61
+ ior: color(ior),
62
+ surface: material_surface (
63
+ scattering: ::df::specular_bsdf (
64
+ tint: color (1.0f, 1.0f, 1.0f),
65
+ mode: ::df::scatter_reflect_transmit
66
+ )
67
+ ),
68
+ volume: material_volume (
69
+ scattering: ::df::anisotropic_vdf(
70
+ directional_bias: directional_bias
71
+ ),
72
+ absorption_coefficient: (distance_scale <= 0)? color(0): ::math::log(absorption) / -distance_scale,
73
+ scattering_coefficient: (distance_scale <= 0)? color(0): ::math::log(scattering) / -distance_scale
74
+ )
75
+ );
76
+
77
+ // plastic_full_weighted_mix
78
+ // Plastic material using diffuse reflection, diffuse transmission
79
+ // and SSS. Due to the diffuse transmission the volume absorption will
80
+ // render faster and converge smoother than when using specular transmission.
81
+ export material Plastic_Thick_Translucent(
82
+ color diffuse_color = color(0.6940f, 0.5831f, 0.0493f)
83
+ [[
84
+ ::anno::display_name("Diffuse Color"),
85
+ ::anno::description("The diffuse color of the plastic material"),
86
+ ::anno::in_group("Appearance")
87
+ ]],
88
+ float diffuse_weight = 0.3f
89
+ [[
90
+ ::anno::display_name("Diffuse Weight"),
91
+ ::anno::description("The weight of the diffuse color of the plastic material. It is recommended to keep "
92
+ "the value around 0.5, lower values make the material appear more transparent while higher values make "
93
+ "it more opaque."),
94
+ ::anno::in_group("Appearance"),
95
+ ::anno::hard_range(0.f, 1.f)
96
+ ]],
97
+ color absorption = color(0.8665f, 0.7769f, 0.1559f)
98
+ [[
99
+ ::anno::display_name("Absorption Color"),
100
+ ::anno::description("Sets the absorption color (this is color when light goes extinct)of the plastic material"),
101
+ ::anno::in_group("Appearance")
102
+ ]],
103
+ color scattering = color(.5f)
104
+ [[
105
+ ::anno::display_name("Scattering Color"),
106
+ ::anno::description("Sets the absorption color (this is color when light goes extinct)of the plastic material"),
107
+ ::anno::in_group("Appearance")
108
+ ]],
109
+ float distance_scale = 1.5f
110
+ [[
111
+ ::anno::display_name("Distance Scale"),
112
+ ::anno::description("Scales how quickly light is absorbed. Set this value low enough to see "
113
+ "some light extinction taking place. Tip: Set 'diffuse_weight' to 0.0 while adjusting this "
114
+ "material parameter for your scene"),
115
+ ::anno::in_group("Appearance")
116
+ ]],
117
+
118
+ color diffuse_transmission_tint = color(1.0000f, 0.7249f, 0.1972f)
119
+ [[
120
+ ::anno::display_name("Diffuse Transmission Color"),
121
+ ::anno::description("The tinting of light scattering through the plastic material"),
122
+ ::anno::in_group("Appearance")
123
+ ]],
124
+
125
+ float reflection_roughness = 0.0f
126
+ [[
127
+ ::anno::display_name("Roughness"),
128
+ ::anno::description("The roughness of the reflection on the plastic"),
129
+ ::anno::in_group("Appearance"),
130
+ ::anno::hard_range(0.f, 1.f)
131
+ ]]
132
+ )
133
+ [[
134
+ ::anno::author("NVIDIA ARC"),
135
+ ::anno::display_name("Plastic Full Control"),
136
+ ::anno::description("Plastic Material finegrained controls of its appearance"),
137
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.Plastic_Thick_Translucent.png"),
138
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny")),
139
+ ::anno::copyright_notice(COPYRIGHT),
140
+ ::anno::hidden()
141
+ ]] = let {
142
+ float reflection_weight = 1.0f;
143
+ float normal_reflectivity = 0.04f;
144
+ float grazing_reflectivity = 1.0f;
145
+ float reflectivity_exponent = 5.0f;
146
+ uniform float ior = 1.4f;
147
+
148
+ material plastic = volume_absorption(
149
+ absorption: absorption,
150
+ scattering: scattering,
151
+ distance_scale: distance_scale,
152
+ ior: ior
153
+ );
154
+
155
+ bsdf transdiff = ::df::diffuse_transmission_bsdf(
156
+ tint: diffuse_transmission_tint
157
+ );
158
+
159
+ bsdf diffuse = ::df::diffuse_reflection_bsdf(
160
+ tint: diffuse_color
161
+ );
162
+
163
+ bsdf diffuse_mix_layer = ::df::weighted_layer(
164
+ base: transdiff,
165
+ layer: diffuse,
166
+ weight: diffuse_weight
167
+
168
+ );
169
+
170
+ bsdf glossy_reflection = ::df::simple_glossy_bsdf(
171
+ tint: color(1.0f),
172
+ roughness_u: reflection_roughness,
173
+ mode: ::df::scatter_reflect
174
+ );
175
+
176
+ bsdf final_layer = ::df::custom_curve_layer(
177
+ normal_reflectivity: normal_reflectivity,
178
+ grazing_reflectivity: grazing_reflectivity,
179
+ layer: glossy_reflection,
180
+ base: diffuse_mix_layer,
181
+ weight: reflection_weight,
182
+ exponent: reflectivity_exponent
183
+ );
184
+
185
+ } in material (
186
+ surface: material_surface(
187
+ scattering: final_layer
188
+ ),
189
+
190
+ volume: plastic.volume
191
+ );
192
+
193
+
194
+ export material plastic_simple_controls(
195
+ color diffuse_color = color(0.6940f, 0.5831f, 0.0493f)
196
+ [[
197
+ ::anno::display_name("Diffuse Color"),
198
+ ::anno::description("The diffuse color of the plastic material"),
199
+ ::anno::in_group("Appearance")
200
+ ]],
201
+ float diffuse_weight = 0.5f
202
+ [[
203
+ ::anno::display_name("Diffuse Weight"),
204
+ ::anno::description("The weight of the diffuse color of the plastic material. It is recommended to keep "
205
+ "the value around 0.5, lower values make the material appear more transparent while higher values make "
206
+ "it more opaque."),
207
+ ::anno::in_group("Appearance"),
208
+ ::anno::hard_range(0.f, 1.f)
209
+ ]],
210
+ color transmissive_color = color(0.8665f, 0.7769f, 0.1559f)
211
+ [[
212
+ ::anno::display_name("Transmissive Color"),
213
+ ::anno::description("The tinting of light scattering through the plastic material"),
214
+ ::anno::in_group("Appearance")
215
+ ]],
216
+ float reflection_roughness = 0.0f
217
+ [[
218
+ ::anno::display_name("Roughness"),
219
+ ::anno::description("The roughness of the reflection on the plastic"),
220
+ ::anno::in_group("Appearance"),
221
+ ::anno::hard_range(0.f, 1.f)
222
+ ]],
223
+ float distance_scale = 0.005f
224
+ [[
225
+ ::anno::display_name("Distance Scale"),
226
+ ::anno::description("Scales how quickly light is absorbed. Set this value low enough to see "
227
+ "some light extinction taking place. Tip: Set 'diffuse_weight' to 0.0 while adjusting this "
228
+ "material parameter for your scene"),
229
+ ::anno::in_group("Appearance")
230
+ ]]
231
+
232
+ )
233
+ [[
234
+ ::anno::author("NVIDIA ARC"),
235
+ ::anno::display_name("Plastic"),
236
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
237
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
238
+ "(which can be verified by setting 'Diffuse Weight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
239
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny")),
240
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_simple_controls.png"),
241
+ ::anno::copyright_notice(COPYRIGHT),
242
+ ::anno::hidden()
243
+ ]] = Plastic_Thick_Translucent(
244
+ absorption: ::math::pow(transmissive_color, 0.2f),
245
+ scattering: color(0.5f),
246
+ distance_scale: distance_scale,
247
+ diffuse_transmission_tint: ::math::pow(transmissive_color, 0.2f),
248
+ diffuse_color: diffuse_color,
249
+ diffuse_weight: diffuse_weight,
250
+ reflection_roughness: reflection_roughness
251
+
252
+ );
253
+
254
+
255
+
256
+ // 01 - Black
257
+ export material plastic_black(*)
258
+ [[
259
+ ::anno::author("NVIDIA ARC"),
260
+ ::anno::display_name("Plastic Black"),
261
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
262
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
263
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
264
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "dark", "black", "neutral")),
265
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_black.png"),
266
+ ::anno::copyright_notice(COPYRIGHT)
267
+ ]] = plastic_simple_controls(
268
+ diffuse_color: color(0.034230f),
269
+ diffuse_weight: .5f,
270
+ transmissive_color: color(0.034230f),
271
+ distance_scale: 0.002f,
272
+ reflection_roughness: 0.05f
273
+ );
274
+
275
+
276
+ // 02 - Dark Gray
277
+ export material plastic_dark_gray(*)
278
+ [[
279
+ ::anno::author("NVIDIA ARC"),
280
+ ::anno::display_name("Plastic Dark Gray"),
281
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
282
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
283
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
284
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "dark", "gray", "neutral")),
285
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_dark_gray.png"),
286
+ ::anno::copyright_notice(COPYRIGHT)
287
+ ]] = plastic_simple_controls(
288
+ diffuse_color: color(0.127530f),
289
+ diffuse_weight: .5f,
290
+ transmissive_color: color(0.089194f),
291
+ distance_scale: 0.002f,
292
+ reflection_roughness: 0.05f
293
+ );
294
+
295
+
296
+ // 03 - Light Gray
297
+ export material plastic_light_gray(*)
298
+ [[
299
+ ::anno::author("NVIDIA ARC"),
300
+ ::anno::display_name("Plastic Light Gray"),
301
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
302
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
303
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
304
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "light", "gray", "neutral")),
305
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_light_gray.png"),
306
+ ::anno::copyright_notice(COPYRIGHT)
307
+ ]] = plastic_simple_controls(
308
+ diffuse_color: color(0.464741f),
309
+ diffuse_weight: .5f,
310
+ transmissive_color: color(0.358654f),
311
+ distance_scale: 0.002f,
312
+ reflection_roughness: 0.05f
313
+ );
314
+
315
+
316
+ // 04 - White
317
+ export material plastic_white(*)
318
+ [[
319
+ ::anno::author("NVIDIA ARC"),
320
+ ::anno::display_name("Plastic White"),
321
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
322
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
323
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
324
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "light", "white", "neutral")),
325
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_white.png"),
326
+ ::anno::copyright_notice(COPYRIGHT)
327
+ ]] = plastic_simple_controls(
328
+ diffuse_color: color(0.915750f),
329
+ diffuse_weight: .5f,
330
+ transmissive_color: color(0.812241f),
331
+ distance_scale: 0.002f,
332
+ reflection_roughness: 0.05f
333
+ );
334
+
335
+
336
+ // 05 - Ivory White
337
+ export material plastic_ivory_white(*)
338
+ [[
339
+ ::anno::author("NVIDIA ARC"),
340
+ ::anno::display_name("Plastic Ivory White"),
341
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
342
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
343
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
344
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "white", "bright", "ivory", "warm")),
345
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_ivory_white.png"),
346
+ ::anno::copyright_notice(COPYRIGHT)
347
+ ]] = plastic_simple_controls(
348
+ diffuse_color: color(0.899385f, 0.843370f, 0.694081f),
349
+ diffuse_weight: .5f,
350
+ transmissive_color: color(0.722672f, 0.708298f, 0.547994f),
351
+ distance_scale: 0.002f,
352
+ reflection_roughness: 0.05f
353
+ );
354
+
355
+
356
+ // 06 - Lemon
357
+ export material plastic_lemon(*)
358
+ [[
359
+ ::anno::author("NVIDIA ARC"),
360
+ ::anno::display_name("Plastic Lemon"),
361
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
362
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
363
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
364
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "lemon", "yellow", "light", "warm")),
365
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_lemon.png"),
366
+ ::anno::copyright_notice(COPYRIGHT)
367
+ ]] = plastic_simple_controls(
368
+ diffuse_color: color(0.859174f, 0.875138f, 0.039947f),
369
+ diffuse_weight: .5f,
370
+ transmissive_color: color(0.98211f, 0.843370f, 0.031551f),
371
+ distance_scale: 0.002f,
372
+ reflection_roughness: 0.05f
373
+ );
374
+
375
+
376
+ // 07 - Yellow Orange
377
+ export material plastic_yellow_orange(*)
378
+ [[
379
+ ::anno::author("NVIDIA ARC"),
380
+ ::anno::display_name("Plastic Yellow"),
381
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
382
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
383
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
384
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "light", "orange", "yellow", "warm")),
385
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_yellow_orange.png"),
386
+ ::anno::copyright_notice(COPYRIGHT)
387
+ ]] = plastic_simple_controls(
388
+ diffuse_color: color(0.875138f, 0.612066f, 0.039947f),
389
+ diffuse_weight: .5f,
390
+ transmissive_color: color(0.899385f, 0.373615f, 0.030257f),
391
+ distance_scale: 0.002f,
392
+ reflection_roughness: 0.05f
393
+ );
394
+
395
+
396
+ // 08 - Orange
397
+ export material plastic_orange(*)
398
+ [[
399
+ ::anno::author("NVIDIA ARC"),
400
+ ::anno::display_name("Plastic Orange"),
401
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
402
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
403
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
404
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "orange", "warm")),
405
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_orange.png"),
406
+ ::anno::copyright_notice(COPYRIGHT)
407
+ ]] = plastic_simple_controls(
408
+ diffuse_color: color(0.875138f, 0.353741f, 0.030257f),
409
+ diffuse_weight: .5f,
410
+ transmissive_color: color(0.891262f, 0.420508f, 0.022013f),
411
+ distance_scale: 0.002f,
412
+ reflection_roughness: 0.05f
413
+ );
414
+
415
+
416
+ // 09 - Dark Orange
417
+ export material plastic_dark_orange(*)
418
+ [[
419
+ ::anno::author("NVIDIA ARC"),
420
+ ::anno::display_name("Plastic Dark Orange"),
421
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
422
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
423
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
424
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "dark", "orange", "warm")),
425
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_dark_orange.png"),
426
+ ::anno::copyright_notice(COPYRIGHT)
427
+ ]] = plastic_simple_controls(
428
+ diffuse_color: color(0.535642f, 0.127530f, 0.022013f),
429
+ diffuse_weight: .5f,
430
+ transmissive_color: color(0.827726f, 0.267358f, 0.022013f),
431
+ distance_scale: 0.002f,
432
+ reflection_roughness: 0.05f
433
+ );
434
+
435
+
436
+ // 10 - Red
437
+ export material plastic_red(*)
438
+ [[
439
+ ::anno::author("NVIDIA ARC"),
440
+ ::anno::display_name("Plastic Red"),
441
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
442
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
443
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
444
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "red", "cherry", "warm")),
445
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_red.png"),
446
+ ::anno::copyright_notice(COPYRIGHT)
447
+ ]] = plastic_simple_controls(
448
+ diffuse_color: color(0.547994f, 0.027755f, 0.027755f),
449
+ diffuse_weight: .5f,
450
+ transmissive_color: color(0.875138f, 0.022013f, 0.022013f),
451
+ distance_scale: 0.002f,
452
+ reflection_roughness: 0.05f
453
+ );
454
+
455
+
456
+ // 11 - Magenta
457
+ export material plastic_magenta(*)
458
+ [[
459
+ ::anno::author("NVIDIA ARC"),
460
+ ::anno::display_name("Plastic Magenta"),
461
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
462
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
463
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
464
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "magenta")),
465
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_magenta.png"),
466
+ ::anno::copyright_notice(COPYRIGHT)
467
+ ]] = plastic_simple_controls(
468
+ diffuse_color: color(0.547994f, 0.047776f, 0.554227f),
469
+ diffuse_weight: .5f,
470
+ transmissive_color: color(0.722672f, 0.030257f, 0.566810f),
471
+ distance_scale: 0.002f,
472
+ reflection_roughness: 0.05f
473
+ );
474
+
475
+
476
+ // 12 - Purple
477
+ export material plastic_purple(*)
478
+ [[
479
+ ::anno::author("NVIDIA ARC"),
480
+ ::anno::display_name("Plastic Purple"),
481
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
482
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
483
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
484
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "purple")),
485
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_purple.png"),
486
+ ::anno::copyright_notice(COPYRIGHT)
487
+ ]] = plastic_simple_controls(
488
+ diffuse_color: color(0.193972f, 0.017936f, 0.464741f),
489
+ diffuse_weight: .5f,
490
+ transmissive_color: color(0.701170f, 0.018913f, 0.645555f),
491
+ distance_scale: 0.002f,
492
+ reflection_roughness: 0.05f
493
+ );
494
+
495
+
496
+ // 13 - Dark Blue
497
+ export material plastic_dark_blue(*)
498
+ [[
499
+ ::anno::author("NVIDIA ARC"),
500
+ ::anno::display_name("Plastic Dark Blue"),
501
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
502
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
503
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
504
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "dark", "blue", "cool")),
505
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_dark_blue.png"),
506
+ ::anno::copyright_notice(COPYRIGHT)
507
+ ]] = plastic_simple_controls(
508
+ diffuse_color: color(0.027755f, 0.058187f, 0.311180f),
509
+ diffuse_weight: .5f,
510
+ transmissive_color: color(0.027755f, 0.058187f, 0.311180f),
511
+ distance_scale: 0.002f,
512
+ reflection_roughness: 0.05f
513
+ );
514
+
515
+
516
+ // 14 - Blue
517
+ export material plastic_blue(*)
518
+ [[
519
+ ::anno::author("NVIDIA ARC"),
520
+ ::anno::display_name("Plastic Blue"),
521
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
522
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
523
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
524
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "blue", "cool")),
525
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_blue.png"),
526
+ ::anno::copyright_notice(COPYRIGHT)
527
+ ]] = plastic_simple_controls(
528
+ diffuse_color: color(0.034230f, 0.173439f, 0.843370f),
529
+ diffuse_weight: .5f,
530
+ transmissive_color: color(0.034230f, 0.124741f, 0.659224f),
531
+ distance_scale: 0.002f,
532
+ reflection_roughness: 0.05f
533
+ );
534
+
535
+
536
+ // 15 - Sky Blue
537
+ export material plastic_sky_blue(*)
538
+ [[
539
+ ::anno::author("NVIDIA ARC"),
540
+ ::anno::display_name("Plastic Sky Blue"),
541
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
542
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
543
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
544
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "blue", "sky", "cool")),
545
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_sky_blue.png"),
546
+ ::anno::copyright_notice(COPYRIGHT)
547
+ ]] = plastic_simple_controls(
548
+ diffuse_color: color(0.061907f, 0.535642f, 0.875138f),
549
+ diffuse_weight: .5f,
550
+ transmissive_color: color(0.028991f, 0.358654f, 0.673049f),
551
+ distance_scale: 0.002f,
552
+ reflection_roughness: 0.05f
553
+ );
554
+
555
+
556
+ // 16 - Light Blue
557
+ export material plastic_light_blue(*)
558
+ [[
559
+ ::anno::author("NVIDIA ARC"),
560
+ ::anno::display_name("Plastic Light Blue"),
561
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
562
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
563
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
564
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "light", "blue", "cool")),
565
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_light_blue.png"),
566
+ ::anno::copyright_notice(COPYRIGHT)
567
+ ]] = plastic_simple_controls(
568
+ diffuse_color: color(0.263175f, 0.774227f, 0.827726f),
569
+ diffuse_weight: .5f,
570
+ transmissive_color: color(0.163641f, 0.592438f, 0.759300f),
571
+ distance_scale: 0.002f,
572
+ reflection_roughness: 0.05f
573
+ );
574
+
575
+
576
+ // 17 - Teal
577
+ export material plastic_teal(*)
578
+ [[
579
+ ::anno::author("NVIDIA ARC"),
580
+ ::anno::display_name("Plastic Teal"),
581
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
582
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
583
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
584
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "teal", "cool")),
585
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_teal.png"),
586
+ ::anno::copyright_notice(COPYRIGHT)
587
+ ]] = plastic_simple_controls(
588
+ diffuse_color: color(0.037029f, 0.579547f, 0.329729f),
589
+ diffuse_weight: .5f,
590
+ transmissive_color: color(0.022013f, 0.476177f, 0.353741f),
591
+ distance_scale: 0.002f,
592
+ reflection_roughness: 0.05f
593
+ );
594
+
595
+
596
+ // 18 - Dark Green
597
+ export material plastic_dark_green(*)
598
+ [[
599
+ ::anno::author("NVIDIA ARC"),
600
+ ::anno::display_name("Plastic Dark Green"),
601
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
602
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
603
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
604
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "dark", "green")),
605
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_dark_green.png"),
606
+ ::anno::copyright_notice(COPYRIGHT)
607
+ ]] = plastic_simple_controls(
608
+ diffuse_color: color(0.034230f, 0.141980f, 0.034230f),
609
+ diffuse_weight: .5f,
610
+ transmissive_color: color(0.016988f, 0.141980f, 0.016988f),
611
+ distance_scale: 0.002f,
612
+ reflection_roughness: 0.05f
613
+ );
614
+
615
+
616
+ // 19 - Green
617
+ export material plastic_green(*)
618
+ [[
619
+ ::anno::author("NVIDIA ARC"),
620
+ ::anno::display_name("Plastic Green"),
621
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
622
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
623
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
624
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "green")),
625
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_green.png"),
626
+ ::anno::copyright_notice(COPYRIGHT)
627
+ ]] = plastic_simple_controls(
628
+ diffuse_color: color(0.016988f, 0.311180f, 0.016988f),
629
+ diffuse_weight: .5f,
630
+ transmissive_color: color(0.012664f, 0.358654f, 0.012664f),
631
+ distance_scale: 0.002f,
632
+ reflection_roughness: 0.05f
633
+ );
634
+
635
+
636
+ // 20 - Light Green
637
+ export material plastic_light_green(*)
638
+ [[
639
+ ::anno::author("NVIDIA ARC"),
640
+ ::anno::display_name("Plastic Light Green"),
641
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
642
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
643
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
644
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "light", "green")),
645
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_light_green.png"),
646
+ ::anno::copyright_notice(COPYRIGHT)
647
+ ]] = plastic_simple_controls(
648
+ diffuse_color: color(0.030257f, 0.687031f, 0.027755f),
649
+ diffuse_weight: .5f,
650
+ transmissive_color: color(0.030257f, 0.701170f, 0.027755f),
651
+ distance_scale: 0.002f,
652
+ reflection_roughness: 0.05f
653
+ );
654
+
655
+
656
+ // 21 - Lime Green
657
+ export material plastic_lime_green(*)
658
+ [[
659
+ ::anno::author("NVIDIA ARC"),
660
+ ::anno::display_name("Plastic Lime Green"),
661
+ ::anno::description("Plastic material with a simple but fast light scattering for dense scattering plastic materials. "
662
+ "The material was built to scatter light within the range of a few centimeters. If light scattering cannot be seen "
663
+ "(which can be verified by setting 'Diffuse Wight' to 0.0), check the scene units scale or increase 'Distance Scale'."),
664
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "lime", "green", "light")),
665
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent.plastic_lime_green.png"),
666
+ ::anno::copyright_notice(COPYRIGHT)
667
+ ]] = plastic_simple_controls(
668
+ diffuse_color: color(0.186989f, 0.605484f, 0.027755f),
669
+ diffuse_weight: .5f,
670
+ transmissive_color: color(0.204710f, 0.701170f, 0.022013f),
671
+ distance_scale: 0.002f,
672
+ reflection_roughness: 0.05f
673
+ );
objects/table_oak/materials/remote/omniverse-content-production.s3.us-west-2.amazonaws.com/Materials/2023_1/vMaterials_2/Plastic/Plastic_Thick_Translucent_Flakes.mdl ADDED
@@ -0,0 +1,1025 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2023 NVIDIA Corporation. All rights reserved.
3
+ ******************************************************************************
4
+
5
+ Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge,
6
+ to any person obtaining a copy of the sample definition code that uses our
7
+ Material Definition Language (the "MDL Materials"), to reproduce and distribute
8
+ the MDL Materials, including without limitation the rights to use, copy, merge,
9
+ publish, distribute, and sell modified and unmodified copies of the MDL
10
+ Materials, and to permit persons to whom the MDL Materials is furnished to do
11
+ so, in all cases solely for use with NVIDIA's Material Definition Language,
12
+ subject to the following further conditions:
13
+
14
+ 1. The above copyright notices, this list of conditions, and the disclaimer
15
+ that follows shall be retained in all copies of one or more of the MDL
16
+ Materials, including in any software with which the MDL Materials are bundled,
17
+ redistributed, and/or sold, and included either as stand-alone text files,
18
+ human-readable headers or in the appropriate machine-readable metadata fields
19
+ within text or binary files as long as those fields can be easily viewed by the
20
+ user, as applicable.
21
+ 2. The name of NVIDIA shall not be used to promote, endorse or advertise any
22
+ Modified Version without specific prior written permission, except a) to comply
23
+ with the notice requirements otherwise contained herein; or b) to acknowledge
24
+ the contribution(s) of NVIDIA.
25
+
26
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
27
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
28
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
29
+ TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR
30
+ ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL,
31
+ INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF
32
+ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE
33
+ THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.
34
+ */
35
+
36
+ // This file contains samples of very fast rendering SSS plastics for iray
37
+ //
38
+
39
+ mdl 1.4;
40
+ import ::df::*;
41
+ import ::math::*;
42
+ import ::anno::*;
43
+ import ::state::*;
44
+ import ::base::*;
45
+ import ::nvidia::core_definitions::dimension;
46
+
47
+
48
+ const string COPYRIGHT =
49
+ " Copyright 2023 NVIDIA Corporation. All rights reserved.\n"
50
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
51
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
52
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
53
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
54
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
55
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
56
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
57
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
58
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
59
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
60
+
61
+
62
+ const string DESCRIPTION =
63
+ "Translucent plastic material with integrated metal flakes. Features: Effective light scattering for dense "
64
+ "plastic materials and metal flakes. The material was built to scatter light within the range of a few "
65
+ "centimeters. If light scattering cannot be seen (which can be verified by setting 'Diffuse Weight' to 0.0), "
66
+ "check the scene units scale or increase 'Distance Scale'.";
67
+
68
+
69
+ //
70
+ // flake noise utilities
71
+ //
72
+ int hash(int seed, int i)
73
+ {
74
+ return (i ^ seed) * 1075385539;
75
+ }
76
+ int rnd_init(int3 pos)
77
+ {
78
+ return hash(hash(hash(0, pos.x), pos.y), pos.z);
79
+ }
80
+
81
+ int rnd_next(int seed) {
82
+ // xorshift32 using signed int
83
+ seed ^= seed << 13;
84
+ seed ^= seed >>> 17;
85
+ seed ^= seed << 5;
86
+ return seed;
87
+ }
88
+
89
+ float rnd_value(int seed)
90
+ {
91
+ return ::math::abs(float(seed) * 4.6566e-10f);
92
+ }
93
+
94
+ // apply random rotation (using "Fast Random Rotation Matrices" by James Arvo)
95
+ float3 rotate_pos(float3 pos, float3 xi)
96
+ {
97
+ float theta = ::math::PI * 2.0f * xi.x;
98
+ float phi = ::math::PI * 2.0f * xi.y;
99
+ float z = xi.z * 2.0f;
100
+
101
+ float r = ::math::sqrt(z);
102
+ float[2] sp_cp = ::math::sincos(phi);
103
+ float Vx = sp_cp[0] * r;
104
+ float Vy = sp_cp[1] * r;
105
+ float Vz = ::math::sqrt(2.0f - z);
106
+
107
+ float[2] st_ct = ::math::sincos(theta);
108
+ float Sx = Vx * st_ct[1] - Vy * st_ct[0];
109
+ float Sy = Vx * st_ct[0] + Vy * st_ct[1];
110
+
111
+ float3x3 M(
112
+ Vx * Sx - st_ct[1], Vx * Sy - st_ct[0], Vx * Vz,
113
+ Vy * Sx + st_ct[0], Vy * Sy - st_ct[1], Vy * Vz,
114
+ Vz * Sx, Vz * Sy, 1.0f - z);
115
+
116
+ return M * pos;
117
+ }
118
+
119
+ struct flake_noise_value {
120
+ // flake priority (in [0..1], 0: no flake, flakes with higher priority shadow flakes "below" them)
121
+ float priority;
122
+ // Stores values from the functions (once normal, another time the color)
123
+ // current pseudo random number generator seed
124
+ int rnd_seed;
125
+ float4 carrier;
126
+ };
127
+
128
+ // flake noise function with controllable regularity, flake size, and probability
129
+ flake_noise_value flake_noise(
130
+ float3 pos,
131
+ float jitter_scale = 1.0f,
132
+ float flake_diameter = 0.75f,
133
+ float flake_probability = 1.0f)
134
+ {
135
+ float3 base_pos = ::math::floor(pos);
136
+ int3 base_pos_i = int3(base_pos);
137
+
138
+ // limit the flake size to the allowed maximum (such that looking at all neighbors is sufficient)
139
+ flake_diameter = ::math::min(flake_diameter, (1.5f - 0.5f * jitter_scale) / ::math::sqrt(3.0f));
140
+
141
+ flake_noise_value val(0.0f, 0, float4(0.0));
142
+
143
+ for (int i = -1; i < 2; ++i) {
144
+ for (int j = -1; j < 2; ++j) {
145
+ for (int k = -1; k < 2; ++k) {
146
+
147
+ int seed = rnd_init(base_pos_i + int3(i, j, k));
148
+
149
+ seed = rnd_next(seed);
150
+ if (rnd_value(seed) > flake_probability)
151
+ continue;
152
+
153
+ seed = rnd_next(seed);
154
+ float priority = rnd_value(seed);
155
+ if (priority < val.priority)
156
+ continue;
157
+
158
+ float3 flake_pos = base_pos + float3(i, j, k) + float3(0.5f);
159
+
160
+ if (jitter_scale > 0.0f) {
161
+ seed = rnd_next(seed);
162
+ flake_pos.x += (rnd_value(seed) - 0.5f) * jitter_scale;
163
+ seed = rnd_next(seed);
164
+ flake_pos.y += (rnd_value(seed) - 0.5f) * jitter_scale;
165
+ seed = rnd_next(seed);
166
+ flake_pos.z += (rnd_value(seed) - 0.5f) * jitter_scale;
167
+ }
168
+
169
+ float3 p = pos - flake_pos;
170
+ if (::math::dot(p, p) >= flake_diameter * flake_diameter * 4.0f)
171
+ continue;
172
+
173
+ float3 xi_rot;
174
+ seed = rnd_next(seed);
175
+ xi_rot.x = rnd_value(seed);
176
+ seed = rnd_next(seed);
177
+ xi_rot.y = rnd_value(seed);
178
+ seed = rnd_next(seed);
179
+ xi_rot.z = rnd_value(seed);
180
+ p = rotate_pos(p, xi_rot);
181
+
182
+ if (::math::abs(p.x) <= flake_diameter &&
183
+ ::math::abs(p.y) <= flake_diameter &&
184
+ ::math::abs(p.z) <= flake_diameter)
185
+ {
186
+ val.priority = priority;
187
+ val.rnd_seed = seed;
188
+ }
189
+ }
190
+ }
191
+ }
192
+
193
+ return val;
194
+ }
195
+
196
+
197
+ // constants for numerical fitted curve to observed flake noise density behavior
198
+ // 1. no jitter, maximum flake diameter
199
+ const float4 ABCD = float4(-26.19771808f, 26.39663835f, 85.53857017f, -102.35069432f);
200
+ const float2 EF = float2(-101.42634862f, 118.45082288f);
201
+ // 2. jitter scale of 0.5f, maximum flake diameter
202
+ const float4 ABCD_J = float4(-0.87962159f, 0.91006603f, 0.76088203f, -0.24953308f);
203
+ const float2 EF_J = float2(-3.11456809f, 2.63430594f);
204
+ // compute a flake probability for a given flake coverage density x
205
+ float density_to_probability(
206
+ float4 abcd,
207
+ float2 ef,
208
+ float x)
209
+ {
210
+ float xx = x * x;
211
+ return (abcd.x * xx + abcd.y * x) / (abcd.z * xx * x + abcd.w * xx + ef.x * x + ef.y);
212
+ }
213
+
214
+ // statistically controlled (area/volume coverage density) flake noise
215
+ flake_noise_value flake_noise(
216
+ float3 position,
217
+ float density = 0.5f,
218
+ bool jittered = false) // jittered: slightly slower and slightly less uniform
219
+ {
220
+ float probability = density_to_probability(jittered ? ABCD_J : ABCD, jittered ? EF_J : EF, ::math::saturate(density));
221
+
222
+ return flake_noise(pos: position, jitter_scale: jittered ? 0.5f : 0.0f, flake_diameter: (jittered ? 1.25f : 1.5f) / ::math::sqrt(3.0f), flake_probability: probability);
223
+ }
224
+
225
+ // create a flake normal by importance sampling the Beckmann distribution with given roughness
226
+ flake_noise_value flake_normal(
227
+ flake_noise_value val,
228
+ float spread)
229
+ {
230
+ if (val.priority <= 0.0f)
231
+ {
232
+ val.carrier = float4(::state::normal().x, ::state::normal().y, ::state::normal().z, 1.0);
233
+ return val;
234
+ }
235
+
236
+ // int seed0 = rnd_next(val.rnd_seed);
237
+ // float xi0 = rnd_value(seed0);
238
+ // float xi1 = rnd_value(rnd_next(seed0));
239
+
240
+ int seed = rnd_next(val.rnd_seed);
241
+ float xi0 = rnd_value(seed);
242
+ seed = rnd_next(seed);
243
+ float xi1 = rnd_value(seed);
244
+
245
+ float phi = ::math::PI * 2.0f * xi0;
246
+
247
+ float roughness = spread * spread;
248
+
249
+ float tantheta = ::math::sqrt(-roughness * roughness * ::math::log(1.0f - xi1));
250
+ float sintheta = tantheta / ::math::sqrt(1.0f + tantheta * tantheta);
251
+ float costheta = ::math::sqrt(1.0f - sintheta * sintheta);
252
+
253
+ float[2] scphi = ::math::sincos(phi);
254
+
255
+ val.rnd_seed = seed;
256
+
257
+ // return
258
+ // ::state::texture_tangent_u(0) * scphi[1] * sintheta +
259
+ // ::state::texture_tangent_v(0) * scphi[0] * sintheta +
260
+ // ::state::normal() * costheta;
261
+ float3 normal = ::state::texture_tangent_u(0) * scphi[1] * sintheta +
262
+ ::state::texture_tangent_v(0) * scphi[0] * sintheta +
263
+ ::state::normal() * costheta;
264
+
265
+ val.carrier = float4(normal.x, normal.y, normal.z, 1.0);
266
+
267
+
268
+ return val;
269
+ }
270
+
271
+ flake_noise_value random_flake_color(flake_noise_value val)
272
+ {
273
+ int seed = rnd_next(val.rnd_seed);
274
+ float r = rnd_value(seed);
275
+ seed = rnd_next(seed);
276
+ float g = rnd_value(seed);
277
+ seed = rnd_next(seed);
278
+ float b = rnd_value(seed);
279
+ seed = rnd_next(seed);
280
+ float a = rnd_value(seed);
281
+
282
+ val.carrier = float4(r, g, b, a);
283
+ return val;
284
+ }
285
+
286
+
287
+ // Template for absorption and scattering, do not use directly
288
+ material volume_absorption(
289
+ color absorption = color(0.8665, 0.7769, 0.1559),
290
+ color scattering = color(.5),
291
+ float distance_scale = .03,
292
+ float directional_bias = 0.0,
293
+ uniform float ior = 1.2
294
+
295
+ )
296
+ [[
297
+ ::anno::author("NVIDIA vMaterials"),
298
+ ::anno::display_name("Volume Absorption"),
299
+ ::anno::description("Pure volume absorption material"),
300
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.volume_absorption.png"),
301
+ ::anno::copyright_notice(COPYRIGHT),
302
+ ::anno::hidden()
303
+
304
+ ]] = material (
305
+ ior: color(ior),
306
+ surface: material_surface (
307
+ scattering: ::df::specular_bsdf (
308
+ tint: color (1.0, 1.0, 1.0),
309
+ mode: ::df::scatter_reflect_transmit
310
+ )
311
+ ),
312
+ volume: material_volume (
313
+ scattering: ::df::anisotropic_vdf(
314
+ directional_bias: directional_bias
315
+ ),
316
+ absorption_coefficient: (distance_scale <= 0)? color(0): ::math::log(absorption) / -distance_scale,
317
+ scattering_coefficient: (distance_scale <= 0)? color(0): ::math::log(scattering) / -distance_scale
318
+ )
319
+ );
320
+
321
+ // metallic_plastic_full_weighted_mix( )
322
+ // Plastic material using diffuse reflection, diffuse transmission
323
+ // and SSS. Due to the diffuse transmission the volume absorption will
324
+ // render faster and converge smoother than when using specular transmission.
325
+ export material Plastic_Thick_Translucent_Flakes(
326
+ color diffuse_color = color(0.6940f, 0.5831f, 0.0493f)
327
+ [[
328
+ ::anno::display_name("Diffuse Color"),
329
+ ::anno::description("The diffuse color of the plastic material"),
330
+ ::anno::in_group("Appearance")
331
+ ]],
332
+ float diffuse_weight = 0.3f
333
+ [[
334
+ ::anno::display_name("Diffuse Weight"),
335
+ ::anno::description("The weight of the diffuse color of the plastic material. It is recommended to keep "
336
+ "the value around 0.5, lower values make the material appear more transparent while higher values make "
337
+ "it more opaque."),
338
+ ::anno::in_group("Appearance"),
339
+ ::anno::hard_range(0.f, 1.f)
340
+ ]],
341
+ color absorption = color(0.8665f, 0.7769f, 0.1559f)
342
+ [[
343
+ ::anno::display_name("Absorption Color"),
344
+ ::anno::description("Sets the absorption color (this is color when light goes extinct)of the plastic material"),
345
+ ::anno::in_group("Appearance")
346
+ ]],
347
+ color scattering = color(.5f)
348
+ [[
349
+ ::anno::display_name("Scattering Color"),
350
+ ::anno::description("Sets the absorption color (this is color when light goes extinct)of the plastic material"),
351
+ ::anno::in_group("Appearance")
352
+ ]],
353
+ float distance_scale = 1.5f
354
+ [[
355
+ ::anno::display_name("Distance Scale"),
356
+ ::anno::description("Scales how quickly light is absorbed. Set this value low enough to see "
357
+ "some light extinction taking place. Tip: Set 'diffuse_weight' to 0.0 while adjusting this "
358
+ "material parameter for your scene"),
359
+ ::anno::in_group("Appearance")
360
+ ]],
361
+
362
+ color diffuse_transmission_tint = color(1.0000f, 0.7249f, 0.1972f)
363
+ [[
364
+ ::anno::display_name("Diffuse Transmission Color"),
365
+ ::anno::description("The tinting of light scattering through the plastic material"),
366
+ ::anno::in_group("Appearance")
367
+ ]],
368
+
369
+ float reflection_roughness = 0.0f
370
+ [[
371
+ ::anno::display_name("Roughness"),
372
+ ::anno::description("The roughness of the reflection on the plastic"),
373
+ ::anno::in_group("Appearance"),
374
+ ::anno::hard_range(0.f, 1.f)
375
+ ]],
376
+
377
+ // Flakes Controls
378
+ color flake_color_1 = color(1.0f, 1.0f, 1.0f)
379
+ [[
380
+ ::anno::display_name("Flakes Color"),
381
+ ::anno::description("Flakes Color"),
382
+ ::anno::in_group("Flakes")
383
+ ]],
384
+ bool enable_color_randomization = true
385
+ [[
386
+ ::anno::display_name("Flakes Color Randomization"),
387
+ ::anno::description("Enables that a random flakes color will be chosen. Using 'Flakes Color Randomness' allows "
388
+ "to blend between the chosen reflection color for the flakes and an purely random chosen color."),
389
+ ::anno::in_group("Flakes")
390
+ ]],
391
+ float flake_color_randomness = 1.0f
392
+ [[
393
+ ::anno::display_name("Flakes Color Randomness"),
394
+ ::anno::description("Incresing this value will blend towards a randomly chosen flakes color."),
395
+ ::anno::in_group("Flakes"),
396
+ ::anno::hard_range(0.f, 1.f),
397
+ ::anno::enable_if("enable_color_randomization == true")
398
+ ]],
399
+ uniform float flake_size = 0.1f
400
+ [[
401
+ ::anno::display_name("Flakes Size"),
402
+ ::anno::description("The size of the flakes in the material"),
403
+ ::anno::in_group("Flakes")
404
+ ]],
405
+ uniform float3 texture_scale = float3 ( 1.f , 1.f, 1.f)
406
+ [[
407
+ //::anno::hidden(),
408
+ ::anno::display_name("Scale"),
409
+ ::anno::description("Larger numbers increase the texture size."),
410
+ ::nvidia::core_definitions::dimension(float3(1.0f, 1.0f, 1.0f)),
411
+ ::anno::in_group("Transform")
412
+ ]],
413
+ uniform float flake_amount = 0.1f
414
+ [[
415
+ ::anno::display_name("Flakes Amount"),
416
+ ::anno::description("The number of flakes used in the material, 0 meaning no flakes, 1 meaning that flakes "
417
+ "cover the entire surface"),
418
+ ::anno::in_group("Flakes"),
419
+ ::anno::hard_range(0.f, 1.f)
420
+ ]],
421
+
422
+ float flake_spread = 0.7f
423
+ [[
424
+ ::anno::display_name("Flakes Spread"),
425
+ ::anno::description("The amount of randomness in the orientation of the flakes. When set to zero, flakes are "
426
+ "oriented along the surface normal. Higher values tilt the flakes stronger in a random direction."),
427
+ ::anno::in_group("Flakes"),
428
+ ::anno::hard_range(0.f, 1.f)
429
+ ]]
430
+ )
431
+ [[
432
+ ::anno::author("NVIDIA vMaterials"),
433
+ ::anno::display_name("Plastic Full Control"),
434
+ ::anno::description(DESCRIPTION),
435
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.Plastic_Thick_Translucent_Flakes.png"),
436
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment")),
437
+ ::anno::copyright_notice(COPYRIGHT),
438
+ ::anno::hidden()
439
+ ]] = let {
440
+ // Hardcoded plastic parameters
441
+ float reflection_weight = 1.0f;
442
+ float normal_reflectivity = 0.04f;
443
+ float grazing_reflectivity = 1.0f;
444
+ float reflectivity_exponent = 5.0f;
445
+ uniform float ior = 1.4f;
446
+
447
+ // Hardcoded flake parameters
448
+ uniform float flake_roughness = 0.4f;
449
+ float flake_transparency_randomness = 1.0f;
450
+ float flakes_opacity = 0.8;
451
+
452
+ // Flakes
453
+
454
+ float3 flake_uvw_scale = float3(1.0f);
455
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(
456
+ coordinate_system: ::base::texture_coordinate_world,
457
+ texture_space: 0
458
+ );
459
+
460
+ ::base::texture_coordinate_info transformed_uvw = uvw;
461
+ float3 flake_uvw = (texture_scale * transformed_uvw.position * flake_uvw_scale) / (flake_size * 0.001f);
462
+
463
+ flake_noise_value val = flake_noise(flake_uvw, flake_amount, true);
464
+ bool is_flake = val.priority > 0.0f;
465
+ flake_noise_value val2 = flake_normal(val, flake_spread);
466
+ float3 flake_normal = float3(val2.carrier.x, val2.carrier.y, val2.carrier.z);
467
+ flake_noise_value val3 = random_flake_color(val2);
468
+
469
+ color random_color = color(val3.carrier.x, val3.carrier.y, val3.carrier.z);
470
+ float flakes_transparency_value = ::math::lerp(flakes_opacity, val3.carrier.w * flakes_opacity, flake_transparency_randomness);
471
+
472
+ color flake_color = enable_color_randomization ?
473
+ ::math::lerp(flake_color_1, random_color, flake_color_randomness) : flake_color_1;
474
+
475
+ bsdf flakes = ::df::simple_glossy_bsdf(mode: ::df::scatter_reflect, roughness_u: flake_roughness * flake_roughness, tint: flake_color);
476
+
477
+
478
+ // Plastic
479
+
480
+ material plastic = volume_absorption(
481
+ absorption: absorption,
482
+ scattering: scattering,
483
+ distance_scale: distance_scale,
484
+ ior: ior
485
+ );
486
+
487
+ bsdf transdiff = ::df::diffuse_transmission_bsdf(
488
+ tint: diffuse_transmission_tint
489
+ );
490
+
491
+ bsdf diffuse = ::df::diffuse_reflection_bsdf(
492
+ tint: diffuse_color
493
+ );
494
+
495
+ bsdf diffuse_mix_layer = ::df::weighted_layer(
496
+ base: transdiff,
497
+ layer: diffuse,
498
+ weight: diffuse_weight
499
+
500
+ );
501
+
502
+ bsdf plastic_with_flakes = ::df::weighted_layer(
503
+ base: diffuse_mix_layer,
504
+ layer: flakes,
505
+ weight: is_flake ? flakes_transparency_value : 0.0f,
506
+ normal: flake_normal
507
+ );
508
+
509
+ bsdf glossy_reflection = ::df::simple_glossy_bsdf(
510
+ tint: color(1.0),
511
+ roughness_u: reflection_roughness,
512
+ mode: ::df::scatter_reflect
513
+ );
514
+
515
+ bsdf final_layer = ::df::custom_curve_layer(
516
+ normal_reflectivity: normal_reflectivity,
517
+ grazing_reflectivity: grazing_reflectivity,
518
+ layer: glossy_reflection,
519
+ base: plastic_with_flakes,
520
+ weight: reflection_weight,
521
+ exponent: reflectivity_exponent
522
+ );
523
+
524
+ } in material (
525
+ surface: material_surface(
526
+ scattering: final_layer
527
+ ),
528
+
529
+ volume: plastic.volume
530
+ );
531
+
532
+
533
+ export material metallic_plastic_simple_controls(
534
+ color diffuse_color = color(0.6940, 0.5831, 0.0493)
535
+ [[
536
+ ::anno::display_name("Diffuse Color"),
537
+ ::anno::description("The diffuse color of the plastic material"),
538
+ ::anno::in_group("Appearance")
539
+ ]],
540
+ float diffuse_weight = 0.5
541
+ [[
542
+ ::anno::display_name("Diffuse Weight"),
543
+ ::anno::description("The weight of the diffuse color of the plastic material. It is recommended to keep "
544
+ "the value around 0.5, lower values make the material appear more transparent while higher values make "
545
+ "it more opaque."),
546
+ ::anno::in_group("Appearance"),
547
+ ::anno::hard_range(0.f, 1.f)
548
+ ]],
549
+ color transmissive_color = color(0.8665, 0.7769, 0.1559)
550
+ [[
551
+ ::anno::display_name("Transmissive Color"),
552
+ ::anno::description("The tinting of light scattering through the plastic material"),
553
+ ::anno::in_group("Appearance")
554
+ ]],
555
+ float reflection_roughness = 0.0
556
+ [[
557
+ ::anno::display_name("Roughness"),
558
+ ::anno::description("The roughness of the reflection on the plastic"),
559
+ ::anno::in_group("Appearance"),
560
+ ::anno::hard_range(0.f, 1.f)
561
+ ]],
562
+ float distance_scale = 0.005
563
+ [[
564
+ ::anno::display_name("Distance Scale"),
565
+ ::anno::description("Scales how quickly light is absorbed. Set this value low enough to see "
566
+ "some light extinction taking place. Tip: Set 'diffuse_weight' to 0.0 while adjusting this "
567
+ "material parameter for your scene"),
568
+ ::anno::in_group("Appearance")
569
+ ]],
570
+
571
+ // Flakes Controls
572
+ color flake_color_1 = color(1.0f, 1.0f, 1.0f)
573
+ [[
574
+ ::anno::display_name("Flakes Color"),
575
+ ::anno::description("Flakes Color"),
576
+ ::anno::in_group("Flakes")
577
+ ]],
578
+ bool enable_color_randomization = true
579
+ [[
580
+ ::anno::display_name("Flakes Color Randomization"),
581
+ ::anno::description("Enables that a random flakes color will be chosen. Using 'Flakes Color Randomness' allows "
582
+ "to blend between the chosen reflection color for the flakes and an purely random chosen color."),
583
+ ::anno::in_group("Flakes")
584
+ ]],
585
+ float flake_color_randomness = 1.0
586
+ [[
587
+ ::anno::display_name("Flakes Color Randomness"),
588
+ ::anno::description("Incresing this value will blend towards a randomly chosen flakes color."),
589
+ ::anno::in_group("Flakes"),
590
+ ::anno::hard_range(0.f, 1.f),
591
+ ::anno::enable_if("enable_color_randomization == true")
592
+ ]],
593
+ uniform float flake_size = 0.1f
594
+ [[
595
+ ::anno::display_name("Flakes Size"),
596
+ ::anno::description("The size of the flakes in the material"),
597
+ ::anno::in_group("Flakes")
598
+ ]],
599
+ uniform float3 texture_scale = float3 ( 1.f , 1.f, 1.f)
600
+ [[
601
+ //::anno::hidden(),
602
+ ::anno::display_name("Scale"),
603
+ ::anno::description("Larger numbers increase the texture size."),
604
+ ::nvidia::core_definitions::dimension(float3(1.0f, 1.0f, 1.0f)),
605
+ ::anno::in_group("Transform")
606
+ ]],
607
+ uniform float flake_amount = 0.1f
608
+ [[
609
+ ::anno::display_name("Flakes Amount"),
610
+ ::anno::description("The number of flakes used in the material, 0 meaning no flakes, 1 meaning that flakes cover the entire surface"),
611
+ ::anno::in_group("Flakes"),
612
+ ::anno::hard_range(0.f, 1.f)
613
+ ]],
614
+ float flake_spread = 0.7f
615
+ [[
616
+ ::anno::display_name("Flakes Spread"),
617
+ ::anno::description("The amount of randomness in the orientation of the flakes. When set to zero, flakes are oriented along the surface normal. Higher values tilt the flakes stronger in a random direction."),
618
+ ::anno::in_group("Flakes"),
619
+ ::anno::hard_range(0.f, 1.f)
620
+ ]]
621
+
622
+ )
623
+ [[
624
+ ::anno::author("NVIDIA ARC"),
625
+ ::anno::display_name("Plastic"),
626
+ ::anno::description(DESCRIPTION),
627
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment")),
628
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_simple_controls.png"),
629
+ ::anno::copyright_notice(COPYRIGHT),
630
+ ::anno::hidden()
631
+ ]] = Plastic_Thick_Translucent_Flakes(
632
+ absorption: ::math::pow(transmissive_color, 0.2),
633
+ scattering: color(0.5),
634
+ distance_scale: distance_scale,
635
+ diffuse_transmission_tint: ::math::pow(transmissive_color, 0.2),
636
+ diffuse_color: diffuse_color,
637
+ diffuse_weight: diffuse_weight,
638
+ reflection_roughness: reflection_roughness,
639
+
640
+ flake_color_1: flake_color_1,
641
+ enable_color_randomization: enable_color_randomization,
642
+ flake_color_randomness: flake_color_randomness,
643
+ flake_size: flake_size,
644
+ texture_scale: texture_scale,
645
+ flake_amount: flake_amount,
646
+ flake_spread: flake_spread
647
+ );
648
+
649
+
650
+ // 01 - Black
651
+ export material plastic_black(*)
652
+ [[
653
+ ::anno::author("NVIDIA ARC"),
654
+ ::anno::display_name("Metallic Plastic Black"),
655
+ ::anno::description(DESCRIPTION),
656
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "dark", "black", "neutral")),
657
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_black.png"),
658
+ ::anno::copyright_notice(COPYRIGHT)
659
+ ]] = metallic_plastic_simple_controls(
660
+ diffuse_color: color(0.034230),
661
+ diffuse_weight: .5,
662
+ transmissive_color: color(0.034230),
663
+ distance_scale: 0.002,
664
+ reflection_roughness: 0.05
665
+ );
666
+
667
+
668
+ // 02 - Dark Gray
669
+ export material plastic_dark_gray(*)
670
+ [[
671
+ ::anno::author("NVIDIA ARC"),
672
+ ::anno::display_name("Metallic Plastic Dark Gray"),
673
+ ::anno::description(DESCRIPTION),
674
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "dark", "gray", "neutral")),
675
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_dark_gray.png"),
676
+ ::anno::copyright_notice(COPYRIGHT)
677
+ ]] = metallic_plastic_simple_controls(
678
+ diffuse_color: color(0.127530),
679
+ diffuse_weight: .5,
680
+ transmissive_color: color(0.089194),
681
+ distance_scale: 0.002,
682
+ reflection_roughness: 0.05
683
+ );
684
+
685
+
686
+ // 03 - Light Gray
687
+ export material plastic_light_gray(*)
688
+ [[
689
+ ::anno::author("NVIDIA ARC"),
690
+ ::anno::display_name("Metallic Plastic Light Gray"),
691
+ ::anno::description(DESCRIPTION),
692
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "light", "gray", "neutral")),
693
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_light_gray.png"),
694
+ ::anno::copyright_notice(COPYRIGHT)
695
+ ]] = metallic_plastic_simple_controls(
696
+ diffuse_color: color(0.464741),
697
+ diffuse_weight: .5,
698
+ transmissive_color: color(0.358654),
699
+ distance_scale: 0.002,
700
+ reflection_roughness: 0.05
701
+ );
702
+
703
+
704
+ // 04 - White
705
+ export material plastic_white(*)
706
+ [[
707
+ ::anno::author("NVIDIA ARC"),
708
+ ::anno::display_name("Metallic Plastic White"),
709
+ ::anno::description(DESCRIPTION),
710
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "light", "white", "neutral")),
711
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_white.png"),
712
+ ::anno::copyright_notice(COPYRIGHT)
713
+ ]] = metallic_plastic_simple_controls(
714
+ diffuse_color: color(0.915750),
715
+ diffuse_weight: .5,
716
+ transmissive_color: color(0.812241),
717
+ distance_scale: 0.002,
718
+ reflection_roughness: 0.05
719
+ );
720
+
721
+
722
+ // 05 - Ivory White
723
+ export material plastic_ivory_white(*)
724
+ [[
725
+ ::anno::author("NVIDIA ARC"),
726
+ ::anno::display_name("Metallic Plastic Ivory White"),
727
+ ::anno::description(DESCRIPTION),
728
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "white", "bright", "ivory", "warm")),
729
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_ivory_white.png"),
730
+ ::anno::copyright_notice(COPYRIGHT)
731
+ ]] = metallic_plastic_simple_controls(
732
+ diffuse_color: color(0.899385, 0.843370, 0.694081),
733
+ diffuse_weight: .5,
734
+ transmissive_color: color(0.722672, 0.708298, 0.547994),
735
+ distance_scale: 0.002,
736
+ reflection_roughness: 0.05
737
+ );
738
+
739
+
740
+ // 06 - Lemon
741
+ export material plastic_lemon(*)
742
+ [[
743
+ ::anno::author("NVIDIA ARC"),
744
+ ::anno::display_name("Metallic Plastic Lemon"),
745
+ ::anno::description(DESCRIPTION),
746
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "lemon", "yellow", "light", "warm")),
747
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_lemon.png"),
748
+ ::anno::copyright_notice(COPYRIGHT)
749
+ ]] = metallic_plastic_simple_controls(
750
+ diffuse_color: color(0.859174, 0.875138, 0.039947),
751
+ diffuse_weight: .5,
752
+ transmissive_color: color(0.98211, 0.843370, 0.031551),
753
+ distance_scale: 0.002,
754
+ reflection_roughness: 0.05
755
+ );
756
+
757
+
758
+ // 07 - Yellow Orange
759
+ export material plastic_yellow_orange(*)
760
+ [[
761
+ ::anno::author("NVIDIA ARC"),
762
+ ::anno::display_name("Metallic Plastic Yellow"),
763
+ ::anno::description(DESCRIPTION),
764
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "light", "orange", "yellow", "warm")),
765
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_yellow_orange.png"),
766
+ ::anno::copyright_notice(COPYRIGHT)
767
+ ]] = metallic_plastic_simple_controls(
768
+ diffuse_color: color(0.875138, 0.612066, 0.039947),
769
+ diffuse_weight: .5,
770
+ transmissive_color: color(0.899385, 0.373615, 0.030257),
771
+ distance_scale: 0.002,
772
+ reflection_roughness: 0.05
773
+ );
774
+
775
+
776
+ // 08 - Orange
777
+ export material plastic_orange(*)
778
+ [[
779
+ ::anno::author("NVIDIA ARC"),
780
+ ::anno::display_name("Metallic Plastic Orange"),
781
+ ::anno::description(DESCRIPTION),
782
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "orange", "warm")),
783
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_orange.png"),
784
+ ::anno::copyright_notice(COPYRIGHT)
785
+ ]] = metallic_plastic_simple_controls(
786
+ diffuse_color: color(0.875138, 0.353741, 0.030257),
787
+ diffuse_weight: .5,
788
+ transmissive_color: color(0.891262, 0.420508, 0.022013),
789
+ distance_scale: 0.002,
790
+ reflection_roughness: 0.05
791
+ );
792
+
793
+
794
+ // 09 - Dark Orange
795
+ export material plastic_dark_orange(*)
796
+ [[
797
+ ::anno::author("NVIDIA ARC"),
798
+ ::anno::display_name("Metallic Plastic Dark Orange"),
799
+ ::anno::description(DESCRIPTION),
800
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "dark", "orange", "warm")),
801
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_dark_orange.png"),
802
+ ::anno::copyright_notice(COPYRIGHT)
803
+ ]] = metallic_plastic_simple_controls(
804
+ diffuse_color: color(0.535642, 0.127530, 0.022013),
805
+ diffuse_weight: .5,
806
+ transmissive_color: color(0.827726, 0.267358, 0.022013),
807
+ distance_scale: 0.002,
808
+ reflection_roughness: 0.05
809
+ );
810
+
811
+
812
+ // 10 - Red
813
+ export material plastic_red(*)
814
+ [[
815
+ ::anno::author("NVIDIA ARC"),
816
+ ::anno::display_name("Metallic Plastic Red"),
817
+ ::anno::description(DESCRIPTION),
818
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "red", "cherry", "warm")),
819
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_red.png"),
820
+ ::anno::copyright_notice(COPYRIGHT)
821
+ ]] = metallic_plastic_simple_controls(
822
+ diffuse_color: color(0.547994, 0.027755, 0.027755),
823
+ diffuse_weight: .5,
824
+ transmissive_color: color(0.875138, 0.022013, 0.022013),
825
+ distance_scale: 0.002,
826
+ reflection_roughness: 0.05
827
+ );
828
+
829
+
830
+ // 11 - Magenta
831
+ export material plastic_magenta(*)
832
+ [[
833
+ ::anno::author("NVIDIA ARC"),
834
+ ::anno::display_name("Metallic Plastic Magenta"),
835
+ ::anno::description(DESCRIPTION),
836
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "magenta")),
837
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_magenta.png"),
838
+ ::anno::copyright_notice(COPYRIGHT)
839
+ ]] = metallic_plastic_simple_controls(
840
+ diffuse_color: color(0.547994, 0.047776, 0.554227),
841
+ diffuse_weight: .5,
842
+ transmissive_color: color(0.722672, 0.030257, 0.566810),
843
+ distance_scale: 0.002,
844
+ reflection_roughness: 0.05
845
+ );
846
+
847
+
848
+ // 12 - Purple
849
+ export material plastic_purple(*)
850
+ [[
851
+ ::anno::author("NVIDIA ARC"),
852
+ ::anno::display_name("Metallic Plastic Purple"),
853
+ ::anno::description(DESCRIPTION),
854
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "purple")),
855
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_purple.png"),
856
+ ::anno::copyright_notice(COPYRIGHT)
857
+ ]] = metallic_plastic_simple_controls(
858
+ diffuse_color: color(0.193972, 0.017936, 0.464741),
859
+ diffuse_weight: .5,
860
+ transmissive_color: color(0.701170, 0.018913, 0.645555),
861
+ distance_scale: 0.002,
862
+ reflection_roughness: 0.05
863
+ );
864
+
865
+
866
+ // 13 - Dark Blue
867
+ export material plastic_dark_blue(*)
868
+ [[
869
+ ::anno::author("NVIDIA ARC"),
870
+ ::anno::display_name("Metallic Plastic Dark Blue"),
871
+ ::anno::description(DESCRIPTION),
872
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "dark", "blue", "cool")),
873
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_dark_blue.png"),
874
+ ::anno::copyright_notice(COPYRIGHT)
875
+ ]] = metallic_plastic_simple_controls(
876
+ diffuse_color: color(0.027755, 0.058187, 0.311180),
877
+ diffuse_weight: .5,
878
+ transmissive_color: color(0.027755, 0.058187, 0.311180),
879
+ distance_scale: 0.002,
880
+ reflection_roughness: 0.05
881
+ );
882
+
883
+
884
+ // 14 - Blue
885
+ export material plastic_blue(*)
886
+ [[
887
+ ::anno::author("NVIDIA ARC"),
888
+ ::anno::display_name("Metallic Plastic Blue"),
889
+ ::anno::description(DESCRIPTION),
890
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "blue", "cool")),
891
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_blue.png"),
892
+ ::anno::copyright_notice(COPYRIGHT)
893
+ ]] = metallic_plastic_simple_controls(
894
+ diffuse_color: color(0.034230, 0.173439, 0.843370),
895
+ diffuse_weight: .5,
896
+ transmissive_color: color(0.034230, 0.124741, 0.659224),
897
+ distance_scale: 0.002,
898
+ reflection_roughness: 0.05
899
+ );
900
+
901
+
902
+ // 15 - Sky Blue
903
+ export material plastic_sky_blue(*)
904
+ [[
905
+ ::anno::author("NVIDIA ARC"),
906
+ ::anno::display_name("Metallic Plastic Sky Blue"),
907
+ ::anno::description(DESCRIPTION),
908
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "blue", "sky", "cool")),
909
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_sky_blue.png"),
910
+ ::anno::copyright_notice(COPYRIGHT)
911
+ ]] = metallic_plastic_simple_controls(
912
+ diffuse_color: color(0.061907, 0.535642, 0.875138),
913
+ diffuse_weight: .5,
914
+ transmissive_color: color(0.028991, 0.358654, 0.673049),
915
+ distance_scale: 0.002,
916
+ reflection_roughness: 0.05
917
+ );
918
+
919
+
920
+ // 16 - Light Blue
921
+ export material plastic_light_blue(*)
922
+ [[
923
+ ::anno::author("NVIDIA ARC"),
924
+ ::anno::display_name("Metallic Plastic Light Blue"),
925
+ ::anno::description(DESCRIPTION),
926
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "light", "blue", "cool")),
927
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_light_blue.png"),
928
+ ::anno::copyright_notice(COPYRIGHT)
929
+ ]] = metallic_plastic_simple_controls(
930
+ diffuse_color: color(0.263175, 0.774227, 0.827726),
931
+ diffuse_weight: .5,
932
+ transmissive_color: color(0.163641, 0.592438, 0.759300),
933
+ distance_scale: 0.002,
934
+ reflection_roughness: 0.05
935
+ );
936
+
937
+
938
+ // 17 - Teal
939
+ export material plastic_teal(*)
940
+ [[
941
+ ::anno::author("NVIDIA ARC"),
942
+ ::anno::display_name("Metallic Plastic Teal"),
943
+ ::anno::description(DESCRIPTION),
944
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "teal", "cool")),
945
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_teal.png"),
946
+ ::anno::copyright_notice(COPYRIGHT)
947
+ ]] = metallic_plastic_simple_controls(
948
+ diffuse_color: color(0.037029, 0.579547, 0.329729),
949
+ diffuse_weight: .5,
950
+ transmissive_color: color(0.022013, 0.476177, 0.353741),
951
+ distance_scale: 0.002,
952
+ reflection_roughness: 0.05
953
+ );
954
+
955
+
956
+ // 18 - Dark Green
957
+ export material plastic_dark_green(*)
958
+ [[
959
+ ::anno::author("NVIDIA ARC"),
960
+ ::anno::display_name("Metallic Plastic Dark Green"),
961
+ ::anno::description(DESCRIPTION),
962
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "dark", "green")),
963
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_dark_green.png"),
964
+ ::anno::copyright_notice(COPYRIGHT)
965
+ ]] = metallic_plastic_simple_controls(
966
+ diffuse_color: color(0.034230, 0.141980, 0.034230),
967
+ diffuse_weight: .5,
968
+ transmissive_color: color(0.016988, 0.141980, 0.016988),
969
+ distance_scale: 0.002,
970
+ reflection_roughness: 0.05
971
+ );
972
+
973
+
974
+ // 19 - Green
975
+ export material plastic_green(*)
976
+ [[
977
+ ::anno::author("NVIDIA ARC"),
978
+ ::anno::display_name("Metallic Plastic Green"),
979
+ ::anno::description(DESCRIPTION),
980
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "green")),
981
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_green.png"),
982
+ ::anno::copyright_notice(COPYRIGHT)
983
+ ]] = metallic_plastic_simple_controls(
984
+ diffuse_color: color(0.016988, 0.311180, 0.016988),
985
+ diffuse_weight: .5,
986
+ transmissive_color: color(0.012664, 0.358654, 0.012664),
987
+ distance_scale: 0.002,
988
+ reflection_roughness: 0.05
989
+ );
990
+
991
+
992
+ // 20 - Light Green
993
+ export material plastic_light_green(*)
994
+ [[
995
+ ::anno::author("NVIDIA ARC"),
996
+ ::anno::display_name("Metallic Plastic Light Green"),
997
+ ::anno::description(DESCRIPTION),
998
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "light", "green")),
999
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_light_green.png"),
1000
+ ::anno::copyright_notice(COPYRIGHT)
1001
+ ]] = metallic_plastic_simple_controls(
1002
+ diffuse_color: color(0.030257, 0.687031, 0.027755),
1003
+ diffuse_weight: .5,
1004
+ transmissive_color: color(0.030257, 0.701170, 0.027755),
1005
+ distance_scale: 0.002,
1006
+ reflection_roughness: 0.05
1007
+ );
1008
+
1009
+
1010
+ // 21 - Lime Green
1011
+ export material plastic_lime_green(*)
1012
+ [[
1013
+ ::anno::author("NVIDIA ARC"),
1014
+ ::anno::display_name("Metallic Plastic Lime Green"),
1015
+ ::anno::description(DESCRIPTION),
1016
+ ::anno::key_words(string[]("plastic", "artificial", "scattering", "SSS", "diffuse", "translucent", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "lime", "green", "light")),
1017
+ ::anno::thumbnail("./.thumbs/Plastic_Thick_Translucent_Flakes.plastic_lime_green.png"),
1018
+ ::anno::copyright_notice(COPYRIGHT)
1019
+ ]] = metallic_plastic_simple_controls(
1020
+ diffuse_color: color(0.186989, 0.605484, 0.027755),
1021
+ diffuse_weight: .5,
1022
+ transmissive_color: color(0.204710, 0.701170, 0.022013),
1023
+ distance_scale: 0.002,
1024
+ reflection_roughness: 0.05
1025
+ );