Datasets:

Modalities:
Image
Text
Formats:
text
Size:
< 1K
Libraries:
Datasets
License:
ZijunCui commited on
Commit
3020829
·
verified ·
1 Parent(s): 07f37b0

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. code/third_party/vMaterials_2/Composite/Carbon_Fiber.mdl +578 -0
  2. code/third_party/vMaterials_2/Composite/Fiberglass.mdl +394 -0
  3. code/third_party/vMaterials_2/Composite/Fiberglass_Imperfections.mdl +878 -0
  4. code/third_party/vMaterials_2/Gems/Alexandrite.mdl +102 -0
  5. code/third_party/vMaterials_2/Gems/Amethyst.mdl +136 -0
  6. code/third_party/vMaterials_2/Gems/Ametrine.mdl +161 -0
  7. code/third_party/vMaterials_2/Gems/Aquamarine.mdl +92 -0
  8. code/third_party/vMaterials_2/Gems/Citrine.mdl +133 -0
  9. code/third_party/vMaterials_2/Gems/Diamond.mdl +235 -0
  10. code/third_party/vMaterials_2/Gems/Emerald.mdl +93 -0
  11. code/third_party/vMaterials_2/Gems/Garnet.mdl +147 -0
  12. code/third_party/vMaterials_2/Gems/Iolite.mdl +91 -0
  13. code/third_party/vMaterials_2/Gems/Jade.mdl +133 -0
  14. code/third_party/vMaterials_2/Gems/Morganite.mdl +91 -0
  15. code/third_party/vMaterials_2/Gems/Onyx.mdl +157 -0
  16. code/third_party/vMaterials_2/Gems/Pearl.mdl +121 -0
  17. code/third_party/vMaterials_2/Gems/Peridot.mdl +91 -0
  18. code/third_party/vMaterials_2/Gems/Ruby.mdl +146 -0
  19. code/third_party/vMaterials_2/Gems/Sapphire.mdl +148 -0
  20. code/third_party/vMaterials_2/Gems/Tanzanite.mdl +94 -0
  21. code/third_party/vMaterials_2/Gems/Topaz.mdl +145 -0
  22. code/third_party/vMaterials_2/Gems/Tourmaline.mdl +181 -0
  23. code/third_party/vMaterials_2/Gems/Turquoise.mdl +719 -0
  24. code/third_party/vMaterials_2/Gems/Zircon.mdl +140 -0
  25. code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl.png +3 -0
  26. code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper.png +3 -0
  27. code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_10_of_12.png +3 -0
  28. code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_11_of_12.png +3 -0
  29. code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_2_of_12.png +3 -0
  30. code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_3_of_12.png +3 -0
  31. code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_4_of_12.png +3 -0
  32. code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_5_of_12.png +3 -0
  33. code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_6_of_12.png +3 -0
  34. code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_7_of_12.png +3 -0
  35. code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_8_of_12.png +3 -0
  36. code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_9_of_12.png +3 -0
  37. code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum.mdl.png +3 -0
  38. code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum.mdl@Aluminum.png +3 -0
  39. code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum.mdl@Aluminum_Glossy_Fingerprints.png +3 -0
  40. code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum.mdl@Aluminum_Polished.png +3 -0
  41. code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl.png +3 -0
  42. code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized.png +3 -0
  43. code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Electric_Blue_Coated.png +3 -0
  44. code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Electric_Blue_Dirty.png +3 -0
  45. code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Electric_Blue_Scratched.png +3 -0
  46. code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Electric_Blue_Shiny.png +3 -0
  47. code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Electric_Blue_Smudges.png +3 -0
  48. code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Gold.png +3 -0
  49. code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Grass_Green.png +3 -0
  50. code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Lavender.png +3 -0
code/third_party/vMaterials_2/Composite/Carbon_Fiber.mdl ADDED
@@ -0,0 +1,578 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2024 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
+
37
+ mdl 1.6;
38
+
39
+ import ::anno::*;
40
+ import ::base::*;
41
+ import ::df::*;
42
+ import ::math::*;
43
+ import ::state::*;
44
+ import ::tex::*;
45
+ import ::nvidia::core_definitions::blend_colors;
46
+ import ::nvidia::core_definitions::dimension;
47
+
48
+ const string COPYRIGHT =
49
+ " Copyright 2024 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
+ const string DESCRIPTION = "A polished brass material with tweakable surface imperfections.";
62
+
63
+
64
+ annotation preview_scale( float f);
65
+
66
+ // Returns the normal n in tangent space, given n is in internal space.
67
+ float3 transform_internal_to_tangent(float3 n)
68
+ [[
69
+ anno::hidden()
70
+ ]]
71
+ {
72
+ return
73
+ n.x* float3(state::texture_tangent_u(0).x,state::texture_tangent_v(0).x,state::normal().x)+
74
+ n.y* float3(state::texture_tangent_u(0).y,state::texture_tangent_v(0).y,state::normal().y)+
75
+ n.z* float3(state::texture_tangent_u(0).z,state::texture_tangent_v(0).z,state::normal().z);
76
+ }
77
+
78
+ // Returns the normal n in internal space, given n is in tangent space.
79
+ float3 transform_tangent_to_internal(float3 n)
80
+ [[
81
+ anno::hidden()
82
+ ]]
83
+ {
84
+ return state::texture_tangent_u(0) * n.x +
85
+ state::texture_tangent_v(0) * n.y +
86
+ state::normal() * n.z ;
87
+ }
88
+
89
+
90
+
91
+ // Returns a normal by adding a detail normal to a global normal.
92
+ // If detail blending of two normal maps gives visual artifacts, check if texture_2d are loaded
93
+ // correctly with tex::gamma_linear
94
+ float3 add_detail_normal(float3 nd = state::normal(), float3 n = state::normal())
95
+ {
96
+ // http://blog.selfshadow.com/publications/blending-in-detail/
97
+ float3 n_t = transform_internal_to_tangent(n);
98
+ float3 nd_t = transform_internal_to_tangent(nd);
99
+
100
+ n_t=n_t + float3(0.,0.,1.);
101
+ nd_t = nd_t * float3(-1.,-1.,1.);
102
+ n = n_t*math::dot(n_t, nd_t)/n_t.z - nd_t;
103
+ return ::math::normalize(transform_tangent_to_internal(n));
104
+ }
105
+
106
+
107
+ float histogram_range(float input, float range = 1.0f, float position = 0.5f)
108
+ {
109
+ float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0);
110
+ float high = ::math::clamp(math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0);
111
+ return ::math::lerp(low, high, input);
112
+ }
113
+
114
+
115
+ float remap(float input, float low, float high)
116
+ {
117
+ return ::math::lerp(low, high, input);
118
+ }
119
+
120
+ ::base::texture_coordinate_info vmat_transform_post_scale(
121
+ ::base::texture_coordinate_info uvw,
122
+ float2 scale = float2(1.0f)
123
+ )
124
+ {
125
+ return ::base::texture_coordinate_info(
126
+ position: float3(uvw.position.x / scale.x,
127
+ uvw.position.y / scale.y,
128
+ uvw.position.z),
129
+ tangent_u: uvw.tangent_u,
130
+ tangent_v: uvw.tangent_v
131
+ );
132
+ }
133
+
134
+ ::base::anisotropy_return anisotropy_conversion(
135
+ float roughness = 0.0,
136
+ float anisotropy = 0.0,
137
+ float anisotropy_rotation = 0.0,
138
+ float3 tangent_u = ::state::texture_tangent_u(0)
139
+ )
140
+ {
141
+ ::base::anisotropy_return return_value(
142
+ roughness_u: roughness * roughness,
143
+ roughness_v: roughness * roughness,
144
+ tangent_u: tangent_u
145
+ );
146
+
147
+ if (anisotropy > 0.f) {
148
+ // Allows for infinite anisotropy when roughness==0, full roughness when anisotropy==0 (saturated later on)
149
+ return_value.roughness_u += ::math::pow(anisotropy,4);
150
+
151
+ if (anisotropy_rotation > 0.f && anisotropy_rotation < 1.f) {
152
+ float3 tangent_v = ::math::cross(::state::normal(), tangent_u); // assumed these are normalized already
153
+ float rotation_angle = 2.f * ::math::PI * anisotropy_rotation;
154
+ return_value.tangent_u = tangent_u * ::math::cos(rotation_angle) - tangent_v * ::math::sin(rotation_angle);
155
+ }
156
+ }
157
+
158
+ return_value.roughness_u = ::math::min(1.f, return_value.roughness_u);
159
+ return_value.roughness_v = ::math::min(1.f, return_value.roughness_v);
160
+
161
+ return return_value;
162
+ }
163
+
164
+
165
+ ::base::texture_coordinate_info vmat_transform(
166
+ uniform float2 translation = float2(0.0, 0.0),
167
+ uniform float rotation = 0.0,
168
+ uniform float2 scaling = float2(1.0, 1.0),
169
+ uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw,
170
+ uniform int uv_space = 0
171
+ )
172
+ {
173
+ float4x4 scale =
174
+ float4x4(1.0 /scaling.x, 0. , 0. , 0.,
175
+ 0. , 1.0 /scaling.y , 0. , 0.,
176
+ 0. , 0. , 1.0, 0.,
177
+ translation.x , translation.y , 0.0, 1.);
178
+
179
+ float s = ::math::sin(rotation);
180
+ float c = ::math::cos(rotation);
181
+ float4x4 rotate =
182
+ float4x4( c , -s , 0.0 , 0.0,
183
+ s , c , 0.0 , 0.0,
184
+ 0.0, 0.0 , 1.0 , 0.0,
185
+ 0. , 0.0 , 0.0 , 1.);
186
+
187
+ return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space));
188
+ }
189
+
190
+ float remap_xy_to_0_1(float input, float x, float y)
191
+ {
192
+ return (input - x)/(y - x);
193
+ }
194
+
195
+ float histogram_scan_big(float input, float width, float position)
196
+ {
197
+ return ::math::clamp(
198
+ remap_xy_to_0_1(input,
199
+ ::math::lerp(-width, 1.0, position),
200
+ ::math::lerp(0.0, 1.0 + width, position)),
201
+ 0.0,
202
+ 1.0);
203
+ }
204
+
205
+ float histogram_pos_range(float input, float range, float position)
206
+ {
207
+ float range_half = range/2.0;
208
+ float add_high = (position - range_half) < 0.0 ? ::math::abs(position - range_half) : 0.0;
209
+ float subtract_low = (position + range_half) > 1.0 ? ::math::abs((position + range_half)-1.0) : 0.0;
210
+
211
+
212
+ float low = (position - range_half) < 0.0 ? 0.0 : (position - range_half - subtract_low);
213
+ float high = (position + range_half) > 1.0 ? 1.0 : (position + range_half + add_high);
214
+ return remap(input, low, high);
215
+ }
216
+
217
+ export material Carbon_Fiber(
218
+ float carbon_fiber_brightness = 0.22f [[
219
+ ::anno::description("Adjusts the brightness of the material."),
220
+ ::anno::display_name("Brightness"),
221
+ ::anno::hard_range(0.f, 1.f),
222
+ ::anno::ui_order(0)
223
+ ]],
224
+ float fibers_roughness = 0.16f [[
225
+ ::anno::description("Afjusts the roughness of the fibers."),
226
+ ::anno::display_name("Fibers Roughness"),
227
+ ::anno::in_group("Appearance", "Fibers"),
228
+ ::anno::hard_range(0.f, 1.f),
229
+ ::anno::ui_order(1)
230
+ ]],
231
+ float fibers_anisotropy = 0.18f [[
232
+ ::anno::description("Adjusts the anisotropy of the fibers. Higher values stretches the reflection of the fibers."),
233
+ ::anno::display_name("Fibers Anisotropy"),
234
+ ::anno::in_group("Appearance", "Fibers"),
235
+ ::anno::hard_range(0.f, 1.f),
236
+ ::anno::ui_order(2)
237
+ ]],
238
+ uniform float weaving_bump_strength = 1.f [[
239
+ ::anno::description("Adjusts the bumpiness of the weaving pattern."),
240
+ ::anno::display_name("Weaving Bump Strength"),
241
+ ::anno::in_group("Appearance", "Fibers"),
242
+ ::anno::hard_range(0.f, 2.f),
243
+ ::anno::soft_range(0.f, 1.f),
244
+ ::anno::ui_order(3)
245
+ ]],
246
+ uniform bool enable_coating = false [[
247
+ ::anno::description("When enables, a a transparent coating is applied on top of the carbon fiber."),
248
+ ::anno::display_name("Enable Coating"),
249
+ ::anno::in_group("Coating"),
250
+ ::anno::ui_order(4)
251
+ ]],
252
+ float coating_roughness = 0.f [[
253
+ ::anno::description("Adjusts the roughness of the coating. Higher values lead to blurrier reflections."),
254
+ ::anno::display_name("Coating Roughness"),
255
+ ::anno::in_group("Coating"),
256
+ ::anno::hard_range(0.f, 1.f),
257
+ ::anno::ui_order(5)
258
+ ]],
259
+ float coating_roughness_variation = 0.36f [[
260
+ ::anno::description("This parameter adds variation to the roughness so that it appears less uniform."),
261
+ ::anno::display_name("Coating Roughness Variation"),
262
+ ::anno::in_group("Coating"),
263
+ ::anno::hard_range(0.f, 1.f),
264
+ ::anno::ui_order(6)
265
+ ]],
266
+ uniform float coating_damages_intensity = 0.02f [[
267
+ ::anno::description("Adds scratches and wear on the coating."),
268
+ ::anno::display_name("Coating Damages"),
269
+ ::anno::in_group("Coating"),
270
+ ::anno::hard_range(0.f, 1.f),
271
+ ::anno::ui_order(7)
272
+ ]],
273
+ float coating_damages_scale = .75f [[
274
+ ::anno::description("Use this parameter to make the damages bigger or smaller, relative to the overall texture scale."),
275
+ ::anno::display_name("Damages Scale"),
276
+ ::anno::in_group("Coating"),
277
+ ::anno::hard_range(0.f, 1.f),
278
+ ::anno::ui_order(8)
279
+ ]],
280
+ float coating_dust = 0.23f [[
281
+ ::anno::description("Adds a thin layer of dust which makes the surface a bit more matte when applied."),
282
+ ::anno::display_name("Coating Dust"),
283
+ ::anno::in_group("Coating"),
284
+ ::anno::hard_range(0.f, 1.f),
285
+ ::anno::ui_order(9)
286
+ ]],
287
+ uniform float2 texture_translate = float2(0.f) [[
288
+ ::anno::description("Controls the position of the texture."),
289
+ ::anno::display_name("Texture Translate"),
290
+ ::anno::in_group("Transform"),
291
+ ::anno::ui_order(10)
292
+ ]],
293
+ uniform float texture_rotate = 0.f [[
294
+ ::anno::description("Rotates angle of the texture in degrees."),
295
+ ::anno::display_name("Texture Rotate"),
296
+ ::anno::in_group("Transform"),
297
+ ::anno::soft_range(0.f, 360.f),
298
+ ::anno::ui_order(11)
299
+ ]],
300
+ uniform float2 texture_scale = float2(1.f) [[
301
+ ::anno::description("Larger numbers increase the size."),
302
+ ::anno::display_name("Texture Scale"),
303
+ ::anno::in_group("Transform"),
304
+ ::nvidia::core_definitions::dimension(float2(.60f, .60f)),
305
+ ::preview_scale(2.5f),
306
+ ::anno::ui_order(12)
307
+ ]],
308
+ uniform bool roundcorners_enable = false [[
309
+ ::anno::description("Enables the round corner effect. Comes at a slight performance cost as additional raytracing calls are required to evaluate the round corner effect."),
310
+ ::anno::display_name("Enable Round Corners"),
311
+ ::anno::in_group("Round Corners"),
312
+ ::anno::ui_order(13)
313
+ ]],
314
+ uniform float roundcorners_radius_mm = 1.5f [[
315
+ ::anno::description("Radius of the rounded corners in millimeters."),
316
+ ::anno::display_name("Round Corner Radius (mm)"),
317
+ ::anno::in_group("Round Corners"),
318
+ ::anno::soft_range(0.f, 10.f),
319
+ ::anno::ui_order(14)
320
+ ]],
321
+ uniform bool roundcorners_across_materials = false [[
322
+ ::anno::description("Applies the round corner effect across different materials when enabled."),
323
+ ::anno::display_name("Across Materials"),
324
+ ::anno::in_group("Round Corners"),
325
+ ::anno::ui_order(15)
326
+ ]],
327
+ uniform int uv_space_index = 0 [[
328
+ ::anno::description("Uses selected UV space for material."),
329
+ ::anno::display_name("UV Space Index"),
330
+ ::anno::in_group("Advanced"),
331
+ ::anno::ui_order(16)
332
+ ]])
333
+ [[
334
+ ::anno::author("NVIDIA vMaterials"),
335
+ ::anno::contributor("Rüdiger Raab"),
336
+ ::anno::contributor("Maik Rohland"),
337
+ ::anno::display_name("Carbon Fiber - Shiny Uncoated"),
338
+ ::anno::description(DESCRIPTION),
339
+ ::anno::copyright_notice(COPYRIGHT),
340
+ ::anno::thumbnail("./.thumbs/Carbon_Fiber.Carbon_Fiber.png"),
341
+ ::anno::key_words(string[]("fabric", "composite", "woven", "new", "bumped", "design", "automotive", "black", "dark", "neutral"))
342
+ ]]
343
+ =
344
+ let {
345
+ bool tmp0 = true;
346
+ material_surface tmp1(enable_coating ? ::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf((float3(::base::file_texture(texture_2d("./textures/surface_damages_multi_R_rough_B_rough2.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(coating_damages_scale * 8.f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).y * coating_dust + ::math::max(::math::lerp(::math::lerp(0.f, 0.300000012f, coating_roughness), coating_roughness * ::base::file_texture(texture_2d("./textures/generic_surface_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(coating_damages_scale * 8.f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).mono, histogram_range(coating_roughness_variation, 0.229999989f, 0.300000012f)), float3(::base::file_texture(texture_2d("./textures/surface_damages_multi_R_rough_B_rough2.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(coating_damages_scale * 8.f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x * coating_damages_intensity)) * (float3(::base::file_texture(texture_2d("./textures/surface_damages_multi_R_rough_B_rough2.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(coating_damages_scale * 8.f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).y * coating_dust + ::math::max(::math::lerp(::math::lerp(0.f, 0.300000012f, coating_roughness), coating_roughness * ::base::file_texture(texture_2d("./textures/generic_surface_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(coating_damages_scale * 8.f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).mono, histogram_range(coating_roughness_variation, 0.229999989f, 0.300000012f)), float3(::base::file_texture(texture_2d("./textures/surface_damages_multi_R_rough_B_rough2.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(coating_damages_scale * 8.f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x * coating_damages_intensity)), (float3(::base::file_texture(texture_2d("./textures/surface_damages_multi_R_rough_B_rough2.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(coating_damages_scale * 8.f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).y * coating_dust + ::math::max(::math::lerp(::math::lerp(0.f, 0.300000012f, coating_roughness), coating_roughness * ::base::file_texture(texture_2d("./textures/generic_surface_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(coating_damages_scale * 8.f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).mono, histogram_range(coating_roughness_variation, 0.229999989f, 0.300000012f)), float3(::base::file_texture(texture_2d("./textures/surface_damages_multi_R_rough_B_rough2.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(coating_damages_scale * 8.f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x * coating_damages_intensity)) * (float3(::base::file_texture(texture_2d("./textures/surface_damages_multi_R_rough_B_rough2.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(coating_damages_scale * 8.f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).y * coating_dust + ::math::max(::math::lerp(::math::lerp(0.f, 0.300000012f, coating_roughness), coating_roughness * ::base::file_texture(texture_2d("./textures/generic_surface_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(coating_damages_scale * 8.f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).mono, histogram_range(coating_roughness_variation, 0.229999989f, 0.300000012f)), float3(::base::file_texture(texture_2d("./textures/surface_damages_multi_R_rough_B_rough2.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(coating_damages_scale * 8.f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x * coating_damages_intensity)), color(1.f, 1.f, 1.f), color(0.f, 0.f, 0.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(0.0700000003f, ::df::diffuse_transmission_bsdf(color(::math::pow(histogram_scan_big(float3(::base::file_texture(texture_2d("./textures/carbon_fiber_multi_R_rough_G_cutout_B_patternA.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, 0.48999998f, 0.560000002f), 2.20000005f))), ::df::custom_curve_layer(carbon_fiber_brightness * 0.300000012f + 0.0199999996f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(anisotropy_conversion(histogram_range(float3(::base::file_texture(texture_2d("./textures/carbon_fiber_multi_R_rough_G_cutout_B_patternA.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, 0.769999981f, ::math::lerp(0.300000012f, 0.550000012f, fibers_roughness)), histogram_range(float3(::base::file_texture(texture_2d("./textures/carbon_fiber_multi_R_rough_G_cutout_B_patternA.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, 0.789999962f, ::math::lerp(0.599999964f, 0.75f, fibers_anisotropy)), texture_rotate / 360.f + float3(::base::file_texture(texture_2d("./textures/carbon_fiber_multi_R_rough_G_cutout_B_patternA.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).z * 0.25f, ::state::texture_tangent_u(0)).roughness_u, anisotropy_conversion(histogram_range(float3(::base::file_texture(texture_2d("./textures/carbon_fiber_multi_R_rough_G_cutout_B_patternA.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, 0.769999981f, ::math::lerp(0.300000012f, 0.550000012f, fibers_roughness)), histogram_range(float3(::base::file_texture(texture_2d("./textures/carbon_fiber_multi_R_rough_G_cutout_B_patternA.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, 0.789999962f, ::math::lerp(0.599999964f, 0.75f, fibers_anisotropy)), texture_rotate / 360.f + float3(::base::file_texture(texture_2d("./textures/carbon_fiber_multi_R_rough_G_cutout_B_patternA.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).z * 0.25f, ::state::texture_tangent_u(0)).roughness_v, color(1.f, 1.f, 1.f), color(0.737910986f, 0.737910986f, 0.737910986f), anisotropy_conversion(histogram_range(float3(::base::file_texture(texture_2d("./textures/carbon_fiber_multi_R_rough_G_cutout_B_patternA.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, 0.769999981f, ::math::lerp(0.300000012f, 0.550000012f, fibers_roughness)), histogram_range(float3(::base::file_texture(texture_2d("./textures/carbon_fiber_multi_R_rough_G_cutout_B_patternA.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, 0.789999962f, ::math::lerp(0.599999964f, 0.75f, fibers_anisotropy)), texture_rotate / 360.f + float3(::base::file_texture(texture_2d("./textures/carbon_fiber_multi_R_rough_G_cutout_B_patternA.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).z * 0.25f, ::state::texture_tangent_u(0)).tangent_u, ::df::scatter_reflect), ::df::weighted_layer(0.219999999f, ::df::diffuse_reflection_bsdf(color(::math::pow(histogram_pos_range(float3(::base::file_texture(texture_2d("./textures/carbon_fiber_multi_R_rough_G_cutout_B_patternA.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, 0.469999999f, 0.149999991f), 2.20000005f)), 0.f), bsdf(), ::state::normal()), add_detail_normal(::base::tangent_space_normal_texture(texture_2d("./textures/carbon_fiber_fibers_norm.jpg", ::tex::gamma_linear), 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f, 0.f, int2(0), ::tex::wrap_repeat, 30.f), ::base::tangent_space_normal_texture(texture_2d("./textures/carbon_fiber_weaving_norm.png", ::tex::gamma_linear), weaving_bump_strength, false, false, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.25f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f, 0.f, int2(0), ::tex::wrap_repeat, 30.f))), add_detail_normal(::base::tangent_space_normal_texture(texture_2d("./textures/carbon_fiber_fibers_norm.jpg", ::tex::gamma_linear), 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f, 0.f, int2(0), ::tex::wrap_repeat, 30.f), ::base::tangent_space_normal_texture(texture_2d("./textures/carbon_fiber_weaving_norm.png", ::tex::gamma_linear), weaving_bump_strength, false, false, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.25f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f, 0.f, int2(0), ::tex::wrap_repeat, 30.f))), ::base::tangent_space_normal_texture(texture_2d("./textures/surface_damages_norm.jpg", ::tex::gamma_linear), coating_damages_intensity * 0.5f, false, false, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(coating_damages_scale * 8.f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f, 0.f, int2(0), ::tex::wrap_repeat, 30.f)) : ::df::weighted_layer(0.0700000003f, ::df::diffuse_transmission_bsdf(color(::math::pow(histogram_scan_big(float3(::base::file_texture(texture_2d("./textures/carbon_fiber_multi_R_rough_G_cutout_B_patternA.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, 0.48999998f, 0.560000002f), 2.20000005f))), ::df::custom_curve_layer(carbon_fiber_brightness * 0.300000012f + 0.0199999996f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(anisotropy_conversion(histogram_range(float3(::base::file_texture(texture_2d("./textures/carbon_fiber_multi_R_rough_G_cutout_B_patternA.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, 0.769999981f, ::math::lerp(0.300000012f, 0.550000012f, fibers_roughness)), histogram_range(float3(::base::file_texture(texture_2d("./textures/carbon_fiber_multi_R_rough_G_cutout_B_patternA.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, 0.789999962f, ::math::lerp(0.599999964f, 0.75f, fibers_anisotropy)), texture_rotate / 360.f + float3(::base::file_texture(texture_2d("./textures/carbon_fiber_multi_R_rough_G_cutout_B_patternA.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).z * 0.25f, ::state::texture_tangent_u(0)).roughness_u, anisotropy_conversion(histogram_range(float3(::base::file_texture(texture_2d("./textures/carbon_fiber_multi_R_rough_G_cutout_B_patternA.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, 0.769999981f, ::math::lerp(0.300000012f, 0.550000012f, fibers_roughness)), histogram_range(float3(::base::file_texture(texture_2d("./textures/carbon_fiber_multi_R_rough_G_cutout_B_patternA.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, 0.789999962f, ::math::lerp(0.599999964f, 0.75f, fibers_anisotropy)), texture_rotate / 360.f + float3(::base::file_texture(texture_2d("./textures/carbon_fiber_multi_R_rough_G_cutout_B_patternA.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).z * 0.25f, ::state::texture_tangent_u(0)).roughness_v, color(1.f, 1.f, 1.f), color(0.737910986f, 0.737910986f, 0.737910986f), anisotropy_conversion(histogram_range(float3(::base::file_texture(texture_2d("./textures/carbon_fiber_multi_R_rough_G_cutout_B_patternA.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, 0.769999981f, ::math::lerp(0.300000012f, 0.550000012f, fibers_roughness)), histogram_range(float3(::base::file_texture(texture_2d("./textures/carbon_fiber_multi_R_rough_G_cutout_B_patternA.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, 0.789999962f, ::math::lerp(0.599999964f, 0.75f, fibers_anisotropy)), texture_rotate / 360.f + float3(::base::file_texture(texture_2d("./textures/carbon_fiber_multi_R_rough_G_cutout_B_patternA.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).z * 0.25f, ::state::texture_tangent_u(0)).tangent_u, ::df::scatter_reflect), ::df::weighted_layer(0.219999999f, ::df::diffuse_reflection_bsdf(color(::math::pow(histogram_pos_range(float3(::base::file_texture(texture_2d("./textures/carbon_fiber_multi_R_rough_G_cutout_B_patternA.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, 0.469999999f, 0.149999991f), 2.20000005f)), 0.f), bsdf(), ::state::normal()), add_detail_normal(::base::tangent_space_normal_texture(texture_2d("./textures/carbon_fiber_fibers_norm.jpg", ::tex::gamma_linear), 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f, 0.f, int2(0), ::tex::wrap_repeat, 30.f), ::base::tangent_space_normal_texture(texture_2d("./textures/carbon_fiber_weaving_norm.png", ::tex::gamma_linear), weaving_bump_strength, false, false, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.25f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f, 0.f, int2(0), ::tex::wrap_repeat, 30.f))), add_detail_normal(::base::tangent_space_normal_texture(texture_2d("./textures/carbon_fiber_fibers_norm.jpg", ::tex::gamma_linear), 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f, 0.f, int2(0), ::tex::wrap_repeat, 30.f), ::base::tangent_space_normal_texture(texture_2d("./textures/carbon_fiber_weaving_norm.png", ::tex::gamma_linear), weaving_bump_strength, false, false, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.25f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f, 0.f, int2(0), ::tex::wrap_repeat, 30.f))), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
347
+ material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
348
+ color tmp3 = color(1.f, 1.f, 1.f);
349
+ 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));
350
+ material_geometry tmp5(float3(0.f), 1.f, roundcorners_enable ? ::state::rounded_corner_normal(roundcorners_radius_mm * 0.00100000005f, true, float(roundcorners_across_materials)) : ::state::normal());
351
+ } in
352
+ material(
353
+ thin_walled: tmp0,
354
+ surface: tmp1,
355
+ backface: tmp2,
356
+ ior: tmp3,
357
+ volume: tmp4,
358
+ geometry: tmp5,
359
+ hair: hair_bsdf());
360
+
361
+ // 2
362
+ export material Carbon_Fiber_Matte_Uncoated(*)
363
+ [[
364
+ ::anno::author("NVIDIA vMaterials"),
365
+ ::anno::contributor("Rüdiger Raab"),
366
+ ::anno::contributor("Maik Rohland"),
367
+ ::anno::display_name("Carbon Fiber - Matte Uncoated"),
368
+ ::anno::description(DESCRIPTION),
369
+ ::anno::copyright_notice(COPYRIGHT),
370
+ ::anno::thumbnail("./.thumbs/Carbon_Fiber.Carbon_Fiber_Matte_Uncoated.png"),
371
+ ::anno::key_words(string[]("fabric", "composite", "woven", "new", "matte", "bumped", "design", "automotive", "black", "dark", "neutral"))
372
+ ]] = Carbon_Fiber(
373
+ carbon_fiber_brightness: 0.22f,
374
+ fibers_roughness: 0.75f,
375
+ fibers_anisotropy: 0.18f,
376
+ weaving_bump_strength: 1.0f,
377
+ enable_coating: false,
378
+ coating_roughness: 0.0f,
379
+ coating_roughness_variation: 0.36f,
380
+ coating_damages_intensity: 0.0f,
381
+ coating_damages_scale: 1.00f,
382
+ coating_dust: 0.23f,
383
+ texture_translate: float2(0.0f),
384
+ texture_rotate: 0.0f,
385
+ texture_scale: float2(1.0f),
386
+ roundcorners_enable: false,
387
+ roundcorners_radius_mm: 1.5f,
388
+ roundcorners_across_materials: false,
389
+ uv_space_index: 0
390
+ );
391
+
392
+ // 3
393
+ export material Carbon_Fiber_Shiny_Coating(*)
394
+ [[
395
+ ::anno::author("NVIDIA vMaterials"),
396
+ ::anno::contributor("Rüdiger Raab"),
397
+ ::anno::contributor("Maik Rohland"),
398
+ ::anno::display_name("Carbon Fiber - Shiny Coating"),
399
+ ::anno::description(DESCRIPTION),
400
+ ::anno::copyright_notice(COPYRIGHT),
401
+ ::anno::thumbnail("./.thumbs/Carbon_Fiber.Carbon_Fiber_Shiny_Coating.png"),
402
+ ::anno::key_words(string[]("fabric", "composite", "woven", "new", "coated", "smooth", "design", "automotive", "coated", "black", "dark", "neutral"))
403
+ ]] = Carbon_Fiber(
404
+ carbon_fiber_brightness: 0.22f,
405
+ fibers_roughness: 0.41f,
406
+ fibers_anisotropy: 0.22f,
407
+ weaving_bump_strength: 1.0f,
408
+ enable_coating: true,
409
+ coating_roughness: 0.0f,
410
+ coating_roughness_variation: 0.36f,
411
+ coating_damages_intensity: 0.0f,
412
+ coating_damages_scale: 1.00f,
413
+ coating_dust: 0.15f,
414
+ texture_translate: float2(0.0f),
415
+ texture_rotate: 0.0f,
416
+ texture_scale: float2(1.0f),
417
+ roundcorners_enable: false,
418
+ roundcorners_radius_mm: 1.5f,
419
+ roundcorners_across_materials: false,
420
+ uv_space_index: 0
421
+ );
422
+
423
+
424
+ // 4
425
+ export material Carbon_Fiber_Worn_Coating(*)
426
+ [[
427
+ ::anno::author("NVIDIA vMaterials"),
428
+ ::anno::contributor("Rüdiger Raab"),
429
+ ::anno::contributor("Maik Rohland"),
430
+ ::anno::display_name("Carbon Fiber - Worn Coating"),
431
+ ::anno::description(DESCRIPTION),
432
+ ::anno::copyright_notice(COPYRIGHT),
433
+ ::anno::thumbnail("./.thumbs/Carbon_Fiber.Carbon_Fiber_Worn_Coating.png"),
434
+ ::anno::key_words(string[]("fabric", "composite", "woven", "worn", "used", "old", "scratched", "shiny", "bumped", "design", "automotive", "coated", "black", "dark", "neutral"))
435
+ ]] = Carbon_Fiber(
436
+ carbon_fiber_brightness: 0.22f,
437
+ fibers_roughness: 0.41f,
438
+ fibers_anisotropy: 0.18f,
439
+ weaving_bump_strength: 1.0f,
440
+ enable_coating: true,
441
+ coating_roughness: 0.0f,
442
+ coating_roughness_variation: 0.96f,
443
+ coating_damages_intensity: 0.97f,
444
+ coating_damages_scale: 1.00f,
445
+ coating_dust: 0.73f,
446
+ texture_translate: float2(0.0f),
447
+ texture_rotate: 0.0f,
448
+ texture_scale: float2(1.0f),
449
+ roundcorners_enable: false,
450
+ roundcorners_radius_mm: 1.5f,
451
+ roundcorners_across_materials: false,
452
+ uv_space_index: 0
453
+ );
454
+
455
+ // 5
456
+ export material Carbon_Fiber_Matte_Coating(*)
457
+ [[
458
+ ::anno::author("NVIDIA vMaterials"),
459
+ ::anno::contributor("Rüdiger Raab"),
460
+ ::anno::contributor("Maik Rohland"),
461
+ ::anno::display_name("Carbon Fiber - Matte Coating"),
462
+ ::anno::description(DESCRIPTION),
463
+ ::anno::copyright_notice(COPYRIGHT),
464
+ ::anno::thumbnail("./.thumbs/Carbon_Fiber.Carbon_Fiber_Matte_Coating.png"),
465
+ ::anno::key_words(string[]("fabric", "composite", "woven", "new", "matte", "design", "automotive", "coated", "black", "dark", "neutral"))
466
+ ]] = Carbon_Fiber(
467
+ carbon_fiber_brightness: 0.22f,
468
+ fibers_roughness: 0.41f,
469
+ fibers_anisotropy: 0.18f,
470
+ weaving_bump_strength: 1.0f,
471
+ enable_coating: true,
472
+ coating_roughness: 0.74f,
473
+ coating_roughness_variation: 0.36f,
474
+ coating_damages_intensity: 0.0f,
475
+ coating_damages_scale: 1.0f,
476
+ coating_dust: 0.23f,
477
+ texture_translate: float2(0.0f),
478
+ texture_rotate: 0.0f,
479
+ texture_scale: float2(1.0f),
480
+ roundcorners_enable: false,
481
+ roundcorners_radius_mm: 1.5f,
482
+ roundcorners_across_materials: false,
483
+ uv_space_index: 0
484
+ );
485
+
486
+ //6
487
+ export material Carbon_Fiber_Dusty_Coating(*)
488
+ [[
489
+ ::anno::author("NVIDIA vMaterials"),
490
+ ::anno::contributor("Rüdiger Raab"),
491
+ ::anno::contributor("Maik Rohland"),
492
+ ::anno::display_name("Carbon Fiber - Dusty Coating"),
493
+ ::anno::description(DESCRIPTION),
494
+ ::anno::copyright_notice(COPYRIGHT),
495
+ ::anno::thumbnail("./.thumbs/Carbon_Fiber.Carbon_Fiber_Dusty_Coating.png"),
496
+ ::anno::key_words(string[]("fabric", "composite", "woven", "shiny", "bumped", "design", "automotive", "coated", "black", "dark", "neutral"))
497
+ ]] = Carbon_Fiber(
498
+ carbon_fiber_brightness: 0.22f,
499
+ fibers_roughness: 0.41f,
500
+ fibers_anisotropy: 0.18f,
501
+ weaving_bump_strength: 1.0f,
502
+ enable_coating: true,
503
+ coating_roughness: 0.08f,
504
+ coating_roughness_variation: 0.5f,
505
+ coating_damages_intensity: 0.12f,
506
+ coating_damages_scale: 0.65f,
507
+ coating_dust: 1.0f,
508
+ texture_translate: float2(0.0f),
509
+ texture_rotate: 0.0f,
510
+ texture_scale: float2(1.0f),
511
+ roundcorners_enable: false,
512
+ roundcorners_radius_mm: 1.5f,
513
+ roundcorners_across_materials: false,
514
+ uv_space_index: 0
515
+ );
516
+
517
+ //7
518
+ export material Carbon_Fiber_Aluminized(*)
519
+ [[
520
+ ::anno::author("NVIDIA vMaterials"),
521
+ ::anno::contributor("Rüdiger Raab"),
522
+ ::anno::contributor("Maik Rohland"),
523
+ ::anno::display_name("Carbon Fiber - Aluminized"),
524
+ ::anno::description(DESCRIPTION),
525
+ ::anno::copyright_notice(COPYRIGHT),
526
+ ::anno::thumbnail("./.thumbs/Carbon_Fiber.Carbon_Fiber_Aluminized.png"),
527
+ ::anno::key_words(string[]("fabric", "composite", "woven", "shiny", "bumped", "design", "automotive", "aluminum", "gray", "neutral"))
528
+ ]] = Carbon_Fiber(
529
+ carbon_fiber_brightness: 0.58f,
530
+ fibers_roughness: 0.41f,
531
+ fibers_anisotropy: 0.18f,
532
+ weaving_bump_strength: 1.3f,
533
+ enable_coating: false,
534
+ coating_roughness: 0.08f,
535
+ coating_roughness_variation: 0.5f,
536
+ coating_damages_intensity: 0.08f,
537
+ coating_damages_scale: 0.65f,
538
+ coating_dust: 0.05f,
539
+ texture_translate: float2(0.0f),
540
+ texture_rotate: 0.0f,
541
+ texture_scale: float2(1.0f),
542
+ roundcorners_enable: false,
543
+ roundcorners_radius_mm: 1.5f,
544
+ roundcorners_across_materials: false,
545
+ uv_space_index: 0
546
+ );
547
+
548
+
549
+ //8
550
+ export material Carbon_Fiber_Aluminized_Coated(*)
551
+ [[
552
+ ::anno::author("NVIDIA vMaterials"),
553
+ ::anno::contributor("Rüdiger Raab"),
554
+ ::anno::contributor("Maik Rohland"),
555
+ ::anno::display_name("Carbon Fiber - Aluminized Coated"),
556
+ ::anno::description(DESCRIPTION),
557
+ ::anno::copyright_notice(COPYRIGHT),
558
+ ::anno::thumbnail("./.thumbs/Carbon_Fiber.Carbon_Fiber_Aluminized_Coated.png"),
559
+ ::anno::key_words(string[]("fabric", "composite", "woven", "shiny", "bumped", "design", "automotive", "aluminum", "coated", "gray", "neutral"))
560
+ ]] = Carbon_Fiber(
561
+ carbon_fiber_brightness: 0.58f,
562
+ fibers_roughness: 0.41f,
563
+ fibers_anisotropy: 0.18f,
564
+ weaving_bump_strength: 1.3f,
565
+ enable_coating: true,
566
+ coating_roughness: 0.08f,
567
+ coating_roughness_variation: 0.5f,
568
+ coating_damages_intensity: 0.08f,
569
+ coating_damages_scale: 0.65f,
570
+ coating_dust: 0.05f,
571
+ texture_translate: float2(0.0f),
572
+ texture_rotate: 0.0f,
573
+ texture_scale: float2(1.0f),
574
+ roundcorners_enable: false,
575
+ roundcorners_radius_mm: 1.5f,
576
+ roundcorners_across_materials: false,
577
+ uv_space_index: 0
578
+ );
code/third_party/vMaterials_2/Composite/Fiberglass.mdl ADDED
@@ -0,0 +1,394 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2024 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
+
37
+ mdl 1.5;
38
+
39
+ import ::anno::*;
40
+ import ::base::*;
41
+ import ::df::*;
42
+ import ::math::*;
43
+ import ::state::*;
44
+ import ::tex::*;
45
+ import ::nvidia::core_definitions::blend_colors;
46
+ import ::nvidia::core_definitions::dimension;
47
+
48
+ const string COPYRIGHT =
49
+ " Copyright 2024 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
+ annotation preview_scale( float f);
62
+
63
+ ::base::texture_coordinate_info transform_coordinate_2(
64
+ float4x4 transform
65
+ [[ ::anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix.") ]],
66
+ ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info()
67
+ [[ ::anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection.") ]]
68
+ ) [[
69
+ ::anno::description("Transform a texture coordinate by a matrix.") ,
70
+ ::anno::noinline()
71
+ ]]
72
+ {
73
+ // Version 2
74
+ float4 r_position = transform * float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1);
75
+ //Try aproximating it for the case that the rotation is only aroud z and assuming the texture layout is nice and z is ~constant.
76
+ //just pretend there is no other rotation happening
77
+ //get rid of scaling and translation. Then extract fields where sin and cos would be in a simple 2d transform around z.
78
+ float4 u = transform[0];
79
+ float3 ru = ::math::normalize(float3(u.x,u.y,u.z));
80
+ float cos = ru.x;
81
+ float sin = -ru.y;
82
+ //TODO: at least also handle sign of z?
83
+ //TODO: handle tangent becoming 0
84
+
85
+
86
+ return ::base::texture_coordinate_info(
87
+ float3(r_position.x,r_position.y,r_position.z),
88
+ ::math::normalize(cos * coordinate.tangent_u - sin * coordinate.tangent_v),
89
+ ::math::normalize(cos * coordinate.tangent_v + sin * coordinate.tangent_u));
90
+ }
91
+
92
+
93
+ ::base::texture_coordinate_info vmat_transform(
94
+ float2 translation = float2(0.0, 0.0),
95
+ float rotation = 0.0, // rotation in degrees
96
+ float2 scaling = float2(1.0, 1.0),
97
+ uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw,
98
+ uniform int uv_space = 0
99
+ )
100
+ {
101
+ float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f;
102
+ float4x4 scale =
103
+ float4x4(1.0 /scaling.x, 0. , 0. , 0.,
104
+ 0. , 1.0 /scaling.y , 0. , 0.,
105
+ 0. , 0. , 1.0, 0.,
106
+ translation.x , translation.y , 0.0, 1.);
107
+
108
+ float s = ::math::sin(rotation_rad);
109
+ float c = ::math::cos(rotation_rad);
110
+ float4x4 rotate =
111
+ float4x4( c , -s , 0.0 , 0.0,
112
+ s , c , 0.0 , 0.0,
113
+ 0.0, 0.0 , 1.0 , 0.0,
114
+ 0. , 0.0 , 0.0 , 1.);
115
+
116
+ return transform_coordinate_2(scale*rotate, ::base::coordinate_source(system, uv_space));
117
+ }
118
+
119
+
120
+ float remap_xy_to_0_1(float input, float x, float y)
121
+ {
122
+ return (input - x)/(y - x);
123
+ }
124
+
125
+ float histogram_range(float input, float range = 1.0f, float position = 0.5f)
126
+ {
127
+ float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0);
128
+ float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0);
129
+ return ::math::lerp(low, high, input);
130
+ }
131
+
132
+ float histogram_scan(float input, float width, float position)
133
+ {
134
+ float low = ::math::clamp(1.0f - position * 2.0, 0.0f ,1.0f);
135
+ float high = ::math::clamp(position > 0.5f ? 1.0 : 2.0f - 2 * position, 0.0f, 1.0f);
136
+ //float center = (low + high)/2.0f);
137
+ float offset = ((high - low) / 2.0) * width;
138
+ low += offset;
139
+ high -= offset;
140
+ return ::math::clamp(
141
+ remap_xy_to_0_1(input,
142
+ low,
143
+ high),
144
+ 0.0,
145
+ 1.0);
146
+ }
147
+
148
+ // Returns the normal n in tangent space, given n is in internal space.
149
+ float3 transform_internal_to_tangent(float3 n)
150
+ [[
151
+ ::anno::hidden()
152
+ ]]
153
+ {
154
+ return
155
+ n.x* float3(::state::texture_tangent_u(0).x,::state::texture_tangent_v(0).x,::state::normal().x)+
156
+ n.y* float3(::state::texture_tangent_u(0).y,::state::texture_tangent_v(0).y,::state::normal().y)+
157
+ n.z* float3(::state::texture_tangent_u(0).z,::state::texture_tangent_v(0).z,::state::normal().z);
158
+ }
159
+
160
+ // Returns the normal n in internal space, given n is in tangent space.
161
+ float3 transform_tangent_to_internal(float3 n)
162
+ [[
163
+ ::anno::hidden()
164
+ ]]
165
+ {
166
+ return ::state::texture_tangent_u(0) * n.x +
167
+ ::state::texture_tangent_v(0) * n.y +
168
+ ::state::normal() * n.z ;
169
+ }
170
+
171
+
172
+
173
+ // Returns a normal by adding a detail normal to a global normal.
174
+ // If detail blending of two normal maps gives visual artifacts, check if texture_2d are loaded
175
+ // correctly with ::tex::gamma_linear
176
+ float3 add_detail_normal(float3 nd = ::state::normal(), float3 n = ::state::normal())
177
+ {
178
+ // http://blog.selfshadow.com/publications/blending-in-detail/
179
+ float3 n_t = transform_internal_to_tangent(n);
180
+ float3 nd_t = transform_internal_to_tangent(nd);
181
+
182
+ n_t=n_t + float3(0.,0.,1.);
183
+ nd_t = nd_t * float3(-1.,-1.,1.);
184
+ n = n_t*::math::dot(n_t, nd_t)/n_t.z - nd_t;
185
+ return ::math::normalize(transform_tangent_to_internal(n));
186
+ }
187
+
188
+ export material Fiberglass(
189
+ float fibers_shininess = 0.5f [[
190
+ ::anno::description("Makes the fiber glass material duller or shinier. Default value is 0.5."),
191
+ ::anno::display_name("Fibers Shininess"),
192
+ ::anno::in_group("Appearance"),
193
+ ::anno::hard_range(0.f, 1.f),
194
+ ::anno::ui_order(0)
195
+ ]],
196
+ color fiberglass_tint = color(.8f) [[
197
+ ::anno::description("Tints the glass fiber material."),
198
+ ::anno::display_name("Fiberglass Tint"),
199
+ ::anno::in_group("Appearance", "Diffuse"),
200
+ ::anno::ui_order(1)
201
+ ]],
202
+ uniform float weaving_bump_strength = 1.0f [[
203
+ ::anno::description("Determines the degree of bumpiness."),
204
+ ::anno::display_name("Weaving Bump Strength"),
205
+ ::anno::in_group("Appearance", "Bump"),
206
+ ::anno::soft_range(0.f, 1.f),
207
+ ::anno::hard_range(0.f, 3.f),
208
+ ::anno::ui_order(2)
209
+ ]],
210
+ uniform float fibers_bump_strength = 1.f [[
211
+ ::anno::description("Determines the degree of bumpiness of the fibers."),
212
+ ::anno::display_name("Fibers Bump Strength"),
213
+ ::anno::in_group("Appearance", "Bump"),
214
+ ::anno::hard_range(0.f, 3.f),
215
+ ::anno::soft_range(0.f, 1.f),
216
+ ::anno::ui_order(3)
217
+ ]],
218
+ float diffuse_brightness = 0.61f [[
219
+ ::anno::description("The diffuse brightness of the fibers."),
220
+ ::anno::display_name("Diffuse Brightness"),
221
+ ::anno::in_group("Appearance", "Advanced"),
222
+ ::anno::hard_range(0.f, 1.f),
223
+ ::anno::ui_order(5)
224
+ ]],
225
+ float specular_weight = 1.f [[
226
+ ::anno::description("The amount of glossiness variation for the vertical fiber glossiness."),
227
+ ::anno::display_name("Specular Weight"),
228
+ ::anno::in_group("Appearance", "Advanced"),
229
+ ::anno::hard_range(0.f, 1.f),
230
+ ::anno::ui_order(4)
231
+ ]],
232
+ float diffuse_transmission_weight = 0.21f [[
233
+ ::anno::description("Weight of the diffuse transmission."),
234
+ ::anno::display_name("Diffuse Transmission Weight"),
235
+ ::anno::in_group("Appearance", "Advanced"),
236
+ ::anno::hard_range(0.f, 1.f),
237
+ ::anno::ui_order(6)
238
+ ]],
239
+ float2 texture_translate = float2(0.f) [[
240
+ ::anno::description("Controls the position of the texture."),
241
+ ::anno::display_name("Texture Translate"),
242
+ ::anno::in_group("Transform"),
243
+ ::anno::ui_order(10)
244
+ ]],
245
+ float texture_rotate = 0.f [[
246
+ ::anno::description("Rotates angle of the texture in degrees."),
247
+ ::anno::display_name("Texture Rotate"),
248
+ ::anno::in_group("Transform"),
249
+ ::anno::soft_range(0.f, 360.f),
250
+ ::anno::ui_order(11)
251
+ ]],
252
+ float2 texture_scale = float2(1.0f) [[
253
+ ::anno::description("Larger numbers increase the size."),
254
+ ::anno::display_name("Texture Scale"),
255
+ ::anno::in_group("Transform"),
256
+ ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)),
257
+ ::preview_scale(2.5f),
258
+ ::anno::ui_order(12)
259
+ ]],
260
+ uniform int uv_space_index = 0 [[
261
+ ::anno::description("The UV space to use for the texture mapping."),
262
+ ::anno::display_name("UV Space Index"),
263
+ ::anno::in_group("Advanced"),
264
+ ::anno::ui_order(13)
265
+ ]])
266
+ [[
267
+ ::anno::description("A fiberglass material."),
268
+ ::anno::display_name("Fiberglass"),
269
+ ::anno::copyright_notice(COPYRIGHT),
270
+ ::anno::thumbnail("./.thumbs/Fiberglass.Fiberglass.png"),
271
+ ::anno::key_words(string[]("fiber", "fiberglass", "artificial", "design", "fabric", "mesh", "woven", "synthetic", "white", "light", "neutral")),
272
+ ::anno::author("NVIDIA vMaterials"),
273
+ ::anno::contributor("Ruediger Raab"),
274
+ ::anno::contributor("Maik Rohland")
275
+ ]]
276
+ =
277
+ let {
278
+
279
+ float2 texture_rescale = texture_scale * 0.1f;
280
+
281
+ bool tmp0 = false;
282
+ material_surface tmp1(::df::weighted_layer(diffuse_transmission_weight, ::df::diffuse_transmission_bsdf(nvidia::core_definitions::blend_colors(color(histogram_range(float3(::base::file_texture(texture_2d("./textures/fiberglass_multi_R_rough_G_ao_B_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, 0.810000002f)), fiberglass_tint, ::base::color_layer_multiply, 1.f).tint), ::df::custom_curve_layer(specular_weight, 1.f, 5.f, histogram_scan(float3(::base::file_texture(texture_2d("./textures/fiberglass_multi_R_rough_G_ao_B_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.f, 0.469999999f), ::df::microfacet_ggx_smith_bsdf(::math::max(::math::smoothstep(0.789999962f, 0.790999949f, float3(::base::file_texture(texture_2d("./textures/fiberglass_multi_R_rough_G_ao_B_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2]) * histogram_range(float3(::base::file_texture(texture_2d("./textures/fiberglass_multi_R_rough_G_ao_B_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.389999986f, 0.0799999982f, fibers_shininess)), histogram_range(float3(::base::file_texture(texture_2d("./textures/fiberglass_multi_R_rough_G_ao_B_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.800000012f, 0.5f, fibers_shininess)) * ::math::min(1.f - ::math::smoothstep(0.50999999f, 0.539999962f, float3(::base::file_texture(texture_2d("./textures/fiberglass_multi_R_rough_G_ao_B_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2]), ::math::smoothstep(0.340000004f, 0.389999986f, float3(::base::file_texture(texture_2d("./textures/fiberglass_multi_R_rough_G_ao_B_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2]))), ::math::max(::math::smoothstep(0.789999962f, 0.790999949f, float3(::base::file_texture(texture_2d("./textures/fiberglass_multi_R_rough_G_ao_B_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2]) * histogram_range(float3(::base::file_texture(texture_2d("./textures/fiberglass_multi_R_rough_G_ao_B_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.800000012f, 0.5f, fibers_shininess)), histogram_range(float3(::base::file_texture(texture_2d("./textures/fiberglass_multi_R_rough_G_ao_B_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.389999986f, 0.0799999982f, fibers_shininess)) * ::math::min(1.f - ::math::smoothstep(0.50999999f, 0.539999962f, float3(::base::file_texture(texture_2d("./textures/fiberglass_multi_R_rough_G_ao_B_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2]), ::math::smoothstep(0.340000004f, 0.389999986f, float3(::base::file_texture(texture_2d("./textures/fiberglass_multi_R_rough_G_ao_B_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2]))), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(color(histogram_range(float3(::base::file_texture(texture_2d("./textures/fiberglass_multi_R_rough_G_ao_B_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, diffuse_brightness)), fiberglass_tint, ::base::color_layer_multiply, 1.f).tint, 0.f), ::state::normal()), ::state::normal()), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
283
+ material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
284
+ color tmp3 = color(1.f, 1.f, 1.f);
285
+ 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));
286
+ material_geometry tmp5(float3(0.f), ::math::smoothstep(0.0299999993f, 0.0309999995f, float3(::base::file_texture(texture_2d("./textures/fiberglass_multi_R_rough_G_ao_B_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2]), add_detail_normal(::base::file_bump_texture(texture_2d("./textures/fiberglass_bump.jpg", ::tex::gamma_linear), fibers_bump_strength, ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, ::state::normal(), false), ::base::tangent_space_normal_texture(texture_2d("./textures/fiberglass_norm.jpg", ::tex::gamma_linear), weaving_bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)));
287
+ hair_bsdf tmp6 = hair_bsdf();
288
+ } in
289
+ material(
290
+ thin_walled: tmp0,
291
+ surface: tmp1,
292
+ backface: tmp2,
293
+ ior: tmp3,
294
+ volume: tmp4,
295
+ geometry: tmp5,
296
+ hair: tmp6);
297
+
298
+
299
+ export material Fiberglass_Flat_Weave(*)
300
+ [[
301
+ ::anno::description("A fiberglass material."),
302
+ ::anno::display_name("Fiberglass Flat Weave"),
303
+ ::anno::copyright_notice(COPYRIGHT),
304
+ ::anno::thumbnail("./.thumbs/Fiberglass.Fiberglass_Flat_Weave.png"),
305
+ ::anno::key_words(string[]("fiber", "fiberglass", "artificial", "design", "fabric", "mesh", "woven", "synthetic", "white", "light", "neutral")),
306
+ ::anno::author("NVIDIA vMaterials"),
307
+ ::anno::contributor("Ruediger Raab"),
308
+ ::anno::contributor("Maik Rohland")
309
+ ]] = Fiberglass(
310
+ fibers_shininess: 0.5f,
311
+ fiberglass_tint: color(.85f),
312
+ weaving_bump_strength: 0.3f,
313
+ fibers_bump_strength: 1.0f,
314
+ specular_weight: 1.0f,
315
+ diffuse_brightness: 0.7f,
316
+ diffuse_transmission_weight: 0.21f,
317
+ texture_translate: float2(0.0f),
318
+ texture_rotate: 0.0f,
319
+ texture_scale: float2(1.0f),
320
+ uv_space_index: 0
321
+ );
322
+
323
+ export material Fiberglass_Shiny(*)
324
+ [[
325
+ ::anno::description("A fiberglass material."),
326
+ ::anno::display_name("Fiberglass Shiny"),
327
+ ::anno::copyright_notice(COPYRIGHT),
328
+ ::anno::thumbnail("./.thumbs/Fiberglass.Fiberglass_Shiny.png"),
329
+ ::anno::key_words(string[]("fiber", "fiberglass", "artificial", "design", "fabric", "mesh", "woven", "synthetic", "white", "light", "neutral")),
330
+ ::anno::author("NVIDIA vMaterials"),
331
+ ::anno::contributor("Ruediger Raab"),
332
+ ::anno::contributor("Maik Rohland")
333
+ ]] = Fiberglass(
334
+ fibers_shininess: 1.0f,
335
+ fiberglass_tint: color(.8f),
336
+ weaving_bump_strength: 0.75f,
337
+ fibers_bump_strength: 1.0f,
338
+ specular_weight: 1.0f,
339
+ diffuse_brightness: 0.75f,
340
+ diffuse_transmission_weight: 0.21f,
341
+ texture_translate: float2(0.0f),
342
+ texture_rotate: 0.0f,
343
+ texture_scale: float2(1.0f),
344
+ uv_space_index: 0
345
+ );
346
+
347
+ export material Fiberglass_Yellowish(*)
348
+ [[
349
+ ::anno::description("A fiberglass material."),
350
+ ::anno::display_name("Fiberglass Yellowish"),
351
+ ::anno::copyright_notice(COPYRIGHT),
352
+ ::anno::thumbnail("./.thumbs/Fiberglass.Fiberglass_Yellowish.png"),
353
+ ::anno::key_words(string[]("fiber", "fiberglass", "artificial", "design", "fabric", "mesh", "woven", "synthetic", "yellow", "light", "neutral")),
354
+ ::anno::author("NVIDIA vMaterials"),
355
+ ::anno::contributor("Ruediger Raab"),
356
+ ::anno::contributor("Maik Rohland")
357
+ ]] = Fiberglass(
358
+ fibers_shininess: 0.0f,
359
+ fiberglass_tint: color(0.875138f, 0.812241f, 0.348865f),
360
+ weaving_bump_strength: 0.75f,
361
+ fibers_bump_strength: 1.0f,
362
+ specular_weight: 1.0f,
363
+ diffuse_brightness: 0.75f,
364
+ diffuse_transmission_weight: 0.21f,
365
+ texture_translate: float2(0.0f),
366
+ texture_rotate: 0.0f,
367
+ texture_scale: float2(1.0f),
368
+ uv_space_index: 0
369
+ );
370
+
371
+
372
+ export material Fiberglass_Blueish(*)
373
+ [[
374
+ ::anno::description("A fiberglass material."),
375
+ ::anno::display_name("Fiberglass Blueish"),
376
+ ::anno::copyright_notice(COPYRIGHT),
377
+ ::anno::thumbnail("./.thumbs/Fiberglass.Fiberglass_Blueish.png"),
378
+ ::anno::key_words(string[]("fiber", "fiberglass", "artificial", "design", "fabric", "mesh", "woven", "synthetic", "white", "blue", "light", "neutral")),
379
+ ::anno::author("NVIDIA vMaterials"),
380
+ ::anno::contributor("Ruediger Raab"),
381
+ ::anno::contributor("Maik Rohland")
382
+ ]] = Fiberglass(
383
+ fibers_shininess: 0.0f,
384
+ fiberglass_tint: color(0.744530f, 0.915750f, 0.957370f),
385
+ weaving_bump_strength: 0.75f,
386
+ fibers_bump_strength: .75f,
387
+ specular_weight: 1.0f,
388
+ diffuse_brightness: 0.75f,
389
+ diffuse_transmission_weight: 0.21f,
390
+ texture_translate: float2(0.0f),
391
+ texture_rotate: 0.0f,
392
+ texture_scale: float2(1.0f),
393
+ uv_space_index: 0
394
+ );
code/third_party/vMaterials_2/Composite/Fiberglass_Imperfections.mdl ADDED
@@ -0,0 +1,878 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2024 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
+
37
+ mdl 1.5;
38
+
39
+ import ::anno::*;
40
+ import ::base::*;
41
+ import ::df::*;
42
+ import ::math::*;
43
+ import ::state::*;
44
+ import ::tex::*;
45
+ import ::nvidia::core_definitions::blend_colors;
46
+ import ::nvidia::core_definitions::dimension;
47
+
48
+
49
+ const string COPYRIGHT =
50
+ " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
51
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
52
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
53
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
54
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
55
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
56
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
57
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
58
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
59
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
60
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
61
+
62
+ annotation preview_scale( float f);
63
+
64
+ ::base::texture_coordinate_info warped_coordinate(
65
+ // uniform texture_2d warp_texture,
66
+ float warp_value,
67
+ float amount,
68
+ float angle,
69
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source()
70
+ )
71
+ {
72
+ uvw.position = float3(uvw.position.x + amount * warp_value * ::math::sin(angle),
73
+ uvw.position.y + amount * warp_value * ::math::cos(angle),
74
+ uvw.position.z
75
+ );
76
+ return uvw;
77
+ }
78
+
79
+
80
+ ::base::texture_coordinate_info transform_coordinate_2(
81
+ float4x4 transform
82
+ [[ ::anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix.") ]],
83
+ ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info()
84
+ [[ ::anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection.") ]]
85
+ ) [[
86
+ ::anno::description("Transform a texture coordinate by a matrix.") ,
87
+ ::anno::noinline()
88
+ ]]
89
+ {
90
+ // Version 2
91
+ float4 r_position = transform * float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1);
92
+ //Try aproximating it for the case that the rotation is only aroud z and assuming the texture layout is nice and z is ~constant.
93
+ //just pretend there is no other rotation happening
94
+ //get rid of scaling and translation. Then extract fields where sin and cos would be in a simple 2d transform around z.
95
+ float4 u = transform[0];
96
+ float3 ru = ::math::normalize(float3(u.x,u.y,u.z));
97
+ float cos = ru.x;
98
+ float sin = -ru.y;
99
+ //TODO: at least also handle sign of z?
100
+ //TODO: handle tangent becoming 0
101
+
102
+
103
+ return ::base::texture_coordinate_info(
104
+ float3(r_position.x,r_position.y,r_position.z),
105
+ ::math::normalize(cos * coordinate.tangent_u - sin * coordinate.tangent_v),
106
+ ::math::normalize(cos * coordinate.tangent_v + sin * coordinate.tangent_u));
107
+ }
108
+
109
+
110
+ ::base::texture_coordinate_info vmat_transform(
111
+ float2 translation = float2(0.0, 0.0),
112
+ float rotation = 0.0, // rotation in degrees
113
+ float2 scaling = float2(1.0, 1.0),
114
+ uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw,
115
+ uniform int uv_space = 0
116
+ )
117
+ {
118
+ float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f;
119
+ float4x4 scale =
120
+ float4x4(1.0 /scaling.x, 0. , 0. , 0.,
121
+ 0. , 1.0 /scaling.y , 0. , 0.,
122
+ 0. , 0. , 1.0, 0.,
123
+ translation.x , translation.y , 0.0, 1.);
124
+
125
+ float s = ::math::sin(rotation_rad);
126
+ float c = ::math::cos(rotation_rad);
127
+ float4x4 rotate =
128
+ float4x4( c , -s , 0.0 , 0.0,
129
+ s , c , 0.0 , 0.0,
130
+ 0.0, 0.0 , 1.0 , 0.0,
131
+ 0. , 0.0 , 0.0 , 1.);
132
+
133
+ return transform_coordinate_2(scale*rotate, ::base::coordinate_source(system, uv_space));
134
+ }
135
+
136
+ float uint2float(int x)
137
+ {
138
+ return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0);
139
+ }
140
+
141
+
142
+ int lowbias32(int x)
143
+ {
144
+ x ^= x >>> 16;
145
+ x *= 0x7feb352d;
146
+ x ^= x >>> 15;
147
+ x *= 0x846ca68b;
148
+ x ^= x >>> 16;
149
+ return x;
150
+ }
151
+
152
+ float2 rotate_around(float2 uv, float angle, float2 pt)
153
+ {
154
+ float sine = ::math::sin(angle);
155
+ float cosine = ::math::cos(angle);
156
+ float2x2 rot = float2x2(cosine, -sine, sine, cosine);
157
+ uv -= pt;
158
+ uv = rot * uv ;
159
+ return uv + pt;
160
+ }
161
+
162
+ float2 scale_around(float2 uv, float2 scale, float2 pt)
163
+ {
164
+ float2x2 rot = float2x2(scale.x, 0., 0., scale.y);
165
+ uv -= pt;
166
+ uv = rot * uv;
167
+ return uv + pt;
168
+ }
169
+
170
+
171
+
172
+ float scatter_grayscale(
173
+ uniform texture_2d pattern_texture = texture_2d(),
174
+ uniform texture_2d mask_texture = texture_2d(),
175
+ uniform texture_2d bluenoise_texture = texture_2d(),
176
+
177
+ float pattern_size = 1.0f, // The size of the pattern
178
+ float pattern_brightness = 1.0f,
179
+ float pattern_brightness_variation = 0.0, // amount of color randomization
180
+ int compute_size = 1, // bigger grid size is required when texture is scaled larger but is more expensive
181
+ float random_mask_threshold = 0.0f, // higher values cause certain cells not to be rendered
182
+ bool use_true_random_masking = false, // vs. using the blue noise texture that spaces the particles more venely apart from each other
183
+
184
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(), // UVW coordinates to be used to lay the bombing over
185
+ float2 texture_scale = float2(30.0f, 30.0f),
186
+ float2 offset_randomization = float2(.5), // amount of position randomization. Larger values will require "compute_size" to be
187
+ // increased, otherwise the texture will be clipped
188
+ float rotation = 0.0, // amount of global rotation
189
+ float rotation_randomization = 0.5, // amount of rotation randomization
190
+ float scale_randomization = 0.0, // amount of scaling randomization
191
+ bool additive_blend = false, // when false, mode is "max", otherwise "add/sub", centered at 0.5
192
+
193
+ // MASK
194
+ bool enable_grayscale_mask = false,
195
+ float grayscale_mask_threshold = 0.0,
196
+ int seed = 0
197
+ )
198
+ {
199
+ float result = 0.0;
200
+ float4 grayscale_mask_lookup = 0.0f;
201
+ float masking_value = 0.0;
202
+ compute_size = compute_size < 1 ? 1 : compute_size;
203
+ float2 uv = float2(uvw.position.x, uvw.position.y) * texture_scale;
204
+
205
+ for(float i = -compute_size; i <= compute_size; i++)
206
+ for(float j = -compute_size; j <= compute_size; j++)
207
+ {
208
+ float2 p = ::math::floor(uv + float2(i, j));
209
+ float2 f = ::math::frac(uv) - float2(i, j);
210
+
211
+ //float4 rand_4f = rnd42(int2(p));
212
+ int r1, r2, r3, r4, r5;
213
+ // get random values
214
+ r1 = lowbias32(lowbias32(seed) + int(p[0]) + lowbias32(int(p[1])));
215
+ r2 = lowbias32(r1);
216
+ r3 = lowbias32(r2);
217
+ r4 = lowbias32(r3);
218
+ r5 = lowbias32(r4);
219
+
220
+ float rnd1, rnd2, rnd3, rnd4, rnd5;
221
+ rnd1 = uint2float(r1)/ 4294967296.f;
222
+ rnd2 = uint2float(r2)/ 4294967296.f;
223
+ rnd3 = uint2float(r3)/ 4294967296.f;
224
+ rnd4 = uint2float(r4)/ 4294967296.f;
225
+ rnd5 = uint2float(r5)/ 4294967296.f;
226
+
227
+ f+= (float2(rnd1, rnd2) - float2(0.5f)) * offset_randomization;
228
+
229
+ float2 rand_2f_remap = (float2(rnd3, rnd4) - float2( .5f)) * 2.0f; // center around - 1.0 - 1.0
230
+ f = rotate_around(f, (rotation + rand_2f_remap.x * rotation_randomization) * 3.1415, float2(0.5));
231
+ f = scale_around(f, float2(1.0 + rand_2f_remap.y * scale_randomization)/ pattern_size, float2(0.5));
232
+
233
+ int blue_noise_width = ::tex::width(bluenoise_texture);
234
+ int blue_noise_height = ::tex::height(bluenoise_texture);
235
+
236
+ // switch between completely random mask and mask mrovided by blue noise texture
237
+ masking_value = use_true_random_masking ? rnd4 :
238
+ ::tex::texel_float4(bluenoise_texture, int2(int(::math::floor(p.x))%blue_noise_width, int(::math::floor(p.y))%blue_noise_height)).x;
239
+
240
+ if (enable_grayscale_mask == true)
241
+ {
242
+ // compute exact center of cells for the masking before it is being offset. We are not computing the mask
243
+ // at the position where the element that is being scattered is ending up. That could be an alternative mode to be implemented.
244
+ float2 cell_size = float2(1.0/texture_scale);
245
+ grayscale_mask_lookup = ::tex::lookup_float4(mask_texture, float2(cell_size/2 + cell_size * p));
246
+ }
247
+ bool mask_pass = (grayscale_mask_lookup.x > grayscale_mask_threshold) || enable_grayscale_mask == false;
248
+
249
+ if(f.x >= 0.0 && f.x < 1.0 && f.y >= 0.0 && f.y < 1.0 && mask_pass && random_mask_threshold < masking_value)
250
+ {
251
+ float4 lookup = ::tex::lookup_float4(pattern_texture, float2(f), ::tex::wrap_repeat, ::tex::wrap_repeat, float2(0.0, 1.0), float2(0.0, 1.0));
252
+ // do blending of lookup
253
+ // if (blend_add_sub == true)
254
+ // {
255
+ // value = (lookup.x + lookup.y + lookup.z)/3 - 0.5;
256
+ // result = ::math::clamp(result + value * (1.0 - rand_4f.z * pattern_brightness_variation), 0.0f, 1.0f);
257
+ // }
258
+ // else
259
+
260
+ if (additive_blend == true)
261
+ result = result + (lookup.x + lookup.y + lookup.z)/3 * (1.0 - rnd5 * pattern_brightness_variation)*pattern_brightness;
262
+ else
263
+ result = ::math::max((lookup.x + lookup.y + lookup.z)/3 * (1.0 - rnd5 * pattern_brightness_variation)*pattern_brightness, result);
264
+ }
265
+ }
266
+
267
+ return result;
268
+ }
269
+
270
+ float scatter_atlas_grayscale(
271
+ uniform texture_2d pattern_atlas_texture = texture_2d(),
272
+ uniform texture_2d mask_texture = texture_2d(),
273
+ uniform texture_2d bluenoise_texture = texture_2d(),
274
+
275
+ uniform int atlas_size = 2,
276
+ int min_pattern = 1,
277
+ int max_pattern = 4,
278
+ float pattern_size = 1.0f, // The size of the pattern
279
+ float pattern_brightness = 1.0f,
280
+ float pattern_brightness_variation = 0.0, // amount of color randomization
281
+ int compute_size = 1, // bigger grid size is required when texture is scaled larger but is more expensive
282
+ float random_mask_threshold = 0.0f, // higher values cause certain cells not to be rendered
283
+ bool use_true_random_masking = false, // vs. using the blue noise texture that spaces the particles more venely apart from each other
284
+
285
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(), // UVW coordinates to be used to lay the bombing over
286
+ float2 texture_scale = float2(30.0f, 30.0f),
287
+ float2 offset_randomization = float2(.5), // amount of position randomization. Larger values will require "compute_size" to be
288
+ // increased, otherwise the texture will be clipped
289
+ float rotation = 0.0, // amount of global rotation
290
+ float rotation_randomization = 0.5, // amount of rotation randomization
291
+ float scale_randomization = 0.0, // amount of scaling randomization
292
+ bool additive_blend = false, // when false, mode is "max", otherwise "add/sub", centered at 0.5
293
+
294
+ // MASK
295
+ bool enable_grayscale_mask = false,
296
+ float grayscale_mask_threshold = 0.0,
297
+ int seed = 0
298
+ )
299
+ {
300
+ float result = 0.0;
301
+ float4 grayscale_mask_lookup = 0.0f;
302
+ float masking_value = 0.0;
303
+ compute_size = compute_size < 1 ? 1 : compute_size;
304
+ float atlas_tile_size = 1.0f/atlas_size; // dimension of a single atlas tile
305
+ float2 uv = float2(uvw.position.x, uvw.position.y) * texture_scale;
306
+
307
+
308
+ for(float i = -compute_size; i <= compute_size; i++)
309
+ for(float j = -compute_size; j <= compute_size; j++)
310
+ {
311
+ float2 p = ::math::floor(uv + float2(i, j));
312
+ float2 f = ::math::frac(uv) - float2(i, j);
313
+
314
+ //float4 rand_4f = rnd42(int2(p));
315
+ int r1, r2, r3, r4, r5;
316
+ // get random values
317
+ r1 = lowbias32(lowbias32(seed) + int(p[0]) + lowbias32(int(p[1])));
318
+ r2 = lowbias32(r1);
319
+ r3 = lowbias32(r2);
320
+ r4 = lowbias32(r3);
321
+ r5 = lowbias32(r4);
322
+
323
+ float rnd1, rnd2, rnd3, rnd4, rnd5;
324
+ rnd1 = uint2float(r1)/ 4294967296.f;
325
+ rnd2 = uint2float(r2)/ 4294967296.f;
326
+ rnd3 = uint2float(r3)/ 4294967296.f;
327
+ rnd4 = uint2float(r4)/ 4294967296.f;
328
+ rnd5 = uint2float(r5)/ 4294967296.f;
329
+
330
+ f+= (float2(rnd1, rnd2) - float2(0.5f)) * offset_randomization;
331
+
332
+ float2 rand_2f_remap = (float2(rnd3, rnd4) - float2( .5f)) * 2.0f; // center around - 1.0 - 1.0
333
+ float rot_angle = (rotation + rand_2f_remap.x * rotation_randomization) * 3.1415;
334
+ f = rotate_around(f, rot_angle, float2(0.5));
335
+ f = scale_around(f, float2(1.0 + rand_2f_remap.y * scale_randomization)/ pattern_size, float2(0.5));
336
+
337
+ int blue_noise_width = ::tex::width(bluenoise_texture);
338
+ int blue_noise_height = ::tex::height(bluenoise_texture);
339
+
340
+ // switch between completely random mask and mask mrovided by blue noise texture
341
+ masking_value = use_true_random_masking ? rnd4 :
342
+ ::tex::texel_float4(bluenoise_texture, int2(int(::math::floor(p.x))%blue_noise_width, int(::math::floor(p.y))%blue_noise_height)).x;
343
+
344
+ if (enable_grayscale_mask == true)
345
+ {
346
+ // compute exact center of cells for the masking before it is being offset. We are not computing the mask
347
+ // at the position where the element that is being scattered is ending up. That could be an alternative mode to be implemented.
348
+ float2 cell_size = float2(1.0/texture_scale);
349
+ grayscale_mask_lookup = ::tex::lookup_float4(mask_texture, float2(cell_size/2 + cell_size * p));
350
+ }
351
+ bool mask_pass = (grayscale_mask_lookup.x > grayscale_mask_threshold) || enable_grayscale_mask == false;
352
+
353
+ if(f.x >= 0.0 && f.x < 1.0 && f.y >= 0.0 && f.y < 1.0 && mask_pass && random_mask_threshold < masking_value)
354
+ {
355
+ // compute atlas tile from random number and derive tile coordinates from that
356
+
357
+ float atlas_tile = ::math::floor(::math::lerp(float(min_pattern), float(max_pattern+1), rnd5));
358
+ float div = (atlas_tile/atlas_size);
359
+ float remainder = div - ::math::floor(div);
360
+
361
+ // Perform lookup in the range that was selected
362
+ float2 lookup_uv = float2(::math::lerp(::math::floor(div) * atlas_tile_size, ::math::floor(div) * atlas_tile_size + atlas_tile_size, f.x),
363
+ ::math::lerp(remainder, remainder + atlas_tile_size, f.y));
364
+
365
+ float4 lookup = ::tex::lookup_float4(pattern_atlas_texture, lookup_uv, ::tex::wrap_repeat, ::tex::wrap_repeat, float2(0.0, 1.0), float2(0.0, 1.0));
366
+
367
+ if (additive_blend == true)
368
+ result = result + (lookup.x + lookup.y + lookup.z)/3 * (1.0 - rnd1 * pattern_brightness_variation)*pattern_brightness;
369
+ else
370
+ result = ::math::max((lookup.x + lookup.y + lookup.z)/3 * (1.0 - rnd1 * pattern_brightness_variation)*pattern_brightness, result);
371
+
372
+ }
373
+ }
374
+
375
+ return result;
376
+ }
377
+
378
+ float remap_xy_to_0_1(float input, float x, float y)
379
+ {
380
+ return (input - x)/(y - x);
381
+ }
382
+
383
+ float histogram_range(float input, float range = 1.0f, float position = 0.5f)
384
+ {
385
+ float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0);
386
+ float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0);
387
+ return ::math::lerp(low, high, input);
388
+ }
389
+
390
+ float histogram_scan(float input, float width, float position)
391
+ {
392
+ float low = ::math::clamp(1.0f - position * 2.0, 0.0f ,1.0f);
393
+ float high = ::math::clamp(position > 0.5f ? 1.0 : 2.0f - 2 * position, 0.0f, 1.0f);
394
+ //float center = (low + high)/2.0f);
395
+ float offset = ((high - low) / 2.0) * width;
396
+ low += offset;
397
+ high -= offset;
398
+ return ::math::clamp(
399
+ remap_xy_to_0_1(input,
400
+ low,
401
+ high),
402
+ 0.0,
403
+ 1.0);
404
+ }
405
+
406
+ float3 normalmap_normal(
407
+ uniform texture_2d texture,
408
+ float factor = 1.0,
409
+ ::base::texture_coordinate_info uvw = ::base::texture_coordinate_info()
410
+ )
411
+ {
412
+ float3 lookup = (::tex::lookup_float3(texture, float2(uvw.position.x, uvw.position.y)) - float3(0.5)) * (factor * 2.0);
413
+ return ::math::normalize(uvw.tangent_u * lookup.x + uvw.tangent_v * lookup.y + ::state::normal() * (lookup.z + (1.0 - factor)));
414
+ }
415
+
416
+ // Returns the normal n in tangent space, given n is in internal space.
417
+ float3 transform_internal_to_tangent(float3 n)
418
+ [[
419
+ ::anno::hidden()
420
+ ]]
421
+ {
422
+ return
423
+ n.x* float3(::state::texture_tangent_u(0).x,::state::texture_tangent_v(0).x,::state::normal().x)+
424
+ n.y* float3(::state::texture_tangent_u(0).y,::state::texture_tangent_v(0).y,::state::normal().y)+
425
+ n.z* float3(::state::texture_tangent_u(0).z,::state::texture_tangent_v(0).z,::state::normal().z);
426
+ }
427
+
428
+ // Returns the normal n in internal space, given n is in tangent space.
429
+ float3 transform_tangent_to_internal(float3 n)
430
+ [[
431
+ ::anno::hidden()
432
+ ]]
433
+ {
434
+ return ::state::texture_tangent_u(0) * n.x +
435
+ ::state::texture_tangent_v(0) * n.y +
436
+ ::state::normal() * n.z ;
437
+ }
438
+
439
+ // Returns a normal by adding a detail normal to a global normal.
440
+ // If detail blending of two normal maps gives visual artifacts, check if texture_2d are loaded
441
+ // correctly with ::tex::gamma_linear
442
+ float3 add_detail_normal(float3 nd = ::state::normal(), float3 n = ::state::normal())
443
+ {
444
+ // http://blog.selfshadow.com/publications/blending-in-detail/
445
+ float3 n_t = transform_internal_to_tangent(n);
446
+ float3 nd_t = transform_internal_to_tangent(nd);
447
+
448
+ n_t=n_t + float3(0.,0.,1.);
449
+ nd_t = nd_t * float3(-1.,-1.,1.);
450
+ n = n_t*::math::dot(n_t, nd_t)/n_t.z - nd_t;
451
+ return ::math::normalize(transform_tangent_to_internal(n));
452
+ }
453
+
454
+
455
+
456
+ export material Fiberglass_Imperfections(
457
+ int seed = 14 [[
458
+ ::anno::description("A random seed to randomize the imperfections."),
459
+ ::anno::display_name("Random Seed"),
460
+ ::anno::in_group("Appearance"),
461
+ ::anno::ui_order(0)
462
+ ]],
463
+ color fiberglass_tint = color(0.812241f, 0.932277f, 0.957370f) [[
464
+ ::anno::description("Applies a colored tint to the fibers."),
465
+ ::anno::display_name("Fiberglass Tint"),
466
+ ::anno::in_group("Appearance", "Diffuse"),
467
+ ::anno::ui_order(1)
468
+ ]],
469
+ float fibers_shininess = 1.f [[
470
+ ::anno::description("Makes the fiber glass material duller or shinier. Default value is 0.5."),
471
+ ::anno::display_name("Fibers Shininess"),
472
+ ::anno::in_group("Appearance"),
473
+ ::anno::hard_range(0.f, 1.f),
474
+ ::anno::ui_order(2)
475
+ ]],
476
+ uniform float weaving_bump_strength = 0.75f [[
477
+ ::anno::description("Determines the degree of bumpiness for the weaving."),
478
+ ::anno::display_name("Weaving Bump Strength"),
479
+ ::anno::in_group("Appearance", "Bump"),
480
+ ::anno::soft_range(0.f, 1.f),
481
+ ::anno::hard_range(0.f, 3.f),
482
+ ::anno::ui_order(3)
483
+ ]],
484
+ uniform float fibers_bump_strength = 1.f [[
485
+ ::anno::description("Determines the degree of bumpiness of the fibers."),
486
+ ::anno::display_name("Fibers Bump Strength"),
487
+ ::anno::in_group("Appearance", "Bump"),
488
+ ::anno::hard_range(0.f, 3.f),
489
+ ::anno::soft_range(0.f, 1.f),
490
+ ::anno::ui_order(4)
491
+ ]],
492
+ float diffuse_brightness = 0.75f [[
493
+ ::anno::description("The diffuse brightness of the fibers."),
494
+ ::anno::display_name("Diffuse Brightness"),
495
+ ::anno::in_group("Appearance", "Advanced"),
496
+ ::anno::hard_range(0.f, 1.f),
497
+ ::anno::ui_order(5)
498
+ ]],
499
+ float specular_weight = 1.0f [[
500
+ ::anno::description("The amount of glossiness variation for the vertical fiber glossiness."),
501
+ ::anno::display_name("Specular Weight"),
502
+ ::anno::in_group("Appearance", "Advanced"),
503
+ ::anno::hard_range(0.f, 1.f),
504
+ ::anno::ui_order(6)
505
+ ]],
506
+ float diffuse_transmission_weight = 0.21f [[
507
+ ::anno::description("The amount of light being able to scatter through the fibers."),
508
+ ::anno::display_name("Diffuse Transmission Weight"),
509
+ ::anno::in_group("Appearance", "Advanced"),
510
+ ::anno::hard_range(0.f, 1.f),
511
+ ::anno::ui_order(7)
512
+ ]],
513
+ float bumps_and_dents_probability = 0.34f [[
514
+ ::anno::description("The probability of generating bumps appearing on the material. Higher values will generate more bumps and dents."),
515
+ ::anno::display_name("Bumps Probability"),
516
+ ::anno::in_group("Bumps and Dents"),
517
+ ::anno::hard_range(0.f, 1.f),
518
+ ::anno::ui_order(12)
519
+ ]],
520
+ float bumps_dents_density = 4.5f [[
521
+ ::anno::description("The density of the bumps and dents."),
522
+ ::anno::display_name("Bumps Density"),
523
+ ::anno::in_group("Bumps and Dents"),
524
+ ::anno::soft_range(0.f, 8.f),
525
+ ::anno::enable_if("bumps_and_dents_probability > 0.0"),
526
+ ::anno::ui_order(13)
527
+ ]],
528
+ float bumps_kernel_size = 1.f [[
529
+ ::anno::description("The area that the bumped imperfection is covering."),
530
+ ::anno::display_name("Bumped Kernel Size"),
531
+ ::anno::in_group("Bumps and Dents"),
532
+ ::anno::hard_range(0.f, 1.f),
533
+ ::anno::enable_if("bumps_and_dents_probability > 0.0"),
534
+ ::anno::ui_order(14)
535
+ ]],
536
+ float bumps_waves_size = 0.7f [[
537
+ ::anno::description("The dimension of the waves that bump and dent the surface."),
538
+ ::anno::display_name("Bumps Wave Size"),
539
+ ::anno::in_group("Bumps and Dents"),
540
+ ::anno::hard_range(0.f, 1.f),
541
+ ::anno::enable_if("bumps_and_dents_probability > 0.0"),
542
+ ::anno::ui_order(15)
543
+ ]],
544
+ float bumps_dents_size_variation = 0.9f [[
545
+ ::anno::description("Size variation of the bump surface imperfection."),
546
+ ::anno::display_name("Bumps Size Variation"),
547
+ ::anno::in_group("Bumps and Dents"),
548
+ ::anno::hard_range(0.f, 1.f),
549
+ ::anno::enable_if("bumps_and_dents_probability > 0.0"),
550
+ ::anno::ui_order(16)
551
+ ]],
552
+ float bumps_dents_intensity = 1.f [[
553
+ ::anno::description("Overall intensity of the bumps."),
554
+ ::anno::display_name("Bumps Overall Intensity"),
555
+ ::anno::in_group("Bumps and Dents"),
556
+ ::anno::hard_range(0.f, 4.f),
557
+ ::anno::enable_if("bumps_and_dents_probability > 0.0"),
558
+ ::anno::ui_order(17)
559
+ ]],
560
+ float bumps_dents_intensity_variation = 1.0f [[
561
+ ::anno::description("The amount of variation that is applied to the intensitz of the bumps and dents."),
562
+ ::anno::display_name("Bumps Intensity Variation"),
563
+ ::anno::in_group("Bumps and Dents"),
564
+ ::anno::hard_range(0.f, 1.f),
565
+ ::anno::enable_if("bumps_and_dents_probability > 0.0"),
566
+ ::anno::ui_order(18)
567
+ ]],
568
+ float deformation_probability = 0.5f [[
569
+ ::anno::description("The probability of fabric deformation appearing on the material. Higher values will generate more deformations."),
570
+ ::anno::display_name("Deformations Probability"),
571
+ ::anno::in_group("Deformations"),
572
+ ::anno::hard_range(0.f, 1.f),
573
+ ::anno::ui_order(19)
574
+ ]],
575
+ float deformations_density = 5.f [[
576
+ ::anno::description("The density of the deformations."),
577
+ ::anno::display_name("Deformations Density"),
578
+ ::anno::in_group("Deformations"),
579
+ ::anno::soft_range(0.f, 8.f),
580
+ ::anno::enable_if("deformation_probability > 0.0"),
581
+ ::anno::ui_order(20)
582
+ ]],
583
+ float deformations_size = 1.f [[
584
+ ::anno::description("The area that the fabric deformationis covering."),
585
+ ::anno::display_name("Deformations Kernel Size"),
586
+ ::anno::in_group("Deformations"),
587
+ ::anno::hard_range(0.f, 1.f),
588
+ ::anno::enable_if("deformation_probability > 0.0"),
589
+ ::anno::ui_order(21)
590
+ ]],
591
+ float deformations_size_variation = 0.25f [[
592
+ ::anno::description("The amount of size variation of the areas where fabric deformations appear."),
593
+ ::anno::display_name("Deformations Size Variation"),
594
+ ::anno::in_group("Deformations"),
595
+ ::anno::hard_range(0.f, 1.f),
596
+ ::anno::enable_if("deformation_probability > 0.0"),
597
+ ::anno::ui_order(22)
598
+ ]],
599
+ float deformation_intensity = 0.31f [[
600
+ ::anno::description("The amount of deformation."),
601
+ ::anno::display_name("Deformations Intensity"),
602
+ ::anno::in_group("Deformations"),
603
+ ::anno::hard_range(0.f, 1.f),
604
+ ::anno::enable_if("deformation_probability > 0.0"),
605
+ ::anno::ui_order(23)
606
+ ]],
607
+ float deformation_intensity_variation = 1.f [[
608
+ ::anno::description("The amount of random variation to areas where surface deformation appears."),
609
+ ::anno::display_name("Deformations Intensity Variation"),
610
+ ::anno::in_group("Deformations"),
611
+ ::anno::hard_range(0.f, 1.f),
612
+ ::anno::enable_if("deformation_probability > 0.0"),
613
+ ::anno::ui_order(24)
614
+ ]],
615
+ float tearing_probability = 0.13f [[
616
+ ::anno::description("The probability tearing to on the material. Higher values will generate more tearings."),
617
+ ::anno::display_name("Tearings Probability"),
618
+ ::anno::in_group("Tearings"),
619
+ ::anno::hard_range(0.f, 1.f),
620
+ ::anno::ui_order(25)
621
+ ]],
622
+ float tearings_density = 3.15f [[
623
+ ::anno::description("The density of tearings appearing on the material."),
624
+ ::anno::display_name("Tearings Density"),
625
+ ::anno::in_group("Tearings"),
626
+ ::anno::soft_range(0.f, 8.f),
627
+ ::anno::enable_if("tearing_probability > 0.0"),
628
+ ::anno::ui_order(26)
629
+ ]],
630
+ float tearings_size = 1.f [[
631
+ ::anno::description("The area that a tearing is covering."),
632
+ ::anno::display_name("Tearings Kernel Size"),
633
+ ::anno::in_group("Tearings"),
634
+ ::anno::hard_range(0.f, 1.f),
635
+ ::anno::enable_if("tearing_probability > 0.0"),
636
+ ::anno::ui_order(27)
637
+ ]],
638
+ float tearing_size_variation = 0.36f [[
639
+ ::anno::description("Randomizes the size of the tearings."),
640
+ ::anno::display_name("Tearings Size Variation"),
641
+ ::anno::in_group("Tearings"),
642
+ ::anno::hard_range(0.f, 1.f),
643
+ ::anno::enable_if("tearing_probability > 0.0"),
644
+ ::anno::ui_order(28)
645
+ ]],
646
+ float tearings_rotation = 0.f [[
647
+ ::anno::description("The overal rotation of the tearings."),
648
+ ::anno::display_name("Tearings Rotation"),
649
+ ::anno::in_group("Tearings"),
650
+ ::anno::soft_range(0.f, 3.f),
651
+ ::anno::enable_if("tearing_probability > 0.0"),
652
+ ::anno::ui_order(29)
653
+ ]],
654
+ float tearings_rotation_randomization = 0.f [[
655
+ ::anno::description("The amount of random rotation of a tearing."),
656
+ ::anno::display_name("Tearings Rotation Variation"),
657
+ ::anno::in_group("Tearings"),
658
+ ::anno::hard_range(0.f, 1.f),
659
+ ::anno::enable_if("tearing_probability > 0.0"),
660
+ ::anno::ui_order(30)
661
+ ]],
662
+ float2 texture_translate = float2(0.f) [[
663
+ ::anno::description("Controls the position of the texture."),
664
+ ::anno::display_name("Texture Translate"),
665
+ ::anno::in_group("Transform"),
666
+ ::anno::ui_order(31)
667
+ ]],
668
+ float texture_rotate = 0.f [[
669
+ ::anno::description("Rotates angle of the texture in degrees."),
670
+ ::anno::display_name("Texture Rotate"),
671
+ ::anno::in_group("Transform"),
672
+ ::anno::soft_range(0.f, 360.f),
673
+ ::anno::ui_order(32)
674
+ ]],
675
+ float2 texture_scale = float2(1.0f) [[
676
+ ::anno::description("Larger numbers increase the size."),
677
+ ::anno::display_name("Texture Scale"),
678
+ ::anno::in_group("Transform"),
679
+ ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)),
680
+ ::preview_scale(3.5f),
681
+ ::anno::ui_order(33)
682
+ ]],
683
+ uniform int uv_space_index = 0 [[
684
+ ::anno::description("Use selected UV space for the material."),
685
+ ::anno::display_name("UV Space Index"),
686
+ ::anno::in_group("Advanced"),
687
+ ::anno::ui_order(34)
688
+ ]])
689
+ [[
690
+ ::anno::description("A fiberglass material with adjustable imperfections such as bumps, warps and tears."),
691
+ ::anno::display_name("Fiberglass with Imperfections"),
692
+ ::anno::copyright_notice(COPYRIGHT),
693
+ ::anno::thumbnail("./.thumbs/Fiberglass_Imperfections.Fiberglass_Imperfections.png"),
694
+ ::anno::key_words(string[]("fiber", "fiberglass", "artificial", "design", "fabric", "mesh", "woven", "synthetic", "imperfection", "white")),
695
+ ::anno::author("NVIDIA vMaterials"),
696
+ ::anno::contributor("Ruediger Raab"),
697
+ ::anno::contributor("Maik Rohland")
698
+ ]]
699
+ =
700
+ let {
701
+ float2 texture_rescale = texture_scale * 0.1f;
702
+
703
+ texture_2d blue_noise_tex = texture_2d("./textures/fiber_blue_noise_placement_512x512.png", ::tex::gamma_linear);
704
+ texture_2d rough_ao_mask_tex = texture_2d("./textures/fiber_multi_R_rough_G_ao_B_mask.jpg", ::tex::gamma_linear);
705
+ texture_2d warp_direction_noise_tex = texture_2d("./textures/fiber_warp_direction_noise.jpg", ::tex::gamma_linear);
706
+ texture_2d warps_tex = texture_2d("./textures/fiberglass_warps.jpg", ::tex::gamma_linear);
707
+ texture_2d bump_tex = texture_2d("./textures/fiber_bump.jpg", ::tex::gamma_linear);
708
+ texture_2d tears_tex = texture_2d("./textures/fiber_tears.png", ::tex::gamma_linear);
709
+ texture_2d fiber_norm_tex = texture_2d("./textures/fiber_norm.jpg", ::tex::gamma_linear);
710
+ texture_2d waves_norm_tex = texture_2d("./textures/fiber_waves_norm.jpg", ::tex::gamma_linear);
711
+ texture_2d kernel_tex = texture_2d("./textures/fiber_kernel.jpg", ::tex::gamma_linear);
712
+
713
+ bool tmp0 = false;
714
+ material_surface tmp1(::df::weighted_layer(diffuse_transmission_weight, ::df::diffuse_transmission_bsdf(nvidia::core_definitions::blend_colors(color(histogram_range(float3(::base::file_texture(rough_ao_mask_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, warped_coordinate(scatter_atlas_grayscale(warps_tex, texture_2d(), blue_noise_tex, 2, 0, 4, deformations_size * 2.f, deformation_intensity, deformation_intensity_variation, 1, 1.f - deformation_probability * 0.100000001f, true, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(deformations_density), float2(1.f), 0.f, 0.25f, deformations_size_variation * 0.600000024f, false, false, 0.f, seed + 11), 0.099999994f, ::base::file_texture(warp_direction_noise_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::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 * 3.1415f, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, 0.810000002f)), fiberglass_tint, ::base::color_layer_multiply, 1.f).tint, ""), ::df::custom_curve_layer(specular_weight, 1.f, 5.f, histogram_scan(float3(::base::file_texture(rough_ao_mask_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, warped_coordinate(scatter_atlas_grayscale(warps_tex, texture_2d(), blue_noise_tex, 2, 0, 4, deformations_size * 2.f, deformation_intensity, deformation_intensity_variation, 1, 1.f - deformation_probability * 0.100000001f, true, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(deformations_density), float2(1.f), 0.f, 0.25f, deformations_size_variation * 0.600000024f, false, false, 0.f, seed + 11), 0.099999994f, ::base::file_texture(warp_direction_noise_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::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 * 3.1415f, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.f, 0.469999999f), ::df::microfacet_ggx_smith_bsdf(::math::max(::math::smoothstep(0.790000021f, 0.791000009f, float3(::base::file_texture(rough_ao_mask_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, warped_coordinate(scatter_atlas_grayscale(warps_tex, texture_2d(), blue_noise_tex, 2, 0, 4, deformations_size * 2.f, deformation_intensity, deformation_intensity_variation, 1, 1.f - deformation_probability * 0.100000001f, true, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(deformations_density), float2(1.f), 0.f, 0.25f, deformations_size_variation * 0.600000024f, false, false, 0.f, seed + 11), 0.099999994f, ::base::file_texture(warp_direction_noise_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::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 * 3.1415f, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2]) * histogram_range(float3(::base::file_texture(rough_ao_mask_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, warped_coordinate(scatter_atlas_grayscale(warps_tex, texture_2d(), blue_noise_tex, 2, 0, 4, deformations_size * 2.f, deformation_intensity, deformation_intensity_variation, 1, 1.f - deformation_probability * 0.100000001f, true, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(deformations_density), float2(1.f), 0.f, 0.25f, deformations_size_variation * 0.600000024f, false, false, 0.f, seed + 11), 0.099999994f, ::base::file_texture(warp_direction_noise_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::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 * 3.1415f, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.389999986f, 0.0799999982f, fibers_shininess)), histogram_range(float3(::base::file_texture(rough_ao_mask_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, warped_coordinate(scatter_atlas_grayscale(warps_tex, texture_2d(), blue_noise_tex, 2, 0, 4, deformations_size * 2.f, deformation_intensity, deformation_intensity_variation, 1, 1.f - deformation_probability * 0.100000001f, true, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(deformations_density), float2(1.f), 0.f, 0.25f, deformations_size_variation * 0.600000024f, false, false, 0.f, seed + 11), 0.099999994f, ::base::file_texture(warp_direction_noise_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::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 * 3.1415f, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.800000012f, 0.5f, fibers_shininess)) * ::math::min(1.f - ::math::smoothstep(0.50999999f, 0.539999962f, float3(::base::file_texture(rough_ao_mask_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, warped_coordinate(scatter_atlas_grayscale(warps_tex, texture_2d(), blue_noise_tex, 2, 0, 4, deformations_size * 2.f, deformation_intensity, deformation_intensity_variation, 1, 1.f - deformation_probability * 0.100000001f, true, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(deformations_density), float2(1.f), 0.f, 0.25f, deformations_size_variation * 0.600000024f, false, false, 0.f, seed + 11), 0.099999994f, ::base::file_texture(warp_direction_noise_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::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 * 3.1415f, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2]), ::math::smoothstep(0.340000004f, 0.389999986f, float3(::base::file_texture(rough_ao_mask_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, warped_coordinate(scatter_atlas_grayscale(warps_tex, texture_2d(), blue_noise_tex, 2, 0, 4, deformations_size * 2.f, deformation_intensity, deformation_intensity_variation, 1, 1.f - deformation_probability * 0.100000001f, true, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(deformations_density), float2(1.f), 0.f, 0.25f, deformations_size_variation * 0.600000024f, false, false, 0.f, seed + 11), 0.099999994f, ::base::file_texture(warp_direction_noise_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::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 * 3.1415f, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2]))), ::math::max(::math::smoothstep(0.790000021f, 0.791000009f, float3(::base::file_texture(rough_ao_mask_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, warped_coordinate(scatter_atlas_grayscale(warps_tex, texture_2d(), blue_noise_tex, 2, 0, 4, deformations_size * 2.f, deformation_intensity, deformation_intensity_variation, 1, 1.f - deformation_probability * 0.100000001f, true, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(deformations_density), float2(1.f), 0.f, 0.25f, deformations_size_variation * 0.600000024f, false, false, 0.f, seed + 11), 0.099999994f, ::base::file_texture(warp_direction_noise_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::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 * 3.1415f, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2]) * histogram_range(float3(::base::file_texture(rough_ao_mask_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, warped_coordinate(scatter_atlas_grayscale(warps_tex, texture_2d(), blue_noise_tex, 2, 0, 4, deformations_size * 2.f, deformation_intensity, deformation_intensity_variation, 1, 1.f - deformation_probability * 0.100000001f, true, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(deformations_density), float2(1.f), 0.f, 0.25f, deformations_size_variation * 0.600000024f, false, false, 0.f, seed + 11), 0.099999994f, ::base::file_texture(warp_direction_noise_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::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 * 3.1415f, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.800000012f, 0.5f, fibers_shininess)), histogram_range(float3(::base::file_texture(rough_ao_mask_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, warped_coordinate(scatter_atlas_grayscale(warps_tex, texture_2d(), blue_noise_tex, 2, 0, 4, deformations_size * 2.f, deformation_intensity, deformation_intensity_variation, 1, 1.f - deformation_probability * 0.100000001f, true, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(deformations_density), float2(1.f), 0.f, 0.25f, deformations_size_variation * 0.600000024f, false, false, 0.f, seed + 11), 0.099999994f, ::base::file_texture(warp_direction_noise_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::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 * 3.1415f, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.389999986f, 0.0799999982f, fibers_shininess)) * ::math::min(1.f - ::math::smoothstep(0.50999999f, 0.539999962f, float3(::base::file_texture(rough_ao_mask_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, warped_coordinate(scatter_atlas_grayscale(warps_tex, texture_2d(), blue_noise_tex, 2, 0, 4, deformations_size * 2.f, deformation_intensity, deformation_intensity_variation, 1, 1.f - deformation_probability * 0.100000001f, true, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(deformations_density), float2(1.f), 0.f, 0.25f, deformations_size_variation * 0.600000024f, false, false, 0.f, seed + 11), 0.099999994f, ::base::file_texture(warp_direction_noise_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::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 * 3.1415f, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2]), ::math::smoothstep(0.340000004f, 0.389999986f, float3(::base::file_texture(rough_ao_mask_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, warped_coordinate(scatter_atlas_grayscale(warps_tex, texture_2d(), blue_noise_tex, 2, 0, 4, deformations_size * 2.f, deformation_intensity, deformation_intensity_variation, 1, 1.f - deformation_probability * 0.100000001f, true, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(deformations_density), float2(1.f), 0.f, 0.25f, deformations_size_variation * 0.600000024f, false, false, 0.f, seed + 11), 0.099999994f, ::base::file_texture(warp_direction_noise_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::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 * 3.1415f, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2]))), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(color(histogram_range(float3(::base::file_texture(rough_ao_mask_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, warped_coordinate(scatter_atlas_grayscale(warps_tex, texture_2d(), blue_noise_tex, 2, 0, 4, deformations_size * 2.f, deformation_intensity, deformation_intensity_variation, 1, 1.f - deformation_probability * 0.100000001f, true, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(deformations_density), float2(1.f), 0.f, 0.25f, deformations_size_variation * 0.600000024f, false, false, 0.f, seed + 11), 0.099999994f, ::base::file_texture(warp_direction_noise_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::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 * 3.1415f, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, diffuse_brightness)), fiberglass_tint, ::base::color_layer_multiply, 1.f).tint, 0.f, ""), ::state::normal()), ::state::normal()), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
715
+ material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
716
+ color tmp3 = color(1.f, 1.f, 1.f);
717
+ 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));
718
+ material_geometry tmp5(float3(0.f), ::math::min(::math::smoothstep(0.0299999993f, 0.0309999995f, float3(::base::file_texture(rough_ao_mask_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, warped_coordinate(scatter_atlas_grayscale(warps_tex, texture_2d(), blue_noise_tex, 2, 0, 4, deformations_size * 2.f, deformation_intensity, deformation_intensity_variation, 1, 1.f - deformation_probability * 0.100000001f, true, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(deformations_density), float2(1.f), 0.f, 0.25f, deformations_size_variation * 0.600000024f, false, false, 0.f, seed + 11), 0.099999994f, ::base::file_texture(warp_direction_noise_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::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 * 3.1415f, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2]), 1.f - scatter_atlas_grayscale(tears_tex, texture_2d(), blue_noise_tex, 2, 0, 4, tearings_size * 2.f, 1.f, 0.f, 1, 1.f - tearing_probability * 0.100000001f, true, warped_coordinate(scatter_atlas_grayscale(warps_tex, texture_2d(), blue_noise_tex, 2, 0, 4, deformations_size * 2.f, deformation_intensity, deformation_intensity_variation, 1, 1.f - deformation_probability * 0.100000001f, true, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(deformations_density), float2(1.f), 0.f, 0.25f, deformations_size_variation * 0.600000024f, false, false, 0.f, seed + 11), 0.099999994f, ::base::file_texture(warp_direction_noise_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::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 * 3.1415f, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index)), float2(tearings_density), float2(1.f), tearings_rotation, tearings_rotation_randomization, tearing_size_variation * 0.600000024f, false, false, 0.f, seed + 10)), add_detail_normal(::base::file_bump_texture(bump_tex, fibers_bump_strength, ::base::mono_average, warped_coordinate(scatter_atlas_grayscale(warps_tex, texture_2d(), blue_noise_tex, 2, 0, 4, deformations_size * 2.f, deformation_intensity, deformation_intensity_variation, 1, 1.f - deformation_probability * 0.100000001f, true, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(deformations_density), float2(1.f), 0.f, 0.25f, deformations_size_variation * 0.600000024f, false, false, 0.f, seed + 11), 0.099999994f, ::base::file_texture(warp_direction_noise_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::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 * 3.1415f, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, ::state::normal(), false), add_detail_normal(::base::tangent_space_normal_texture(fiber_norm_tex, weaving_bump_strength, false, false, warped_coordinate(scatter_atlas_grayscale(warps_tex, texture_2d(), blue_noise_tex, 2, 0, 4, deformations_size * 2.f, deformation_intensity, deformation_intensity_variation, 1, 1.f - deformation_probability * 0.100000001f, true, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(deformations_density), float2(1.f), 0.f, 0.25f, deformations_size_variation * 0.600000024f, false, false, 0.f, seed + 11), 0.099999994f, ::base::file_texture(warp_direction_noise_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::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 * 3.1415f, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f), normalmap_normal(waves_norm_tex, scatter_grayscale(kernel_tex, texture_2d(), blue_noise_tex, bumps_kernel_size * 3.f, 1.f, bumps_dents_intensity_variation, 3, 1.f - bumps_and_dents_probability * 0.200000003f, true, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(bumps_dents_density), float2(1.f, 0.98999995f), 0.f, 1.f, bumps_dents_size_variation * 0.600000024f, false, false, 0.f, seed) * bumps_dents_intensity, vmat_transform(texture_translate, texture_rotate, texture_rescale * (bumps_waves_size * 3.f + 0.25f), ::base::texture_coordinate_uvw, uv_space_index)))));
719
+ hair_bsdf tmp6 = hair_bsdf();
720
+ } in
721
+ material(
722
+ thin_walled: tmp0,
723
+ surface: tmp1,
724
+ backface: tmp2,
725
+ ior: tmp3,
726
+ volume: tmp4,
727
+ geometry: tmp5,
728
+ hair: tmp6);
729
+
730
+
731
+
732
+ export material Fiberglass_Bumpy_Imperfections(*)
733
+ [[
734
+ ::anno::description("A fiberglass material with adjustable imperfections such as bumps, warps and tears."),
735
+ ::anno::display_name("Fiberglass with Bumpy Imperfections"),
736
+ ::anno::copyright_notice(COPYRIGHT),
737
+ ::anno::thumbnail("./.thumbs/Fiberglass_Imperfections.Fiberglass_Bumpy_Imperfections.png"),
738
+ ::anno::key_words(string[]("fiber", "fiberglass", "artificial", "design", "fabric", "mesh", "woven", "synthetic", "imperfection", "bumped", "bumpy", "white")),
739
+ ::anno::author("NVIDIA vMaterials"),
740
+ ::anno::contributor("Ruediger Raab"),
741
+ ::anno::contributor("Maik Rohland")
742
+ ]] = Fiberglass_Imperfections(
743
+ seed: 14,
744
+ fibers_shininess: 0.5f,
745
+ fiberglass_tint: color(0.812241f, 0.932277f, 0.957370f),
746
+ weaving_bump_strength: 0.75f,
747
+ fibers_bump_strength: 1.0f,
748
+ specular_weight: 1.0f,
749
+ diffuse_brightness: 0.75f,
750
+ diffuse_transmission_weight: 0.21f,
751
+
752
+ bumps_and_dents_probability: 0.95f,
753
+ bumps_dents_density: 5.5f,
754
+ bumps_kernel_size: 1.0f,
755
+ bumps_waves_size: 0.7f,
756
+ bumps_dents_size_variation: 0.9f,
757
+ bumps_dents_intensity: 1.0f,
758
+ bumps_dents_intensity_variation: 1.0f,
759
+
760
+ deformation_probability: 0.0f,
761
+ deformations_density: 5.0f,
762
+ deformations_size: 1.0f,
763
+ deformations_size_variation: 0.25f,
764
+ deformation_intensity: 0.31f,
765
+ deformation_intensity_variation: 1.0f,
766
+
767
+ tearing_probability: 0.0f,
768
+ tearings_density: 2.8f,
769
+ tearings_size: 1.0f,
770
+ tearing_size_variation: 0.36,
771
+ tearings_rotation: 0.0f,
772
+ tearings_rotation_randomization: 0.0f,
773
+
774
+ texture_translate: float2(0.0f),
775
+ texture_rotate: 0.0f,
776
+ texture_scale: float2(1.0f),
777
+ uv_space_index: 0
778
+ );
779
+
780
+
781
+
782
+ export material Fiberglass_Torn_Imperfections(*)
783
+ [[
784
+ ::anno::description("A fiberglass material with adjustable imperfections such as bumps, warps and tears."),
785
+ ::anno::display_name("Fiberglass with Torn Imperfections"),
786
+ ::anno::copyright_notice(COPYRIGHT),
787
+ ::anno::thumbnail("./.thumbs/Fiberglass_Imperfections.Fiberglass_Torn_Imperfections.png"),
788
+ ::anno::key_words(string[]("fiber", "fiberglass", "artificial", "design", "fabric", "mesh", "woven", "synthetic", "imperfection", "torn", "white")),
789
+ ::anno::author("NVIDIA vMaterials"),
790
+ ::anno::contributor("Ruediger Raab"),
791
+ ::anno::contributor("Maik Rohland")
792
+ ]] = Fiberglass_Imperfections(
793
+ seed: 14,
794
+ fibers_shininess: 0.5f,
795
+ fiberglass_tint: color(0.812241f, 0.932277f, 0.957370f),
796
+ weaving_bump_strength: 0.75f,
797
+ fibers_bump_strength: 1.0f,
798
+ specular_weight: 1.0f,
799
+ diffuse_brightness: 0.75f,
800
+ diffuse_transmission_weight: 0.21f,
801
+
802
+ bumps_and_dents_probability: 0.0f,
803
+ bumps_dents_density: 4.5f,
804
+ bumps_kernel_size: 1.0f,
805
+ bumps_waves_size: 0.7f,
806
+ bumps_dents_size_variation: 0.9f,
807
+ bumps_dents_intensity: 1.0f,
808
+ bumps_dents_intensity_variation: 1.0f,
809
+
810
+ deformation_probability: 0.0f,
811
+ deformations_density: 5.0f,
812
+ deformations_size: 1.0f,
813
+ deformations_size_variation: 0.25f,
814
+ deformation_intensity: 0.31f,
815
+ deformation_intensity_variation: 1.0f,
816
+
817
+ tearing_probability: 0.47f,
818
+ tearings_density: 3.15f,
819
+ tearings_size: 1.0f,
820
+ tearing_size_variation: 0.36,
821
+ tearings_rotation: 0.0f,
822
+ tearings_rotation_randomization: 0.0f,
823
+
824
+ texture_translate: float2(0.0f),
825
+ texture_rotate: 0.0f,
826
+ texture_scale: float2(1.0f),
827
+ uv_space_index: 0
828
+ );
829
+
830
+
831
+
832
+ export material Fiberglass_Warped_Imperfections(*)
833
+ [[
834
+ ::anno::description("A fiberglass material with adjustable imperfections such as bumps, warps and tears."),
835
+ ::anno::display_name("Fiberglass with Warped Imperfections"),
836
+ ::anno::copyright_notice(COPYRIGHT),
837
+ ::anno::thumbnail("./.thumbs/Fiberglass_Imperfections.Fiberglass_Warped_Imperfections.png"),
838
+ ::anno::key_words(string[]("fiber", "fiberglass", "artificial", "design", "fabric", "mesh", "woven", "synthetic", "imperfection", "warped", "white")),
839
+ ::anno::author("NVIDIA vMaterials"),
840
+ ::anno::contributor("Ruediger Raab"),
841
+ ::anno::contributor("Maik Rohland")
842
+ ]] = Fiberglass_Imperfections(
843
+ seed: 14,
844
+ fibers_shininess: 0.5f,
845
+ fiberglass_tint: color(0.812241f, 0.932277f, 0.957370f),
846
+ weaving_bump_strength: 0.75f,
847
+ fibers_bump_strength: 1.0f,
848
+ specular_weight: 1.0f,
849
+ diffuse_brightness: 0.75f,
850
+ diffuse_transmission_weight: 0.21f,
851
+
852
+ bumps_and_dents_probability: 0.0f,
853
+ bumps_dents_density: 4.5f,
854
+ bumps_kernel_size: 1.0f,
855
+ bumps_waves_size: 0.7f,
856
+ bumps_dents_size_variation: 0.9f,
857
+ bumps_dents_intensity: 1.0f,
858
+ bumps_dents_intensity_variation: 1.0f,
859
+
860
+ deformation_probability: 0.84f,
861
+ deformations_density: 4.89f,
862
+ deformations_size: 1.0f,
863
+ deformations_size_variation: 0.25f,
864
+ deformation_intensity: 0.31f,
865
+ deformation_intensity_variation: 1.0f,
866
+
867
+ tearing_probability: 0.47f,
868
+ tearings_density: 3.15f,
869
+ tearings_size: 1.0f,
870
+ tearing_size_variation: 0.36,
871
+ tearings_rotation: 0.0f,
872
+ tearings_rotation_randomization: 0.0f,
873
+
874
+ texture_translate: float2(0.0f),
875
+ texture_rotate: 0.0f,
876
+ texture_scale: float2(1.0f),
877
+ uv_space_index: 0
878
+ );
code/third_party/vMaterials_2/Gems/Alexandrite.mdl ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2024 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
+
38
+ import ::anno::*;
39
+ import ::nvidia::core_definitions::flex_material;
40
+ import ::state::normal;
41
+
42
+
43
+ const string COPYRIGHT =
44
+ " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
45
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
46
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
47
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
48
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
49
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
50
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
51
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
52
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
53
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
54
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
55
+
56
+
57
+ export material Alexandrite(
58
+ uniform color transmission_color = color ( 0.8901961f , 0.509804f , 1.f)
59
+ [[
60
+ ::anno::display_name("Transmission Color"),
61
+ ::anno::description("Color effect for transmission independent of thickness of the object."),
62
+ ::anno::in_group("Appearance")
63
+ ]],
64
+ uniform color volume_color = color ( 0.2039216f , 0.9137255f , 0.3803922f)
65
+ [[
66
+ ::anno::display_name("Volume Color"),
67
+ ::anno::description("Color effect for volume of the object reached at transmission distance."),
68
+ ::anno::in_group("Appearance")
69
+ ]],
70
+ uniform float clarity = 1.f
71
+ [[
72
+ ::anno::display_name("Clarity"),
73
+ ::anno::description("Use to adapt to size of gem, smaller numbers darken the gem."),
74
+ ::anno::soft_range(0.1,10.0),
75
+ ::anno::in_group("Appearance")
76
+ ]])
77
+ [[
78
+ ::anno::display_name("Alexandrite"),
79
+ ::anno::description("Alexandrite gem material (Default values based on 2cm stone size.)"),
80
+ ::anno::author("NVIDIA vMaterials"),
81
+ ::anno::contributor("Rüdiger Raab"),
82
+ ::anno::contributor("Maik Rohland"),
83
+ ::anno::copyright_notice(COPYRIGHT),
84
+ ::anno::thumbnail("./.thumbs/Alexandrite.Alexandrite.png"),
85
+ ::anno::key_words(string[]("gem", "jewelry", "gemstone", "transmissive", "new", "design", "alexandrite", "green"))
86
+ ]]=
87
+ ::nvidia::core_definitions::flex_material(
88
+ base_color: color ( 1.f , 1.f , 1.f),
89
+ diffuse_roughness: 0.f,
90
+ is_metal: false,
91
+ reflectivity: 1.f,
92
+ reflection_roughness: 0.f,
93
+ anisotropy: 0.f,
94
+ anisotropy_rotation: 0.f,
95
+ transparency: 1.f,
96
+ transmission_color: transmission_color,
97
+ volume_color: volume_color,
98
+ transmission_roughness: 0.f,
99
+ base_thickness: clarity * 0.015f,
100
+ ior: 1.75f,
101
+ thin_walled: false,
102
+ normal: ::state::normal ());
code/third_party/vMaterials_2/Gems/Amethyst.mdl ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2024 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
+
38
+ import ::df::*;
39
+ import ::anno::*;
40
+ import ::base::*;
41
+ import ::math::*;
42
+ import ::nvidia::core_definitions::thick_glass;
43
+ import ::state::normal;
44
+
45
+ const string COPYRIGHT =
46
+ " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
47
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
48
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
49
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
50
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
51
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
52
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
53
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
54
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
55
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
56
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
57
+
58
+
59
+
60
+ export material Amethyst(
61
+ color transmission_color = color ( 0.9647059f , 0.6862745f , 0.9647059f)
62
+ [[
63
+ ::anno::display_name("Transmission Color"),
64
+ ::anno::description("Color effect for transmission independent of thickness of the object."),
65
+ ::anno::in_group("Appearance")
66
+ ]],
67
+ uniform color volume_color = color ( 0.427451f , 0.1294118f , 0.4745098f)
68
+ [[
69
+ ::anno::display_name("Volume Color"),
70
+ ::anno::description("Color effect for volume of the object reached at transmission distance."),
71
+ ::anno::in_group("Appearance")
72
+ ]],
73
+ uniform float clarity = 1.f
74
+ [[
75
+ ::anno::display_name("Clarity"),
76
+ ::anno::description("Use to adapt to size of gem, smaller numbers darken the gem."),
77
+ ::anno::soft_range(0.1,10.0),
78
+ ::anno::in_group("Appearance")
79
+ ]],
80
+ uniform bool dispersion = true
81
+ [[
82
+ ::anno::display_name("Dispersion"),
83
+ ::anno::description("Enable or disable the dispersion."),
84
+ ::anno::in_group("Advanced")
85
+ ]]
86
+ )
87
+ [[
88
+ ::anno::display_name("Amethyst"),
89
+ ::anno::description("Amethyst gem material (Default values based on 2cm stone size.)"),
90
+ ::anno::author("NVIDIA vMaterials"),
91
+ ::anno::contributor("Rüdiger Raab"),
92
+ ::anno::contributor("Maik Rohland"),
93
+ ::anno::copyright_notice(COPYRIGHT),
94
+ ::anno::thumbnail("./.thumbs/Amethyst.Amethyst.png"),
95
+ ::anno::key_words(string[]("gem", "jewelry", "gemstone", "transmissive", "new", "design", "amethyst", "purple"))
96
+ ]]
97
+ = let{
98
+
99
+ //color transmission_color = color(1.0);
100
+ color glass_color = volume_color;
101
+ float roughness = 0.0;
102
+ float volume_ior = 1.54f;
103
+ //uniform bool dispersion = true;
104
+ uniform float abbe_number = 67.82f;
105
+ uniform float base_thickness = clarity * 0.008f;
106
+ float3 normal = state::normal();
107
+
108
+ bsdf glossy_bsdf = df::simple_glossy_bsdf(
109
+ mode: df::scatter_reflect,
110
+ tint: color(1.),
111
+ roughness_u: roughness
112
+ );
113
+ bsdf glossy_bsdf_transmission = df::simple_glossy_bsdf(
114
+ mode: df::scatter_transmit,
115
+ tint: transmission_color,
116
+ roughness_u: roughness
117
+ );
118
+ } in material(
119
+ thin_walled: false,
120
+ surface: material_surface(
121
+ df::weighted_layer(
122
+ normal: normal,
123
+ weight: 1.,
124
+ layer: df::color_fresnel_layer(
125
+ layer: glossy_bsdf,
126
+ base: glossy_bsdf_transmission,
127
+
128
+ ior: dispersion?::base::abbe_number_ior(volume_ior, abbe_number):color(volume_ior)
129
+ )
130
+ )
131
+ ),
132
+ volume: material_volume(
133
+ absorption_coefficient: (base_thickness <= 0)? color(0): math::log(glass_color) / -base_thickness
134
+ ),
135
+ ior: dispersion?base::abbe_number_ior(volume_ior, abbe_number):color(volume_ior)
136
+ );
code/third_party/vMaterials_2/Gems/Ametrine.mdl ADDED
@@ -0,0 +1,161 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2024 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
+
38
+ import ::anno::*;
39
+ import ::base::texture_return;
40
+ import ::nvidia::core_definitions::blend;
41
+ import ::nvidia::core_definitions::flex_material;
42
+ import ::nvidia::core_definitions::flow_noise_texture;
43
+ import ::nvidia::core_definitions::dimension;
44
+ import ::state::normal;
45
+
46
+ const string COPYRIGHT =
47
+ " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
48
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
49
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
50
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
51
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
52
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
53
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
54
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
55
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
56
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
57
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
58
+
59
+ export material Ametrine(
60
+ uniform color gem_transmission_color= color ( 0.8431373f , 0.6509804f , 0.8666667f)
61
+ [[
62
+ ::anno::display_name("Gem Transmission Color"),
63
+ ::anno::description("Gem color."),
64
+ ::anno::in_group("Appearance")
65
+ ]],
66
+ uniform color vein_transmission_color = color ( 1.f , 0.9137255f , 0.5843138f)
67
+ [[
68
+ ::anno::display_name("Vein Transmission Color"),
69
+ ::anno::description("Vein Color."),
70
+ ::anno::in_group("Appearance")
71
+ ]],
72
+ uniform color volume_color = color ( 0.9647059f , 0.6431373f , 0.7882353f)
73
+ [[
74
+ ::anno::display_name("Volume Color"),
75
+ ::anno::description("Color effect for volume of the object reached at transmission distance."),
76
+ ::anno::in_group("Appearance")
77
+ ]],
78
+ uniform float clarity = 1.f
79
+ [[
80
+ ::anno::display_name("Clarity"),
81
+ ::anno::description("Use to adapt to size of object."),
82
+ ::anno::soft_range(0.1,10.0),
83
+ ::anno::in_group("Appearance")
84
+ ]],
85
+ uniform float3 texture_translate = float3 ( 0.f)
86
+ [[
87
+ ::anno::display_name("Translate"),
88
+ ::anno::description("Controls the position of the texture."),
89
+ ::anno::in_group("Transform")
90
+ ]],
91
+ uniform float3 texture_rotate = float3 ( 0.f)
92
+ [[
93
+ ::anno::display_name("Rotate"),
94
+ ::anno::description("Rotates angle of the texture in degrees."),
95
+ ::anno::in_group("Transform")
96
+ ]],
97
+ uniform float texture_scale = 1.f
98
+ [[
99
+ ::anno::display_name("Scale"),
100
+ ::anno::description("Larger numbers increase the texture size."),
101
+ ::anno::in_group("Transform"),
102
+ ::nvidia::core_definitions::dimension(0.04f)
103
+ ]])
104
+ [[
105
+ ::anno::display_name("Ametrine"),
106
+ ::anno::description("Ametrine gem material (Default values based on 2cm stone size.)"),
107
+ ::anno::author("NVIDIA vMaterials"),
108
+ ::anno::contributor("Rüdiger Raab"),
109
+ ::anno::contributor("Maik Rohland"),
110
+ ::anno::copyright_notice(COPYRIGHT),
111
+ ::anno::thumbnail("./.thumbs/Ametrine.Ametrine.png"),
112
+ ::anno::key_words(string[]("gem", "jewelry", "gemstone", "transmissive", "new", "design", "Ametrine"))
113
+ ]]=
114
+ ::nvidia::core_definitions::blend(
115
+ base: ::nvidia::core_definitions::flex_material(
116
+ base_color: color ( 0.5f , 0.5f , 0.5f),
117
+ diffuse_roughness: 0.f,
118
+ is_metal: false,
119
+ reflectivity: 1.f,
120
+ reflection_roughness: 0.f,
121
+ anisotropy: 0.f,
122
+ anisotropy_rotation: 0.f,
123
+ transparency: 1.f,
124
+ transmission_color: gem_transmission_color,
125
+ volume_color: volume_color,
126
+ transmission_roughness: 0.f,
127
+ base_thickness: clarity * 0.3f,
128
+ ior: 1.6f,
129
+ thin_walled: false,
130
+ normal: ::state::normal ()),
131
+ blend: ::nvidia::core_definitions::flex_material(
132
+ base_color: color ( 1.f , 1.f , 1.f),
133
+ diffuse_roughness: 0.f,
134
+ is_metal: false,
135
+ reflectivity: 1.f,
136
+ reflection_roughness: 0.f,
137
+ anisotropy: 0.f,
138
+ anisotropy_rotation: 0.f,
139
+ transparency: 1.f,
140
+ transmission_color: vein_transmission_color,
141
+ volume_color: volume_color,
142
+ transmission_roughness: 0.f,
143
+ base_thickness: clarity * 0.2f,
144
+ ior: 1.6f,
145
+ thin_walled: false,
146
+ normal: ::state::normal ()),
147
+ weight: ::nvidia::core_definitions::flow_noise_texture(
148
+ color1: color ( 1.f , 1.f , 1.f),
149
+ color2: color ( 0.f , 0.f , 0.f),
150
+ object_space: true,
151
+ texture_space: 0,
152
+ noise_levels: 3,
153
+ absolute_noise: false,
154
+ phase: 0.f,
155
+ level_gain: 3.f,
156
+ level_scale: 1.f,
157
+ level_progressive_u_scale: 0.3f,
158
+ level_progressive_v_motion: 0.f,
159
+ scaling: float3 ( (2.f / (texture_scale)) * 20.f , 0.f , 0.f),
160
+ translation: texture_translate ,
161
+ rotation: float3 ( texture_rotate.x + 0.f , texture_rotate.y + 0.f , texture_rotate.z + 45.f)).mono);
code/third_party/vMaterials_2/Gems/Aquamarine.mdl ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2024 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
+
38
+ import ::anno::*;
39
+ import ::nvidia::core_definitions::thick_glass;
40
+ import ::state::normal;
41
+
42
+ const string COPYRIGHT =
43
+ " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
44
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
45
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
46
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
47
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
48
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
49
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
50
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
51
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
52
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
53
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
54
+
55
+
56
+ export material Aquamarine(
57
+ color transmission_color = color(0.982251f, 0.982251f, 0.879622f) // vmat 1.7: ( 1.f , 1.f , 0.8823529f)
58
+ [[
59
+ ::anno::display_name("Transmission Color"),
60
+ ::anno::description("Color effect for transmission independent of thickness of the object."),
61
+ ::anno::in_group("Appearance")
62
+ ]],
63
+ uniform color volume_color = color ( 0.9294118f , 0.972549f , 0.9803922f)
64
+ [[
65
+ ::anno::display_name("Volume Color"),
66
+ ::anno::description("Color effect for volume of the object reached at transmission distance."),
67
+ ::anno::in_group("Appearance")
68
+ ]],
69
+ uniform float clarity = 1.f
70
+ [[
71
+ ::anno::display_name("Clarity"),
72
+ ::anno::description("Use to adapt to size of gem, smaller numbers darken the gem."),
73
+ ::anno::soft_range(0.1,10.0),
74
+ ::anno::in_group("Appearance")
75
+ ]])
76
+ [[
77
+ ::anno::display_name("Aquamarine"),
78
+ ::anno::description("Aquamarine gem material (Default values based on 2cm stone size.)"),
79
+ ::anno::author("NVIDIA vMaterials"),
80
+ ::anno::contributor("Rüdiger Raab"),
81
+ ::anno::contributor("Maik Rohland"),
82
+ ::anno::copyright_notice(COPYRIGHT),
83
+ ::anno::thumbnail("./.thumbs/Aquamarine.Aquamarine.png"),
84
+ ::anno::key_words(string[]("gem", "jewelry", "gemstone", "transmissive", "new", "design", "Aquamarine"))
85
+ ]]=
86
+ ::nvidia::core_definitions::thick_glass(
87
+ transmission_color: transmission_color,
88
+ glass_color: volume_color,
89
+ roughness: 0.003f,
90
+ ior: 1.57f,
91
+ base_thickness: clarity * 0.001f,
92
+ normal: ::state::normal ());
code/third_party/vMaterials_2/Gems/Citrine.mdl ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2024 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
+
38
+ import ::anno::*;
39
+ import ::base::*;
40
+ import ::math::*;
41
+ import ::state::*;
42
+ import ::df::*;
43
+ import ::nvidia::core_definitions::thick_glass;
44
+
45
+ const string COPYRIGHT =
46
+ " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
47
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
48
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
49
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
50
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
51
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
52
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
53
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
54
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
55
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
56
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
57
+
58
+
59
+ export material Citrine(
60
+ color transmission_color = color (0.982251f, 0.982251f, 0.846873f) //vmat 1.7: ( 1.f , 1.f , 0.8509804f)
61
+ [[
62
+ ::anno::display_name("Transmission Color"),
63
+ ::anno::description("Color effect for transmission independent of thickness of the object."),
64
+ ::anno::in_group("Appearance")
65
+ ]],
66
+ uniform color volume_color = color ( 1.f , 0.8117647f , 0.4745098f)
67
+ [[
68
+ ::anno::display_name("Volume Color"),
69
+ ::anno::description("Color effect for volume of the object reached at transmission distance."),
70
+ ::anno::in_group("Appearance")
71
+ ]],
72
+ uniform float clarity = 1.f
73
+ [[
74
+ ::anno::display_name("Clarity"),
75
+ ::anno::description("Use to adapt to size of gem, smaller numbers darken the gem."),
76
+ ::anno::soft_range(0.1,10.0),
77
+ ::anno::in_group("Appearance")
78
+ ]],
79
+ uniform bool dispersion = true
80
+ [[
81
+ ::anno::display_name("Dispersion"),
82
+ ::anno::description("Enable or disable the dispersion."),
83
+ ::anno::in_group("Advanced")
84
+ ]]
85
+
86
+ )
87
+ [[
88
+ ::anno::display_name("Citrine"),
89
+ ::anno::description("Citrine gem material (Default values based on 2cm stone size.)"),
90
+ ::anno::author("NVIDIA vMaterials"),
91
+ ::anno::contributor("Rüdiger Raab"),
92
+ ::anno::contributor("Maik Rohland"),
93
+ ::anno::copyright_notice(COPYRIGHT),
94
+ ::anno::thumbnail("./.thumbs/Citrine.Citrine.png"),
95
+ ::anno::key_words(string[]("gem", "jewelry", "gemstone", "transmissive", "new", "design", "Citrine", "orange", "warm"))
96
+ ]]
97
+ = let{
98
+ uniform color glass_color = volume_color;
99
+ float roughness = 0.003f;
100
+ uniform float volume_ior = 1.545f;
101
+ //uniform bool dispersion = true;
102
+ uniform float abbe_number = 67.82f;
103
+ uniform float base_thickness = clarity * 0.01f;
104
+ float3 normal = ::state::normal();
105
+
106
+ bsdf glossy_bsdf = ::df::simple_glossy_bsdf(
107
+ mode: ::df::scatter_reflect,
108
+ tint: color(1.),
109
+ roughness_u: roughness
110
+ );
111
+ bsdf glossy_bsdf_transmission = ::df::simple_glossy_bsdf(
112
+ mode: ::df::scatter_transmit,
113
+ tint: transmission_color,
114
+ roughness_u: roughness
115
+ );
116
+ } in material(
117
+ thin_walled: false,
118
+ surface: material_surface(
119
+ ::df::weighted_layer(
120
+ normal: normal,
121
+ weight: 1.,
122
+ layer: ::df::color_fresnel_layer(
123
+ layer: glossy_bsdf,
124
+ base: glossy_bsdf_transmission,
125
+ ior: dispersion?(::base::abbe_number_ior(volume_ior, abbe_number)):color(volume_ior)
126
+ )
127
+ )
128
+ ),
129
+ volume: material_volume(
130
+ absorption_coefficient: (base_thickness <= 0)? color(0): ::math::log(glass_color) / -base_thickness
131
+ ),
132
+ ior: dispersion?::base::abbe_number_ior(volume_ior, abbe_number):color(volume_ior)
133
+ );
code/third_party/vMaterials_2/Gems/Diamond.mdl ADDED
@@ -0,0 +1,235 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2024 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
+
38
+ import ::anno::*;
39
+ import ::df::*;
40
+ import ::base::*;
41
+ import ::math::*;
42
+ import ::nvidia::core_definitions::apply_colorfalloff;
43
+ import ::nvidia::core_definitions::thick_glass;
44
+ import ::state::normal;
45
+
46
+ const string COPYRIGHT =
47
+ " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
48
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
49
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
50
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
51
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
52
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
53
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
54
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
55
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
56
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
57
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
58
+
59
+ /*
60
+ bsdf apply_colorfalloff_v2(
61
+ material base = scratched_metal_v2(metal_color: color(1.)),
62
+ uniform color color_0 = color(1.,0.,0.),
63
+ uniform color color_1 = color(0.,1.,0.),
64
+ uniform color color_2 = color(0.,0.,1.),
65
+ uniform color color_3 = color(1.,0.,0.),
66
+ uniform color color_4 = color(0.,1.,0.)
67
+ )
68
+ = material(
69
+ surface: material_surface(
70
+ scattering: df::measured_curve_factor(
71
+ curve_values: color[](color_0,color_1,color_2,color_3,color_4),
72
+ base: base.surface.scattering
73
+ ),
74
+ emission: base.surface.emission
75
+ ),
76
+ volume: base.volume,
77
+ ior: base.ior,
78
+ thin_walled: base.thin_walled,
79
+ geometry: base.geometry
80
+ );
81
+
82
+
83
+ material gem_definition(
84
+ color transmission_color = color(1.0),
85
+ uniform color glass_color = color(.95),
86
+ float roughness = 0.0,
87
+ uniform float volume_ior = 1.4f,
88
+ uniform bool dispersion = true,
89
+ uniform float abbe_number = 1.4f,
90
+ uniform float base_thickness = .1,
91
+ float3 normal = ::state::normal()
92
+ )
93
+ [[
94
+ ::anno::hidden()
95
+ ]]
96
+ = let{
97
+
98
+ bsdf glossy_bsdf = ::df::simple_glossy_bsdf(
99
+ mode: ::df::scatter_reflect,
100
+ tint: color(1.),
101
+ roughness_u: roughness
102
+ );
103
+ bsdf glossy_bsdf_transmission = ::df::simple_glossy_bsdf(
104
+ mode: ::df::scatter_transmit,
105
+ tint: transmission_color,
106
+ roughness_u: roughness
107
+ );
108
+
109
+ bsdf surface_bsdf = ::df::weighted_layer(
110
+ normal: normal,
111
+ weight: 1.,
112
+ layer: ::df::color_fresnel_layer(
113
+ layer: glossy_bsdf,
114
+ base: glossy_bsdf_transmission,
115
+ ior: dispersion?::base::abbe_number_ior(volume_ior, abbe_number):color(volume_ior)
116
+ )
117
+ );
118
+
119
+ } in material(
120
+ thin_walled: false,
121
+ surface: material_surface(scattering: surface_bsdf ),
122
+ volume: material_volume(
123
+ absorption_coefficient: (base_thickness <= 0)? color(0): ::math::log(glass_color) / -base_thickness
124
+ ),
125
+ ior: dispersion?::base::abbe_number_ior(volume_ior, abbe_number):color(volume_ior)
126
+ );
127
+ */
128
+
129
+ export material Diamond(
130
+ color transmission_color = color ( 1.f , 1.f , 1.f)
131
+ [[
132
+ ::anno::display_name("Transmission Color"),
133
+ ::anno::description("Color effect for transmission independent of thickness of the object."),
134
+ ::anno::in_group("Appearance")
135
+ ]],
136
+ uniform color volume_color = color ( 1.f , 1.f , 1.f)
137
+ [[
138
+ ::anno::display_name("Volume Color"),
139
+ ::anno::description("Color effect for volume of the object reached at transmission distance."),
140
+ ::anno::in_group("Appearance")
141
+ ]],
142
+ uniform float clarity = 1.f
143
+ [[
144
+ ::anno::display_name("Clarity"),
145
+ ::anno::description("Use to adapt to size of gem, smaller numbers darken the gem."),
146
+ ::anno::soft_range(0.1,10.0),
147
+ ::anno::in_group("Appearance")
148
+ ]],
149
+ uniform bool dispersion = true
150
+ [[
151
+ ::anno::display_name("Dispersion"),
152
+ ::anno::description("Enable or disable the dispersion."),
153
+ ::anno::in_group("Advanced")
154
+ ]])
155
+ [[
156
+ ::anno::display_name("Diamond"),
157
+ ::anno::description("Diamond gem material (Default values based on 2cm stone size.)"),
158
+ ::anno::author("NVIDIA vMaterials"),
159
+ ::anno::contributor("Rüdiger Raab"),
160
+ ::anno::contributor("Maik Rohland"),
161
+ ::anno::copyright_notice(COPYRIGHT),
162
+ ::anno::thumbnail("./.thumbs/Diamond.Diamond.png"),
163
+ ::anno::key_words(string[]("gem", "jewelry", "gemstone", "transmissive", "new", "design", "transparent", "diamond", "purple"))
164
+ ]] =
165
+ let{
166
+ // Gem definition
167
+ // uniform color glass_color = color(.95),
168
+ float roughness = 0.0;
169
+ float volume_ior = 2.42f;
170
+ float abbe_number = 55.f;
171
+ float base_thickness = clarity * 0.1f;
172
+ // float3 normal = ::state::normal()
173
+
174
+ bsdf glossy_bsdf = ::df::simple_glossy_bsdf(
175
+ mode: ::df::scatter_reflect,
176
+ tint: color(1.),
177
+ roughness_u: roughness
178
+ );
179
+ bsdf glossy_bsdf_transmission = ::df::simple_glossy_bsdf(
180
+ mode: ::df::scatter_transmit,
181
+ tint: transmission_color,
182
+ roughness_u: roughness
183
+ );
184
+
185
+ bsdf surface_bsdf = ::df::weighted_layer(
186
+ //normal: normal, // is state::normal anyways, can be omitted
187
+ weight: 1.,
188
+ layer: ::df::color_fresnel_layer(
189
+ layer: glossy_bsdf,
190
+ base: glossy_bsdf_transmission,
191
+ ior: dispersion?::base::abbe_number_ior(volume_ior, abbe_number):color(volume_ior)
192
+ )
193
+ );
194
+
195
+ bsdf falloff_bsdf = df::measured_curve_factor(
196
+ curve_values: color[](color( 0.9529412f , 0.972549f , 1.f),
197
+ color( 1.f , 0.9529412f , 0.9960784f),
198
+ color( 0.9529412f , 0.9764706f , 1.f),
199
+ color( 0.9529412f , 1.f , 0.9960784f),
200
+ color( 1.f , 0.9529412f , 0.9843137f)
201
+ ),
202
+ base: surface_bsdf
203
+ );
204
+
205
+
206
+ // the apply color falloff function does nothing but add a color gradient while keeping the material'sample
207
+ // other properties
208
+
209
+ /*
210
+ ::nvidia::core_definitions::apply_colorfalloff(
211
+ base: gem_definition(
212
+ transmission_color: transmission_color, // CHECK
213
+ glass_color: volume_color, // CHECK was modified in the material+_colume expresion
214
+ roughness: 0.f, // CHECK
215
+ volume_ior: 2.42F, // CHECK
216
+ dispersion: dispersion, // CHECK
217
+ abbe_number: 55.f, // CHECK
218
+ base_thickness: clarity * 0.1f, // CHECK
219
+ normal: ::state::normal ()), // CHECK
220
+ color_0: color( 0.9529412f , 0.972549f , 1.f), // CHECK
221
+ color_1: color( 1.f , 0.9529412f , 0.9960784f),// CHECK
222
+ color_2: color( 0.9529412f , 0.9764706f , 1.f),// CHECK
223
+ color_3: color( 0.9529412f , 1.f , 0.9960784f),// CHECK
224
+ color_4: color( 1.f , 0.9529412f , 0.9843137f));// CHECK
225
+ */
226
+
227
+ } in material(
228
+ thin_walled: false,
229
+ surface: material_surface(scattering: falloff_bsdf ),
230
+ volume: material_volume(
231
+ absorption_coefficient: (base_thickness <= 0)? color(0): ::math::log(volume_color) / -base_thickness
232
+ ),
233
+ ior: dispersion?::base::abbe_number_ior(volume_ior, abbe_number):color(volume_ior)
234
+ );
235
+
code/third_party/vMaterials_2/Gems/Emerald.mdl ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2024 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
+
38
+ import ::anno::*;
39
+ import ::nvidia::core_definitions::thick_glass;
40
+ import ::state::normal;
41
+
42
+
43
+ const string COPYRIGHT =
44
+ " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
45
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
46
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
47
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
48
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
49
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
50
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
51
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
52
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
53
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
54
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
55
+
56
+
57
+ export material Emerald(
58
+ color transmission_color = color(0.456411f, 0.982251f, 0.982251f) // vmat 1.7: ( 0.4627451f , 1.f , 1.f)
59
+ [[
60
+ ::anno::display_name("Transmission Color"),
61
+ ::anno::description("Color effect for transmission independent of thickness of the object."),
62
+ ::anno::in_group("Appearance")
63
+ ]],
64
+ uniform color volume_color = color ( 0.01960784f , 0.3176471f , 0.1058824f)
65
+ [[
66
+ ::anno::display_name("Volume Color"),
67
+ ::anno::description("Color effect for volume of the object reached at transmission distance."),
68
+ ::anno::in_group("Appearance")
69
+ ]],
70
+ uniform float clarity = 1.f
71
+ [[
72
+ ::anno::display_name("Clarity"),
73
+ ::anno::description("Use to adapt to size of gem, smaller numbers darken the gem."),
74
+ ::anno::soft_range(0.1,10.0),
75
+ ::anno::in_group("Appearance")
76
+ ]])
77
+ [[
78
+ ::anno::display_name("Emerald"),
79
+ ::anno::description("Emerald gem material (Default values based on 2cm stone size.)"),
80
+ ::anno::author("NVIDIA vMaterials"),
81
+ ::anno::contributor("Rüdiger Raab"),
82
+ ::anno::contributor("Maik Rohland"),
83
+ ::anno::copyright_notice(COPYRIGHT),
84
+ ::anno::thumbnail("./.thumbs/Emerald.Emerald.png"),
85
+ ::anno::key_words(string[]("gem", "jewelry", "gemstone", "transmissive", "new", "design", "emerald", "green"))
86
+ ]]=
87
+ ::nvidia::core_definitions::thick_glass(
88
+ transmission_color: transmission_color,
89
+ glass_color: volume_color,
90
+ roughness: 0.06f,
91
+ ior: 1.58f,
92
+ base_thickness: clarity * 0.015f,
93
+ normal: ::state::normal ());
code/third_party/vMaterials_2/Gems/Garnet.mdl ADDED
@@ -0,0 +1,147 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2024 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
+
38
+ import ::anno::*;
39
+ import ::df::*;
40
+ import ::math::*;
41
+ import ::base::*;
42
+ import ::nvidia::core_definitions::thick_glass;
43
+ import ::state::normal;
44
+
45
+ const string COPYRIGHT =
46
+ " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
47
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
48
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
49
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
50
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
51
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
52
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
53
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
54
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
55
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
56
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
57
+
58
+
59
+ material gem_definition(
60
+ color transmission_color = color(1.0),
61
+ uniform color glass_color = color(.95),
62
+ float roughness = 0.0,
63
+ uniform float volume_ior = 1.4f,
64
+ uniform bool dispersion = true,
65
+ uniform float abbe_number = 1.4f,
66
+ uniform float base_thickness = .1,
67
+ float3 normal = ::state::normal()
68
+ )
69
+ [[
70
+ ::anno::hidden()
71
+ ]]
72
+ = let{
73
+
74
+ bsdf glossy_bsdf = ::df::simple_glossy_bsdf(
75
+ mode: ::df::scatter_reflect,
76
+ tint: color(1.),
77
+ roughness_u: roughness
78
+ );
79
+ bsdf glossy_bsdf_transmission = ::df::simple_glossy_bsdf(
80
+ mode: ::df::scatter_transmit,
81
+ tint: transmission_color,
82
+ roughness_u: roughness
83
+ );
84
+ } in material(
85
+ thin_walled: false,
86
+ surface: material_surface(
87
+ ::df::weighted_layer(
88
+ normal: normal,
89
+ weight: 1.,
90
+ layer: ::df::color_fresnel_layer(
91
+ layer: glossy_bsdf,
92
+ base: glossy_bsdf_transmission,
93
+ ior: dispersion?::base::abbe_number_ior(volume_ior, abbe_number):color(volume_ior)
94
+ )
95
+ )
96
+ ),
97
+ volume: material_volume(
98
+ absorption_coefficient: (base_thickness <= 0)? color(0): ::math::log(glass_color) / -base_thickness
99
+ ),
100
+ ior: dispersion?::base::abbe_number_ior(volume_ior, abbe_number):color(volume_ior)
101
+ );
102
+
103
+
104
+ export material Garnet(
105
+ color transmission_color = color(0.982251f, 0.428690f, 0.116971f) //vmat 1.7: ( 1.f , 0.4392157f , 0.1176471f)
106
+ [[
107
+ ::anno::display_name("Transmission Color"),
108
+ ::anno::description("Color effect for transmission independent of thickness of the object."),
109
+ ::anno::in_group("Appearance")
110
+ ]],
111
+ uniform color volume_color = color ( 0.3098039f , 0.003921569f , 0.003921569f)
112
+ [[
113
+ ::anno::display_name("Volume Color"),
114
+ ::anno::description("Color effect for volume of the object reached at transmission distance."),
115
+ ::anno::in_group("Appearance")
116
+ ]],
117
+ uniform float clarity = 1.0f
118
+ [[
119
+ ::anno::display_name("Clarity"),
120
+ ::anno::description("UUse to adapt to size of gem, smaller numbers darken the gem."),
121
+ ::anno::soft_range(0.1,10.0),
122
+ ::anno::in_group("Appearance")
123
+ ]],
124
+ uniform bool dispersion = true
125
+ [[
126
+ ::anno::display_name("Dispersion"),
127
+ ::anno::description("Enable or disable the dispersion."),
128
+ ::anno::in_group("Advanced")
129
+ ]])
130
+ [[
131
+ ::anno::display_name("Garnet"),
132
+ ::anno::description("Garnet gem material (Default values based on 2cm stone size.)"),
133
+ ::anno::author("NVIDIA vMaterials"),
134
+ ::anno::contributor("Rüdiger Raab"),
135
+ ::anno::contributor("Maik Rohland"),
136
+ ::anno::copyright_notice(COPYRIGHT),
137
+ ::anno::thumbnail("./.thumbs/Garnet.Garnet.png"),
138
+ ::anno::key_words(string[]("gem", "jewelry", "gemstone", "transmissive", "new", "design", "garnet", "red", "warm", "dark"))
139
+ ]]= gem_definition(
140
+ transmission_color: transmission_color,
141
+ glass_color: volume_color,
142
+ roughness: 0.03f,
143
+ volume_ior: 1.91f,
144
+ dispersion: dispersion,
145
+ abbe_number: 52.57f,
146
+ base_thickness: clarity * 0.01f,
147
+ normal: ::state::normal ());
code/third_party/vMaterials_2/Gems/Iolite.mdl ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2024 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
+
38
+ import ::anno::*;
39
+ import ::nvidia::core_definitions::thick_glass;
40
+ import ::state::normal;
41
+
42
+ const string COPYRIGHT =
43
+ " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
44
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
45
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
46
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
47
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
48
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
49
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
50
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
51
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
52
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
53
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
54
+
55
+ export material Iolite(
56
+ color transmission_color = color ( 0.6117647f , 0.6117647f , 1.f)
57
+ [[
58
+ ::anno::display_name("Transmission Color"),
59
+ ::anno::description("Color effect for transmission independent of thickness of the object."),
60
+ ::anno::in_group("Appearance")
61
+ ]],
62
+ uniform color volume_color = color ( 0.2392157f , 0.172549f , 0.5843138f)
63
+ [[
64
+ ::anno::display_name("Volume Color"),
65
+ ::anno::description("Color effect for volume of the object reached at transmission distance."),
66
+ ::anno::in_group("Appearance")
67
+ ]],
68
+ uniform float clarity = 1.f
69
+ [[
70
+ ::anno::display_name("Clarity"),
71
+ ::anno::description("Use to adapt to size of gem, smaller numbers darken the gem."),
72
+ ::anno::soft_range(0.1,10.0),
73
+ ::anno::in_group("Appearance")
74
+ ]])
75
+ [[
76
+ ::anno::display_name("Iolite"),
77
+ ::anno::description("Iolite gem material (Default values based on 2cm stone size.)"),
78
+ ::anno::author("NVIDIA vMaterials"),
79
+ ::anno::contributor("Rüdiger Raab"),
80
+ ::anno::contributor("Maik Rohland"),
81
+ ::anno::copyright_notice(COPYRIGHT),
82
+ ::anno::thumbnail("./.thumbs/Iolite.Iolite.png"),
83
+ ::anno::key_words(string[]("gem", "jewelry", "gemstone", "transmissive", "new", "design", "iolite", "blue", "cool"))
84
+ ]]=
85
+ ::nvidia::core_definitions::thick_glass(
86
+ transmission_color: transmission_color,
87
+ glass_color: volume_color,
88
+ roughness: 0.02f,
89
+ ior: 1.59f,
90
+ base_thickness: clarity * 0.03f,
91
+ normal: ::state::normal ());
code/third_party/vMaterials_2/Gems/Jade.mdl ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2024 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
+
38
+ import ::anno::*;
39
+ import ::base::texture_return;
40
+ import ::nvidia::core_definitions::perlin_noise_texture;
41
+ import ::state::normal;
42
+ import ::nvidia::core_definitions::thick_translucent;
43
+ import ::nvidia::core_definitions::dimension;
44
+
45
+ const string COPYRIGHT =
46
+ " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
47
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
48
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
49
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
50
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
51
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
52
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
53
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
54
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
55
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
56
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
57
+
58
+
59
+ export material Jade(
60
+ color transmission_color1 = color ( 0.8352941f , 0.8431373f , 0.6039216f)
61
+ [[
62
+ ::anno::display_name("Transmission Color 1"),
63
+ ::anno::description("Color effect for transmission independent of thickness of the object."),
64
+ ::anno::in_group("Appearance")
65
+ ]],
66
+ color transmission_color2 = color ( 0.4392157f , 0.6509804f , 0.282353f)
67
+ [[
68
+ ::anno::display_name("Transmission Color 2"),
69
+ ::anno::description("Color effect for transmission independent of thickness of the object."),
70
+ ::anno::in_group("Appearance")
71
+ ]],
72
+ uniform color volume_color = color ( 0.3488667f , 0.4877647f , 0.3940823f)
73
+ [[
74
+ ::anno::display_name("Volume Color"),
75
+ ::anno::description("Color effect for volume of the object reached at transmission distance."),
76
+ ::anno::in_group("Appearance")
77
+ ]],
78
+ uniform float clarity = 1.f
79
+ [[
80
+ ::anno::display_name("Clarity"),
81
+ ::anno::description("Use to adapt to size of gem, smaller numbers darken the gem."),
82
+ ::anno::soft_range(0.1,10.0),
83
+ ::anno::in_group("Appearance")
84
+ ]],
85
+ uniform float3 texture_translate = float3 ( 0.f)
86
+ [[
87
+ ::anno::display_name("Translate"),
88
+ ::anno::description("Controls the position of the texture."),
89
+ ::anno::in_group("Transform")
90
+ ]],
91
+ uniform float3 texture_rotate = float3 ( 0.f)
92
+ [[
93
+ ::anno::display_name("Rotate"),
94
+ ::anno::description("Rotates angle of the texture in degrees."),
95
+ ::anno::in_group("Transform")
96
+ ]],
97
+ uniform float3 texture_scale = float3 ( 1.f)
98
+ [[
99
+ ::anno::display_name("Scale"),
100
+ ::anno::description("Larger numbers increase the texture size."),
101
+ ::anno::in_group("Transform"),
102
+ ::nvidia::core_definitions::dimension(float3(1.0f, 1.0f, 1.0f))
103
+ ]])
104
+ [[
105
+ ::anno::display_name("Jade"),
106
+ ::anno::description("Jade gem material (Default values based on 2cm stone size.)"),
107
+ ::anno::author("NVIDIA vMaterials"),
108
+ ::anno::contributor("Rüdiger Raab"),
109
+ ::anno::contributor("Maik Rohland"),
110
+ ::anno::copyright_notice(COPYRIGHT),
111
+ ::anno::thumbnail("./.thumbs/Jade.Jade.png"),
112
+ ::anno::key_words(string[]("gem", "jewelry", "gemstone", "transmissive", "new", "design", "jade", "green"))
113
+ ]]=
114
+ ::nvidia::core_definitions::thick_translucent(
115
+ transmission_color: ::nvidia::core_definitions::perlin_noise_texture(
116
+ color1: transmission_color1,
117
+ color2: transmission_color2,
118
+ object_space: true,
119
+ noise_levels: 3,
120
+ absolute_noise: true,
121
+ noise_threshold_high: 0.5f,
122
+ noise_threshold_low: 0.f,
123
+ scaling: float3 ( (1.f / texture_scale.x) * 400.f , (1.f / texture_scale.y) * 400.f , (1.f / texture_scale.z) * 380.f),
124
+ translation: texture_translate ,
125
+ rotation: texture_rotate + float3 ( 0.f, 0.f, 0.f),
126
+ texture_space: 0).tint,
127
+ volume_color: volume_color,
128
+ volume_scattering: 0.98f,
129
+ roughness: 0.1f,
130
+ reflectivity: 0.85f,
131
+ base_thickness: clarity * 0.01f,
132
+ normal: ::state::normal (),
133
+ ior: 1.61f);
code/third_party/vMaterials_2/Gems/Morganite.mdl ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2024 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
+
38
+ import ::anno::*;
39
+ import ::nvidia::core_definitions::thick_glass;
40
+ import ::state::normal;
41
+
42
+ const string COPYRIGHT =
43
+ " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
44
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
45
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
46
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
47
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
48
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
49
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
50
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
51
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
52
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
53
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
54
+
55
+ export material Morganite(
56
+ color transmission_color = color(0.982251f, 0.955973f, 0.791298f) // vmat 1.7: ( 1.f , 0.9647059f , 0.8039216f)
57
+ [[
58
+ ::anno::display_name("Transmission Color"),
59
+ ::anno::description("Color effect for transmission independent of thickness of the object."),
60
+ ::anno::in_group("Appearance")
61
+ ]],
62
+ uniform color volume_color = color(0.982251f, 0.768151f, 0.846873f) // vmat 1.7: ( 1.f , 0.7882353f , 0.8666667f)
63
+ [[
64
+ ::anno::display_name("Volume Color"),
65
+ ::anno::description("Color effect for volume of the object reached at transmission distance."),
66
+ ::anno::in_group("Appearance")
67
+ ]],
68
+ uniform float clarity = 1.0f
69
+ [[
70
+ ::anno::display_name("Clarity"),
71
+ ::anno::description("Use to adapt to size of gem, smaller numbers darken the gem."),
72
+ ::anno::soft_range(0.1,10.0),
73
+ ::anno::in_group("Appearance")
74
+ ]])
75
+ [[
76
+ ::anno::display_name("Morganite"),
77
+ ::anno::description("Morganite gem material (Default values based on 2cm stone size.)"),
78
+ ::anno::author("NVIDIA vMaterials"),
79
+ ::anno::contributor("Rüdiger Raab"),
80
+ ::anno::contributor("Maik Rohland"),
81
+ ::anno::copyright_notice(COPYRIGHT),
82
+ ::anno::thumbnail("./.thumbs/Morganite.Morganite.png"),
83
+ ::anno::key_words(string[]("gem", "jewelry", "gemstone", "transmissive", "new", "design", "morganite", "purple"))
84
+ ]]=
85
+ ::nvidia::core_definitions::thick_glass(
86
+ transmission_color: transmission_color,
87
+ glass_color: volume_color,
88
+ roughness: 0.003f,
89
+ ior: 1.595f,
90
+ base_thickness: clarity * 0.01f,
91
+ normal: ::state::normal ());
code/third_party/vMaterials_2/Gems/Onyx.mdl ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2024 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
+
38
+ import ::anno::*;
39
+ import ::base::color_layer_mode;
40
+ import ::base::texture_return;
41
+ import ::nvidia::core_definitions::blend_colors;
42
+ import ::nvidia::core_definitions::checker_texture;
43
+ import ::nvidia::core_definitions::flow_noise_texture;
44
+ import ::nvidia::core_definitions::thick_translucent;
45
+ import ::nvidia::core_definitions::dimension;
46
+ import ::state::normal;
47
+
48
+ const string COPYRIGHT =
49
+ " Copyright 2024 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
+ export material Onyx(
62
+ color transmission_color = color ( 0.001f , 0.001f , 0.001f)
63
+ [[
64
+ ::anno::display_name("Transmission Color"),
65
+ ::anno::description("Color effect for transmission independent of thickness of the object."),
66
+ ::anno::in_group("Appearance")
67
+ ]],
68
+ color striation_color1 = color ( 0.3058824f , 0.3019608f , 0.345098f)
69
+ [[
70
+ ::anno::display_name("Transmission Color"),
71
+ ::anno::description("Color effect for transmission independent of thickness of the object."),
72
+ ::anno::in_group("Appearance")
73
+ ]],
74
+ color striation_color2 = color ( 0.1215686f , 0.08235294f , 0.05882353f)
75
+ [[
76
+ ::anno::display_name("Transmission Color"),
77
+ ::anno::description("Color effect for transmission independent of thickness of the object."),
78
+ ::anno::in_group("Appearance")
79
+ ]],
80
+ uniform float clarity = 1.f
81
+ [[
82
+ ::anno::display_name("Clarity"),
83
+ ::anno::description("Use to adapt to size of gem, smaller numbers darken the gem."),
84
+ ::anno::soft_range(0.1,10.0),
85
+ ::anno::in_group("Appearance")
86
+ ]],
87
+ uniform float3 texture_translate = float3 ( 0.f)
88
+ [[
89
+ ::anno::display_name("Translate"),
90
+ ::anno::description("Controls the position of the texture."),
91
+ ::anno::in_group("Transform")
92
+ ]],
93
+ uniform float3 texture_rotate = float3 ( 0.f)
94
+ [[
95
+ ::anno::display_name("Rotate"),
96
+ ::anno::description("Rotates angle of the texture in degrees."),
97
+ ::anno::in_group("Transform")
98
+ ]],
99
+ uniform float texture_scale = 1.f
100
+ [[
101
+ ::anno::display_name("Scale"),
102
+ ::anno::description("Larger numbers increase the texture size."),
103
+ ::anno::in_group("Transform"),
104
+ ::nvidia::core_definitions::dimension(float(0.03f))
105
+ ]],
106
+ uniform int uv_space_index = 0
107
+ [[
108
+ ::anno::display_name("UV Space Index"),
109
+ ::anno::description("UV space index."),
110
+ ::anno::hard_range(0,3),
111
+ ::anno::in_group("Advanced")
112
+ ]])
113
+ [[
114
+ ::anno::display_name("Onyx"),
115
+ ::anno::description("Onyx gem material (Default values based on 2cm stone size.)"),
116
+ ::anno::author("NVIDIA vMaterials"),
117
+ ::anno::contributor("Rüdiger Raab"),
118
+ ::anno::contributor("Maik Rohland"),
119
+ ::anno::copyright_notice(COPYRIGHT),
120
+ ::anno::thumbnail("./.thumbs/Onyx.Onyx.png"),
121
+ ::anno::key_words(string[]("gem", "jewelry", "gemstone", "transmissive", "new", "design", "onyx", "black", "dark"))
122
+ ]]=
123
+ ::nvidia::core_definitions::thick_translucent(
124
+ transmission_color: ::nvidia::core_definitions::blend_colors(
125
+ color_1: transmission_color,
126
+ color_2: ::nvidia::core_definitions::flow_noise_texture(
127
+ color1: striation_color1,
128
+ color2: striation_color2,
129
+ object_space: false,
130
+ texture_space: 0,
131
+ noise_levels: 3,
132
+ absolute_noise: false,
133
+ phase: 0.f,
134
+ level_gain: 3.f,
135
+ level_scale: 2.5f,
136
+ level_progressive_u_scale: 0.f,
137
+ level_progressive_v_motion: 0.f,
138
+ scaling: float3 ( 0.f, (1.f / texture_scale) * 7.f, 0.f),
139
+ translation: texture_translate ,
140
+ rotation: float3 ( texture_rotate.x + 45.f , texture_rotate.y + 90.f , texture_rotate.z + 0.f)).tint,
141
+ mode: ::base::color_layer_blend,
142
+ weight: ::nvidia::core_definitions::checker_texture(
143
+ color1: color ( 0.f , 0.f , 0.f),
144
+ color2: color ( 1.f , 1.f , 1.f),
145
+ scaling: float3 ( 0.f , (1.f / texture_scale), 0.f),
146
+ translation: texture_translate ,
147
+ object_space: false,
148
+ blur: 0.f,
149
+ rotation: float3 ( texture_rotate.x + 45.f , texture_rotate.y + 90.f , texture_rotate.z + 0.f),
150
+ texture_space: uv_space_index).mono).tint,
151
+ volume_color: color ( 0.95f , 0.95f , 0.95f),
152
+ volume_scattering: 0.3f,
153
+ roughness: 0.05f,
154
+ reflectivity: 1.f,
155
+ base_thickness: clarity * 0.0001f,
156
+ normal: ::state::normal (),
157
+ ior: 1.486f);
code/third_party/vMaterials_2/Gems/Pearl.mdl ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2024 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
+
38
+ import ::anno::*;
39
+ import ::nvidia::core_definitions::apply_clearcoat;
40
+ import ::nvidia::core_definitions::apply_colorfalloff;
41
+ import ::nvidia::core_definitions::blend;
42
+ import ::nvidia::core_definitions::flex_material;
43
+ import ::state::normal;
44
+
45
+ const string COPYRIGHT =
46
+ " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
47
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
48
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
49
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
50
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
51
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
52
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
53
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
54
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
55
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
56
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
57
+
58
+
59
+ export material Pearl(
60
+ uniform color diffuse = color ( 0.8509804f , 0.7960784f , 0.7215686f)
61
+ [[
62
+ ::anno::display_name("Color"),
63
+ ::anno::description("Base color of the pearl."),
64
+ ::anno::in_group("Appearance")
65
+ ]])
66
+ [[
67
+ ::anno::display_name("Pearl"),
68
+ ::anno::description("Pearl gem material (Default values based on 2cm stone size.)"),
69
+ ::anno::author("NVIDIA vMaterials"),
70
+ ::anno::contributor("Rüdiger Raab"),
71
+ ::anno::contributor("Maik Rohland"),
72
+ ::anno::copyright_notice(COPYRIGHT),
73
+ ::anno::thumbnail("./.thumbs/Pearl.Pearl.png"),
74
+ ::anno::key_words(string[]("gem", "jewelry", "gemstone", "transmissive", "new", "design", "pearl", "pink", "light"))
75
+ ]]=
76
+ ::nvidia::core_definitions::apply_clearcoat(
77
+ base: ::nvidia::core_definitions::blend(
78
+ base: ::nvidia::core_definitions::flex_material(
79
+ base_color: diffuse,
80
+ diffuse_roughness: 0.2f,
81
+ is_metal: false,
82
+ reflectivity: 0.7f,
83
+ reflection_roughness: 0.07f,
84
+ anisotropy: 0.f,
85
+ anisotropy_rotation: 0.f,
86
+ transparency: 0.f,
87
+ transmission_color: color ( 1.f , 1.f , 1.f),
88
+ volume_color: color ( 1.f , 1.f , 1.f),
89
+ transmission_roughness: 0.f,
90
+ base_thickness: 0.1f,
91
+ ior: 1.5f,
92
+ thin_walled: false,
93
+ normal: ::state::normal ()),
94
+ blend: ::nvidia::core_definitions::apply_colorfalloff(
95
+ base: ::nvidia::core_definitions::flex_material(
96
+ base_color: diffuse,
97
+ diffuse_roughness: 0.2f,
98
+ is_metal: false,
99
+ reflectivity: 0.7f,
100
+ reflection_roughness: 0.07f,
101
+ anisotropy: 0.f,
102
+ anisotropy_rotation: 0.f,
103
+ transparency: 0.f,
104
+ transmission_color: color ( 1.f , 1.f , 1.f),
105
+ volume_color: color ( 1.f , 1.f , 1.f),
106
+ transmission_roughness: 0.f,
107
+ base_thickness: 0.1f,
108
+ ior: 1.5f,
109
+ thin_walled: false,
110
+ normal: ::state::normal ()),
111
+ color_0: color ( 0.4392157f , 0.3372549f , 0.1411765f),
112
+ color_1: color ( 0.8039216f , 0.8509804f , 1.f),
113
+ color_2: color ( 1.f , 0.7294118f , 0.9882353f),
114
+ color_3: color ( 1.f , 0.5333334f , 0.9568627f),
115
+ color_4: color ( 1.f , 0.7333333f , 0.1647059f)),
116
+ weight: 0.6f),
117
+ ior: 1.6f,
118
+ roughness: 0.1f,
119
+ visibility: 1.f,
120
+ normal: ::state::normal (),
121
+ coat_filter_color: color ( 1.f , 1.f , 1.f));
code/third_party/vMaterials_2/Gems/Peridot.mdl ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2024 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
+
38
+ import ::anno::*;
39
+ import ::nvidia::core_definitions::thick_glass;
40
+ import ::state::normal;
41
+
42
+ const string COPYRIGHT =
43
+ " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
44
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
45
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
46
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
47
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
48
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
49
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
50
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
51
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
52
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
53
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
54
+
55
+ export material Peridot(
56
+ color transmission_color = color ( 0.9647059f , 1.f , 0.509804f)
57
+ [[
58
+ ::anno::display_name("Transmission Color"),
59
+ ::anno::description("Color effect for transmission independent of thickness of the object."),
60
+ ::anno::in_group("Appearance")
61
+ ]],
62
+ uniform color volume_color = color ( 0.5529412f , 0.6862745f , 0.1843137f)
63
+ [[
64
+ ::anno::display_name("Volume Color"),
65
+ ::anno::description("Color effect for volume of the object reached at transmission distance."),
66
+ ::anno::in_group("Appearance")
67
+ ]],
68
+ uniform float clarity = 1.f
69
+ [[
70
+ ::anno::display_name("Clarity"),
71
+ ::anno::description("Use to adapt to size of gem, smaller numbers darken the gem."),
72
+ ::anno::soft_range(0.1,10.0),
73
+ ::anno::in_group("Appearance")
74
+ ]])
75
+ [[
76
+ ::anno::display_name("Peridot"),
77
+ ::anno::description("Peridot gem material (Default values based on 2cm stone size.)"),
78
+ ::anno::author("NVIDIA vMaterials"),
79
+ ::anno::contributor("Rüdiger Raab"),
80
+ ::anno::contributor("Maik Rohland"),
81
+ ::anno::copyright_notice(COPYRIGHT),
82
+ ::anno::thumbnail("./.thumbs/Peridot.Peridot.png"),
83
+ ::anno::key_words(string[]("gem", "jewelry", "gemstone", "transmissive", "new", "design", "peridot", "green"))
84
+ ]]=
85
+ ::nvidia::core_definitions::thick_glass(
86
+ transmission_color: transmission_color,
87
+ glass_color: volume_color,
88
+ roughness: 0.02f,
89
+ ior: 1.59f,
90
+ base_thickness: clarity * 0.01f,
91
+ normal: ::state::normal ());
code/third_party/vMaterials_2/Gems/Ruby.mdl ADDED
@@ -0,0 +1,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2024 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
+
38
+ import ::anno::*;
39
+ import ::df::*;
40
+ import ::base::*;
41
+ import ::math::*;
42
+ import ::nvidia::core_definitions::thick_glass;
43
+ import ::state::normal;
44
+
45
+ const string COPYRIGHT =
46
+ " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
47
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
48
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
49
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
50
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
51
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
52
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
53
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
54
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
55
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
56
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
57
+
58
+ material gem_definition(
59
+ color transmission_color = color(1.0),
60
+ uniform color glass_color = color(.95),
61
+ float roughness = 0.0,
62
+ uniform float volume_ior = 1.4f,
63
+ uniform bool dispersion = true,
64
+ uniform float abbe_number = 1.4f,
65
+ uniform float base_thickness = .1,
66
+ float3 normal = ::state::normal()
67
+ )
68
+ [[
69
+ ::anno::hidden()
70
+ ]]
71
+ = let{
72
+
73
+ bsdf glossy_bsdf = ::df::simple_glossy_bsdf(
74
+ mode: ::df::scatter_reflect,
75
+ tint: color(1.),
76
+ roughness_u: roughness
77
+ );
78
+ bsdf glossy_bsdf_transmission = ::df::simple_glossy_bsdf(
79
+ mode: ::df::scatter_transmit,
80
+ tint: transmission_color,
81
+ roughness_u: roughness
82
+ );
83
+ } in material(
84
+ thin_walled: false,
85
+ surface: material_surface(
86
+ ::df::weighted_layer(
87
+ normal: normal,
88
+ weight: 1.,
89
+ layer: ::df::color_fresnel_layer(
90
+ layer: glossy_bsdf,
91
+ base: glossy_bsdf_transmission,
92
+ ior: dispersion?::base::abbe_number_ior(volume_ior, abbe_number):color(volume_ior)
93
+ )
94
+ )
95
+ ),
96
+ volume: material_volume(
97
+ absorption_coefficient: (base_thickness <= 0)? color(0): ::math::log(glass_color) / -base_thickness
98
+ ),
99
+ ior: dispersion?::base::abbe_number_ior(volume_ior, abbe_number):color(volume_ior)
100
+ );
101
+
102
+
103
+ export material Ruby(
104
+ color transmission_color = color ( 1.f , 0.3294118f , 0.8196079f)
105
+ [[
106
+ ::anno::display_name("Transmission Color"),
107
+ ::anno::description("Color effect for transmission independent of thickness of the object."),
108
+ ::anno::in_group("Appearance")
109
+ ]],
110
+ uniform color volume_color = color ( 0.2666667f , 0.007843138f , 0.01568628f)
111
+ [[
112
+ ::anno::display_name("Volume Color"),
113
+ ::anno::description("Color effect for volume of the object reached at transmission distance."),
114
+ ::anno::in_group("Appearance")
115
+ ]],
116
+ uniform float clarity = 1.f
117
+ [[
118
+ ::anno::display_name("Clarity"),
119
+ ::anno::description("Use to adapt to size of gem, smaller numbers darken the gem."),
120
+ ::anno::soft_range(0.1,10.0),
121
+ ::anno::in_group("Appearance")
122
+ ]],
123
+ uniform bool dispersion = true
124
+ [[
125
+ ::anno::display_name("Dispersion"),
126
+ ::anno::description("Enable or disable the dispersion."),
127
+ ::anno::in_group("Advanced")
128
+ ]])
129
+ [[
130
+ ::anno::display_name("Ruby"),
131
+ ::anno::description("Ruby gem material (Default values based on 2cm stone size.)"),
132
+ ::anno::author("NVIDIA vMaterials"),
133
+ ::anno::contributor("Rüdiger Raab"),
134
+ ::anno::contributor("Maik Rohland"),
135
+ ::anno::copyright_notice(COPYRIGHT),
136
+ ::anno::thumbnail("./.thumbs/Ruby.Ruby.png"),
137
+ ::anno::key_words(string[]("gem", "jewelry", "gemstone", "transmissive", "new", "design", "ruby", "red", "warm"))
138
+ ]]= gem_definition(
139
+ transmission_color: transmission_color,
140
+ glass_color: volume_color,
141
+ roughness: 0.06f,
142
+ volume_ior: 1.78f,
143
+ dispersion: dispersion,
144
+ abbe_number: 72.2f,
145
+ base_thickness: clarity * 0.03f,
146
+ normal: ::state::normal ());
code/third_party/vMaterials_2/Gems/Sapphire.mdl ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2024 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
+
38
+ import ::anno::*;
39
+ import ::math::*;
40
+ import ::base::*;
41
+ import ::df::*;
42
+ import ::nvidia::core_definitions::flex_material;
43
+ import ::state::normal;
44
+
45
+
46
+ const string COPYRIGHT =
47
+ " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
48
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
49
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
50
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
51
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
52
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
53
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
54
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
55
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
56
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
57
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
58
+
59
+
60
+ material gem_definition(
61
+ color transmission_color = color(1.0),
62
+ uniform color glass_color = color(.95),
63
+ float roughness = 0.0,
64
+ uniform float volume_ior = 1.4f,
65
+ uniform bool dispersion = true,
66
+ uniform float abbe_number = 1.4f,
67
+ uniform float base_thickness = .1,
68
+ float3 normal = ::state::normal()
69
+ )
70
+ [[
71
+ ::anno::hidden()
72
+ ]]
73
+ = let{
74
+
75
+ bsdf glossy_bsdf = ::df::simple_glossy_bsdf(
76
+ mode: ::df::scatter_reflect,
77
+ tint: color(1.),
78
+ roughness_u: roughness
79
+ );
80
+ bsdf glossy_bsdf_transmission = ::df::simple_glossy_bsdf(
81
+ mode: ::df::scatter_transmit,
82
+ tint: transmission_color,
83
+ roughness_u: roughness
84
+ );
85
+ } in material(
86
+ thin_walled: false,
87
+ surface: material_surface(
88
+ ::df::weighted_layer(
89
+ normal: normal,
90
+ weight: 1.,
91
+ layer: ::df::color_fresnel_layer(
92
+ layer: glossy_bsdf,
93
+ base: glossy_bsdf_transmission,
94
+ ior: dispersion?::base::abbe_number_ior(volume_ior, abbe_number):color(volume_ior)
95
+ )
96
+ )
97
+ ),
98
+ volume: material_volume(
99
+ absorption_coefficient: (base_thickness <= 0)? color(0): ::math::log(glass_color) / -base_thickness
100
+ ),
101
+ ior: dispersion?::base::abbe_number_ior(volume_ior, abbe_number):color(volume_ior)
102
+ );
103
+
104
+
105
+ export material Sapphire(
106
+ uniform color transmission_color = color ( 0.509804f , 0.427451f , 0.8196079f)
107
+ [[
108
+ ::anno::display_name("Transmission Color"),
109
+ ::anno::description("Color effect for transmission independent of thickness of the object."),
110
+ ::anno::in_group("Appearance")
111
+ ]],
112
+ uniform color volume_color = color ( 0.001f , 0.03137255f , 0.2392157f)
113
+ [[
114
+ ::anno::display_name("Volume Color"),
115
+ ::anno::description("Color effect for volume of the object reached at transmission distance."),
116
+ ::anno::in_group("Appearance")
117
+ ]],
118
+ uniform float clarity = 1.f
119
+ [[
120
+ ::anno::display_name("Clarity"),
121
+ ::anno::description("Use to adapt to size of gem, smaller numbers darken the gem."),
122
+ ::anno::soft_range(0.1,10.0),
123
+ ::anno::in_group("Appearance")
124
+ ]],
125
+ uniform bool dispersion = true
126
+ [[
127
+ ::anno::display_name("Dispersion"),
128
+ ::anno::description("Enable or disable the dispersion."),
129
+ ::anno::in_group("Advanced")
130
+ ]])
131
+ [[
132
+ ::anno::display_name("Sapphire"),
133
+ ::anno::description("Sapphire gem material (Default values based on 2cm stone size.)"),
134
+ ::anno::author("NVIDIA vMaterials"),
135
+ ::anno::contributor("Rüdiger Raab"),
136
+ ::anno::contributor("Maik Rohland"),
137
+ ::anno::copyright_notice(COPYRIGHT),
138
+ ::anno::thumbnail("./.thumbs/Sapphire.Sapphire.png"),
139
+ ::anno::key_words(string[]("gem", "jewelry", "gemstone", "transmissive", "new", "design", "sapphire", "blue", "cool", "dark"))
140
+ ]] = gem_definition(
141
+ transmission_color: transmission_color,
142
+ glass_color: volume_color,
143
+ roughness: 0.f,
144
+ volume_ior: 1.76f,
145
+ dispersion: dispersion,
146
+ abbe_number: 72.2f,
147
+ base_thickness: clarity * 0.1f,
148
+ normal: ::state::normal ());
code/third_party/vMaterials_2/Gems/Tanzanite.mdl ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2024 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
+
38
+ import ::anno::*;
39
+ import ::df::*;
40
+ import ::base::*;
41
+ import ::math::*;
42
+ import ::nvidia::core_definitions::thick_glass;
43
+ import ::state::normal;
44
+
45
+ const string COPYRIGHT =
46
+ " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
47
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
48
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
49
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
50
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
51
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
52
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
53
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
54
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
55
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
56
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
57
+
58
+ export material Tanzanite(
59
+ color transmission_color = color ( 0.7215686f , 0.4392157f , 0.8823529f)
60
+ [[
61
+ ::anno::display_name("Transmission Color"),
62
+ ::anno::description("Color effect for transmission independent of thickness of the object."),
63
+ ::anno::in_group("Appearance")
64
+ ]],
65
+ uniform color volume_color = color ( 0.01960784f , 0.02745098f , 0.1921569f)
66
+ [[
67
+ ::anno::display_name("Volume Color"),
68
+ ::anno::description("Color effect for volume of the object reached at transmission distance."),
69
+ ::anno::in_group("Appearance")
70
+ ]],
71
+ uniform float clarity = 1.f
72
+ [[
73
+ ::anno::display_name("Clarity"),
74
+ ::anno::description("Use to adapt to size of gem, smaller numbers darken the gem."),
75
+ ::anno::soft_range(0.1,10.0),
76
+ ::anno::in_group("Appearance")
77
+ ]])
78
+ [[
79
+ ::anno::display_name("Tanzanite"),
80
+ ::anno::description("Tanzanite gem material (Default values based on 2cm stone size.)"),
81
+ ::anno::author("NVIDIA vMaterials"),
82
+ ::anno::contributor("Rüdiger Raab"),
83
+ ::anno::contributor("Maik Rohland"),
84
+ ::anno::copyright_notice(COPYRIGHT),
85
+ ::anno::thumbnail("./.thumbs/Tanzanite.Tanzanite.png"),
86
+ ::anno::key_words(string[]("gem", "jewelry", "gemstone", "transmissive", "new", "design", "tanzanite", "purple"))
87
+ ]]=
88
+ ::nvidia::core_definitions::thick_glass(
89
+ transmission_color: transmission_color,
90
+ glass_color: volume_color,
91
+ roughness: 0.f,
92
+ ior: 1.7f,
93
+ base_thickness: clarity * 0.015f,
94
+ normal: ::state::normal ());
code/third_party/vMaterials_2/Gems/Topaz.mdl ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2024 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
+
38
+ import ::anno::*;
39
+ import ::df::*;
40
+ import ::base::*;
41
+ import ::math::*;
42
+ import ::nvidia::core_definitions::thick_glass;
43
+ import ::state::normal;
44
+
45
+ const string COPYRIGHT =
46
+ " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
47
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
48
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
49
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
50
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
51
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
52
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
53
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
54
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
55
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
56
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
57
+
58
+ material gem_definition(
59
+ color transmission_color = color(1.0),
60
+ uniform color glass_color = color(.95),
61
+ float roughness = 0.0,
62
+ uniform float volume_ior = 1.4f,
63
+ uniform bool dispersion = true,
64
+ uniform float abbe_number = 1.4f,
65
+ uniform float base_thickness = .1,
66
+ float3 normal = ::state::normal()
67
+ )
68
+ [[
69
+ ::anno::hidden()
70
+ ]]
71
+ = let{
72
+
73
+ bsdf glossy_bsdf = ::df::simple_glossy_bsdf(
74
+ mode: ::df::scatter_reflect,
75
+ tint: color(1.),
76
+ roughness_u: roughness
77
+ );
78
+ bsdf glossy_bsdf_transmission = ::df::simple_glossy_bsdf(
79
+ mode: ::df::scatter_transmit,
80
+ tint: transmission_color,
81
+ roughness_u: roughness
82
+ );
83
+ } in material(
84
+ thin_walled: false,
85
+ surface: material_surface(
86
+ ::df::weighted_layer(
87
+ normal: normal,
88
+ weight: 1.,
89
+ layer: ::df::color_fresnel_layer(
90
+ layer: glossy_bsdf,
91
+ base: glossy_bsdf_transmission,
92
+ ior: dispersion?::base::abbe_number_ior(volume_ior, abbe_number):color(volume_ior)
93
+ )
94
+ )
95
+ ),
96
+ volume: material_volume(
97
+ absorption_coefficient: (base_thickness <= 0)? color(0): ::math::log(glass_color) / -base_thickness
98
+ ),
99
+ ior: dispersion?::base::abbe_number_ior(volume_ior, abbe_number):color(volume_ior)
100
+ );
101
+
102
+ export material Topaz(
103
+ color transmission_color = color ( 1.f , 1.f , 1.f)
104
+ [[
105
+ ::anno::display_name("Transmission Color"),
106
+ ::anno::description("Color effect for transmission independent of thickness of the object."),
107
+ ::anno::in_group("Appearance")
108
+ ]],
109
+ uniform color volume_color = color ( 0.8823529f , 0.6117647f , 0.2117647f)
110
+ [[
111
+ ::anno::display_name("Volume Color"),
112
+ ::anno::description("Color effect for volume of the object reached at transmission distance."),
113
+ ::anno::in_group("Appearance")
114
+ ]],
115
+ uniform float clarity = 1.f
116
+ [[
117
+ ::anno::display_name("Clarity"),
118
+ ::anno::description("Use to adapt to size of gem, smaller numbers darken the gem."),
119
+ ::anno::soft_range(0.1,10.0),
120
+ ::anno::in_group("Appearance")
121
+ ]],
122
+ uniform bool dispersion = true
123
+ [[
124
+ ::anno::display_name("Dispersion"),
125
+ ::anno::description("Enable or disable the dispersion."),
126
+ ::anno::in_group("Advanced")
127
+ ]])
128
+ [[
129
+ ::anno::display_name("Topaz"),
130
+ ::anno::description("Topaz gem material (Default values based on 2cm stone size.)"),
131
+ ::anno::author("NVIDIA vMaterials"),
132
+ ::anno::contributor("Rüdiger Raab"),
133
+ ::anno::contributor("Maik Rohland"),
134
+ ::anno::copyright_notice(COPYRIGHT),
135
+ ::anno::thumbnail("./.thumbs/Topaz.Topaz.png"),
136
+ ::anno::key_words(string[]("gem", "jewelry", "gemstone", "transmissive", "new", "design", "topaz", "purple"))
137
+ ]] = gem_definition(
138
+ transmission_color: transmission_color,
139
+ glass_color: volume_color,
140
+ roughness: 0.f,
141
+ volume_ior: 1.63f,
142
+ dispersion: dispersion,
143
+ abbe_number: 33.54f,
144
+ base_thickness: clarity * 0.005f,
145
+ normal: ::state::normal());
code/third_party/vMaterials_2/Gems/Tourmaline.mdl ADDED
@@ -0,0 +1,181 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2024 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
+
38
+ import ::anno::*;
39
+ import ::base::*;
40
+ import ::nvidia::core_definitions::*;
41
+ import ::state::normal;
42
+
43
+ const string COPYRIGHT =
44
+ " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
45
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
46
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
47
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
48
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
49
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
50
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
51
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
52
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
53
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
54
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
55
+
56
+ export material Tourmaline(
57
+ uniform color transmission_color1 = color ( .987f , 0.282353f , 0.282353f)
58
+ [[
59
+ ::anno::display_name("Transmission Color 1"),
60
+ ::anno::description("Color effect for transmission independent of thickness of the object."),
61
+ ::anno::in_group("Appearance")
62
+ ]],
63
+ uniform color transmission_color2 = color ( 1.f , 1.f , 1.f)
64
+ [[
65
+ ::anno::display_name("Transmission Color 2"),
66
+ ::anno::description("Color effect for transmission independent of thickness of the object."),
67
+ ::anno::in_group("Appearance")
68
+ ]],
69
+ uniform color transmission_color3 = color ( 0.172549f , 0.427451f , 0.06666667f)
70
+ [[
71
+ ::anno::display_name("Transmission Color 3"),
72
+ ::anno::description("Color effect for transmission independent of thickness of the object."),
73
+ ::anno::in_group("Appearance")
74
+ ]],
75
+ uniform float clarity = 1.f
76
+ [[
77
+ ::anno::display_name("Clarity"),
78
+ ::anno::description("Use to adapt to size of gem, smaller numbers darken the gem."),
79
+ ::anno::soft_range(0.1,10.0),
80
+ ::anno::in_group("Appearance")
81
+ ]],
82
+ uniform float3 texture_translate = float3( 0.f)
83
+ [[
84
+ ::anno::display_name("Translate"),
85
+ ::anno::description("Controls the position of the texture."),
86
+ ::anno::in_group("Transform")
87
+ ]],
88
+ uniform float3 texture_rotate = float3(45.0f, 36.0f, 45.0f)
89
+ [[
90
+ ::anno::display_name("Rotate"),
91
+ ::anno::description("Rotates angle of the texture in degrees."),
92
+ ::anno::in_group("Transform")
93
+ ]],
94
+ uniform float texture_scale = 1.f
95
+ [[
96
+ ::anno::display_name("Scale"),
97
+ ::anno::description("Larger numbers increase the texture size."),
98
+ ::anno::in_group("Transform"),
99
+ ::nvidia::core_definitions::dimension(float2(1.0f))
100
+ ]])
101
+ [[
102
+ ::anno::display_name("Tourmaline"),
103
+ ::anno::description("Tourmaline gem material (Default values based on 2cm stone size.)"),
104
+ ::anno::author("NVIDIA vMaterials"),
105
+ ::anno::contributor("Rüdiger Raab"),
106
+ ::anno::contributor("Maik Rohland"),
107
+ ::anno::copyright_notice(COPYRIGHT),
108
+ ::anno::thumbnail("./.thumbs/Tourmaline.Tourmaline.png"),
109
+ ::anno::key_words(string[]("gem", "jewelry", "gemstone", "transmissive", "new", "design", "tourmaline", "red", "green", "multicolor"))
110
+ ]]=
111
+ ::nvidia::core_definitions::blend(
112
+ base: ::nvidia::core_definitions::flex_material(
113
+ base_color: transmission_color1,
114
+ diffuse_roughness: 0.f,
115
+ is_metal: false,
116
+ reflectivity: 1.f,
117
+ reflection_roughness: 0.f,
118
+ anisotropy: 0.f,
119
+ anisotropy_rotation: 0.f,
120
+ transparency: 0.7f,
121
+ transmission_color: transmission_color1,
122
+ volume_color: transmission_color1,
123
+ transmission_roughness: 0.05f,
124
+ base_thickness: clarity * 0.8f,
125
+ ior: 1.6f,
126
+ thin_walled: false,
127
+ normal: ::state::normal ()),
128
+ blend: ::nvidia::core_definitions::blend(
129
+ base: ::nvidia::core_definitions::flex_material(
130
+ base_color: transmission_color2,
131
+ diffuse_roughness: 0.8f,
132
+ is_metal: false,
133
+ reflectivity: 1.f,
134
+ reflection_roughness: 0.f,
135
+ anisotropy: 0.f,
136
+ anisotropy_rotation: 0.f,
137
+ transparency: 0.6f,
138
+ transmission_color: transmission_color2,
139
+ volume_color: transmission_color2,
140
+ transmission_roughness: 0.01f,
141
+ base_thickness: clarity * 1.f,
142
+ ior: 1.6f,
143
+ thin_walled: false,
144
+ normal: ::state::normal ()),
145
+ blend: ::nvidia::core_definitions::thick_glass(
146
+ transmission_color: transmission_color3,
147
+ glass_color: transmission_color3,
148
+ roughness: 0.f,
149
+ ior: 1.6f,
150
+ base_thickness: clarity * 0.1f,
151
+ normal: ::state::normal ()),
152
+ weight: ::nvidia::core_definitions::flow_noise_texture(
153
+ color1: color ( 1.f , 1.f , 1.f),
154
+ color2: color ( 0.f , 0.f , 0.f),
155
+ object_space: true,
156
+ texture_space: 0,
157
+ noise_levels: 2,
158
+ absolute_noise: false,
159
+ phase: 0.f,
160
+ level_gain: 20.f,
161
+ level_scale: 10.f,
162
+ level_progressive_u_scale: 1.f,
163
+ level_progressive_v_motion: 0.f,
164
+ scaling: float3 ( (10.f / texture_scale) * 5.f , 0.f , 0.f),
165
+ translation: float3 ( texture_translate .x + 0.095f , texture_translate .y + 0.f , texture_translate .z + 0.f),
166
+ rotation: float3 ( texture_rotate.x + 0.f , texture_rotate.y + 90.f , texture_rotate.z + 0.f)).mono),
167
+ weight: ::nvidia::core_definitions::flow_noise_texture(
168
+ color1: color ( 1.f , 1.f , 1.f),
169
+ color2: color ( 0.f , 0.f , 0.f),
170
+ object_space: true,
171
+ texture_space: 0,
172
+ noise_levels: 2,
173
+ absolute_noise: false,
174
+ phase: 0.f,
175
+ level_gain: 20.f,
176
+ level_scale: 10.f,
177
+ level_progressive_u_scale: 1.f,
178
+ level_progressive_v_motion: 0.f,
179
+ scaling: float3 ( (10.f / texture_scale) * 5.f , 0.f , 0.f),
180
+ translation: float3 ( texture_translate .x + 0.1f , texture_translate .y + 0.f , texture_translate .z + 0.f),
181
+ rotation: float3 ( texture_rotate.x + 0.f , texture_rotate.y + 90.f , texture_rotate.z + 0.f)).mono);
code/third_party/vMaterials_2/Gems/Turquoise.mdl ADDED
@@ -0,0 +1,719 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ <<<<<<< .mine
3
+ * Copyright 2024 NVIDIA Corporation. All rights reserved. *
4
+ ||||||| .r374748
5
+ * Copyright 2023 NVIDIA Corporation. All rights reserved. *
6
+ =======
7
+ * Copyright 2024 NVIDIA Corporation. All rights reserved. *
8
+ >>>>>>> .r376783
9
+ ******************************************************************************
10
+
11
+ Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge,
12
+ to any person obtaining a copy of the sample definition code that uses our
13
+ Material Definition Language (the "MDL Materials"), to reproduce and distribute
14
+ the MDL Materials, including without limitation the rights to use, copy, merge,
15
+ publish, distribute, and sell modified and unmodified copies of the MDL
16
+ Materials, and to permit persons to whom the MDL Materials is furnished to do
17
+ so, in all cases solely for use with NVIDIA's Material Definition Language,
18
+ subject to the following further conditions:
19
+
20
+ 1. The above copyright notices, this list of conditions, and the disclaimer
21
+ that follows shall be retained in all copies of one or more of the MDL
22
+ Materials, including in any software with which the MDL Materials are bundled,
23
+ redistributed, and/or sold, and included either as stand-alone text files,
24
+ human-readable headers or in the appropriate machine-readable metadata fields
25
+ within text or binary files as long as those fields can be easily viewed by the
26
+ user, as applicable.
27
+ 2. The name of NVIDIA shall not be used to promote, endorse or advertise any
28
+ Modified Version without specific prior written permission, except a) to comply
29
+ with the notice requirements otherwise contained herein; or b) to acknowledge
30
+ the contribution(s) of NVIDIA.
31
+
32
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
33
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
34
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
35
+ TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR
36
+ ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL,
37
+ INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF
38
+ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE
39
+ THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.
40
+ */
41
+
42
+
43
+ mdl 1.7;
44
+
45
+ import ::anno::*;
46
+ import ::base::*;
47
+ import ::df::*;
48
+ import ::math::*;
49
+ import ::state::*;
50
+ import ::tex::*;
51
+ import ::nvidia::core_definitions::*;
52
+
53
+ const string COPYRIGHT =
54
+ " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
55
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
56
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
57
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
58
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
59
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
60
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
61
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
62
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
63
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
64
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
65
+
66
+
67
+ enum unit_scale{
68
+ unit_mm = 1,
69
+ unit_cm = 2,
70
+ unit_m = 3
71
+ };
72
+
73
+ float histogram_range(float input, float range = 1.0f, float position = 0.5f)
74
+ {
75
+ float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0);
76
+ float high = ::math::clamp(math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0);
77
+ return ::math::lerp(low, high, input);
78
+ }
79
+
80
+ float remap_xy_to_0_1(float input, float x, float y)
81
+ {
82
+ return (input - x)/(y - x);
83
+ }
84
+
85
+ float histogram_scan_small(float input, float width, float position)
86
+ {
87
+ return ::math::clamp(
88
+ remap_xy_to_0_1(input,
89
+ position * (1.0f - width), // special case of ::math::lerp(0.0, 1.0 - width, position),
90
+ ::math::lerp(width, 1.0 , position)),
91
+ 0.0,
92
+ 1.0);
93
+ }
94
+
95
+ struct volume_info{
96
+ color absorption_coefficient;
97
+ color scattering_coefficient;
98
+ };
99
+
100
+
101
+ volume_info volume_transmittance_albedo(
102
+ float density_scale = 1.0,
103
+ color transmittance = color(0.5f), // transmittance color after unit distance
104
+ color albedo = color(1.0f)
105
+ )
106
+ [[
107
+ anno::noinline()
108
+ ]]
109
+ {
110
+ color sigma_t = -math::log(math::saturate(transmittance)) * density_scale;
111
+ color sigma_s = sigma_t * ::math::saturate(albedo);
112
+ return volume_info(
113
+ scattering_coefficient: sigma_s,
114
+ absorption_coefficient: sigma_t - sigma_s);
115
+ }
116
+
117
+ volume_info custom_volume_transmittance(
118
+ unit_scale unit_scale_select = unit_mm,
119
+ float absorption_thickness = 3.0f,
120
+ color transmittance = color(0.5f),
121
+ color albedo = color(0.0f)
122
+ )
123
+ {
124
+ absorption_thickness = (absorption_thickness <= 0.0f) ? 0.00001 : absorption_thickness;
125
+ float scalefactor;
126
+ switch(unit_scale_select){
127
+ case unit_mm: scalefactor = 0.001f; break;
128
+ case unit_cm: scalefactor = 0.01f; break;
129
+ case unit_m: scalefactor = 1.0f; break;
130
+ default: scalefactor = 1.0f;
131
+ }
132
+
133
+
134
+
135
+ volume_info vol_coefficients = volume_transmittance_albedo(
136
+ density_scale: 1.0f/(absorption_thickness * scalefactor),
137
+ transmittance: transmittance,
138
+ albedo: albedo
139
+ );
140
+
141
+ return vol_coefficients;
142
+ }
143
+
144
+ float3 rgb2hsl(float3 c)
145
+ [[
146
+ ::anno::description("Converts a color value to HSL. The function outputs the hue to \n"
147
+ "lie in the range from 0.0-1.0."),
148
+ ::anno::author("NVIDIA vMaterials")
149
+ ]]
150
+ {
151
+ float3 hsl;
152
+ float cMax = ::math::max(::math::max(c.x, c.y), c.z);
153
+ float cMin = ::math::min(::math::min(c.x, c.y), c.z);
154
+ float delta = cMax - cMin;
155
+
156
+ hsl.z = (cMax + cMin) / 2.0;
157
+ hsl.x = ((cMax == cMin) ? 0 :
158
+ (cMax == c.x) ? (c.y - c.z) / delta + ((c.z > c.y) ? 6.0f : 0.0f):
159
+ (cMax == c.y) ? (c.z - c.x) / delta + 2.0 : (c.x - c.y) / delta + 4.0) / 6.0f;
160
+ hsl.y = (hsl.z == 0.0 || hsl.z == 1.0) ? 0.0 : delta / (1.0 - ::math::abs(2.0 * hsl.z - 1.0));
161
+ return hsl;
162
+ }
163
+
164
+
165
+ // converts a HSL value back to a color
166
+ // The Hue is expected to lie in the range
167
+ float f_n(float n, float a, float h, float l) {
168
+ float k = ::math::fmod(n + h * 12.f, 12.f);
169
+
170
+ return l - a * ::math::max(-1.0f, ::math::min(::math::min(k-3.0f, 9.0f-k), 1.0f));
171
+ }
172
+
173
+ color hsl2rgb(float3 hsl)
174
+ [[
175
+ ::anno::description("Converts a HSL value back to a color. Note that the hue is expected to \n"
176
+ "lie in the range from 0.0-1.0."),
177
+ ::anno::author("NVIDIA vMaterials")
178
+ ]]
179
+ {
180
+ float h = hsl.x, s = hsl.y, l = hsl.z;
181
+ float a = s * ::math::min(l, 1.0f - l);
182
+ return color(f_n(0.0, a, h, l),
183
+ f_n(8.0, a, h, l),
184
+ f_n(4.0, a, h, l));
185
+ }
186
+
187
+ struct vm_coordinates{
188
+ float2 uv; // UV coordinates stored as a simple float2
189
+ float rotation; // The rotation is stored in radiands (not degress), to convert use ((rotation* 3.1415926535897932384626433832f) / 180.f)
190
+ int uv_space_index; // The UV space Index from which the UV data came from
191
+ float4 carry; // may carry additional data, such as random IDs
192
+ };
193
+
194
+ struct vm_3float{
195
+ float x;
196
+ float y;
197
+ float z;
198
+ };
199
+
200
+ enum vm_mono_select
201
+ [[
202
+ anno::description("Modes for the creation of a gray-scale value from a color."),
203
+ anno::hidden()
204
+ ]]
205
+ {
206
+ mono_r = 0,
207
+ mono_g = 1,
208
+ mono_b = 2,
209
+ mono_a = 3,
210
+ mono_average = 4
211
+ };
212
+
213
+ vm_coordinates vm_coord
214
+ (
215
+ float2 translation = float2(0.0f, 0.0) [[
216
+ ::anno::display_name("Translation"),
217
+ ::anno::description("Translates the coordinates.")
218
+ ]],
219
+ float rotation = 0.0f [[
220
+ ::anno::display_name("Rotation"),
221
+ ::anno::description("Rotates the coordinates in degrees.")
222
+ ]],
223
+ float2 scaling = float2(1.0f, 1.0f) [[
224
+ ::anno::display_name("Scaling"),
225
+ ::anno::description("Scales the coordinates.")
226
+ ]],
227
+ uniform int uv_space = 0 [[
228
+ ::anno::display_name("UV Space"),
229
+ ::anno::description("Chose the UV space.")
230
+ ]]
231
+ )
232
+ [[
233
+ ::anno::display_name("vm Transform"),
234
+ ::anno::description("Generates coordinates to be used in vm_lookup functions.")
235
+ ]]
236
+ {
237
+ vm_coordinates uv;
238
+ ::base::texture_coordinate_info info = ::base::coordinate_source( ::base::texture_coordinate_uvw, uv_space);
239
+ uv.rotation = (rotation * 3.1415926535897932384626433832f) / 180.f;
240
+ uv.uv = float2(info.position.x, info.position.y);
241
+ float sine = ::math::sin(uv.rotation);
242
+ float cosine = ::math::cos(uv.rotation);
243
+ float2x2 rot = float2x2(cosine, -sine, sine, cosine);
244
+ uv.uv = rot * uv.uv;
245
+ uv.uv /= scaling;
246
+ uv.uv += translation;
247
+ // Translation before or after rotation?
248
+ return uv;
249
+ }
250
+
251
+ vm_coordinates vm_coord_post_rotate(
252
+ vm_coordinates uv = vm_coord() [[
253
+ ::anno::display_name("VM Coordinates"),
254
+ ::anno::description("A set of vm coordinates.")
255
+ ]],
256
+ float rotation = 0.0f [[
257
+ ::anno::display_name("Rotation"),
258
+ ::anno::description("Rotates the coordinates in degrees.")
259
+ ]]
260
+ )
261
+ {
262
+ float rot_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; // track rotation
263
+ float sine = ::math::sin(rot_rad);
264
+ float cosine = ::math::cos(rot_rad);
265
+ float2x2 rot = float2x2(cosine, -sine, sine, cosine);
266
+
267
+ uv.rotation += rot_rad;
268
+ uv.uv = rot * uv.uv;
269
+ return uv;
270
+ }
271
+
272
+
273
+
274
+ vm_coordinates vm_coord_post_scale(
275
+ vm_coordinates uv = vm_coord(),
276
+ float2 scale = float2(1.0f)
277
+ )
278
+ {
279
+ uv.uv /= scale;
280
+ return uv;
281
+ }
282
+
283
+ ::base::texture_return vm_tex_lookup(
284
+ uniform texture_2d tex,
285
+ vm_coordinates uv = vm_coord(),
286
+ uniform vm_mono_select mono_source = mono_a,
287
+ float4 scale = float4(1.0f))
288
+ {
289
+ float mono;
290
+ float4 lookup = ::tex::lookup_float4(tex, uv.uv, ::tex::wrap_repeat, ::tex::wrap_repeat) * scale;
291
+ switch( mono_source ) {
292
+ case mono_r: mono = lookup.x;
293
+ break;
294
+ case mono_g: mono = lookup.y;
295
+ break;
296
+ case mono_b: mono = lookup.z;
297
+ break;
298
+ case mono_a: mono = lookup.w;
299
+ break;
300
+ case mono_average: mono = ::math::average(float3(lookup.x, lookup.y, lookup.z));
301
+ break;
302
+ }
303
+ return ::base::texture_return(color(lookup.x, lookup.y, lookup.z), mono);
304
+ }
305
+
306
+ vm_3float vm_tex_lookup_3float(
307
+ uniform texture_2d tex,
308
+ vm_coordinates uv = vm_coord(),
309
+ float3 scale = float3(1.0f))
310
+ {
311
+ vm_3float ret;
312
+ float3 lookup = ::tex::lookup_float3(tex, uv.uv, ::tex::wrap_repeat, ::tex::wrap_repeat) * scale;
313
+ ret.x = lookup.x;
314
+ ret.y = lookup.y;
315
+ ret.z = lookup.z;
316
+ return ret;
317
+ }
318
+
319
+ float3 vm_tex_normal_lookup_2x(
320
+ uniform texture_2d tex_a,
321
+ uniform texture_2d tex_b,
322
+ vm_coordinates uv_a = vm_coord(),
323
+ vm_coordinates uv_b = vm_coord(),
324
+ float strength_a = 1.0f,
325
+ float strength_b = 1.0f,
326
+ bool use_coord_a_only = false // when set to 'false, tex_b share coordinates from 'uv_a'
327
+ )
328
+ {
329
+ float rot_a = uv_a.rotation;
330
+ float rot_b = use_coord_a_only ? uv_a.rotation : uv_b.rotation;
331
+ uv_b.uv = use_coord_a_only ? uv_a.uv : uv_b.uv;
332
+
333
+ // Lookup and convert normal textures a and b to -1 ... 1 range
334
+ float3 norm_a = (::tex::lookup_float3(tex_a, uv_a.uv, ::tex::wrap_repeat, ::tex::wrap_repeat) - float3(.5f)) * 2.0f;
335
+ norm_a = ::math::normalize(norm_a * float3(strength_a, strength_a, 1.0));
336
+ float3 norm_b = (::tex::lookup_float3(tex_b, uv_b.uv, ::tex::wrap_repeat, ::tex::wrap_repeat) - float3(.5f)) * 2.0f;
337
+ norm_b = ::math::normalize(norm_b * float3(strength_b, strength_b, 1.0));
338
+
339
+ // if any rotation happened prior to the lookup, compensate for it
340
+ norm_a = float3(::math::cos(rot_a) * norm_a.x - ::math::sin(rot_a) * norm_a.y,
341
+ ::math::sin(rot_a) * norm_a.x + ::math::cos(rot_a) * norm_a.y,
342
+ norm_a.z);
343
+ norm_b = float3(::math::cos(rot_b) * norm_b.x - ::math::sin(rot_b) * norm_b.y,
344
+ ::math::sin(rot_b) * norm_b.x + ::math::cos(rot_b) * norm_b.y,
345
+ norm_b.z);
346
+
347
+ // http://blog.selfshadow.com/publications/blending-in-detail/
348
+ norm_a=norm_a + float3(0.,0.,1.);
349
+ norm_b = norm_b * float3(-1.,-1.,1.);
350
+ float3 norm = norm_a*math::dot(norm_a, norm_b)/norm_a.z - norm_b;
351
+
352
+ return norm.x * ::state::texture_tangent_u(uv_a.uv_space_index) +
353
+ norm.y * ::state::texture_tangent_v(uv_a.uv_space_index) +
354
+ norm.z * ::state::normal();
355
+ }
356
+
357
+
358
+ //
359
+ export material Turquoise(
360
+ color transmission_color = color (0.296138f, 1.000000f, 0.904661) //( 0.2392157f , 0.8039216f , 0.7294118f)
361
+ [[
362
+ ::anno::display_name("Transmission Color"),
363
+ ::anno::description("Color effect for transmission independent of thickness of the object."),
364
+ ::anno::in_group("Appearance")
365
+ ]],
366
+ uniform color volume_color = color(0.009721f, 0.693872f, 0.693872f) //( 0.001f , 0.01188235f , 0.01188235f)
367
+ [[
368
+ ::anno::display_name("Volume Color"),
369
+ ::anno::description("Color effect for volume of the object reached at transmission distance."),
370
+ ::anno::in_group("Appearance")
371
+ ]],
372
+ uniform color crack_color = color(0.023153f, 0.011612f, 0.001f) // ( 0.02352941f , 0.01176471f , 0.f)
373
+ [[
374
+ ::anno::display_name("Crack Color"),
375
+ ::anno::description("Color of cracks."),
376
+ ::anno::in_group("Appearance")
377
+ ]],
378
+ uniform color flake_color = color (1.000000f, 0.527115f, 0.001f) //( 1.f , 0.5294118f , 0.f)
379
+ [[
380
+ ::anno::display_name("Flake Color"),
381
+ ::anno::description("Color of flakes."),
382
+ ::anno::in_group("Appearance")
383
+ ]],
384
+ uniform float clarity = .15f
385
+ [[
386
+ ::anno::display_name("Clarity"),
387
+ ::anno::description("Use to adapt to size of object."),
388
+ ::anno::soft_range(0.1,10.0),
389
+ ::anno::in_group("Appearance")
390
+ ]],
391
+ uniform float flake_size = 1.f
392
+ [[
393
+ ::anno::display_name("Flake Size"),
394
+ ::anno::description("Determines size of flakes (in mm)."),
395
+ ::anno::in_group("Appearance")
396
+ ]],
397
+ uniform float flake_amount = 1.f
398
+ [[
399
+ ::anno::display_name("Flake Amount"),
400
+ ::anno::description("Determines amount of visible flakes."),
401
+ ::anno::soft_range(0.0,1.0),
402
+ ::anno::in_group("Appearance")
403
+ ]],
404
+ uniform texture_2d crack_texture = texture_2d ( "./textures/turquoise_crack_msk.png" , ::tex::gamma_srgb)
405
+ [[
406
+ ::anno::display_name("Crack Texture"),
407
+ ::anno::description("Attach map of cracks here."),
408
+ ::anno::in_group("Appearance")
409
+ ]],
410
+ uniform float3 texture_translate = float3 ( 0.f)
411
+ [[
412
+ ::anno::display_name("Translate"),
413
+ ::anno::description("Controls the position of the texture."),
414
+ ::anno::in_group("Transform")
415
+ ]],
416
+ uniform float texture_rotate = 0.f
417
+ [[
418
+ ::anno::display_name("Rotate"),
419
+ ::anno::description("Rotate angle in degrees."),
420
+ ::anno::in_group("Transform")
421
+ ]],
422
+ uniform float2 texture_scale = float2 ( 1.f)
423
+ [[
424
+ ::anno::display_name("Scale"),
425
+ ::anno::description("Larger numbers increase the texture size."),
426
+ ::anno::in_group("Transform"),
427
+ ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f))
428
+ ]],
429
+ uniform int uv_space_index = 0
430
+ [[
431
+ ::anno::display_name("UV Space Index"),
432
+ ::anno::description("UV space index."),
433
+ ::anno::hard_range(0,3),
434
+ ::anno::in_group("Advanced")
435
+ ]])
436
+ [[
437
+ ::anno::display_name("Turquoise"),
438
+ ::anno::description("Turquoise gem material (Default values based on 2cm stone size.)"),
439
+ ::anno::author("NVIDIA vMaterials"),
440
+ ::anno::contributor("Rüdiger Raab"),
441
+ ::anno::contributor("Maik Rohland"),
442
+ ::anno::copyright_notice(COPYRIGHT),
443
+ ::anno::thumbnail("./.thumbs/Turquoise.Turquoise.png"),
444
+ ::anno::hidden(),
445
+ ::anno::key_words(string[]("gem", "jewelry", "gemstone", "transmissive", "new", "design", "turquoise", "cool"))
446
+ ]]=
447
+ ::nvidia::core_definitions::add_globalbump(
448
+ base: ::nvidia::core_definitions::blend(
449
+ base: ::nvidia::core_definitions::thick_translucent(
450
+ transmission_color: ::nvidia::core_definitions::perlin_noise_texture(
451
+ color1: transmission_color,
452
+ color2: color ( 1.f , 1.f , 1.f),
453
+ object_space: true,
454
+ noise_levels: 3,
455
+ absolute_noise: false,
456
+ noise_threshold_high: 1.f,
457
+ noise_threshold_low: 0.f,
458
+ scaling: float3 ( 300.f , 300.f , 300.f),
459
+ translation: texture_translate,
460
+ rotation: float3 (texture_rotate,texture_rotate,texture_rotate),
461
+ texture_space: uv_space_index).tint,
462
+ volume_color: volume_color,
463
+ volume_scattering: 0.99999f,
464
+ roughness: 0.f,
465
+ reflectivity: 1.f,
466
+ base_thickness: clarity * 0.1f,
467
+ normal: ::state::normal (),
468
+ ior: 1.65f),
469
+ blend: ::nvidia::core_definitions::apply_metallicflakes(
470
+ base: ::nvidia::core_definitions::flex_material(
471
+ base_color: crack_color,
472
+ diffuse_roughness: 0.f,
473
+ is_metal: false,
474
+ reflectivity: 0.3f,
475
+ reflection_roughness: 0.2f,
476
+ anisotropy: 0.f,
477
+ anisotropy_rotation: 0.f,
478
+ transparency: 0.f,
479
+ transmission_color: color ( 1.f , 1.f , 1.f),
480
+ volume_color: color ( 1.f , 1.f , 1.f),
481
+ transmission_roughness: 0.f,
482
+ base_thickness: clarity * 0.1f,
483
+ ior: 1.5f,
484
+ thin_walled: false,
485
+ normal: ::state::normal ()),
486
+ flake_color: flake_color,
487
+ roughness: 0.f,
488
+ size: flake_size * 0.1f,
489
+ amount: flake_amount * 0.15f,
490
+ opacity: 0.5f,
491
+ bump: 1.f),
492
+ weight: ::nvidia::core_definitions::file_texture(
493
+ texture: crack_texture,
494
+ mono_source: ::base::mono_average,
495
+ brightness: 1.f,
496
+ contrast: 1.f,
497
+ scaling: 1.f / texture_scale,
498
+ translation: float2 (texture_translate.x, texture_translate.y) ,
499
+ rotation: texture_rotate,
500
+ clip: false,
501
+ texture_space: uv_space_index,
502
+ invert: false).mono),
503
+ normal: ::nvidia::core_definitions::file_bump_texture(
504
+ texture: crack_texture,
505
+ bump_source: ::base::mono_luminance,
506
+ scaling: 1.f / texture_scale,
507
+ translation: float2 (texture_translate.x, texture_translate.y) ,
508
+ rotation: texture_rotate,
509
+ clip: false,
510
+ factor: -0.2f,
511
+ texture_space: uv_space_index));
512
+
513
+
514
+ export material Turquoise_Mineral(
515
+ float turquoise_tint = 1.0f [[
516
+ ::anno::description("Adjusts the color of the mineral from greenish to blueish."),
517
+ ::anno::display_name("Tint"),
518
+ ::anno::in_group("Appearance"),
519
+ ::anno::soft_range(0.f, 1.f),
520
+ ::anno::hard_range(0.f, 1.f),
521
+ ::anno::ui_order(0)
522
+ ]],
523
+ float diffuse_brightness = 0.6f [[
524
+ ::anno::description("Adjusts the lightness of the material."),
525
+ ::anno::display_name("Brightness"),
526
+ ::anno::in_group("Appearance"),
527
+ ::anno::soft_range(0.f, 1.f),
528
+ ::anno::hard_range(0.f, 1.f),
529
+ ::anno::ui_order(1)
530
+ ]],
531
+ float polishing_roughness = 0.26f [[
532
+ ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."),
533
+ ::anno::display_name("Roughness"),
534
+ ::anno::in_group("Appearance"),
535
+ ::anno::soft_range(0.f, 1.f),
536
+ ::anno::hard_range(0.f, 1.f),
537
+ ::anno::ui_order(2)
538
+ ]],
539
+ color veins_color = color(0.158961f, 0.090842f, 0.017642f) [[
540
+ ::anno::description("Adjusts the color of the veins."),
541
+ ::anno::display_name("Vein Color"),
542
+ ::anno::in_group("Appearance"),
543
+ ::anno::ui_order(3)
544
+ ]],
545
+ float veins_big_amount = 1.f [[
546
+ ::anno::description("Controls the visibility of the large veins in the material."),
547
+ ::anno::display_name("Large Veins"),
548
+ ::anno::in_group("Appearance"),
549
+ ::anno::soft_range(0.f, 1.f),
550
+ ::anno::hard_range(0.f, 1.f),
551
+ ::anno::ui_order(4)
552
+ ]],
553
+ float veins_small_amount = 0.52f [[
554
+ ::anno::description("Controls the visibility of the small veins in the material."),
555
+ ::anno::display_name("Small Veins"),
556
+ ::anno::in_group("Appearance"),
557
+ ::anno::soft_range(0.f, 1.f),
558
+ ::anno::hard_range(0.f, 1.f),
559
+ ::anno::ui_order(5)
560
+ ]],
561
+ float veins_breakup = 0.f [[
562
+ ::anno::description("Breaks up the veins, so that they appear and disappear at different positions through the material."),
563
+ ::anno::display_name("Veins Breakup"),
564
+ ::anno::in_group("Appearance"),
565
+ ::anno::soft_range(0.f, 1.f),
566
+ ::anno::hard_range(0.f, 1.f),
567
+ ::anno::ui_order(6)
568
+ ]],
569
+ float veins_bump_strength = 0.03f [[
570
+ ::anno::description("Controls the strength of the veins that appear on the mineral surface."),
571
+ ::anno::display_name("Veins Bump Strength"),
572
+ ::anno::in_group("Appearance"),
573
+ ::anno::soft_range(0.f, 1.f),
574
+ ::anno::hard_range(0.f, 2.f),
575
+ ::anno::ui_order(7)
576
+ ]],
577
+ float2 texture_translate = float2(0.0f, 0.0f) [[
578
+ ::anno::description("Controls the position of the texture."),
579
+ ::anno::display_name("Texture Translate"),
580
+ ::anno::in_group("Transform"),
581
+ ::anno::ui_order(8)
582
+ ]],
583
+ float texture_rotate = 0.f [[
584
+ ::anno::description("Rotates angle of the texture in degrees."),
585
+ ::anno::display_name("Texture Rotate"),
586
+ ::anno::in_group("Transform"),
587
+ ::anno::soft_range(0.f, 360.f),
588
+ ::anno::ui_order(9)
589
+ ]],
590
+ float2 texture_scale = float2(1.0f) [[
591
+ ::anno::description("Larger numbers increase the size."),
592
+ ::anno::display_name("Texture Scale"),
593
+ ::anno::in_group("Transform"),
594
+ ::nvidia::core_definitions::dimension(float2(0.04f, 0.04f)),
595
+ ::anno::ui_order(10)
596
+ ]],
597
+ uniform int uv_space_index = 0 [[
598
+ ::anno::description("Uses selected UV space for material."),
599
+ ::anno::display_name("UV Space Index"),
600
+ ::anno::in_group("Transform"),
601
+ ::anno::ui_order(11)
602
+ ]],
603
+ uniform bool roundcorners_enable = false [[
604
+ ::anno::description("Enables the round corner effect. Comes at a slight performance cost as additional raytracing calls are required to evaluate the round corner effect."),
605
+ ::anno::display_name("Enable Round Corners"),
606
+ ::anno::in_group("Round Corners"),
607
+ ::anno::ui_order(12)
608
+ ]],
609
+ uniform float roundcorners_radius_mm = 1.0f [[
610
+ ::anno::description("Radius of the rounded corners in millimeters."),
611
+ ::anno::display_name("Round Corner Radius (mm)"),
612
+ ::anno::in_group("Round Corners"),
613
+ ::anno::soft_range(0.f, 10.f),
614
+ ::anno::ui_order(13)
615
+ ]],
616
+ uniform bool roundcorners_across_materials = false [[
617
+ ::anno::description("Applies the round corner effect across different materials when enabled."),
618
+ ::anno::display_name("Across Materials"),
619
+ ::anno::in_group("Round Corners."),
620
+ ::anno::ui_order(14)
621
+ ]])
622
+ [[
623
+ ::anno::display_name("Turquoise - Sky Blue"),
624
+ ::anno::description("Turquoise gem material with adjustable color hue and veins."),
625
+ ::anno::author("NVIDIA vMaterials"),
626
+ ::anno::contributor("Rüdiger Raab"),
627
+ ::anno::contributor("Maik Rohland"),
628
+ ::anno::copyright_notice(COPYRIGHT),
629
+ ::anno::thumbnail("./.thumbs/Turquoise.Turquoise_Mineral.png"),
630
+ ::anno::key_words(string[]("gem", "jewelry", "gemstone", "SSS", "transmissive", "new", "design", "turquoise", "blue", "cool", "saturated"))
631
+ ]]
632
+ =
633
+ let {
634
+ bool tmp0 = false;
635
+
636
+ texture_2d multi_rough_tex = texture_2d("./textures/turquoise_multi_rough.jpg", ::tex::gamma_linear);
637
+ texture_2d veins_tex = texture_2d("./textures/turquoise_veins.jpg", ::tex::gamma_linear);
638
+ texture_2d breakup_tex = texture_2d("./textures/turquoise_breakup_noise.png", ::tex::gamma_linear);
639
+ texture_2d diff_lin_tex = texture_2d("./textures/turquoise_diffuse.jpg", ::tex::gamma_linear);
640
+ texture_2d norm_tex = texture_2d("./textures/turquoise_cracks_norm2.jpg", ::tex::gamma_linear);
641
+
642
+
643
+ material_surface tmp1(::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(::math::lerp(histogram_range(vm_tex_lookup_3float(multi_rough_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)).x * 0.620000005f + vm_tex_lookup_3float(multi_rough_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)).y, 0.75999999f, polishing_roughness * 0.5f), ::math::lerp(histogram_range(vm_tex_lookup_3float(multi_rough_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)).x * 0.620000005f + vm_tex_lookup_3float(multi_rough_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)).y, 0.75999999f, polishing_roughness * 0.5f), 0.75f, histogram_scan_small(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(vm_tex_lookup(veins_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(veins_big_amount)).tint, vm_tex_lookup(breakup_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint, ::base::color_layer_multiply, veins_breakup, true).tint, nvidia::core_definitions::blend_colors(vm_tex_lookup(veins_tex, vm_coord_post_scale(vm_coord_post_rotate(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.74000001f), float2(0.5f)), mono_a, float4(veins_small_amount)).tint, vm_tex_lookup(breakup_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), mono_a, float4(1.f)).tint, ::base::color_layer_multiply, veins_breakup, true).tint, ::base::color_layer_screen, 1.f, true).mono, 0.620000005f, 0.119999997f)), veins_bump_strength) * ::math::lerp(histogram_range(vm_tex_lookup_3float(multi_rough_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)).x * 0.620000005f + vm_tex_lookup_3float(multi_rough_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)).y, 0.75999999f, polishing_roughness * 0.5f), ::math::lerp(histogram_range(vm_tex_lookup_3float(multi_rough_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)).x * 0.620000005f + vm_tex_lookup_3float(multi_rough_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)).y, 0.75999999f, polishing_roughness * 0.5f), 0.75f, histogram_scan_small(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(vm_tex_lookup(veins_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(veins_big_amount)).tint, vm_tex_lookup(breakup_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint, ::base::color_layer_multiply, veins_breakup, true).tint, nvidia::core_definitions::blend_colors(vm_tex_lookup(veins_tex, vm_coord_post_scale(vm_coord_post_rotate(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.74000001f), float2(0.5f)), mono_a, float4(veins_small_amount)).tint, vm_tex_lookup(breakup_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), mono_a, float4(1.f)).tint, ::base::color_layer_multiply, veins_breakup, true).tint, ::base::color_layer_screen, 1.f, true).mono, 0.620000005f, 0.119999997f)), veins_bump_strength), ::math::lerp(histogram_range(vm_tex_lookup_3float(multi_rough_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)).x * 0.620000005f + vm_tex_lookup_3float(multi_rough_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)).y, 0.75999999f, polishing_roughness * 0.5f), ::math::lerp(histogram_range(vm_tex_lookup_3float(multi_rough_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)).x * 0.620000005f + vm_tex_lookup_3float(multi_rough_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)).y, 0.75999999f, polishing_roughness * 0.5f), 0.75f, histogram_scan_small(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(vm_tex_lookup(veins_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(veins_big_amount)).tint, vm_tex_lookup(breakup_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint, ::base::color_layer_multiply, veins_breakup, true).tint, nvidia::core_definitions::blend_colors(vm_tex_lookup(veins_tex, vm_coord_post_scale(vm_coord_post_rotate(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.74000001f), float2(0.5f)), mono_a, float4(veins_small_amount)).tint, vm_tex_lookup(breakup_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), mono_a, float4(1.f)).tint, ::base::color_layer_multiply, veins_breakup, true).tint, ::base::color_layer_screen, 1.f, true).mono, 0.620000005f, 0.119999997f)), veins_bump_strength) * ::math::lerp(histogram_range(vm_tex_lookup_3float(multi_rough_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)).x * 0.620000005f + vm_tex_lookup_3float(multi_rough_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)).y, 0.75999999f, polishing_roughness * 0.5f), ::math::lerp(histogram_range(vm_tex_lookup_3float(multi_rough_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)).x * 0.620000005f + vm_tex_lookup_3float(multi_rough_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)).y, 0.75999999f, polishing_roughness * 0.5f), 0.75f, histogram_scan_small(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(vm_tex_lookup(veins_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(veins_big_amount)).tint, vm_tex_lookup(breakup_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint, ::base::color_layer_multiply, veins_breakup, true).tint, nvidia::core_definitions::blend_colors(vm_tex_lookup(veins_tex, vm_coord_post_scale(vm_coord_post_rotate(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.74000001f), float2(0.5f)), mono_a, float4(veins_small_amount)).tint, vm_tex_lookup(breakup_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), mono_a, float4(1.f)).tint, ::base::color_layer_multiply, veins_breakup, true).tint, ::base::color_layer_screen, 1.f, true).mono, 0.620000005f, 0.119999997f)), veins_bump_strength), color(1.f, 1.f, 1.f), color(0.f, 0.f, 0.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(0.589999974f, ::df::diffuse_reflection_bsdf(::math::pow(nvidia::core_definitions::blend_colors(hsl2rgb(rgb2hsl(float3(vm_tex_lookup(diff_lin_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint)) + float3((turquoise_tint - 1.f) * 0.159999996f, 0.f, 0.f)), veins_color, ::base::color_layer_blend, nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(vm_tex_lookup(veins_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(veins_big_amount)).tint, vm_tex_lookup(breakup_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint, ::base::color_layer_multiply, veins_breakup, true).tint, nvidia::core_definitions::blend_colors(vm_tex_lookup(veins_tex, vm_coord_post_scale(vm_coord_post_rotate(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.74000001f), float2(0.5f)), mono_a, float4(veins_small_amount)).tint, vm_tex_lookup(breakup_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), mono_a, float4(1.f)).tint, ::base::color_layer_multiply, veins_breakup, true).tint, ::base::color_layer_screen, 1.f, true).mono, true).tint, diffuse_brightness * -2.5999999f + 3.79999995f), 0.f), ::df::weighted_layer(1.f, ::df::diffuse_transmission_bsdf(color(0.768150985f, 0.944563985f, 1.f)), bsdf(), vm_tex_normal_lookup_2x(norm_tex, norm_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), vm_coord_post_scale(vm_coord_post_rotate(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.74000001f), float2(0.5f)), nvidia::core_definitions::blend_colors(vm_tex_lookup(veins_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(veins_big_amount)).tint, vm_tex_lookup(breakup_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint, ::base::color_layer_multiply, veins_breakup, true).mono * (veins_bump_strength * 10.f), nvidia::core_definitions::blend_colors(vm_tex_lookup(veins_tex, vm_coord_post_scale(vm_coord_post_rotate(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.74000001f), float2(0.5f)), mono_a, float4(veins_small_amount)).tint, vm_tex_lookup(breakup_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), mono_a, float4(1.f)).tint, ::base::color_layer_multiply, veins_breakup, true).mono * (veins_bump_strength * 10.f), false)), vm_tex_normal_lookup_2x(norm_tex, norm_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), vm_coord_post_scale(vm_coord_post_rotate(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.74000001f), float2(0.5f)), nvidia::core_definitions::blend_colors(vm_tex_lookup(veins_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(veins_big_amount)).tint, vm_tex_lookup(breakup_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint, ::base::color_layer_multiply, veins_breakup, true).mono * (veins_bump_strength * 10.f), nvidia::core_definitions::blend_colors(vm_tex_lookup(veins_tex, vm_coord_post_scale(vm_coord_post_rotate(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.74000001f), float2(0.5f)), mono_a, float4(veins_small_amount)).tint, vm_tex_lookup(breakup_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), mono_a, float4(1.f)).tint, ::base::color_layer_multiply, veins_breakup, true).mono * (veins_bump_strength * 10.f), false)), vm_tex_normal_lookup_2x(norm_tex, norm_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), vm_coord_post_scale(vm_coord_post_rotate(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.74000001f), float2(0.5f)), nvidia::core_definitions::blend_colors(vm_tex_lookup(veins_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(veins_big_amount)).tint, vm_tex_lookup(breakup_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint, ::base::color_layer_multiply, veins_breakup, true).mono * (veins_bump_strength * 10.f), nvidia::core_definitions::blend_colors(vm_tex_lookup(veins_tex, vm_coord_post_scale(vm_coord_post_rotate(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.74000001f), float2(0.5f)), mono_a, float4(veins_small_amount)).tint, vm_tex_lookup(breakup_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), mono_a, float4(1.f)).tint, ::base::color_layer_multiply, veins_breakup, true).mono * (veins_bump_strength * 10.f), false)), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
644
+ material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
645
+ color tmp3 = color(1.f, 1.f, 1.f);
646
+ material_volume tmp4(
647
+ vdf(),
648
+ custom_volume_transmittance(unit_cm, 3.f, color(0.0331959985f, 0.0975869969f, 0.0886309966f), hsl2rgb(rgb2hsl(float3(vm_tex_lookup(diff_lin_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint)) + float3((turquoise_tint - 1.f) * 0.159999996f, 0.f, 0.f))).absorption_coefficient,
649
+ custom_volume_transmittance(unit_cm, 3.f, color(0.0331959985f, 0.0975869969f, 0.0886309966f), hsl2rgb(rgb2hsl(float3(vm_tex_lookup(diff_lin_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint)) + float3((turquoise_tint - 1.f) * 0.159999996f, 0.f, 0.f))).scattering_coefficient,
650
+ color(0.f, 0.f, 0.f));
651
+ 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());
652
+ } in
653
+ material(
654
+ thin_walled: tmp0,
655
+ surface: tmp1,
656
+ backface: tmp2,
657
+ ior: tmp3,
658
+ volume: tmp4,
659
+ geometry: tmp5);
660
+
661
+
662
+ // 2
663
+ export material Turquoise_Blueish_Green(*)
664
+ [[
665
+ ::anno::display_name("Turquoise - Medium Blue"),
666
+ ::anno::description("Turquoise gem material with adjustable color hue and veins."),
667
+ ::anno::author("NVIDIA vMaterials"),
668
+ ::anno::contributor("Rüdiger Raab"),
669
+ ::anno::contributor("Maik Rohland"),
670
+ ::anno::copyright_notice(COPYRIGHT),
671
+ ::anno::thumbnail("./.thumbs/Turquoise.Turquoise_Blueish_Green.png"),
672
+ ::anno::key_words(string[]("gem", "jewelry", "gemstone", "SSS", "transmissive", "new", "design", "bumped", "turquoise", "medium", "blue", "cool", "saturated"))
673
+ ]] = Turquoise_Mineral(
674
+ turquoise_tint: 0.66f,
675
+ diffuse_brightness: 0.6f,
676
+ polishing_roughness: 0.35f,
677
+ veins_color: color(0.158961f, 0.090842f, 0.017642f),
678
+ veins_big_amount: 1.0f,
679
+ veins_small_amount: 0.81f,
680
+ veins_breakup: 0.5f,
681
+ veins_bump_strength: 1.0f,
682
+ texture_translate: float2(0.0f),
683
+ texture_rotate: 0.0f,
684
+ texture_scale: float2(1.0f),
685
+ uv_space_index: 0,
686
+ roundcorners_enable: false,
687
+ roundcorners_radius_mm: 1.0f,
688
+ roundcorners_across_materials: false
689
+ );
690
+
691
+
692
+ // 3
693
+ export material Turquoise_Apple_Green(*)
694
+ [[
695
+ ::anno::display_name("Turquoise - Apple Green"),
696
+ ::anno::description("Turquoise gem material with adjustable color hue and veins."),
697
+ ::anno::author("NVIDIA vMaterials"),
698
+ ::anno::contributor("Rüdiger Raab"),
699
+ ::anno::contributor("Maik Rohland"),
700
+ ::anno::copyright_notice(COPYRIGHT),
701
+ ::anno::thumbnail("./.thumbs/Turquoise.Turquoise_Apple_Green.png"),
702
+ ::anno::key_words(string[]("gem", "jewelry", "gemstone", "SSS", "transmissive", "new", "design", "bumped", "rough", "turquoise", "blue", "apple", "green", "cool", "saturated"))
703
+ ]] = Turquoise_Mineral(
704
+ turquoise_tint: 0.0f,
705
+ diffuse_brightness: 0.6f,
706
+ polishing_roughness: 0.79f,
707
+ veins_color: color(0.158961f, 0.090842f, 0.017642f),
708
+ veins_big_amount: 1.0f,
709
+ veins_small_amount: 0.81f,
710
+ veins_breakup: 0.5f,
711
+ veins_bump_strength: 1.0f,
712
+ texture_translate: float2(0.0f),
713
+ texture_rotate: 0.0f,
714
+ texture_scale: float2(1.0f),
715
+ uv_space_index: 0,
716
+ roundcorners_enable: false,
717
+ roundcorners_radius_mm: 1.0f,
718
+ roundcorners_across_materials: false
719
+ );
code/third_party/vMaterials_2/Gems/Zircon.mdl ADDED
@@ -0,0 +1,140 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2024 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
+
38
+ import ::df::*;
39
+ import ::anno::*;
40
+ import ::base::*;
41
+ import ::math::*;
42
+ import ::nvidia::core_definitions::thick_glass;
43
+ import ::state::normal;
44
+
45
+ const string COPYRIGHT =
46
+ " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
47
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
48
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
49
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
50
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
51
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
52
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
53
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
54
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
55
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
56
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
57
+
58
+ material gem_definition(
59
+ color transmission_color = color(1.0),
60
+ uniform color glass_color = color(.95),
61
+ float roughness = 0.0,
62
+ uniform float volume_ior = 1.4f,
63
+ uniform bool dispersion = true,
64
+ uniform float abbe_number = 1.4f,
65
+ uniform float base_thickness = .1,
66
+ float3 normal = ::state::normal()
67
+ )
68
+ [[
69
+ ::anno::hidden()
70
+ ]]
71
+ = let{
72
+
73
+ bsdf glossy_bsdf = ::df::simple_glossy_bsdf(
74
+ mode: ::df::scatter_reflect,
75
+ tint: color(1.),
76
+ roughness_u: roughness
77
+ );
78
+ bsdf glossy_bsdf_transmission = ::df::simple_glossy_bsdf(
79
+ mode: ::df::scatter_transmit,
80
+ tint: transmission_color,
81
+ roughness_u: roughness
82
+ );
83
+ } in material(
84
+ thin_walled: false,
85
+ surface: material_surface(
86
+ ::df::weighted_layer(
87
+ normal: normal,
88
+ weight: 1.,
89
+ layer: ::df::color_fresnel_layer(
90
+ layer: glossy_bsdf,
91
+ base: glossy_bsdf_transmission,
92
+ ior: dispersion?::base::abbe_number_ior(volume_ior, abbe_number):color(volume_ior)
93
+ )
94
+ )
95
+ ),
96
+ volume: material_volume(
97
+ absorption_coefficient: (base_thickness <= 0)? color(0): ::math::log(glass_color) / -base_thickness
98
+ ),
99
+ ior: dispersion?::base::abbe_number_ior(volume_ior, abbe_number):color(volume_ior)
100
+ );
101
+
102
+ export material Zircon(
103
+ uniform color volume_color = color ( 0.194618f , 0.879622f , 1.f)
104
+ [[
105
+ ::anno::display_name("Volume Color"),
106
+ ::anno::description("Color effect for volume of the object reached at transmission distance."),
107
+ ::anno::in_group("Appearance")
108
+ ]],
109
+ uniform float clarity = 1.f
110
+ [[
111
+ ::anno::display_name("Clarity"),
112
+ ::anno::description("Use to adapt to size of gem, smaller numbers darken the gem."),
113
+ ::anno::soft_range(0.1,10.0),
114
+ ::anno::in_group("Appearance")
115
+ ]],
116
+ uniform bool dispersion = true
117
+ [[
118
+ ::anno::display_name("Dispersion"),
119
+ ::anno::description("Enable or disable the dispersion."),
120
+ ::anno::in_group("Advanced")
121
+ ]])
122
+ [[
123
+ ::anno::display_name("Zircon"),
124
+ ::anno::description("Zircon gem material (Default values based on 2cm stone size.)"),
125
+ ::anno::author("NVIDIA vMaterials"),
126
+ ::anno::contributor("Rüdiger Raab"),
127
+ ::anno::contributor("Maik Rohland"),
128
+ ::anno::copyright_notice(COPYRIGHT),
129
+ ::anno::thumbnail("./.thumbs/Zircon.Zircon.png"),
130
+ ::anno::key_words(string[]("gem", "jewelry", "gemstone", "transmissive", "new", "design", "zircon", "purple"))
131
+ ]] = gem_definition(
132
+ transmission_color: color ( 0.5843138f , 0.945098f , 1.f),
133
+ glass_color: volume_color,
134
+ roughness: 0.f,
135
+ volume_ior: 1.92f,
136
+ dispersion: dispersion,
137
+ abbe_number: 33.54f,
138
+ base_thickness: clarity * 0.05f,
139
+ normal: ::state::normal ());
140
+
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl.png ADDED

Git LFS Details

  • SHA256: 30d972b180a2a21d1c2ae146063f8cfc57d6430a6497faa6c0f30339d33b698b
  • Pointer size: 130 Bytes
  • Size of remote file: 99.5 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper.png ADDED

Git LFS Details

  • SHA256: 30d972b180a2a21d1c2ae146063f8cfc57d6430a6497faa6c0f30339d33b698b
  • Pointer size: 130 Bytes
  • Size of remote file: 99.5 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_10_of_12.png ADDED

Git LFS Details

  • SHA256: be4e5a32d968c59a795af42c28d78e9b61e85099c6a8f3310be94e59e695174d
  • Pointer size: 131 Bytes
  • Size of remote file: 117 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_11_of_12.png ADDED

Git LFS Details

  • SHA256: 0b5f5eeed706872228ad5b25f3000b2c39de1f40cb0a75e87b4e50dbabe39431
  • Pointer size: 131 Bytes
  • Size of remote file: 112 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_2_of_12.png ADDED

Git LFS Details

  • SHA256: ce960222d6d58dea0f690531ffe7c0d91f8785063cf3b4666605c972a9e55f41
  • Pointer size: 131 Bytes
  • Size of remote file: 115 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_3_of_12.png ADDED

Git LFS Details

  • SHA256: 3fd498e2188121e836baae5a3e5f162be5e197235909094af1fd2c3c504fe2b8
  • Pointer size: 130 Bytes
  • Size of remote file: 95.7 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_4_of_12.png ADDED

Git LFS Details

  • SHA256: dcfdc644e5378e3bcbf2a43fb55445a5a6af0055f706a28677a14b94c1a4bde2
  • Pointer size: 130 Bytes
  • Size of remote file: 97.9 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_5_of_12.png ADDED

Git LFS Details

  • SHA256: 10e1e3095e4783f993a9e974ecb994980bd58dbe0c261f43ec9919fdddecf136
  • Pointer size: 130 Bytes
  • Size of remote file: 89.2 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_6_of_12.png ADDED

Git LFS Details

  • SHA256: 980612c9756d62f3072f837ef2359bd4bfbd60139679f3086d766ded70979dc8
  • Pointer size: 130 Bytes
  • Size of remote file: 83.1 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_7_of_12.png ADDED

Git LFS Details

  • SHA256: 954d2c3ef9aebed75f4c7e3853eec474d596a9ca2308ad8b472c1d182c15122b
  • Pointer size: 131 Bytes
  • Size of remote file: 105 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_8_of_12.png ADDED

Git LFS Details

  • SHA256: 22bba8d5df3e2a396b2a07080266891bf3bc148323ccaf6f31d339df03a06846
  • Pointer size: 131 Bytes
  • Size of remote file: 104 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_9_of_12.png ADDED

Git LFS Details

  • SHA256: 539e5800a8349896f12923719f3692d2c04d3881b81fac50a475dbf42f687bd2
  • Pointer size: 131 Bytes
  • Size of remote file: 121 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum.mdl.png ADDED

Git LFS Details

  • SHA256: 3782bb67e830036a1dac35b05760ea01c0ba58836b2ba8b6cb76b1cdc28311e0
  • Pointer size: 130 Bytes
  • Size of remote file: 77.5 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum.mdl@Aluminum.png ADDED

Git LFS Details

  • SHA256: 3782bb67e830036a1dac35b05760ea01c0ba58836b2ba8b6cb76b1cdc28311e0
  • Pointer size: 130 Bytes
  • Size of remote file: 77.5 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum.mdl@Aluminum_Glossy_Fingerprints.png ADDED

Git LFS Details

  • SHA256: ba0e2eb9ddabb8c372db142efa6948f75328b8d820a2286279d910f05353a474
  • Pointer size: 130 Bytes
  • Size of remote file: 82.2 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum.mdl@Aluminum_Polished.png ADDED

Git LFS Details

  • SHA256: 1dd1f1a3893260657dbb0d9670a5f2b2c78040d0012d606a2088f4a7e204fb4e
  • Pointer size: 130 Bytes
  • Size of remote file: 75.2 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl.png ADDED

Git LFS Details

  • SHA256: f6501e6b700f468a3d0d31c8cb49d9794790dfc65291cf02221366230a8729c1
  • Pointer size: 130 Bytes
  • Size of remote file: 97.6 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized.png ADDED

Git LFS Details

  • SHA256: f6501e6b700f468a3d0d31c8cb49d9794790dfc65291cf02221366230a8729c1
  • Pointer size: 130 Bytes
  • Size of remote file: 97.6 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Electric_Blue_Coated.png ADDED

Git LFS Details

  • SHA256: 1881a292a4f70b13468fd36939d2f584d311bedd5fa5114b181d7acefb98a53e
  • Pointer size: 131 Bytes
  • Size of remote file: 102 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Electric_Blue_Dirty.png ADDED

Git LFS Details

  • SHA256: 4b18e2deb26076de0e97558f50fe0b2415a4736bdf47d515ab8bfda294f91749
  • Pointer size: 131 Bytes
  • Size of remote file: 100 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Electric_Blue_Scratched.png ADDED

Git LFS Details

  • SHA256: 6921abab02db3df2a443dbe864e0c711810c654f52fb186ba0d5ee52cb5ba7c9
  • Pointer size: 130 Bytes
  • Size of remote file: 99.3 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Electric_Blue_Shiny.png ADDED

Git LFS Details

  • SHA256: 87c9db423944abb798845954f81fda962e221889b65e4f9ee1427617a520c9b4
  • Pointer size: 130 Bytes
  • Size of remote file: 88.5 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Electric_Blue_Smudges.png ADDED

Git LFS Details

  • SHA256: c0b0ed489b8a8e66513ef378bfcb20eeb050406366f27b2fd8f96705d577b96e
  • Pointer size: 130 Bytes
  • Size of remote file: 99.9 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Gold.png ADDED

Git LFS Details

  • SHA256: b740950d3a8b7538f3e2607073679c2e36886d07d10b6f8d704c7aa7b07ad5ea
  • Pointer size: 130 Bytes
  • Size of remote file: 90.6 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Grass_Green.png ADDED

Git LFS Details

  • SHA256: b40d7b24aba83a6a05f3bc3d81c9d6a38748e2c9c9ff08c30420ba2ee0fa4103
  • Pointer size: 130 Bytes
  • Size of remote file: 88.1 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Lavender.png ADDED

Git LFS Details

  • SHA256: 0c8cba7109e57f14a457a7e3ea94472467dd95de04ca33bf5ed141605f785349
  • Pointer size: 130 Bytes
  • Size of remote file: 93.7 kB