Datasets:

Modalities:
Image
Text
Formats:
text
Size:
< 1K
Libraries:
Datasets
License:
ZijunCui commited on
Commit
5b89cb9
·
verified ·
1 Parent(s): fe775b6

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/Concrete/Concrete_Floor_Damage.mdl +533 -0
  2. code/third_party/vMaterials_2/Concrete/Concrete_Formed.mdl +255 -0
  3. code/third_party/vMaterials_2/Concrete/Concrete_Polished.mdl +416 -0
  4. code/third_party/vMaterials_2/Concrete/Concrete_Precast.mdl +1288 -0
  5. code/third_party/vMaterials_2/Concrete/Concrete_Rough.mdl +457 -0
  6. code/third_party/vMaterials_2/Concrete/Concrete_Wall_Aged.mdl +436 -0
  7. code/third_party/vMaterials_2/Concrete/Concrete_Wall_Aged_Scratched.mdl +462 -0
  8. code/third_party/vMaterials_2/Concrete/Concrete_Wall_Even.mdl +449 -0
  9. code/third_party/vMaterials_2/Concrete/Mortar.mdl +626 -0
  10. code/third_party/vMaterials_2/Concrete/Spongy_Concrete_Weathered.mdl +467 -0
  11. code/third_party/vMaterials_2/Concrete/Spongy_Concrete_Weathered_Mossy.mdl +393 -0
  12. code/third_party/vMaterials_2/Concrete/Stone_Pores_Weathered.mdl +706 -0
  13. code/third_party/vMaterials_2/Concrete/textures/concrete_wall_even_R_rough_G_ao_B_grunge.jpg +3 -0
  14. code/third_party/vMaterials_2/Concrete/textures/concrete_wall_even_diff.jpg +3 -0
  15. code/third_party/vMaterials_2/Concrete/textures/moss_diff.jpg +3 -0
  16. code/third_party/vMaterials_2/Concrete/textures/precastconcrete_diff.png +3 -0
  17. code/third_party/vMaterials_2/Concrete/textures/spongy_concrete_weathered_norm.jpg +3 -0
  18. code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Flaxen.png +3 -0
  19. code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Mustard.png +3 -0
  20. code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Potters_Clay.png +3 -0
  21. code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Purple.png +3 -0
  22. code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Rosy_Peach.png +3 -0
  23. code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Smoke.png +3 -0
  24. code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Teal.png +3 -0
  25. code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Denim.Cotton_Denim_Independence_Blue.png +3 -0
  26. code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Denim.Cotton_Denim_Washed_Blue.png +3 -0
  27. code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry.png +3 -0
  28. code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Dark_Blue.png +3 -0
  29. code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Dark_Gray.png +3 -0
  30. code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Harbor_Gray.png +3 -0
  31. code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Mid_Gray.png +3 -0
  32. code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford.png +3 -0
  33. code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Coffee_Bean.png +3 -0
  34. code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Fog.png +3 -0
  35. code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Fuchsia.png +3 -0
  36. code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Peacock.png +3 -0
  37. code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Roughly_Woven.Fabric_Cotton_Roughly_Woven_Dark_Red.png +3 -0
  38. code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Roughly_Woven.Fabric_Cotton_Roughly_Woven_Green.png +3 -0
  39. code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Roughly_Woven.Fabric_Cotton_Roughly_Woven_Orange.png +3 -0
  40. code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey.png +3 -0
  41. code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Amethyst.png +3 -0
  42. code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Brick_Red.png +3 -0
  43. code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Bubblegum.png +3 -0
  44. code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Charcoal.png +3 -0
  45. code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Grass_Green.png +3 -0
  46. code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Gray.png +3 -0
  47. code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Navy_Blue.png +3 -0
  48. code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Orange.png +3 -0
  49. code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Purple.png +3 -0
  50. code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Teal.png +3 -0
code/third_party/vMaterials_2/Concrete/Concrete_Floor_Damage.mdl ADDED
@@ -0,0 +1,533 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ const string DESCRIPTION = "A stone concrete material";
63
+
64
+ int lowbias32(int x)
65
+ {
66
+ x ^= x >>> 16;
67
+ x *= 0x7feb352d;
68
+ x ^= x >>> 15;
69
+ x *= 0x846ca68b;
70
+ x ^= x >>> 16;
71
+ return x;
72
+ }
73
+
74
+ float remap_xy_to_0_1(float input, float x, float y)
75
+ {
76
+ return (input - x)/(y - x);
77
+ }
78
+
79
+ float histogram_scan_big(float input, float width, float position)
80
+ {
81
+ return ::math::clamp(
82
+ remap_xy_to_0_1(input,
83
+ ::math::lerp(-width, 1.0, position),
84
+ ::math::lerp(0.0, 1.0 + width, position)),
85
+ 0.0,
86
+ 1.0);
87
+ }
88
+
89
+ float2x2 invert_2x2(float2x2 M)
90
+ {
91
+ float det = M[0][0]*M[1][1] - M[0][1]*M[1][0];
92
+ //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/
93
+ return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]);
94
+ }
95
+ float uint2float(int x)
96
+ {
97
+ return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0);
98
+ }
99
+
100
+
101
+
102
+ float2 rnd22(int2 p) {
103
+ float2 ret_val = float2(
104
+ uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f,
105
+ uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f
106
+ );
107
+ return ret_val;
108
+ }
109
+
110
+ float3 srgb2rgb(float3 val)
111
+ {
112
+ return ::math::pow(::math::max(val, float3(0.0f)), 2.2);
113
+ }
114
+ ::base::texture_coordinate_info transform_coordinate_2(
115
+ float4x4 transform
116
+ [[ ::anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix.") ]],
117
+ ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info()
118
+ [[ ::anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection.") ]]
119
+ ) [[
120
+ ::anno::description("Transform a texture coordinate by a matrix.") ,
121
+ ::anno::noinline()
122
+ ]]
123
+ {
124
+
125
+
126
+ // Version 2
127
+ float4 r_position = transform * float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1);
128
+ //Try aproximating it for the case that the rotation is only aroud z and assuming the texture layout is nice and z is ~constant.
129
+ //just pretend there is no other rotation happening
130
+ //get rid of scaling and translation. Then extract fields where sin and cos would be in a simple 2d transform around z.
131
+ float4 u = transform[0];
132
+ float3 ru = ::math::normalize(float3(u.x,u.y,u.z));
133
+ float cos = ru.x;
134
+ float sin = -ru.y;
135
+
136
+
137
+ return ::base::texture_coordinate_info(
138
+ float3(r_position.x,r_position.y,r_position.z),
139
+ ::math::normalize(cos * coordinate.tangent_u - sin * coordinate.tangent_v),
140
+ ::math::normalize(cos * coordinate.tangent_v + sin * coordinate.tangent_u));
141
+ }
142
+
143
+ float3 nonrepeat_lookup(
144
+ uniform texture_2d texture = texture_2d(),
145
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
146
+ float texture_scale = 1.0,
147
+ float3 average_color = float3(0.5),
148
+ float patch_size = 8.0
149
+ )
150
+ {
151
+
152
+ float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale;
153
+ float Z = patch_size; // patch scale inside example texture
154
+
155
+ float3 O = float3(0.f);
156
+ float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f);
157
+ float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space
158
+
159
+ float2 U = uv_in;
160
+ float2 V = M * uv_in; //pre-tilted hexa coordinates
161
+ int2 I = int2(::math::floor(V)); // hexa-tile id
162
+
163
+ // The mean color needs to be determined in Photoshop then to make the
164
+ // average color work out, take the float value and calculate the apropriate
165
+ // mean value as (value^(1/2.2))
166
+
167
+ float3 m = average_color;
168
+
169
+ float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W;
170
+ F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates
171
+
172
+ if( F[2] > 0.f )
173
+ O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m)
174
+ + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m)
175
+ + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m);
176
+ else
177
+ O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m)
178
+ + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m)
179
+ + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m);
180
+ O = m + O/::math::length(W);
181
+ O = ::math::clamp( (O), 0.0, 1.0);
182
+
183
+ return float3(O);
184
+ }
185
+
186
+ float3 endless_normal(
187
+ uniform texture_2d texture = texture_2d(),
188
+ float factor = 1.0,
189
+ bool flip_tangent_u = false,
190
+ bool flip_tangent_v = false,
191
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
192
+ float texture_scale = 10.0,
193
+ float3 average_color = float3(0.5, 0.5, 1.0),
194
+ float patch_size = 8.0
195
+ //bool srgb2rgb = false,
196
+ //bool rgb2srgb = false
197
+ )
198
+ {
199
+ float3 transformed_tangent_u = flip_tangent_u ? uvw.tangent_u : - uvw.tangent_u;
200
+ float3 transformed_tangent_v = flip_tangent_v ? uvw.tangent_v : - uvw.tangent_v;
201
+
202
+ if (flip_tangent_u)
203
+ transformed_tangent_u=-transformed_tangent_u;
204
+ if (flip_tangent_v)
205
+ transformed_tangent_v=-transformed_tangent_v;
206
+
207
+ // normalized Lookup
208
+ float3 tangent_space_normal =
209
+ (nonrepeat_lookup (
210
+ texture: texture,
211
+ uvw: uvw,
212
+ texture_scale: texture_scale,
213
+ average_color: average_color,
214
+ patch_size: patch_size
215
+ ) - 0.5) * (2.0 * factor);
216
+
217
+
218
+ return ::math::normalize(uvw.tangent_u * tangent_space_normal.x +
219
+ uvw.tangent_v * tangent_space_normal.y +
220
+ ::state::normal()*1.0);
221
+ //return ::state::normal();
222
+ }
223
+ color endless_texture(
224
+ uniform texture_2d texture = texture_2d(),
225
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
226
+ float texture_scale = 10.0,
227
+ float3 average_color = float3(0.5, 0.5, .5),
228
+ float patch_size = 8.0,
229
+ bool gamma_correct_lookup = true
230
+ )
231
+ {
232
+ return gamma_correct_lookup ? color(srgb2rgb(
233
+ nonrepeat_lookup (
234
+ texture: texture,
235
+ uvw: uvw,
236
+ texture_scale: texture_scale,
237
+ average_color: average_color,
238
+ patch_size: patch_size
239
+ ))
240
+ ) : color(nonrepeat_lookup (
241
+ texture: texture,
242
+ uvw: uvw,
243
+ texture_scale: texture_scale,
244
+ average_color: average_color,
245
+ patch_size: patch_size
246
+ ));
247
+ }
248
+ ::base::texture_coordinate_info vmat_transform(
249
+ float2 translation = float2(0.0, 0.0),
250
+ float rotation = 0.0, // rotation in degrees
251
+ float2 scaling = float2(1.0, 1.0),
252
+ uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw,
253
+ uniform int uv_space = 0
254
+ )
255
+ {
256
+ float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f;
257
+ float4x4 scale =
258
+ float4x4(1.0 /scaling.x, 0. , 0. , 0.,
259
+ 0. , 1.0 /scaling.y , 0. , 0.,
260
+ 0. , 0. , 1.0, 0.,
261
+ translation.x , translation.y , 0.0, 1.);
262
+
263
+ float s = ::math::sin(rotation_rad);
264
+ float c = ::math::cos(rotation_rad);
265
+ float4x4 rotate =
266
+ float4x4( c , -s , 0.0 , 0.0,
267
+ s , c , 0.0 , 0.0,
268
+ 0.0, 0.0 , 1.0 , 0.0,
269
+ 0. , 0.0 , 0.0 , 1.);
270
+
271
+ return transform_coordinate_2(scale*rotate, ::base::coordinate_source(system, uv_space));
272
+ }
273
+ float histogram_range(float input, float range = 1.0f, float position = 0.5f)
274
+ {
275
+ float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0);
276
+ float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0);
277
+ return ::math::lerp(low, high, input);
278
+ }
279
+
280
+
281
+ export material Concrete_Floor_Damage(
282
+ uniform bool infinite_tiling = false [[
283
+ ::anno::description("Enables infinite tiling feature which removes repeating texture patterns. Note that depending on the material this feature changes the appearance of the material slightly."),
284
+ ::anno::display_name("Infinite Tiling"),
285
+ ::anno::in_group("Appearance")
286
+ ]],
287
+ color stone_color = color(1.f, 0.928306997f, 0.848088026f) [[
288
+ ::anno::description("."),
289
+ ::anno::display_name("Color"),
290
+ ::anno::in_group("Appearance")
291
+ ]],
292
+ float reflection_roughness = 1.f [[
293
+ ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."),
294
+ ::anno::display_name("Roughness"),
295
+ ::anno::in_group("Appearance"),
296
+ ::anno::hard_range(0.f, 1.f)
297
+ ]],
298
+ float reflection_weight = 0.9f [[
299
+ ::anno::description("Amount of reflection, higher numbers provide more reflection."),
300
+ ::anno::display_name("Reflection Weight"),
301
+ ::anno::in_group("Appearance"),
302
+ ::anno::hard_range(0.f, 1.f)
303
+ ]],
304
+ uniform float bump_strength = 1.f [[
305
+ ::anno::description("Specifies the strength of the bump."),
306
+ ::anno::display_name("Bump Strength"),
307
+ ::anno::in_group("Appearance"),
308
+ ::anno::hard_range(0.f, 1.f)
309
+ ]],
310
+ float2 texture_translate = float2(0.f) [[
311
+ ::anno::description("Controls the position of the texture."),
312
+ ::anno::display_name("Texture Translate"),
313
+ ::anno::in_group("Transform")
314
+ ]],
315
+ float texture_rotate = 0.f [[
316
+ ::anno::description("Rotates angle of the texture in degrees."),
317
+ ::anno::display_name("Texture Rotate"),
318
+ ::anno::in_group("Transform"),
319
+ ::anno::soft_range(0.f, 360.f)
320
+ ]],
321
+ float2 texture_scale = float2(1.f) [[
322
+ ::anno::description("Larger numbers increase the size."),
323
+ ::anno::display_name("Texture Scale"),
324
+ ::nvidia::core_definitions::dimension(float2(1.f, 1.f)),
325
+ ::anno::in_group("Transform")
326
+ ]],
327
+ uniform bool roundcorners_enable = false [[
328
+ ::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."),
329
+ ::anno::display_name("Enable Round Corners"),
330
+ ::anno::in_group("Round Corners")
331
+ ]],
332
+ uniform float roundcorners_radius_mm = 1.5f [[
333
+ ::anno::description("Radius of the rounded corners in millimeters."),
334
+ ::anno::display_name("Round Corner Radius (mm)"),
335
+ ::anno::in_group("Round Corners"),
336
+ ::anno::soft_range(0.f, 10.f)
337
+ ]],
338
+ uniform bool roundcorners_across_materials = true [[
339
+ ::anno::description("Applies the round corner effect across different materials when enabled."),
340
+ ::anno::display_name("Across Materials"),
341
+ ::anno::in_group("Round Corners")
342
+ ]],
343
+ uniform int uv_space_index = 0 [[
344
+ ::anno::description("Uses selected UV space for material."),
345
+ ::anno::display_name("UV Space Index"),
346
+ ::anno::in_group("Advanced")
347
+ ]])
348
+ [[
349
+ ::anno::description(DESCRIPTION),
350
+ ::anno::display_name("Dry Concrete"),
351
+ ::anno::copyright_notice(COPYRIGHT),
352
+ ::anno::key_words(string[]("dielectric", "infinite", "stone", "nature", "weathered", "wall", "exterior", "rough", "urban", "city", "dry", "damage", "concrete")),
353
+ ::anno::thumbnail("./.thumbs/Concrete_Floor_Damage.Concrete_Floor_Damage.png"),
354
+ ::anno::author("Nvidia vMaterials"),
355
+ ::anno::contributor("Maik Rohland"),
356
+ ::anno::contributor("Ruediger Raab")
357
+ ]]
358
+ =
359
+ let {
360
+ bool tmp0 = false;
361
+ material_surface tmp1(::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, ::math::pow(histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_floor_damage_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 11.f, float3(0.572548985f, 0.858824015f, 0.f), 11.f, true) : ::base::file_texture(texture_2d("./textures/concrete_floor_damage_multi_R_rough_G_ao.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, ::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.229999989f, ::math::lerp(0.790000021f, 0.620000005f, reflection_weight)), 2.20000005f), ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_floor_damage_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 11.f, float3(0.572548985f, 0.858824015f, 0.f), 11.f, true) : ::base::file_texture(texture_2d("./textures/concrete_floor_damage_multi_R_rough_G_ao.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, ::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, reflection_roughness) * histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_floor_damage_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 11.f, float3(0.572548985f, 0.858824015f, 0.f), 11.f, true) : ::base::file_texture(texture_2d("./textures/concrete_floor_damage_multi_R_rough_G_ao.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, ::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, reflection_roughness), histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_floor_damage_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 11.f, float3(0.572548985f, 0.858824015f, 0.f), 11.f, true) : ::base::file_texture(texture_2d("./textures/concrete_floor_damage_multi_R_rough_G_ao.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, ::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, reflection_roughness) * histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_floor_damage_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 11.f, float3(0.572548985f, 0.858824015f, 0.f), 11.f, true) : ::base::file_texture(texture_2d("./textures/concrete_floor_damage_multi_R_rough_G_ao.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, ::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, reflection_roughness), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_floor_damage_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 11.f, float3(0.498039007f, 0.466666996f, 0.431373f), 11.f, true) : ::base::file_texture(texture_2d("./textures/concrete_floor_damage_diff.jpg", ::tex::gamma_srgb), 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, ::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, stone_color, ::base::color_layer_overlay, 1.f).tint, color(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_floor_damage_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 11.f, float3(0.572548985f, 0.858824015f, 0.f), 11.f, true) : ::base::file_texture(texture_2d("./textures/concrete_floor_damage_multi_R_rough_G_ao.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, ::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]), ::base::color_layer_overlay, -0.199999988f).tint, 0.f), bsdf(), infinite_tiling ? endless_normal(texture_2d("./textures/concrete_floor_damage_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 11.f, float3(0.501960993f, 0.498039007f, 0.882353008f), 11.f) : ::base::tangent_space_normal_texture(texture_2d("./textures/concrete_floor_damage_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), infinite_tiling ? endless_normal(texture_2d("./textures/concrete_floor_damage_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 11.f, float3(0.501960993f, 0.498039007f, 0.882353008f), 11.f) : ::base::tangent_space_normal_texture(texture_2d("./textures/concrete_floor_damage_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
362
+ material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
363
+ color tmp3 = color(1.f, 1.f, 1.f);
364
+ 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());
365
+ } in
366
+ material(
367
+ thin_walled: tmp0,
368
+ surface: tmp1,
369
+ backface: tmp2,
370
+ ior: tmp3,
371
+ geometry: tmp5);
372
+
373
+ export material Defined_Reflections_Damaged_Concrete(*)
374
+ [[
375
+ ::anno::display_name("Defined Reflections Damaged Concrete"),
376
+ ::anno::description(DESCRIPTION),
377
+ ::anno::copyright_notice(COPYRIGHT),
378
+ ::anno::key_words(string[]("dielectric", "infinite", "stone", "nature", "weathered", "wall", "exterior", "rough", "urban", "city", "dry", "damage", "concrete")),
379
+ ::anno::thumbnail("./.thumbs/Concrete_Floor_Damage.Defined_Reflections_Damaged_Concrete.png"),
380
+ ::anno::author("NVIDIA vMaterials"),
381
+ ::anno::contributor("Maik Rohland"),
382
+ ::anno::contributor("Ruediger Raab")
383
+ ]]
384
+ = Concrete_Floor_Damage
385
+ (
386
+ infinite_tiling: true,
387
+ stone_color: color(0.957370f, 0.932277f, 0.851252f),
388
+ reflection_roughness: 0.f,
389
+ reflection_weight: 1.f,
390
+ bump_strength: 1.f,
391
+ texture_translate: float2(0.0f),
392
+ texture_rotate: 0.0f,
393
+ texture_scale: float2(1.0f),
394
+ roundcorners_enable: false,
395
+ roundcorners_radius_mm: 1.5f,
396
+ roundcorners_across_materials: true,
397
+ uv_space_index: 0
398
+ );
399
+
400
+ export material Shiny_Damaged_Concrete(*)
401
+ [[
402
+ ::anno::display_name("Shiny Damaged Concrete"),
403
+ ::anno::description(DESCRIPTION),
404
+ ::anno::copyright_notice(COPYRIGHT),
405
+ ::anno::key_words(string[]("dielectric", "infinite", "stone", "nature", "weathered", "wall", "exterior", "rough", "urban", "city", "shiny", "damage", "concrete")),
406
+ ::anno::thumbnail("./.thumbs/Concrete_Floor_Damage.Shiny_Damaged_Concrete.png"),
407
+ ::anno::author("NVIDIA vMaterials"),
408
+ ::anno::contributor("Maik Rohland"),
409
+ ::anno::contributor("Ruediger Raab")
410
+ ]]
411
+ = Concrete_Floor_Damage
412
+ (
413
+ infinite_tiling: true,
414
+ stone_color: color(0.957370f, 0.932277f, 0.851252f),
415
+ reflection_roughness: 0.2f,
416
+ reflection_weight: 0.f,
417
+ bump_strength: 1.f,
418
+ texture_translate: float2(0.0f),
419
+ texture_rotate: 0.0f,
420
+ texture_scale: float2(1.0f),
421
+ roundcorners_enable: false,
422
+ roundcorners_radius_mm: 1.5f,
423
+ roundcorners_across_materials: true,
424
+ uv_space_index: 0
425
+ );
426
+
427
+ export material Soft_Reflections_Damaged_Concrete(*)
428
+ [[
429
+ ::anno::display_name("Soft Reflections Damaged Concrete"),
430
+ ::anno::description(DESCRIPTION),
431
+ ::anno::copyright_notice(COPYRIGHT),
432
+ ::anno::key_words(string[]("dielectric", "infinite", "stone", "nature", "weathered", "wall", "exterior", "rough", "urban", "city", "soft", "damage", "concrete")),
433
+ ::anno::thumbnail("./.thumbs/Concrete_Floor_Damage.Soft_Reflections_Damaged_Concrete.png"),
434
+ ::anno::author("NVIDIA vMaterials"),
435
+ ::anno::contributor("Maik Rohland"),
436
+ ::anno::contributor("Ruediger Raab")
437
+ ]]
438
+ = Concrete_Floor_Damage
439
+ (
440
+ infinite_tiling: true,
441
+ stone_color: color(0.957370f, 0.932277f, 0.851252f),
442
+ reflection_roughness: 0.65f,
443
+ reflection_weight: 0.75f,
444
+ bump_strength: 1.f,
445
+ texture_translate: float2(0.0f),
446
+ texture_rotate: 0.0f,
447
+ texture_scale: float2(1.0f),
448
+ roundcorners_enable: false,
449
+ roundcorners_radius_mm: 1.5f,
450
+ roundcorners_across_materials: true,
451
+ uv_space_index: 0
452
+ );
453
+
454
+ export material Matt_Damaged_Concrete(*)
455
+ [[
456
+ ::anno::display_name("Matt Damaged Concrete"),
457
+ ::anno::description(DESCRIPTION),
458
+ ::anno::copyright_notice(COPYRIGHT),
459
+ ::anno::key_words(string[]("dielectric", "infinite", "stone", "nature", "weathered", "wall", "exterior", "rough", "urban", "city", "soft", "damage", "concrete")),
460
+ ::anno::thumbnail("./.thumbs/Concrete_Floor_Damage.Matt_Damaged_Concrete.png"),
461
+ ::anno::author("NVIDIA vMaterials"),
462
+ ::anno::contributor("Maik Rohland"),
463
+ ::anno::contributor("Ruediger Raab")
464
+ ]]
465
+ = Concrete_Floor_Damage
466
+ (
467
+ infinite_tiling: true,
468
+ stone_color: color(0.957370f, 0.932277f, 0.851252f),
469
+ reflection_roughness: 1.f,
470
+ reflection_weight: 0.f,
471
+ bump_strength: 1.f,
472
+ texture_translate: float2(0.0f),
473
+ texture_rotate: 0.0f,
474
+ texture_scale: float2(1.0f),
475
+ roundcorners_enable: false,
476
+ roundcorners_radius_mm: 1.5f,
477
+ roundcorners_across_materials: true,
478
+ uv_space_index: 0
479
+ );
480
+
481
+ export material Dark_Damaged_Concrete(*)
482
+ [[
483
+ ::anno::display_name("Dark Damaged Concrete"),
484
+ ::anno::description(DESCRIPTION),
485
+ ::anno::copyright_notice(COPYRIGHT),
486
+ ::anno::key_words(string[]("dielectric", "infinite", "stone", "nature", "weathered", "wall", "exterior", "rough", "urban", "city", "dark", "damage", "concrete")),
487
+ ::anno::thumbnail("./.thumbs/Concrete_Floor_Damage.Dark_Damaged_Concrete.png"),
488
+ ::anno::author("NVIDIA vMaterials"),
489
+ ::anno::contributor("Maik Rohland"),
490
+ ::anno::contributor("Ruediger Raab")
491
+ ]]
492
+ = Concrete_Floor_Damage
493
+ (
494
+ infinite_tiling: true,
495
+ stone_color: color(0.157281f, 0.157281f, 0.157281f),
496
+ reflection_roughness: .6f,
497
+ reflection_weight: 0.f,
498
+ bump_strength: 0.35f,
499
+ texture_translate: float2(0.0f),
500
+ texture_rotate: 0.0f,
501
+ texture_scale: float2(1.0f),
502
+ roundcorners_enable: false,
503
+ roundcorners_radius_mm: 1.5f,
504
+ roundcorners_across_materials: true,
505
+ uv_space_index: 0
506
+ );
507
+
508
+ export material Dark_Rough_Concrete(*)
509
+ [[
510
+ ::anno::display_name("Dark Rough Concrete"),
511
+ ::anno::description(DESCRIPTION),
512
+ ::anno::copyright_notice(COPYRIGHT),
513
+ ::anno::key_words(string[]("dielectric", "infinite", "stone", "nature", "weathered", "wall", "exterior", "rough", "urban", "city", "dark", "damage", "concrete")),
514
+ ::anno::thumbnail("./.thumbs/Concrete_Floor_Damage.Dark_Rough_Concrete.png"),
515
+ ::anno::author("NVIDIA vMaterials"),
516
+ ::anno::contributor("Maik Rohland"),
517
+ ::anno::contributor("Ruediger Raab")
518
+ ]]
519
+ = Concrete_Floor_Damage
520
+ (
521
+ infinite_tiling: true,
522
+ stone_color: color(0.157281f, 0.157281f, 0.157281f),
523
+ reflection_roughness: 1.f,
524
+ reflection_weight: 1.f,
525
+ bump_strength: 1.f,
526
+ texture_translate: float2(0.0f),
527
+ texture_rotate: 0.0f,
528
+ texture_scale: float2(1.0f),
529
+ roundcorners_enable: false,
530
+ roundcorners_radius_mm: 1.5f,
531
+ roundcorners_across_materials: true,
532
+ uv_space_index: 0
533
+ );
code/third_party/vMaterials_2/Concrete/Concrete_Formed.mdl ADDED
@@ -0,0 +1,255 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.5;
37
+
38
+ import ::anno::*;
39
+ import ::base::*;
40
+ import ::df::*;
41
+ import ::math::*;
42
+ import ::state::*;
43
+ import ::tex::*;
44
+ import ::nvidia::core_definitions::dimension;
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
+ float remap_xy_to_0_1(float input, float x, float y)
61
+ {
62
+ return (input - x)/(y - x);
63
+ }
64
+
65
+ float histogram_range(float input, float range = 1.0f, float position = 0.5f)
66
+ {
67
+ float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0);
68
+ float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0);
69
+ return ::math::lerp(low, high, input);
70
+ }
71
+
72
+ float histogram_scan_small(float input, float width, float position)
73
+ {
74
+ return ::math::clamp(
75
+ remap_xy_to_0_1(input,
76
+ ::math::lerp(0.0, 1.0 - width, position),
77
+ ::math::lerp(width, 1.0 , position)),
78
+ 0.0,
79
+ 1.0);
80
+ }
81
+
82
+ ::base::texture_coordinate_info transform_coordinate_2(
83
+ float4x4 transform
84
+ [[ ::anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix.") ]],
85
+ ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info()
86
+ [[ ::anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection.") ]]
87
+ ) [[
88
+ ::anno::description("Transform a texture coordinate by a matrix.") ,
89
+ ::anno::noinline()
90
+ ]]
91
+ {
92
+ // Version 2
93
+ float4 r_position = transform * float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1);
94
+ //Try aproximating it for the case that the rotation is only aroud z and assuming the texture layout is nice and z is ~constant.
95
+ //just pretend there is no other rotation happening
96
+ //get rid of scaling and translation. Then extract fields where sin and cos would be in a simple 2d transform around z.
97
+ float4 u = transform[0];
98
+ float3 ru = ::math::normalize(float3(u.x,u.y,u.z));
99
+ float cos = ru.x;
100
+ float sin = -ru.y;
101
+ //TODO: at least also handle sign of z?
102
+ //TODO: handle tangent becoming 0
103
+
104
+
105
+ return ::base::texture_coordinate_info(
106
+ float3(r_position.x,r_position.y,r_position.z),
107
+ ::math::normalize(cos * coordinate.tangent_u - sin * coordinate.tangent_v),
108
+ ::math::normalize(cos * coordinate.tangent_v + sin * coordinate.tangent_u));
109
+ }
110
+
111
+ ::base::texture_coordinate_info vmat_transform(
112
+ float2 translation = float2(0.0, 0.0),
113
+ float rotation = 0.0, // rotation in degrees
114
+ float2 scaling = float2(1.0, 1.0),
115
+ uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw,
116
+ uniform int uv_space = 0
117
+ )
118
+ {
119
+ float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f;
120
+ float4x4 scale =
121
+ float4x4(1.0 /scaling.x, 0. , 0. , 0.,
122
+ 0. , 1.0 /scaling.y , 0. , 0.,
123
+ 0. , 0. , 1.0, 0.,
124
+ translation.x , translation.y , 0.0, 1.);
125
+
126
+ float s = ::math::sin(rotation_rad);
127
+ float c = ::math::cos(rotation_rad);
128
+ float4x4 rotate =
129
+ float4x4( c , -s , 0.0 , 0.0,
130
+ s , c , 0.0 , 0.0,
131
+ 0.0, 0.0 , 1.0 , 0.0,
132
+ 0. , 0.0 , 0.0 , 1.);
133
+
134
+ return transform_coordinate_2(scale*rotate, ::base::coordinate_source(system, uv_space));
135
+ }
136
+
137
+
138
+ export material Concrete_Formed(
139
+ float diffuse_brightness = 0.82f [[
140
+ ::anno::description("Adjusts the lightness of the material."),
141
+ ::anno::display_name("Diffuse Brightness"),
142
+ ::anno::in_group("Appearance"),
143
+ ::anno::hard_range(0.f, 1.f)
144
+ ]],
145
+ float roughness = 0.06f [[
146
+ ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."),
147
+ ::anno::display_name("Roughness"),
148
+ ::anno::in_group("Appearance"),
149
+ ::anno::hard_range(0.f, 1.f)
150
+ ]],
151
+ uniform float bump_strength = 1.f [[
152
+ ::anno::description("Specifies the strength of the bump."),
153
+ ::anno::display_name("Bump Strength"),
154
+ ::anno::in_group("Appearance"),
155
+ ::anno::hard_range(0.f, 1.f)
156
+ ]],
157
+ float2 texture_translate = float2(0.f) [[
158
+ ::anno::description("Controls the position of the texture."),
159
+ ::anno::display_name("Texture Translate"),
160
+ ::anno::in_group("Transform")
161
+ ]],
162
+ float texture_rotate = 0.f [[
163
+ ::anno::description("Rotates angle of the texture in degrees."),
164
+ ::anno::display_name("Texture Rotate"),
165
+ ::anno::in_group("Transform")
166
+ ]],
167
+ float2 texture_scale = float2(1.0f) [[
168
+ ::anno::description("Larger numbers increase the size."),
169
+ ::anno::display_name("Texture Scale"),
170
+ ::anno::in_group("Transform"),
171
+ ::nvidia::core_definitions::dimension(float2(1.4f, 1.4f))
172
+ ]],
173
+ uniform bool round_corners = false [[
174
+ ::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."),
175
+ ::anno::display_name("Round Corners"),
176
+ ::anno::in_group("Round Corners")
177
+ ]],
178
+ uniform float radius = 1.5f [[
179
+ ::anno::description("Radius of the rounded corners."),
180
+ ::anno::display_name("Radius"),
181
+ ::anno::in_group("Round Corners"),
182
+ ::anno::soft_range(0.f, 10.f)
183
+ ]],
184
+ uniform bool across_materials = true [[
185
+ ::anno::description("Applies the round corner effect across different materials when enabled."),
186
+ ::anno::display_name("Across Materials"),
187
+ ::anno::in_group("Round Corners")
188
+ ]],
189
+ uniform int uv_space_index = 0 [[
190
+ ::anno::description("Uses selected UV space for material."),
191
+ ::anno::display_name("UV Space Index"),
192
+ ::anno::in_group("Advanced")
193
+ ]]
194
+ )
195
+ [[
196
+ ::anno::description("A formed concrete material with wooden texture imprint."),
197
+ ::anno::in_group("Concrete"),
198
+ ::anno::display_name("Formed Concrete Shiny"),
199
+ ::anno::key_words(string[]("concrete", "architecture", "hard", "solid", "artificial", "interior", "exterior", "construction", "wood", "pattern", "neutral", "gray")),
200
+ ::anno::thumbnail("./.thumbs/Concrete_Formed.Concrete_Formed.png"),
201
+ ::anno::copyright_notice(COPYRIGHT),
202
+ ::anno::author("NVIDIA vMaterials"),
203
+ ::anno::contributor("Ruediger Raab"),
204
+ ::anno::contributor("Maik Rohland")
205
+ ]]
206
+ =
207
+ let {
208
+ bool tmp0 = false;
209
+ material_surface tmp1(df::custom_curve_layer(0.0399999991f, 1.f, 5.f, math::pow(histogram_scan_small(float3(base::file_texture(texture_2d("./textures/conrete_formed_ORM.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, 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], 0.660000026f, 0.649999976f), 2.20000005f), df::microfacet_ggx_smith_bsdf(histogram_range(float3(base::file_texture(texture_2d("./textures/conrete_formed_ORM.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, 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], math::lerp(0.660000026f, 1.f, roughness), math::lerp(0.5f, 0.800000012f, roughness)) * histogram_range(float3(base::file_texture(texture_2d("./textures/conrete_formed_ORM.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, 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], math::lerp(0.660000026f, 1.f, roughness), math::lerp(0.5f, 0.800000012f, roughness)), histogram_range(float3(base::file_texture(texture_2d("./textures/conrete_formed_ORM.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, 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], math::lerp(0.660000026f, 1.f, roughness), math::lerp(0.5f, 0.800000012f, roughness)) * histogram_range(float3(base::file_texture(texture_2d("./textures/conrete_formed_ORM.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, 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], math::lerp(0.660000026f, 1.f, roughness), math::lerp(0.5f, 0.800000012f, roughness)), color(1.f, 1.f, 1.f), state::texture_tangent_u(0), df::scatter_reflect), df::weighted_layer(1.f, df::diffuse_reflection_bsdf(base::file_texture(texture_2d("./textures/conrete_formed_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(math::lerp(0.641000032f, 1.f, diffuse_brightness)), base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false).tint, 0.f), bsdf(), base::tangent_space_normal_texture(texture_2d("./textures/conrete_formed_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 1.f, 0.f)), base::tangent_space_normal_texture(texture_2d("./textures/conrete_formed_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 1.f, 0.f)), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
210
+ material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
211
+ color tmp3 = color(1.f, 1.f, 1.f);
212
+ 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));
213
+ material_geometry tmp5(float3(0.f), 1.f, round_corners ? state::rounded_corner_normal(radius * 0.00100000005f, across_materials, 1.f) : state::normal());
214
+ hair_bsdf tmp6 = hair_bsdf();
215
+ } in
216
+ material(
217
+ thin_walled: tmp0,
218
+ surface: tmp1,
219
+ backface: tmp2,
220
+ ior: tmp3,
221
+ volume: tmp4,
222
+ geometry: tmp5,
223
+ hair: tmp6);
224
+
225
+ export material Concrete_Formed_Rough(*)
226
+ [[
227
+ ::anno::description("A formed concrete material with wooden texture imprint."),
228
+ ::anno::in_group("Concrete"),
229
+ ::anno::display_name("Formed Concrete Rough"),
230
+ ::anno::key_words(string[]("concrete", "architecture", "hard", "solid", "artificial", "interior", "exterior", "construction", "wood", "pattern", "neutral", "gray")),
231
+ ::anno::thumbnail("./.thumbs/Concrete_Formed.Concrete_Formed_Rough.png"),
232
+ ::anno::copyright_notice(COPYRIGHT),
233
+ ::anno::author("NVIDIA vMaterials"),
234
+ ::anno::contributor("Ruediger Raab"),
235
+ ::anno::contributor("Maik Rohland")
236
+ ]]
237
+ = Concrete_Formed(
238
+ diffuse_brightness: 0.55f,
239
+ roughness: 0.8f,
240
+ bump_strength: 1.0f,
241
+ texture_translate: float2(0.0f),
242
+ texture_rotate: 0.0f,
243
+ texture_scale: float2(1.0f),
244
+ round_corners: false,
245
+ radius: 1.5f,
246
+ across_materials: false,
247
+ uv_space_index: 0
248
+
249
+ );
250
+
251
+
252
+
253
+
254
+
255
+
code/third_party/vMaterials_2/Concrete/Concrete_Polished.mdl ADDED
@@ -0,0 +1,416 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.5;
37
+
38
+ import ::anno::*;
39
+ import ::base::*;
40
+ import ::df::*;
41
+ import ::math::*;
42
+ import ::state::*;
43
+ import ::tex::*;
44
+ import ::nvidia::core_definitions::blend_colors;
45
+ import ::nvidia::core_definitions::dimension;
46
+
47
+ const string COPYRIGHT =
48
+ " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
49
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
50
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
51
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
52
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
53
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
54
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
55
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
56
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
57
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
58
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
59
+
60
+ const string DESCRIPTION = "A fine polished concrete material.";
61
+
62
+ float2x2 invert_2x2(float2x2 M)
63
+ {
64
+ float det = M[0][0]*M[1][1] - M[0][1]*M[1][0];
65
+ //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/
66
+ return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]);
67
+ }
68
+
69
+ float uint2float(int x)
70
+ {
71
+ return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0);
72
+ }
73
+
74
+ int lowbias32(int x)
75
+ {
76
+ x ^= x >>> 16;
77
+ x *= 0x7feb352d;
78
+ x ^= x >>> 15;
79
+ x *= 0x846ca68b;
80
+ x ^= x >>> 16;
81
+ return x;
82
+ }
83
+
84
+ float2 rnd22(int2 p) {
85
+ float2 ret_val = float2(
86
+ uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f,
87
+ uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f
88
+ );
89
+ return ret_val;
90
+ }
91
+
92
+ float3 srgb2rgb(float3 val)
93
+ {
94
+ return ::math::pow(::math::max(val, float3(0.0f)), 2.2);
95
+ }
96
+
97
+ float3 nonrepeat_lookup(
98
+ uniform texture_2d texture = texture_2d(),
99
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
100
+ float texture_scale = 1.0,
101
+ float3 average_color = float3(0.5),
102
+ float patch_size = 8.0
103
+ )
104
+ {
105
+
106
+ float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale;
107
+ float Z = patch_size; // patch scale inside example texture
108
+ float CON = 1.0f;
109
+
110
+ float3 O = float3(0.f);
111
+ float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f);
112
+ float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space
113
+
114
+ float2 U = uv_in;
115
+ float2 V = M * uv_in; //pre-tilted hexa coordinates
116
+ int2 I = int2(::math::floor(V)); // hexa-tile id
117
+
118
+ // The mean color needs to be determined in Photoshop then to make the
119
+ // average color work out, take the float value and calculate the apropriate
120
+ // mean value as (value^(1/2.2))
121
+
122
+ float3 m = average_color;
123
+
124
+ float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W;
125
+ F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates
126
+
127
+ if( F[2] > 0.f )
128
+
129
+ O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON))
130
+ + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON))
131
+ + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON));
132
+ else
133
+ O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON))
134
+ + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON))
135
+ + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON));
136
+ O = m + O/::math::length(W);
137
+ O = ::math::clamp( (O), 0.0, 1.0);
138
+
139
+ return float3(O);
140
+ }
141
+
142
+ float3 endless_normal(
143
+ uniform texture_2d texture = texture_2d(),
144
+ float factor = 1.0,
145
+ bool flip_tangent_u = false,
146
+ bool flip_tangent_v = false,
147
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
148
+ float texture_scale = 1.0,
149
+ float3 average_color = float3(0.5, 0.5, 1.0),
150
+ float patch_size = 8.0
151
+ )
152
+ {
153
+ float3 transformed_tangent_u = flip_tangent_u ? uvw.tangent_u : - uvw.tangent_u;
154
+ float3 transformed_tangent_v = flip_tangent_v ? uvw.tangent_v : - uvw.tangent_v;
155
+
156
+ if (flip_tangent_u)
157
+ transformed_tangent_u=-transformed_tangent_u;
158
+ if (flip_tangent_v)
159
+ transformed_tangent_v=-transformed_tangent_v;
160
+
161
+ // normalized Lookup
162
+ float3 tangent_space_normal =
163
+ (nonrepeat_lookup (
164
+ texture: texture,
165
+ uvw: uvw,
166
+ texture_scale: texture_scale,
167
+ average_color: average_color,
168
+ patch_size: patch_size
169
+ ) - 0.5) * (2.0 * factor);
170
+
171
+
172
+ return ::math::normalize(uvw.tangent_u * tangent_space_normal.x +
173
+ uvw.tangent_v * tangent_space_normal.y +
174
+ ::state::normal()*1.0);
175
+ }
176
+
177
+ color endless_texture(
178
+ uniform texture_2d texture = texture_2d(),
179
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
180
+ float texture_scale = 10.0,
181
+ float3 average_color = float3(0.5, 0.5, 1.0),
182
+ float patch_size = 8.0,
183
+ bool gamma_correct_lookup = true
184
+ )
185
+ {
186
+ return gamma_correct_lookup ? color(srgb2rgb(
187
+ nonrepeat_lookup (
188
+ texture: texture,
189
+ uvw: uvw,
190
+ texture_scale: texture_scale,
191
+ average_color: average_color,
192
+ patch_size: patch_size
193
+ ))
194
+ ) : color(nonrepeat_lookup (
195
+ texture: texture,
196
+ uvw: uvw,
197
+ texture_scale: texture_scale,
198
+ average_color: average_color,
199
+ patch_size: patch_size
200
+ ));
201
+ }
202
+
203
+ float remap_xy_to_0_1(float input, float x, float y)
204
+ {
205
+ return (input - x)/(y - x);
206
+ }
207
+
208
+ float histogram_scan_small(float input, float width, float position)
209
+ {
210
+ return ::math::clamp(
211
+ remap_xy_to_0_1(input,
212
+ ::math::lerp(0.0, 1.0 - width, position),
213
+ ::math::lerp(width, 1.0 , position)),
214
+ 0.0,
215
+ 1.0);
216
+ }
217
+
218
+ float histogram_range(float input, float range = 1.0f, float position = 0.5f)
219
+ {
220
+ float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0);
221
+ float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0);
222
+ return ::math::lerp(low, high, input);
223
+ }
224
+
225
+
226
+
227
+ ::base::texture_coordinate_info transform_coordinate_2(
228
+ float4x4 transform
229
+ [[ ::anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix.") ]],
230
+ ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info()
231
+ [[ ::anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection.") ]]
232
+ ) [[
233
+ ::anno::description("Transform a texture coordinate by a matrix.") ,
234
+ ::anno::noinline()
235
+ ]]
236
+ {
237
+ // Version 2
238
+ float4 r_position = transform * float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1);
239
+ //Try aproximating it for the case that the rotation is only aroud z and assuming the texture layout is nice and z is ~constant.
240
+ //just pretend there is no other rotation happening
241
+ //get rid of scaling and translation. Then extract fields where sin and cos would be in a simple 2d transform around z.
242
+ float4 u = transform[0];
243
+ float3 ru = ::math::normalize(float3(u.x,u.y,u.z));
244
+ float cos = ru.x;
245
+ float sin = -ru.y;
246
+ //TODO: at least also handle sign of z?
247
+ //TODO: handle tangent becoming 0
248
+
249
+
250
+ return ::base::texture_coordinate_info(
251
+ float3(r_position.x,r_position.y,r_position.z),
252
+ ::math::normalize(cos * coordinate.tangent_u - sin * coordinate.tangent_v),
253
+ ::math::normalize(cos * coordinate.tangent_v + sin * coordinate.tangent_u));
254
+ }
255
+
256
+ ::base::texture_coordinate_info vmat_transform(
257
+ float2 translation = float2(0.0, 0.0),
258
+ float rotation = 0.0, // rotation in degrees
259
+ float2 scaling = float2(1.0, 1.0),
260
+ uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw,
261
+ uniform int uv_space = 0
262
+ )
263
+ {
264
+ float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f;
265
+ float4x4 scale =
266
+ float4x4(1.0 /scaling.x, 0. , 0. , 0.,
267
+ 0. , 1.0 /scaling.y , 0. , 0.,
268
+ 0. , 0. , 1.0, 0.,
269
+ translation.x , translation.y , 0.0, 1.);
270
+
271
+ float s = ::math::sin(rotation_rad);
272
+ float c = ::math::cos(rotation_rad);
273
+ float4x4 rotate =
274
+ float4x4( c , -s , 0.0 , 0.0,
275
+ s , c , 0.0 , 0.0,
276
+ 0.0, 0.0 , 1.0 , 0.0,
277
+ 0. , 0.0 , 0.0 , 1.);
278
+
279
+ return transform_coordinate_2(scale*rotate, ::base::coordinate_source(system, uv_space));
280
+ }
281
+
282
+
283
+ export material Concrete_Polished(
284
+ uniform bool infinite_tiling = false [[
285
+ ::anno::description("Enables infinite tiling feature which removes repeating texture patterns. Note that depending on the material this feature changes the appearance of the material slightly."),
286
+ ::anno::display_name("Infinite Tiling"),
287
+ ::anno::in_group("Appearance")
288
+ ]],
289
+ float diffuse_brightness = 1.f [[
290
+ ::anno::description("Adjusts the lightness of the material."),
291
+ ::anno::display_name("Diffuse Brightness"),
292
+ ::anno::in_group("Appearance"),
293
+ ::anno::hard_range(0.f, 1.f)
294
+ ]],
295
+ float reflection_weight = 1.f [[
296
+ ::anno::description("."),
297
+ ::anno::display_name("Reflection Weight"),
298
+ ::anno::in_group("Appearance"),
299
+ ::anno::hard_range(0.f, 1.f)
300
+ ]],
301
+ float reflection_roughness = 0.2f [[
302
+ ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."),
303
+ ::anno::display_name("Roughness"),
304
+ ::anno::in_group("Appearance"),
305
+ ::anno::hard_range(0.f, 1.f)
306
+ ]],
307
+ float reflection_variation = 0.8f [[
308
+ ::anno::description("Amount of variation applied to the roughness, higher numbers lead to non uniform reflections of the material."),
309
+ ::anno::display_name("Reflection Variation"),
310
+ ::anno::in_group("Appearance"),
311
+ ::anno::hard_range(0.f, 1.f)
312
+ ]],
313
+ uniform float bump_strength = 0.5f [[
314
+ ::anno::description("Determines the degree of bumpiness."),
315
+ ::anno::display_name("Bump Strength"),
316
+ ::anno::in_group("Appearance"),
317
+ ::anno::hard_range(0.f, 2.f)
318
+ ]],
319
+ float2 texture_translate = float2(0.f) [[
320
+ ::anno::description("Controls the position of the texture."),
321
+ ::anno::display_name("Texture Translate"),
322
+ ::anno::in_group("Transform")
323
+ ]],
324
+ float texture_rotate = 0.f [[
325
+ ::anno::description("Rotates angle of the texture in degrees."),
326
+ ::anno::display_name("Texture Rotate"),
327
+ ::anno::in_group("Transform"),
328
+ ::anno::soft_range(0.f, 360.f)
329
+ ]],
330
+ float2 texture_scale = float2(1.0f) [[
331
+ ::anno::description("Larger numbers increase the size."),
332
+ ::anno::display_name("Texture Scale"),
333
+ ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)),
334
+ ::anno::in_group("Transform")
335
+ ]],
336
+ uniform bool round_corners = false [[
337
+ ::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."),
338
+ ::anno::display_name("Round Corners"),
339
+ ::anno::in_group("Round Corners")
340
+ ]],
341
+ uniform float radius_mm = 1.5f [[
342
+ ::anno::description("Radius of the rounded corners."),
343
+ ::anno::display_name("Radius"),
344
+ ::anno::in_group("Round Corners"),
345
+ ::anno::soft_range(0.f, 10.f)
346
+ ]],
347
+ uniform bool across_materials = true [[
348
+ ::anno::description("Applies the round corner effect across different materials when enabled."),
349
+ ::anno::display_name("Across Materials"),
350
+ ::anno::in_group("Round Corners")
351
+ ]],
352
+ uniform int uv_space_index = 0 [[
353
+ ::anno::description("Uses selected UV space for material."),
354
+ ::anno::display_name("UV Space Index"),
355
+ ::anno::in_group("Advanced")
356
+ ]]
357
+ )
358
+ [[
359
+ ::anno::author("NVIDIA vMaterials"),
360
+ ::anno::display_name("Concrete Polished"),
361
+ ::anno::description(DESCRIPTION),
362
+ ::anno::copyright_notice(COPYRIGHT),
363
+ ::anno::thumbnail("./.thumbs/Concrete_Polished.Concrete_Polished.png"),
364
+ ::anno::key_words(string[]("concrete", "polished", "smooth", "infinite", "tiling", "new", "artificial", "construction", "interior", "architecture", "gray")),
365
+ ::anno::in_group("Concrete"),
366
+ ::anno::contributor("Ruediger Raab"),
367
+ ::anno::contributor("Maik Rohland")
368
+ ]]
369
+ =
370
+ let {
371
+ bool tmp0 = false;
372
+ material_surface tmp1(::df::custom_curve_layer(0.04f, 1.f, 5.f, ::math::pow(histogram_scan_small(float3(infinite_tiling ? endless_texture(texture_2d("./textures/conrete_polished_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.14100003f, float3(0.937255025f, 0.321568996f, 0.f), 2.14100003f, false) : ::base::file_texture(texture_2d("./textures/conrete_polished_ORM.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, ::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], ::math::lerp(0.0340000018f, 0.824000061f, reflection_weight), 1.f), 2.20000005f), ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/conrete_polished_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.14100003f, float3(0.937255025f, 0.321568996f, 0.f), 2.14100003f, false) : ::base::file_texture(texture_2d("./textures/conrete_polished_ORM.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, ::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], ::math::lerp(0.205000013f, 1.f, reflection_variation), ::math::lerp(0.465000033f, 0.852000058f, reflection_roughness)) * histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/conrete_polished_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.14100003f, float3(0.937255025f, 0.321568996f, 0.f), 2.14100003f, false) : ::base::file_texture(texture_2d("./textures/conrete_polished_ORM.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, ::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], ::math::lerp(0.205000013f, 1.f, reflection_variation), ::math::lerp(0.465000033f, 0.852000058f, reflection_roughness)), histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/conrete_polished_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.14100003f, float3(0.937255025f, 0.321568996f, 0.f), 2.14100003f, false) : ::base::file_texture(texture_2d("./textures/conrete_polished_ORM.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, ::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], ::math::lerp(0.205000013f, 1.f, reflection_variation), ::math::lerp(0.465000033f, 0.852000058f, reflection_roughness)) * histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/conrete_polished_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.14100003f, float3(0.937255025f, 0.321568996f, 0.f), 2.14100003f, false) : ::base::file_texture(texture_2d("./textures/conrete_polished_ORM.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, ::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], ::math::lerp(0.205000013f, 1.f, reflection_variation), ::math::lerp(0.465000033f, 0.852000058f, reflection_roughness)), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(infinite_tiling ? endless_texture(texture_2d("./textures/conrete_polished_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.14100003f, float3(0.470587999f, 0.470587999f, 0.454901993f), 2.14100003f, true) : ::base::file_texture(texture_2d("./textures/conrete_polished_diff.jpg", ::tex::gamma_srgb), 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, ::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, color(0.f, 0.f, 0.f), ::base::color_layer_multiply, ::math::lerp(0.300000012f, 0.f, diffuse_brightness)).tint, 0.f), bsdf(), infinite_tiling ? endless_normal(texture_2d("./textures/conrete_polished_norm.jpg", ::tex::gamma_linear), bump_strength * 2.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.14100003f, float3(0.5f, 0.5f, 1.f), 2.14100003f) : ::base::tangent_space_normal_texture(texture_2d("./textures/conrete_polished_norm.jpg", ::tex::gamma_linear), bump_strength * 2.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), infinite_tiling ? endless_normal(texture_2d("./textures/conrete_polished_norm.jpg", ::tex::gamma_linear), bump_strength * 2.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.14100003f, float3(0.5f, 0.5f, 1.f), 2.14100003f) : ::base::tangent_space_normal_texture(texture_2d("./textures/conrete_polished_norm.jpg", ::tex::gamma_linear), bump_strength * 2.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
373
+ material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
374
+ color tmp3 = color(1.f, 1.f, 1.f);
375
+ 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));
376
+ material_geometry tmp5(float3(0.f), 1.f, round_corners ? ::state::rounded_corner_normal(radius_mm * 0.00100000005f, across_materials, 1.f) : ::state::normal());
377
+ hair_bsdf tmp6 = hair_bsdf();
378
+ } in
379
+ material(
380
+ thin_walled: tmp0,
381
+ surface: tmp1,
382
+ backface: tmp2,
383
+ ior: tmp3,
384
+ volume: tmp4,
385
+ geometry: tmp5,
386
+ hair: tmp6);
387
+
388
+
389
+ export material Concrete_Polished_Matte(*)
390
+ [[
391
+ ::anno::author("NVIDIA vMaterials"),
392
+ ::anno::display_name("Concrete Polished Matte"),
393
+ ::anno::description(DESCRIPTION),
394
+ ::anno::copyright_notice(COPYRIGHT),
395
+ ::anno::thumbnail("./.thumbs/Concrete_Polished.Concrete_Polished_Matte.png"),
396
+ ::anno::key_words(string[]("concrete", "polished", "infinite", "tiling", "new", "artificial", "construction", "interior", "architecture", "rough", "matte", "gray")),
397
+ ::anno::in_group("Concrete"),
398
+ ::anno::contributor("Ruediger Raab"),
399
+ ::anno::contributor("Maik Rohland")
400
+ ]] = Concrete_Polished
401
+ (
402
+ infinite_tiling: true,
403
+ diffuse_brightness: 1.0f,
404
+ reflection_weight: 1.0f,
405
+ reflection_roughness: 0.8f,
406
+ reflection_variation: 1.0f,
407
+ bump_strength: 1.0f,
408
+ texture_translate: float2(0.0f),
409
+ texture_rotate: 0.0f,
410
+
411
+ texture_scale: float2(1.0f),
412
+ round_corners: false,
413
+ radius_mm: 1.5f,
414
+ across_materials: false,
415
+ uv_space_index: 0
416
+ );
code/third_party/vMaterials_2/Concrete/Concrete_Precast.mdl ADDED
@@ -0,0 +1,1288 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.4;
37
+
38
+
39
+ import ::state::*;
40
+ import ::base::*;
41
+ import ::tex::*;
42
+ import ::anno::*;
43
+ import ::nvidia::core_definitions::*;
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
+ export material Concrete_Precast(
61
+
62
+ color concrete_color = color ( 0.57f, 0.57f, 0.57f )
63
+ [[
64
+ ::anno::display_name("Concrete Color"),
65
+ ::anno::description ( "Choose the color of the Concrete."),
66
+ ::anno::in_group("Appearance")
67
+ ]],
68
+ float grunge_amount = 0.20f
69
+ [[
70
+ ::anno::display_name("Grunge Amount"),
71
+ ::anno::description("higher values results in more noise difference in the color of the concrete."),
72
+ ::anno::hard_range(0.0,1.0),
73
+ ::anno::in_group("Appearance")
74
+ ]],
75
+ float reflection_roughness = 0.5f
76
+ [[
77
+ ::anno::display_name("Roughness"),
78
+ ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."),
79
+ ::anno::hard_range(0.0,1.0),
80
+ ::anno::in_group("Appearance")
81
+ ]],
82
+ uniform float bump_strength = .5f
83
+ [[
84
+ ::anno::display_name("Bump Strength"),
85
+ ::anno::description("Specifies the strength of the bump."),
86
+ ::anno::in_group("Appearance")
87
+ ]],
88
+ uniform float2 texture_translate = float2 ( 0.f)
89
+ [[
90
+ ::anno::display_name("Translate"),
91
+ ::anno::description("Controls the position of the texture."),
92
+ ::anno::in_group("Transform")
93
+ ]],
94
+ uniform float texture_rotate = 0.f
95
+ [[
96
+ ::anno::display_name("Rotate"),
97
+ ::anno::description("Rotate angle of the texture in degrees."),
98
+ ::anno::in_group("Transform")
99
+ ]],
100
+ uniform float2 texture_scale = float2 ( 1.f , 1.f)
101
+ [[
102
+ ::anno::display_name("Scale"),
103
+ ::anno::description("Larger numbers increase the texture size."),
104
+ ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)),
105
+ ::anno::in_group("Transform")
106
+ ]],
107
+ uniform float ior = 1.5f
108
+ [[
109
+ ::anno::display_name("IOR"),
110
+ ::anno::description("Index of refraction."),
111
+ ::anno::soft_range(1.0,4.0),
112
+ ::anno::in_group("Advanced")
113
+ ]],
114
+ uniform int uv_space_index = 0
115
+ [[
116
+ ::anno::display_name("UV Space Index"),
117
+ ::anno::description("UV space index."),
118
+ ::anno::hard_range(0,3),
119
+ ::anno::in_group("Advanced")
120
+ ]])
121
+ [[
122
+ ::anno::display_name("Concrete Precast - White"),
123
+ ::anno::description("A material for (pre)cast concrete formwork panels that have holes as part of the manufacturing process."),
124
+ ::anno::author("NVIDIA vMaterials"),
125
+ ::anno::copyright_notice(COPYRIGHT),
126
+ ::anno::thumbnail("./.thumbs/Concrete_Precast.concrete_precast_gray.png"),
127
+ ::anno::key_words(string[]("floor", "cast", "concrete", "precast", "construction", "cement", "white", "unfinished", "rough"))
128
+ ]]=
129
+ ::nvidia::core_definitions::flex_material_v2(
130
+ base_color: ::nvidia::core_definitions::blend_colors(
131
+ color_1: ::nvidia::core_definitions::blend_colors(
132
+ color_1: concrete_color,
133
+ color_2: ::nvidia::core_definitions::file_texture(
134
+ texture: texture_2d ( "./textures/precastconcrete_diff.png" , ::tex::gamma_srgb) ,
135
+ mono_source: ::base::mono_average,
136
+ brightness: 1.f,
137
+ contrast: 1.f,
138
+ scaling: 0.5f/ texture_scale,
139
+ translation: texture_translate,
140
+ rotation: texture_rotate,
141
+ clip: false,
142
+ texture_space: uv_space_index,
143
+ invert: false).tint,
144
+ mode: ::base::color_layer_overlay,
145
+ weight: 1.0f ).tint,
146
+ color_2: ::nvidia::core_definitions::file_texture(
147
+ texture: texture_2d ( "./textures/precastconcrete_grunge_mask.png" , ::tex::gamma_srgb) ,
148
+ mono_source: ::base::mono_average,
149
+ brightness: 1.f,
150
+ contrast: 1.f,
151
+ scaling: 0.5f/ texture_scale,
152
+ translation: texture_translate,
153
+ rotation: texture_rotate,
154
+ clip: false,
155
+ texture_space: uv_space_index,
156
+ invert: false).tint,
157
+ mode: ::base::color_layer_multiply,
158
+ weight: grunge_amount ).tint,
159
+ diffuse_roughness: 0.f,
160
+ is_metal: false,
161
+ reflectivity: 1.0f,
162
+ reflection_roughness: ::nvidia::core_definitions::blend_colors(
163
+ color_1: ::nvidia::core_definitions::file_texture(
164
+ texture: texture_2d ( "./textures/precastconcrete_rough.png" , ::tex::gamma_srgb) ,
165
+ mono_source: ::base::mono_average,
166
+ brightness: 1.f,
167
+ contrast: 1.f,
168
+ scaling: 0.5f/ texture_scale,
169
+ translation: texture_translate,
170
+ rotation: texture_rotate,
171
+ clip: false,
172
+ texture_space: uv_space_index,
173
+ invert: false).tint,
174
+ color_2: color ( reflection_roughness ),
175
+ mode: ::base::color_layer_overlay,
176
+ weight: 1.0f ).mono,
177
+ anisotropy: 0.f,
178
+ anisotropy_rotation: 0.f,
179
+ transparency: 0.f,
180
+ transmission_color: color ( 1.f , 1.f , 1.f),
181
+ volume_color: color ( 1.f , 1.f , 1.f),
182
+ transmission_roughness: 0.f,
183
+ base_thickness: 0.1f,
184
+ ior: ior,
185
+ thin_walled: false,
186
+ normal: ::nvidia::core_definitions::normalmap_texture(
187
+ texture: texture_2d ( "./textures/precastconcrete_norm.jpg" , ::tex::gamma_linear),
188
+ scaling: 0.5f/ texture_scale,
189
+ translation: texture_translate,
190
+ rotation: texture_rotate,
191
+ clip: false,
192
+ factor: bump_strength * 0.20f,
193
+ texture_space: uv_space_index));
194
+
195
+
196
+
197
+ export material concrete_precast_light_gray(
198
+
199
+ color concrete_color = color ( 0.68f , 0.68f , 0.68f )
200
+ [[
201
+ ::anno::display_name("Concrete Color"),
202
+ ::anno::description ( "Choose the color of the Concrete."),
203
+ ::anno::in_group("Appearance")
204
+ ]],
205
+ float grunge_amount = 0.40f
206
+ [[
207
+ ::anno::display_name("Grunge Amount"),
208
+ ::anno::description("higher values results in more noise difference in the color of the concrete."),
209
+ ::anno::hard_range(0.0,1.0),
210
+ ::anno::in_group("Appearance")
211
+ ]],
212
+ float reflection_roughness = 0.15f
213
+ [[
214
+ ::anno::display_name("Roughness"),
215
+ ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."),
216
+ ::anno::hard_range(0.0,1.0),
217
+ ::anno::in_group("Appearance")
218
+ ]],
219
+ uniform float bump_strength = 1.f
220
+ [[
221
+ ::anno::display_name("Bump Strength"),
222
+ ::anno::description("Specifies the strength of the bump."),
223
+ ::anno::in_group("Appearance")
224
+ ]],
225
+ uniform float2 texture_translate = float2 ( 0.f)
226
+ [[
227
+ ::anno::display_name("Translate"),
228
+ ::anno::description("Controls the position of the texture."),
229
+ ::anno::in_group("Transform")
230
+ ]],
231
+ uniform float texture_rotate = 0.f
232
+ [[
233
+ ::anno::display_name("Rotate"),
234
+ ::anno::description("Rotate angle of the texture in degrees."),
235
+ ::anno::in_group("Transform")
236
+ ]],
237
+ uniform float2 texture_scale = float2 ( 1.f , 1.f)
238
+ [[
239
+ ::anno::display_name("Scale"),
240
+ ::anno::description("Larger numbers increase the texture size."),
241
+ ::anno::in_group("Transform"),
242
+ ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f))
243
+ ]],
244
+ uniform float ior = 1.5f
245
+ [[
246
+ ::anno::display_name("IOR"),
247
+ ::anno::description("Index of refraction."),
248
+ ::anno::soft_range(1.0,4.0),
249
+ ::anno::in_group("Advanced")
250
+ ]],
251
+ uniform int uv_space_index = 0
252
+ [[
253
+ ::anno::display_name("UV Space Index"),
254
+ ::anno::description("UV space index."),
255
+ ::anno::hard_range(0,3),
256
+ ::anno::in_group("Advanced")
257
+ ]])
258
+ [[
259
+ ::anno::display_name("Concrete Precast - Light Gray"),
260
+ ::anno::description("A material for (pre)cast concrete formwork panels that have holes as part of the manufacturing process."),
261
+ ::anno::author("NVIDIA vMaterials"),
262
+ ::anno::copyright_notice(COPYRIGHT),
263
+ ::anno::thumbnail("./.thumbs/Concrete_Precast.concrete_precast_light_gray.png"),
264
+ ::anno::key_words(string[]("floor", "cast", "concrete", "precast", "construction", "cement", "gray", "light gray", "light", "unfinished", "rough"))
265
+ ]]=
266
+ ::nvidia::core_definitions::flex_material_v2(
267
+ base_color: ::nvidia::core_definitions::blend_colors(
268
+ color_1: ::nvidia::core_definitions::blend_colors(
269
+ color_1: concrete_color,
270
+ color_2: ::nvidia::core_definitions::file_texture(
271
+ texture: texture_2d ( "./textures/precastconcrete_diff.png" , ::tex::gamma_srgb) ,
272
+ mono_source: ::base::mono_average,
273
+ brightness: 1.f,
274
+ contrast: 1.f,
275
+ scaling: 0.5f/ texture_scale,
276
+ translation: texture_translate,
277
+ rotation: texture_rotate,
278
+ clip: false,
279
+ texture_space: uv_space_index,
280
+ invert: false).tint,
281
+ mode: ::base::color_layer_overlay,
282
+ weight: 1.0f ).tint,
283
+ color_2: ::nvidia::core_definitions::file_texture(
284
+ texture: texture_2d ( "./textures/precastconcrete_grunge_mask.png" , ::tex::gamma_srgb) ,
285
+ mono_source: ::base::mono_average,
286
+ brightness: 1.f,
287
+ contrast: 1.f,
288
+ scaling: 0.5f/ texture_scale,
289
+ translation: texture_translate,
290
+ rotation: texture_rotate,
291
+ clip: false,
292
+ texture_space: uv_space_index,
293
+ invert: false).tint,
294
+ mode: ::base::color_layer_multiply,
295
+ weight: grunge_amount ).tint,
296
+ diffuse_roughness: 0.f,
297
+ is_metal: false,
298
+ reflectivity: 1.0f,
299
+ reflection_roughness: ::nvidia::core_definitions::blend_colors(
300
+ color_1: ::nvidia::core_definitions::file_texture(
301
+ texture: texture_2d ( "./textures/precastconcrete_rough.png" , ::tex::gamma_srgb) ,
302
+ mono_source: ::base::mono_average,
303
+ brightness: 1.f,
304
+ contrast: 1.f,
305
+ scaling: 0.5f/ texture_scale,
306
+ translation: texture_translate,
307
+ rotation: texture_rotate,
308
+ clip: false,
309
+ texture_space: uv_space_index,
310
+ invert: false).tint,
311
+ color_2: color (reflection_roughness),
312
+ mode: ::base::color_layer_overlay,
313
+ weight: 1.0f ).mono,
314
+ anisotropy: 0.f,
315
+ anisotropy_rotation: 0.f,
316
+ transparency: 0.f,
317
+ transmission_color: color ( 1.f , 1.f , 1.f),
318
+ volume_color: color ( 1.f , 1.f , 1.f),
319
+ transmission_roughness: 0.f,
320
+ base_thickness: 0.1f,
321
+ ior: ior,
322
+ thin_walled: false,
323
+ normal: ::nvidia::core_definitions::normalmap_texture(
324
+ texture: texture_2d ( "./textures/precastconcrete_norm.jpg" , ::tex::gamma_linear),
325
+ scaling: 0.5f/ texture_scale,
326
+ translation: texture_translate,
327
+ rotation: texture_rotate,
328
+ clip: false,
329
+ factor: bump_strength * 0.20f,
330
+ texture_space: uv_space_index));
331
+
332
+
333
+ export material concrete_precast_ivory(
334
+
335
+ color concrete_color = color ( 0.883f , 0.851f , 0.797f )
336
+ [[
337
+ ::anno::display_name("Concrete Color"),
338
+ ::anno::description ( "Choose the color of the Concrete."),
339
+ ::anno::in_group("Appearance")
340
+ ]],
341
+ float grunge_amount = 0.30f
342
+ [[
343
+ ::anno::display_name("Grunge Amount"),
344
+ ::anno::description("higher values results in more noise difference in the color of the concrete."),
345
+ ::anno::hard_range(0.0,1.0),
346
+ ::anno::in_group("Appearance")
347
+ ]],
348
+ float reflection_roughness = 0.15f
349
+ [[
350
+ ::anno::display_name("Roughness"),
351
+ ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."),
352
+ ::anno::hard_range(0.0,1.0),
353
+ ::anno::in_group("Appearance")
354
+ ]],
355
+ uniform float bump_strength = 1.f
356
+ [[
357
+ ::anno::display_name("Bump Strength"),
358
+ ::anno::description("Specifies the strength of the bump."),
359
+ ::anno::in_group("Appearance")
360
+ ]],
361
+ uniform float2 texture_translate = float2 ( 0.f)
362
+ [[
363
+ ::anno::display_name("Translate"),
364
+ ::anno::description("Controls the position of the texture."),
365
+ ::anno::in_group("Transform")
366
+ ]],
367
+ uniform float texture_rotate = 0.f
368
+ [[
369
+ ::anno::display_name("Rotate"),
370
+ ::anno::description("Rotate angle of the texture in degrees."),
371
+ ::anno::in_group("Transform")
372
+ ]],
373
+ uniform float2 texture_scale = float2 ( 1.f , 1.f)
374
+ [[
375
+ ::anno::display_name("Scale"),
376
+ ::anno::description("Larger numbers increase the texture size."),
377
+ ::anno::in_group("Transform"),
378
+ ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f))
379
+ ]],
380
+ uniform float ior = 1.5f
381
+ [[
382
+ ::anno::display_name("IOR"),
383
+ ::anno::description("Index of refraction."),
384
+ ::anno::soft_range(1.0,4.0),
385
+ ::anno::in_group("Advanced")
386
+ ]],
387
+ uniform int uv_space_index = 0
388
+ [[
389
+ ::anno::display_name("UV Space Index"),
390
+ ::anno::description("UV space index."),
391
+ ::anno::hard_range(0,3),
392
+ ::anno::in_group("Advanced")
393
+ ]])
394
+ [[
395
+ ::anno::display_name("Concrete Precast - Ivory"),
396
+ ::anno::description("A material for (pre)cast concrete formwork panels that have holes as part of the manufacturing process."),
397
+ ::anno::author("NVIDIA vMaterials"),
398
+ ::anno::copyright_notice(COPYRIGHT),
399
+ ::anno::thumbnail("./.thumbs/Concrete_Precast.concrete_precast_ivory.png"),
400
+ ::anno::key_words(string[]("floor", "cast", "concrete", "precast", "construction", "cement", "white", "ivory", "unfinished", "rough"))
401
+ ]]=
402
+ ::nvidia::core_definitions::flex_material_v2(
403
+ base_color: ::nvidia::core_definitions::blend_colors(
404
+ color_1: ::nvidia::core_definitions::blend_colors(
405
+ color_1: concrete_color,
406
+ color_2: ::nvidia::core_definitions::file_texture(
407
+ texture: texture_2d ( "./textures/precastconcrete_diff.png" , ::tex::gamma_srgb) ,
408
+ mono_source: ::base::mono_average,
409
+ brightness: 1.f,
410
+ contrast: 1.f,
411
+ scaling: 0.5f/ texture_scale,
412
+ translation: texture_translate,
413
+ rotation: texture_rotate,
414
+ clip: false,
415
+ texture_space: uv_space_index,
416
+ invert: false).tint,
417
+ mode: ::base::color_layer_overlay,
418
+ weight: 1.0f ).tint,
419
+ color_2: ::nvidia::core_definitions::file_texture(
420
+ texture: texture_2d ( "./textures/precastconcrete_grunge_mask.png" , ::tex::gamma_srgb) ,
421
+ mono_source: ::base::mono_average,
422
+ brightness: 1.f,
423
+ contrast: 1.f,
424
+ scaling: 0.5f/ texture_scale,
425
+ translation: texture_translate,
426
+ rotation: texture_rotate,
427
+ clip: false,
428
+ texture_space: uv_space_index,
429
+ invert: false).tint,
430
+ mode: ::base::color_layer_multiply,
431
+ weight: grunge_amount ).tint,
432
+ diffuse_roughness: 0.f,
433
+ is_metal: false,
434
+ reflectivity: 1.0f,
435
+ reflection_roughness: ::nvidia::core_definitions::blend_colors(
436
+ color_1: ::nvidia::core_definitions::file_texture(
437
+ texture: texture_2d ( "./textures/precastconcrete_rough.png" , ::tex::gamma_srgb) ,
438
+ mono_source: ::base::mono_average,
439
+ brightness: 1.f,
440
+ contrast: 1.f,
441
+ scaling: 0.5f/ texture_scale,
442
+ translation: texture_translate,
443
+ rotation: texture_rotate,
444
+ clip: false,
445
+ texture_space: uv_space_index,
446
+ invert: false).tint,
447
+ color_2: color (reflection_roughness),
448
+ mode: ::base::color_layer_overlay,
449
+ weight: 1.0f ).mono,
450
+ anisotropy: 0.f,
451
+ anisotropy_rotation: 0.f,
452
+ transparency: 0.f,
453
+ transmission_color: color ( 1.f , 1.f , 1.f),
454
+ volume_color: color ( 1.f , 1.f , 1.f),
455
+ transmission_roughness: 0.f,
456
+ base_thickness: 0.1f,
457
+ ior: ior,
458
+ thin_walled: false,
459
+ normal: ::nvidia::core_definitions::normalmap_texture(
460
+ texture: texture_2d ( "./textures/precastconcrete_norm.jpg" , ::tex::gamma_linear),
461
+ scaling: 0.5f/ texture_scale,
462
+ translation: texture_translate,
463
+ rotation: texture_rotate,
464
+ clip: false,
465
+ factor: bump_strength * 0.20f,
466
+ texture_space: uv_space_index));
467
+
468
+
469
+
470
+ export material concrete_precast_light_warm_gray(
471
+
472
+ color concrete_color = color (0.932f , 0.859f , 0.797f )
473
+ [[
474
+ ::anno::display_name("Concrete Color"),
475
+ ::anno::description ( "Choose the color of the Concrete."),
476
+ ::anno::in_group("Appearance")
477
+ ]],
478
+ float grunge_amount = 0.55f
479
+ [[
480
+ ::anno::display_name("Grunge Amount"),
481
+ ::anno::description("higher values results in more noise difference in the color of the concrete."),
482
+ ::anno::hard_range(0.0,1.0),
483
+ ::anno::in_group("Appearance")
484
+ ]],
485
+ float reflection_roughness = 0.15f
486
+ [[
487
+ ::anno::display_name("Roughness"),
488
+ ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."),
489
+ ::anno::hard_range(0.0,1.0),
490
+ ::anno::in_group("Appearance")
491
+ ]],
492
+ uniform float bump_strength = 1.f
493
+ [[
494
+ ::anno::display_name("Bump Strength"),
495
+ ::anno::description("Specifies the strength of the bump."),
496
+ ::anno::in_group("Appearance")
497
+ ]],
498
+ uniform float2 texture_translate = float2 ( 0.f)
499
+ [[
500
+ ::anno::display_name("Translate"),
501
+ ::anno::description("Controls the position of the texture."),
502
+ ::anno::in_group("Transform")
503
+ ]],
504
+ uniform float texture_rotate = 0.f
505
+ [[
506
+ ::anno::display_name("Rotate"),
507
+ ::anno::description("Rotate angle of the texture in degrees."),
508
+ ::anno::in_group("Transform")
509
+ ]],
510
+ uniform float2 texture_scale = float2 ( 1.f , 1.f)
511
+ [[
512
+ ::anno::display_name("Scale"),
513
+ ::anno::description("Larger numbers increase the texture size."),
514
+ ::anno::in_group("Transform"),
515
+ ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f))
516
+ ]],
517
+ uniform float ior = 1.5f
518
+ [[
519
+ ::anno::display_name("IOR"),
520
+ ::anno::description("Index of refraction."),
521
+ ::anno::soft_range(1.0,4.0),
522
+ ::anno::in_group("Advanced")
523
+ ]],
524
+ uniform int uv_space_index = 0
525
+ [[
526
+ ::anno::display_name("UV Space Index"),
527
+ ::anno::description("UV space index."),
528
+ ::anno::hard_range(0,3),
529
+ ::anno::in_group("Advanced")
530
+ ]])
531
+ [[
532
+ ::anno::display_name("Concrete Precast - Light Warm Gray"),
533
+ ::anno::description("A material for (pre)cast concrete formwork panels that have holes as part of the manufacturing process."),
534
+ ::anno::author("NVIDIA vMaterials"),
535
+ ::anno::copyright_notice(COPYRIGHT),
536
+ ::anno::thumbnail("./.thumbs/Concrete_Precast.concrete_precast_light_warm_gray.png"),
537
+ ::anno::key_words(string[]("floor", "cast", "concrete", "precast", "construction", "cement", "warm", "gray", "light gray", "unfinished", "rough"))
538
+ ]]=
539
+ ::nvidia::core_definitions::flex_material_v2(
540
+ base_color: ::nvidia::core_definitions::blend_colors(
541
+ color_1: ::nvidia::core_definitions::blend_colors(
542
+ color_1: concrete_color,
543
+ color_2: ::nvidia::core_definitions::file_texture(
544
+ texture: texture_2d ( "./textures/precastconcrete_diff.png" , ::tex::gamma_srgb) ,
545
+ mono_source: ::base::mono_average,
546
+ brightness: 1.f,
547
+ contrast: 1.f,
548
+ scaling: 0.5f/ texture_scale,
549
+ translation: texture_translate,
550
+ rotation: texture_rotate,
551
+ clip: false,
552
+ texture_space: uv_space_index,
553
+ invert: false).tint,
554
+ mode: ::base::color_layer_overlay,
555
+ weight: 1.0f ).tint,
556
+ color_2: ::nvidia::core_definitions::file_texture(
557
+ texture: texture_2d ( "./textures/precastconcrete_grunge_mask.png" , ::tex::gamma_srgb) ,
558
+ mono_source: ::base::mono_average,
559
+ brightness: 1.f,
560
+ contrast: 1.f,
561
+ scaling: 0.5f/ texture_scale,
562
+ translation: texture_translate,
563
+ rotation: texture_rotate,
564
+ clip: false,
565
+ texture_space: uv_space_index,
566
+ invert: false).tint,
567
+ mode: ::base::color_layer_multiply,
568
+ weight: grunge_amount ).tint,
569
+ diffuse_roughness: 0.f,
570
+ is_metal: false,
571
+ reflectivity: 1.0f,
572
+ reflection_roughness: ::nvidia::core_definitions::blend_colors(
573
+ color_1: ::nvidia::core_definitions::file_texture(
574
+ texture: texture_2d ( "./textures/precastconcrete_rough.png" , ::tex::gamma_srgb) ,
575
+ mono_source: ::base::mono_average,
576
+ brightness: 1.f,
577
+ contrast: 1.f,
578
+ scaling: 0.5f/ texture_scale,
579
+ translation: texture_translate,
580
+ rotation: texture_rotate,
581
+ clip: false,
582
+ texture_space: uv_space_index,
583
+ invert: false).tint,
584
+ color_2: color (reflection_roughness),
585
+ mode: ::base::color_layer_overlay,
586
+ weight: 1.0f ).mono,
587
+ anisotropy: 0.f,
588
+ anisotropy_rotation: 0.f,
589
+ transparency: 0.f,
590
+ transmission_color: color ( 1.f , 1.f , 1.f),
591
+ volume_color: color ( 1.f , 1.f , 1.f),
592
+ transmission_roughness: 0.f,
593
+ base_thickness: 0.1f,
594
+ ior: ior,
595
+ thin_walled: false,
596
+ normal: ::nvidia::core_definitions::normalmap_texture(
597
+ texture: texture_2d ( "./textures/precastconcrete_norm.jpg" , ::tex::gamma_linear),
598
+ scaling: 0.5f/ texture_scale,
599
+ translation: texture_translate,
600
+ rotation: texture_rotate,
601
+ clip: false,
602
+ factor: bump_strength * 0.20f,
603
+ texture_space: uv_space_index));
604
+
605
+
606
+
607
+ export material concrete_precast_warm_gray(
608
+
609
+ color concrete_color = color (0.932f , 0.859f , 0.797f )
610
+ [[
611
+ ::anno::display_name("Concrete Color"),
612
+ ::anno::description ( "Choose the color of the Concrete."),
613
+ ::anno::in_group("Appearance")
614
+ ]],
615
+ float grunge_amount = 0.55f
616
+ [[
617
+ ::anno::display_name("Grunge Amount"),
618
+ ::anno::description("higher values results in more noise difference in the color of the concrete."),
619
+ ::anno::hard_range(0.0,1.0),
620
+ ::anno::in_group("Appearance")
621
+ ]],
622
+ float reflection_roughness = 0.15f
623
+ [[
624
+ ::anno::display_name("Roughness"),
625
+ ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."),
626
+ ::anno::hard_range(0.0,1.0),
627
+ ::anno::in_group("Appearance")
628
+ ]],
629
+ uniform float bump_strength = 1.f
630
+ [[
631
+ ::anno::display_name("Bump Strength"),
632
+ ::anno::description("Specifies the strength of the bump."),
633
+ ::anno::in_group("Appearance")
634
+ ]],
635
+ uniform float2 texture_translate = float2 ( 0.f)
636
+ [[
637
+ ::anno::display_name("Translate"),
638
+ ::anno::description("Controls the position of the texture."),
639
+ ::anno::in_group("Transform")
640
+ ]],
641
+ uniform float texture_rotate = 0.f
642
+ [[
643
+ ::anno::display_name("Rotate"),
644
+ ::anno::description("Rotate angle of the texture in degrees."),
645
+ ::anno::in_group("Transform")
646
+ ]],
647
+ uniform float2 texture_scale = float2 ( 1.f , 1.f)
648
+ [[
649
+ ::anno::display_name("Scale"),
650
+ ::anno::description("Larger numbers increase the texture size."),
651
+ ::anno::in_group("Transform"),
652
+ ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f))
653
+ ]],
654
+ uniform float ior = 1.5f
655
+ [[
656
+ ::anno::display_name("IOR"),
657
+ ::anno::description("Index of refraction."),
658
+ ::anno::soft_range(1.0,4.0),
659
+ ::anno::in_group("Advanced")
660
+ ]],
661
+ uniform int uv_space_index = 0
662
+ [[
663
+ ::anno::display_name("UV Space Index"),
664
+ ::anno::description("UV space index."),
665
+ ::anno::hard_range(0,3),
666
+ ::anno::in_group("Advanced")
667
+ ]])
668
+ [[
669
+ ::anno::display_name("Concrete Precast - Warm Gray"),
670
+ ::anno::description("A material for (pre)cast concrete formwork panels that have holes as part of the manufacturing process."),
671
+ ::anno::author("NVIDIA vMaterials"),
672
+ ::anno::copyright_notice(COPYRIGHT),
673
+ ::anno::thumbnail("./.thumbs/Concrete_Precast.concrete_precast_warm_gray.png"),
674
+ ::anno::key_words(string[]("floor", "cast", "concrete", "precast", "construction", "cement", "warm", "gray", "unfinished", "rough"))
675
+ ]]=
676
+ ::nvidia::core_definitions::flex_material_v2(
677
+ base_color: ::nvidia::core_definitions::blend_colors(
678
+ color_1: ::nvidia::core_definitions::blend_colors(
679
+ color_1: concrete_color,
680
+ color_2: ::nvidia::core_definitions::file_texture(
681
+ texture: texture_2d ( "./textures/precastconcrete_diff.png" , ::tex::gamma_srgb) ,
682
+ mono_source: ::base::mono_average,
683
+ brightness: 1.f,
684
+ contrast: 1.f,
685
+ scaling: 0.5f/ texture_scale,
686
+ translation: texture_translate,
687
+ rotation: texture_rotate,
688
+ clip: false,
689
+ texture_space: uv_space_index,
690
+ invert: false).tint,
691
+ mode: ::base::color_layer_overlay,
692
+ weight: 1.0f ).tint,
693
+ color_2: ::nvidia::core_definitions::file_texture(
694
+ texture: texture_2d ( "./textures/precastconcrete_grunge_mask.png" , ::tex::gamma_srgb) ,
695
+ mono_source: ::base::mono_average,
696
+ brightness: 1.f,
697
+ contrast: 1.f,
698
+ scaling: 0.5f/ texture_scale,
699
+ translation: texture_translate,
700
+ rotation: texture_rotate,
701
+ clip: false,
702
+ texture_space: uv_space_index,
703
+ invert: false).tint,
704
+ mode: ::base::color_layer_multiply,
705
+ weight: grunge_amount ).tint,
706
+ diffuse_roughness: 0.f,
707
+ is_metal: false,
708
+ reflectivity: 1.0f,
709
+ reflection_roughness: ::nvidia::core_definitions::blend_colors(
710
+ color_1: ::nvidia::core_definitions::file_texture(
711
+ texture: texture_2d ( "./textures/precastconcrete_rough.png" , ::tex::gamma_srgb) ,
712
+ mono_source: ::base::mono_average,
713
+ brightness: 1.f,
714
+ contrast: 1.f,
715
+ scaling: 0.5f/ texture_scale,
716
+ translation: texture_translate,
717
+ rotation: texture_rotate,
718
+ clip: false,
719
+ texture_space: uv_space_index,
720
+ invert: false).tint,
721
+ color_2: color (reflection_roughness),
722
+ mode: ::base::color_layer_overlay,
723
+ weight: 1.0f ).mono,
724
+ anisotropy: 0.f,
725
+ anisotropy_rotation: 0.f,
726
+ transparency: 0.f,
727
+ transmission_color: color ( 1.f , 1.f , 1.f),
728
+ volume_color: color ( 1.f , 1.f , 1.f),
729
+ transmission_roughness: 0.f,
730
+ base_thickness: 0.1f,
731
+ ior: ior,
732
+ thin_walled: false,
733
+ normal: ::nvidia::core_definitions::normalmap_texture(
734
+ texture: texture_2d ( "./textures/precastconcrete_norm.jpg" , ::tex::gamma_linear),
735
+ scaling: 0.5f/ texture_scale,
736
+ translation: texture_translate,
737
+ rotation: texture_rotate,
738
+ clip: false,
739
+ factor: bump_strength * 0.20f,
740
+ texture_space: uv_space_index));
741
+
742
+
743
+
744
+
745
+ export material concrete_precast_dark_gray(
746
+
747
+ color concrete_color = color ( 0.53f , 0.505f , 0.494f )
748
+ [[
749
+ ::anno::display_name("Concrete Color"),
750
+ ::anno::description ( "Choose the color of the Concrete."),
751
+ ::anno::in_group("Appearance")
752
+ ]],
753
+ float grunge_amount = 0.5f
754
+ [[
755
+ ::anno::display_name("Grunge Amount"),
756
+ ::anno::description("higher values results in more noise difference in the color of the concrete."),
757
+ ::anno::hard_range(0.0,1.0),
758
+ ::anno::in_group("Appearance")
759
+ ]],
760
+ float reflection_roughness = 0.15f
761
+ [[
762
+ ::anno::display_name("Roughness"),
763
+ ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."),
764
+ ::anno::hard_range(0.0,1.0),
765
+ ::anno::in_group("Appearance")
766
+ ]],
767
+ uniform float bump_strength = 1.f
768
+ [[
769
+ ::anno::display_name("Bump Strength"),
770
+ ::anno::description("Specifies the strength of the bump."),
771
+ ::anno::in_group("Appearance")
772
+ ]],
773
+ uniform float2 texture_translate = float2 ( 0.f)
774
+ [[
775
+ ::anno::display_name("Translate"),
776
+ ::anno::description("Controls the position of the texture."),
777
+ ::anno::in_group("Transform")
778
+ ]],
779
+ uniform float texture_rotate = 0.f
780
+ [[
781
+ ::anno::display_name("Rotate"),
782
+ ::anno::description("Rotate angle of the texture in degrees."),
783
+ ::anno::in_group("Transform")
784
+ ]],
785
+ uniform float2 texture_scale = float2 ( 1.f , 1.f)
786
+ [[
787
+ ::anno::display_name("Scale"),
788
+ ::anno::description("Larger numbers increase the texture size."),
789
+ ::anno::in_group("Transform"),
790
+ ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f))
791
+ ]],
792
+ uniform float ior = 1.5f
793
+ [[
794
+ ::anno::display_name("IOR"),
795
+ ::anno::description("Index of refraction."),
796
+ ::anno::soft_range(1.0,4.0),
797
+ ::anno::in_group("Advanced")
798
+ ]],
799
+ uniform int uv_space_index = 0
800
+ [[
801
+ ::anno::display_name("UV Space Index"),
802
+ ::anno::description("UV space index."),
803
+ ::anno::hard_range(0,3),
804
+ ::anno::in_group("Advanced")
805
+ ]])
806
+ [[
807
+ ::anno::display_name("Concrete Precast - Dark Gray"),
808
+ ::anno::description("A material for (pre)cast concrete formwork panels that have holes as part of the manufacturing process."),
809
+ ::anno::author("NVIDIA vMaterials"),
810
+ ::anno::copyright_notice(COPYRIGHT),
811
+ ::anno::thumbnail("./.thumbs/Concrete_Precast.concrete_precast_dark_gray.png"),
812
+ ::anno::key_words(string[]("floor", "cast", "concrete", "precast", "construction", "cement", "dark", "gray", "dark gray", "unfinished", "rough"))
813
+ ]]=
814
+ ::nvidia::core_definitions::flex_material_v2(
815
+ base_color: ::nvidia::core_definitions::blend_colors(
816
+ color_1: ::nvidia::core_definitions::blend_colors(
817
+ color_1: concrete_color,
818
+ color_2: ::nvidia::core_definitions::file_texture(
819
+ texture: texture_2d ( "./textures/precastconcrete_diff.png" , ::tex::gamma_srgb) ,
820
+ mono_source: ::base::mono_average,
821
+ brightness: 1.f,
822
+ contrast: 1.f,
823
+ scaling: 0.5f/ texture_scale,
824
+ translation: texture_translate,
825
+ rotation: texture_rotate,
826
+ clip: false,
827
+ texture_space: uv_space_index,
828
+ invert: false).tint,
829
+ mode: ::base::color_layer_overlay,
830
+ weight: 1.0f ).tint,
831
+ color_2: ::nvidia::core_definitions::file_texture(
832
+ texture: texture_2d ( "./textures/precastconcrete_grunge_mask.png" , ::tex::gamma_srgb) ,
833
+ mono_source: ::base::mono_average,
834
+ brightness: 1.f,
835
+ contrast: 1.f,
836
+ scaling: 0.5f/ texture_scale,
837
+ translation: texture_translate,
838
+ rotation: texture_rotate,
839
+ clip: false,
840
+ texture_space: uv_space_index,
841
+ invert: false).tint,
842
+ mode: ::base::color_layer_multiply,
843
+ weight: grunge_amount ).tint,
844
+ diffuse_roughness: 0.f,
845
+ is_metal: false,
846
+ reflectivity: 1.0f,
847
+ reflection_roughness: ::nvidia::core_definitions::blend_colors(
848
+ color_1: ::nvidia::core_definitions::file_texture(
849
+ texture: texture_2d ( "./textures/precastconcrete_rough.png" , ::tex::gamma_srgb) ,
850
+ mono_source: ::base::mono_average,
851
+ brightness: 1.f,
852
+ contrast: 1.f,
853
+ scaling: 0.5f/ texture_scale,
854
+ translation: texture_translate,
855
+ rotation: texture_rotate,
856
+ clip: false,
857
+ texture_space: uv_space_index,
858
+ invert: false).tint,
859
+ color_2: color (reflection_roughness),
860
+ mode: ::base::color_layer_overlay,
861
+ weight: 1.0f ).mono,
862
+ anisotropy: 0.f,
863
+ anisotropy_rotation: 0.f,
864
+ transparency: 0.f,
865
+ transmission_color: color ( 1.f , 1.f , 1.f),
866
+ volume_color: color ( 1.f , 1.f , 1.f),
867
+ transmission_roughness: 0.f,
868
+ base_thickness: 0.1f,
869
+ ior: ior,
870
+ thin_walled: false,
871
+ normal: ::nvidia::core_definitions::normalmap_texture(
872
+ texture: texture_2d ( "./textures/precastconcrete_norm.jpg" , ::tex::gamma_linear),
873
+ scaling: 0.5f/ texture_scale,
874
+ translation: texture_translate,
875
+ rotation: texture_rotate,
876
+ clip: false,
877
+ factor: bump_strength * 0.20f,
878
+ texture_space: uv_space_index));
879
+
880
+
881
+
882
+ export material concrete_precast_dark_charcoal(
883
+
884
+ color concrete_color = color ( 0.28f , 0.259f , 0.239f )
885
+ [[
886
+ ::anno::display_name("Concrete Color"),
887
+ ::anno::description ( "Choose the color of the Concrete."),
888
+ ::anno::in_group("Appearance")
889
+ ]],
890
+ float grunge_amount = 0.5f
891
+ [[
892
+ ::anno::display_name("Grunge Amount"),
893
+ ::anno::description("higher values results in more noise difference in the color of the concrete."),
894
+ ::anno::hard_range(0.0,1.0),
895
+ ::anno::in_group("Appearance")
896
+ ]],
897
+ float reflection_roughness = 0.15f
898
+ [[
899
+ ::anno::display_name("Roughness"),
900
+ ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."),
901
+ ::anno::hard_range(0.0,1.0),
902
+ ::anno::in_group("Appearance")
903
+ ]],
904
+ uniform float bump_strength = 1.f
905
+ [[
906
+ ::anno::display_name("Bump Strength"),
907
+ ::anno::description("Specifies the strength of the bump."),
908
+ ::anno::in_group("Appearance")
909
+ ]],
910
+ uniform float2 texture_translate = float2 ( 0.f)
911
+ [[
912
+ ::anno::display_name("Translate"),
913
+ ::anno::description("Controls the position of the texture."),
914
+ ::anno::in_group("Transform")
915
+ ]],
916
+ uniform float texture_rotate = 0.f
917
+ [[
918
+ ::anno::display_name("Rotate"),
919
+ ::anno::description("Rotate angle of the texture in degrees."),
920
+ ::anno::in_group("Transform")
921
+ ]],
922
+ uniform float2 texture_scale = float2 ( 1.f , 1.f)
923
+ [[
924
+ ::anno::display_name("Scale"),
925
+ ::anno::description("Larger numbers increase the texture size."),
926
+ ::anno::in_group("Transform"),
927
+ ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f))
928
+ ]],
929
+ uniform float ior = 1.5f
930
+ [[
931
+ ::anno::display_name("IOR"),
932
+ ::anno::description("Index of refraction."),
933
+ ::anno::soft_range(1.0,4.0),
934
+ ::anno::in_group("Advanced")
935
+ ]],
936
+ uniform int uv_space_index = 0
937
+ [[
938
+ ::anno::display_name("UV Space Index"),
939
+ ::anno::description("UV space index."),
940
+ ::anno::hard_range(0,3),
941
+ ::anno::in_group("Advanced")
942
+ ]])
943
+ [[
944
+ ::anno::display_name("Concrete Precast - Charcoal"),
945
+ ::anno::description("A material for (pre)cast concrete formwork panels that have holes as part of the manufacturing process."),
946
+ ::anno::author("NVIDIA vMaterials"),
947
+ ::anno::copyright_notice(COPYRIGHT),
948
+ ::anno::thumbnail("./.thumbs/Concrete_Precast.concrete_precast_dark_charcoal.png"),
949
+ ::anno::key_words(string[]("floor", "cast", "concrete", "precast", "construction", "cement", "dark", "charcoal", "gray", "unfinished", "rough"))
950
+ ]]=
951
+ ::nvidia::core_definitions::flex_material_v2(
952
+ base_color: ::nvidia::core_definitions::blend_colors(
953
+ color_1: ::nvidia::core_definitions::blend_colors(
954
+ color_1: concrete_color,
955
+ color_2: ::nvidia::core_definitions::file_texture(
956
+ texture: texture_2d ( "./textures/precastconcrete_diff.png" , ::tex::gamma_srgb) ,
957
+ mono_source: ::base::mono_average,
958
+ brightness: 1.f,
959
+ contrast: 1.f,
960
+ scaling: 0.5f/ texture_scale,
961
+ translation: texture_translate,
962
+ rotation: texture_rotate,
963
+ clip: false,
964
+ texture_space: uv_space_index,
965
+ invert: false).tint,
966
+ mode: ::base::color_layer_overlay,
967
+ weight: 1.0f ).tint,
968
+ color_2: ::nvidia::core_definitions::file_texture(
969
+ texture: texture_2d ( "./textures/precastconcrete_grunge_mask.png" , ::tex::gamma_srgb) ,
970
+ mono_source: ::base::mono_average,
971
+ brightness: 1.f,
972
+ contrast: 1.f,
973
+ scaling: 0.5f/ texture_scale,
974
+ translation: texture_translate,
975
+ rotation: texture_rotate,
976
+ clip: false,
977
+ texture_space: uv_space_index,
978
+ invert: false).tint,
979
+ mode: ::base::color_layer_multiply,
980
+ weight: grunge_amount ).tint,
981
+ diffuse_roughness: 0.f,
982
+ is_metal: false,
983
+ reflectivity: 1.0f,
984
+ reflection_roughness: ::nvidia::core_definitions::blend_colors(
985
+ color_1: ::nvidia::core_definitions::file_texture(
986
+ texture: texture_2d ( "./textures/precastconcrete_rough.png" , ::tex::gamma_srgb) ,
987
+ mono_source: ::base::mono_average,
988
+ brightness: 1.f,
989
+ contrast: 1.f,
990
+ scaling: 0.5f/ texture_scale,
991
+ translation: texture_translate,
992
+ rotation: texture_rotate,
993
+ clip: false,
994
+ texture_space: uv_space_index,
995
+ invert: false).tint,
996
+ color_2: color (reflection_roughness),
997
+ mode: ::base::color_layer_overlay,
998
+ weight: 1.0f ).mono,
999
+ anisotropy: 0.f,
1000
+ anisotropy_rotation: 0.f,
1001
+ transparency: 0.f,
1002
+ transmission_color: color ( 1.f , 1.f , 1.f),
1003
+ volume_color: color ( 1.f , 1.f , 1.f),
1004
+ transmission_roughness: 0.f,
1005
+ base_thickness: 0.1f,
1006
+ ior: ior,
1007
+ thin_walled: false,
1008
+ normal: ::nvidia::core_definitions::normalmap_texture(
1009
+ texture: texture_2d ( "./textures/precastconcrete_norm.jpg" , ::tex::gamma_linear),
1010
+ scaling: 0.5f/ texture_scale,
1011
+ translation: texture_translate,
1012
+ rotation: texture_rotate,
1013
+ clip: false,
1014
+ factor: bump_strength * 0.20f,
1015
+ texture_space: uv_space_index));
1016
+
1017
+
1018
+
1019
+ export material concrete_precast_walnut(
1020
+
1021
+ color concrete_color = color ( 0.47f , 0.307f , 0.239f )
1022
+ [[
1023
+ ::anno::display_name("Concrete Color"),
1024
+ ::anno::description ( "Choose the color of the Concrete."),
1025
+ ::anno::in_group("Appearance")
1026
+ ]],
1027
+ float grunge_amount = 0.5f
1028
+ [[
1029
+ ::anno::display_name("Grunge Amount"),
1030
+ ::anno::description("higher values results in more noise difference in the color of the concrete."),
1031
+ ::anno::hard_range(0.0,1.0),
1032
+ ::anno::in_group("Appearance")
1033
+ ]],
1034
+ float reflection_roughness = 0.15f
1035
+ [[
1036
+ ::anno::display_name("Roughness"),
1037
+ ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."),
1038
+ ::anno::hard_range(0.0,1.0),
1039
+ ::anno::in_group("Appearance")
1040
+ ]],
1041
+ uniform float bump_strength = 1.f
1042
+ [[
1043
+ ::anno::display_name("Bump Strength"),
1044
+ ::anno::description("Specifies the strength of the bump."),
1045
+ ::anno::in_group("Appearance")
1046
+ ]],
1047
+ uniform float2 texture_translate = float2 ( 0.f)
1048
+ [[
1049
+ ::anno::display_name("Translate"),
1050
+ ::anno::description("Controls the position of the texture."),
1051
+ ::anno::in_group("Transform")
1052
+ ]],
1053
+ uniform float texture_rotate = 0.f
1054
+ [[
1055
+ ::anno::display_name("Rotate"),
1056
+ ::anno::description("Rotate angle of the texture in degrees."),
1057
+ ::anno::in_group("Transform")
1058
+ ]],
1059
+ uniform float2 texture_scale = float2 ( 1.f , 1.f)
1060
+ [[
1061
+ ::anno::display_name("Scale"),
1062
+ ::anno::description("Larger numbers increase the texture size."),
1063
+ ::anno::in_group("Transform"),
1064
+ ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f))
1065
+ ]],
1066
+ uniform float ior = 1.5f
1067
+ [[
1068
+ ::anno::display_name("IOR"),
1069
+ ::anno::description("Index of refraction."),
1070
+ ::anno::soft_range(1.0,4.0),
1071
+ ::anno::in_group("Advanced")
1072
+ ]],
1073
+ uniform int uv_space_index = 0
1074
+ [[
1075
+ ::anno::display_name("UV Space Index"),
1076
+ ::anno::description("UV space index."),
1077
+ ::anno::hard_range(0,3),
1078
+ ::anno::in_group("Advanced")
1079
+ ]])
1080
+ [[
1081
+ ::anno::display_name("Concrete Precast - Walnut"),
1082
+ ::anno::description("A material for (pre)cast concrete formwork panels that have holes as part of the manufacturing process."),
1083
+ ::anno::author("NVIDIA vMaterials"),
1084
+ ::anno::copyright_notice(COPYRIGHT),
1085
+ ::anno::thumbnail("./.thumbs/Concrete_Precast.concrete_precast_walnut.png"),
1086
+ ::anno::key_words(string[]("floor", "cast", "concrete", "precast", "construction", "cement", "warm", "walnut", "unfinished", "rough"))
1087
+ ]]=
1088
+ ::nvidia::core_definitions::flex_material_v2(
1089
+ base_color: ::nvidia::core_definitions::blend_colors(
1090
+ color_1: ::nvidia::core_definitions::blend_colors(
1091
+ color_1: concrete_color,
1092
+ color_2: ::nvidia::core_definitions::file_texture(
1093
+ texture: texture_2d ( "./textures/precastconcrete_diff.png" , ::tex::gamma_srgb) ,
1094
+ mono_source: ::base::mono_average,
1095
+ brightness: 1.f,
1096
+ contrast: 1.f,
1097
+ scaling: 0.5f/ texture_scale,
1098
+ translation: texture_translate,
1099
+ rotation: texture_rotate,
1100
+ clip: false,
1101
+ texture_space: uv_space_index,
1102
+ invert: false).tint,
1103
+ mode: ::base::color_layer_overlay,
1104
+ weight: 1.0f ).tint,
1105
+ color_2: ::nvidia::core_definitions::file_texture(
1106
+ texture: texture_2d ( "./textures/precastconcrete_grunge_mask.png" , ::tex::gamma_srgb) ,
1107
+ mono_source: ::base::mono_average,
1108
+ brightness: 1.f,
1109
+ contrast: 1.f,
1110
+ scaling: 0.5f/ texture_scale,
1111
+ translation: texture_translate,
1112
+ rotation: texture_rotate,
1113
+ clip: false,
1114
+ texture_space: uv_space_index,
1115
+ invert: false).tint,
1116
+ mode: ::base::color_layer_multiply,
1117
+ weight: grunge_amount ).tint,
1118
+ diffuse_roughness: 0.f,
1119
+ is_metal: false,
1120
+ reflectivity: 1.0f,
1121
+ reflection_roughness: ::nvidia::core_definitions::blend_colors(
1122
+ color_1: ::nvidia::core_definitions::file_texture(
1123
+ texture: texture_2d ( "./textures/precastconcrete_rough.png" , ::tex::gamma_srgb) ,
1124
+ mono_source: ::base::mono_average,
1125
+ brightness: 1.f,
1126
+ contrast: 1.f,
1127
+ scaling: 0.5f/ texture_scale,
1128
+ translation: texture_translate,
1129
+ rotation: texture_rotate,
1130
+ clip: false,
1131
+ texture_space: uv_space_index,
1132
+ invert: false).tint,
1133
+ color_2: color (reflection_roughness),
1134
+ mode: ::base::color_layer_overlay,
1135
+ weight: 1.0f ).mono,
1136
+ anisotropy: 0.f,
1137
+ anisotropy_rotation: 0.f,
1138
+ transparency: 0.f,
1139
+ transmission_color: color ( 1.f , 1.f , 1.f),
1140
+ volume_color: color ( 1.f , 1.f , 1.f),
1141
+ transmission_roughness: 0.f,
1142
+ base_thickness: 0.1f,
1143
+ ior: ior,
1144
+ thin_walled: false,
1145
+ normal: ::nvidia::core_definitions::normalmap_texture(
1146
+ texture: texture_2d ( "./textures/precastconcrete_norm.jpg" , ::tex::gamma_linear),
1147
+ scaling: 0.5f/ texture_scale,
1148
+ translation: texture_translate,
1149
+ rotation: texture_rotate,
1150
+ clip: false,
1151
+ factor: bump_strength * 0.20f,
1152
+ texture_space: uv_space_index));
1153
+
1154
+
1155
+ export material concrete_precast_sienna(
1156
+
1157
+ color concrete_color = color ( 0.517f , 0.453f , 0.344f )
1158
+ [[
1159
+ ::anno::display_name("Concrete Color"),
1160
+ ::anno::description ( "Choose the color of the Concrete."),
1161
+ ::anno::in_group("Appearance")
1162
+ ]],
1163
+ float grunge_amount = 0.5f
1164
+ [[
1165
+ ::anno::display_name("Grunge Amount"),
1166
+ ::anno::description("higher values results in more noise difference in the color of the concrete."),
1167
+ ::anno::hard_range(0.0,1.0),
1168
+ ::anno::in_group("Appearance")
1169
+ ]],
1170
+ float reflection_roughness = 0.15f
1171
+ [[
1172
+ ::anno::display_name("Roughness"),
1173
+ ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."),
1174
+ ::anno::hard_range(0.0,1.0),
1175
+ ::anno::in_group("Appearance")
1176
+ ]],
1177
+ uniform float bump_strength = 1.f
1178
+ [[
1179
+ ::anno::display_name("Bump Strength"),
1180
+ ::anno::description("Specifies the strength of the bump."),
1181
+ ::anno::in_group("Appearance")
1182
+ ]],
1183
+ uniform float2 texture_translate = float2 ( 0.f)
1184
+ [[
1185
+ ::anno::display_name("Translate"),
1186
+ ::anno::description("Controls the position of the texture."),
1187
+ ::anno::in_group("Transform")
1188
+ ]],
1189
+ uniform float texture_rotate = 0.f
1190
+ [[
1191
+ ::anno::display_name("Rotate"),
1192
+ ::anno::description("Rotate angle of the texture in degrees."),
1193
+ ::anno::in_group("Transform")
1194
+ ]],
1195
+ uniform float2 texture_scale = float2 ( 1.f , 1.f)
1196
+ [[
1197
+ ::anno::display_name("Scale"),
1198
+ ::anno::description("Larger numbers increase the texture size."),
1199
+ ::anno::in_group("Transform"),
1200
+ ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f))
1201
+ ]],
1202
+ uniform float ior = 1.5f
1203
+ [[
1204
+ ::anno::display_name("IOR"),
1205
+ ::anno::description("Index of refraction."),
1206
+ ::anno::soft_range(1.0,4.0),
1207
+ ::anno::in_group("Advanced")
1208
+ ]],
1209
+ uniform int uv_space_index = 0
1210
+ [[
1211
+ ::anno::display_name("UV Space Index"),
1212
+ ::anno::description("UV space index."),
1213
+ ::anno::hard_range(0,3),
1214
+ ::anno::in_group("Advanced")
1215
+ ]])
1216
+ [[
1217
+ ::anno::display_name("Concrete Precast - Sienna"),
1218
+ ::anno::description("A material for (pre)cast concrete formwork panels that have holes as part of the manufacturing process."),
1219
+ ::anno::author("NVIDIA vMaterials"),
1220
+ ::anno::copyright_notice(COPYRIGHT),
1221
+ ::anno::thumbnail("./.thumbs/Concrete_Precast.concrete_precast_sienna.png"),
1222
+ ::anno::key_words(string[]("floor", "cast", "concrete", "precast", "construction", "cement", "sienna", "gray", "unfinished", "rough"))
1223
+ ]]=
1224
+ ::nvidia::core_definitions::flex_material_v2(
1225
+ base_color: ::nvidia::core_definitions::blend_colors(
1226
+ color_1: ::nvidia::core_definitions::blend_colors(
1227
+ color_1: concrete_color,
1228
+ color_2: ::nvidia::core_definitions::file_texture(
1229
+ texture: texture_2d ( "./textures/precastconcrete_diff.png" , ::tex::gamma_srgb) ,
1230
+ mono_source: ::base::mono_average,
1231
+ brightness: 1.f,
1232
+ contrast: 1.f,
1233
+ scaling: 0.5f/ texture_scale,
1234
+ translation: texture_translate,
1235
+ rotation: texture_rotate,
1236
+ clip: false,
1237
+ texture_space: uv_space_index,
1238
+ invert: false).tint,
1239
+ mode: ::base::color_layer_overlay,
1240
+ weight: 1.0f ).tint,
1241
+ color_2: ::nvidia::core_definitions::file_texture(
1242
+ texture: texture_2d ( "./textures/precastconcrete_grunge_mask.png" , ::tex::gamma_srgb) ,
1243
+ mono_source: ::base::mono_average,
1244
+ brightness: 1.f,
1245
+ contrast: 1.f,
1246
+ scaling: 0.5f/ texture_scale,
1247
+ translation: texture_translate,
1248
+ rotation: texture_rotate,
1249
+ clip: false,
1250
+ texture_space: uv_space_index,
1251
+ invert: false).tint,
1252
+ mode: ::base::color_layer_multiply,
1253
+ weight: grunge_amount ).tint,
1254
+ diffuse_roughness: 0.f,
1255
+ is_metal: false,
1256
+ reflectivity: 1.0f,
1257
+ reflection_roughness: ::nvidia::core_definitions::blend_colors(
1258
+ color_1: ::nvidia::core_definitions::file_texture(
1259
+ texture: texture_2d ( "./textures/precastconcrete_rough.png" , ::tex::gamma_srgb) ,
1260
+ mono_source: ::base::mono_average,
1261
+ brightness: 1.f,
1262
+ contrast: 1.f,
1263
+ scaling: 0.5f/ texture_scale,
1264
+ translation: texture_translate,
1265
+ rotation: texture_rotate,
1266
+ clip: false,
1267
+ texture_space: uv_space_index,
1268
+ invert: false).tint,
1269
+ color_2: color (reflection_roughness),
1270
+ mode: ::base::color_layer_overlay,
1271
+ weight: 1.0f ).mono,
1272
+ anisotropy: 0.f,
1273
+ anisotropy_rotation: 0.f,
1274
+ transparency: 0.f,
1275
+ transmission_color: color ( 1.f , 1.f , 1.f),
1276
+ volume_color: color ( 1.f , 1.f , 1.f),
1277
+ transmission_roughness: 0.f,
1278
+ base_thickness: 0.1f,
1279
+ ior: ior,
1280
+ thin_walled: false,
1281
+ normal: ::nvidia::core_definitions::normalmap_texture(
1282
+ texture: texture_2d ( "./textures/precastconcrete_norm.jpg" , ::tex::gamma_linear),
1283
+ scaling: 0.5f/ texture_scale,
1284
+ translation: texture_translate,
1285
+ rotation: texture_rotate,
1286
+ clip: false,
1287
+ factor: bump_strength * 0.20f,
1288
+ texture_space: uv_space_index));
code/third_party/vMaterials_2/Concrete/Concrete_Rough.mdl ADDED
@@ -0,0 +1,457 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.5;
37
+
38
+ import ::anno::*;
39
+ import ::base::*;
40
+ import ::df::*;
41
+ import ::math::*;
42
+ import ::state::*;
43
+ import ::tex::*;
44
+ import ::nvidia::core_definitions::blend_colors;
45
+ import ::nvidia::core_definitions::dimension;
46
+
47
+ const string COPYRIGHT =
48
+ " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
49
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
50
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
51
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
52
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
53
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
54
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
55
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
56
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
57
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
58
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
59
+
60
+
61
+
62
+ float remap_xy_to_0_1(float input, float x, float y)
63
+ {
64
+ return (input - x)/(y - x);
65
+ }
66
+
67
+ float histogram_scan_big(float input, float width, float position)
68
+ {
69
+ return ::math::clamp(
70
+ remap_xy_to_0_1(input,
71
+ ::math::lerp(-width, 1.0, position),
72
+ ::math::lerp(0.0, 1.0 + width, position)),
73
+ 0.0,
74
+ 1.0);
75
+ }
76
+
77
+ float histogram_scan_small(float input, float width, float position)
78
+ {
79
+ return ::math::clamp(
80
+ remap_xy_to_0_1(input,
81
+ ::math::lerp(0.0, 1.0 - width, position),
82
+ ::math::lerp(width, 1.0 , position)),
83
+ 0.0,
84
+ 1.0);
85
+ }
86
+
87
+ ::base::texture_coordinate_info vmat_transform(
88
+ uniform float2 translation = float2(0.0, 0.0),
89
+ uniform float rotation = 0.0,
90
+ uniform float2 scaling = float2(1.0, 1.0),
91
+ uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw,
92
+ uniform int uv_space = 0
93
+ )
94
+ {
95
+ float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f;
96
+
97
+ float4x4 scale =
98
+ float4x4(1.0 /scaling.x, 0. , 0. , 0.,
99
+ 0. , 1.0 /scaling.y , 0. , 0.,
100
+ 0. , 0. , 1.0, 0.,
101
+ translation.x , translation.y , 0.0, 1.);
102
+
103
+ float s = ::math::sin(rotation_rad);
104
+ float c = ::math::cos(rotation_rad);
105
+ float4x4 rotate =
106
+ float4x4( c , -s , 0.0 , 0.0,
107
+ s , c , 0.0 , 0.0,
108
+ 0.0, 0.0 , 1.0 , 0.0,
109
+ 0. , 0.0 , 0.0 , 1.);
110
+
111
+ return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space));
112
+ }
113
+
114
+
115
+ float histogram_range(float input, float range, float position)
116
+ {
117
+ float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0);
118
+ float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0);
119
+ return ::math::lerp(low, high, input);
120
+ }
121
+
122
+
123
+
124
+ float uint2float(int x)
125
+ {
126
+ return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0);
127
+ }
128
+
129
+ int lowbias32(int x)
130
+ {
131
+ x ^= x >>> 16;
132
+ x *= 0x7feb352d;
133
+ x ^= x >>> 15;
134
+ x *= 0x846ca68b;
135
+ x ^= x >>> 16;
136
+ return x;
137
+ }
138
+
139
+ float2 rnd22(int2 p) {
140
+ float2 ret_val = float2(
141
+ uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f,
142
+ uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f
143
+ );
144
+ return ret_val;
145
+ }
146
+
147
+ float3 srgb2rgb(float3 val)
148
+ {
149
+ return ::math::pow(::math::max(val, float3(0.0f)), 2.2);
150
+ }
151
+
152
+ float2x2 invert_2x2(float2x2 M)
153
+ {
154
+ float det = M[0][0]*M[1][1] - M[0][1]*M[1][0];
155
+ //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/
156
+ return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]);
157
+ }
158
+
159
+ float3 nonrepeat_lookup(
160
+ uniform texture_2d texture = texture_2d(),
161
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
162
+ float texture_scale = 1.0,
163
+ float3 average_color = float3(0.5),
164
+ float patch_size = 8.0
165
+ )
166
+ {
167
+
168
+ float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale;
169
+ float Z = patch_size; // patch scale inside example texture
170
+ float CON = 1.0f;
171
+
172
+ float3 O = float3(0.f);
173
+ float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f);
174
+ float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space
175
+
176
+ float2 U = uv_in;
177
+ float2 V = M * uv_in; //pre-tilted hexa coordinates
178
+ int2 I = int2(::math::floor(V)); // hexa-tile id
179
+
180
+ // The mean color needs to be determined in Photoshop then to make the
181
+ // average color work out, take the float value and calculate the apropriate
182
+ // mean value as (value^(1/2.2))
183
+
184
+ float3 m = average_color;
185
+
186
+ float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W;
187
+ F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates
188
+
189
+ if( F[2] > 0.f )
190
+
191
+ O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON))
192
+ + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON))
193
+ + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON));
194
+ else
195
+ O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON))
196
+ + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON))
197
+ + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON));
198
+ O = m + O/::math::length(W);
199
+ O = ::math::clamp( (O), 0.0, 1.0);
200
+
201
+ return float3(O);
202
+ }
203
+
204
+ color endless_texture(
205
+ uniform texture_2d texture = texture_2d(),
206
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
207
+ float texture_scale = 10.0,
208
+ float3 average_color = float3(0.5, 0.5, 1.0),
209
+ float patch_size = 8.0,
210
+ bool gamma_correct_lookup = true
211
+ )
212
+ {
213
+ return gamma_correct_lookup ? color(srgb2rgb(
214
+ nonrepeat_lookup (
215
+ texture: texture,
216
+ uvw: uvw,
217
+ texture_scale: texture_scale,
218
+ average_color: average_color,
219
+ patch_size: patch_size
220
+ ))
221
+ ) : color(nonrepeat_lookup (
222
+ texture: texture,
223
+ uvw: uvw,
224
+ texture_scale: texture_scale,
225
+ average_color: average_color,
226
+ patch_size: patch_size
227
+ ));
228
+ }
229
+
230
+ float3 endless_normal(
231
+ uniform texture_2d texture = texture_2d(),
232
+ float factor = 1.0,
233
+ bool flip_tangent_u = false,
234
+ bool flip_tangent_v = false,
235
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
236
+ float texture_scale = 1.0,
237
+ float3 average_color = float3(0.5, 0.5, 1.0),
238
+ float patch_size = 8.0
239
+ )
240
+ {
241
+ float3 transformed_tangent_u = flip_tangent_u ? uvw.tangent_u : - uvw.tangent_u;
242
+ float3 transformed_tangent_v = flip_tangent_v ? uvw.tangent_v : - uvw.tangent_v;
243
+
244
+ if (flip_tangent_u)
245
+ transformed_tangent_u=-transformed_tangent_u;
246
+ if (flip_tangent_v)
247
+ transformed_tangent_v=-transformed_tangent_v;
248
+
249
+ // normalized Lookup
250
+ float3 tangent_space_normal =
251
+ (nonrepeat_lookup (
252
+ texture: texture,
253
+ uvw: uvw,
254
+ texture_scale: texture_scale,
255
+ average_color: average_color,
256
+ patch_size: patch_size
257
+ ) - 0.5) * (2.0 * factor);
258
+
259
+ return ::math::normalize(uvw.tangent_u * tangent_space_normal.x +
260
+ uvw.tangent_v * tangent_space_normal.y +
261
+ ::state::normal()*1.0);
262
+ }
263
+
264
+ float3 normalmap_normal(
265
+ uniform texture_2d texture,
266
+ float factor = 1.0,
267
+ ::base::texture_coordinate_info uvw = ::base::texture_coordinate_info()
268
+ )
269
+ {
270
+ float3 lookup = (::tex::lookup_float3(texture, float2(uvw.position.x, uvw.position.y)) - float3(0.5)) * (factor * 2.0);
271
+ return ::math::normalize(uvw.tangent_u * lookup.x + uvw.tangent_v * lookup.y + ::state::normal() * (lookup.z + (1.0 - factor)));
272
+ }
273
+
274
+
275
+ export material Concrete_Rough(
276
+ uniform bool infinite_tiling = true [[
277
+ ::anno::description("Enables infinite tiling feature which removes repeating texture patterns. Note that depending on the material this feature changes the appearance of the material slightly."),
278
+ ::anno::display_name("Infinite Tiling"),
279
+ ::anno::in_group("Appearance")
280
+ ]],
281
+ float diffuse_brightness = 1.f [[
282
+ ::anno::description("Adjusts the lightness of the material."),
283
+ ::anno::display_name("Diffuse Brightness"),
284
+ ::anno::hard_range(0.f, 1.f),
285
+ ::anno::in_group("Appearance")
286
+ ]],
287
+ float roughness = 0.f [[
288
+ ::anno::description("Higher values lead to blurrier reflections."),
289
+ ::anno::display_name("Roughness"),
290
+ ::anno::hard_range(0.f, 1.f),
291
+ ::anno::in_group("Appearance")
292
+ ]],
293
+ float reflectivity = 1.f [[
294
+ ::anno::description("Higher values make the surface more reflective."),
295
+ ::anno::display_name("Reflectivity"),
296
+ ::anno::hard_range(0.f, 1.f),
297
+ ::anno::in_group("Appearance")
298
+ ]],
299
+ float moss_growth = 0.f [[
300
+ ::anno::description("Grows a layer of moss on top of the material."),
301
+ ::anno::display_name("Moss Growth"),
302
+ ::anno::hard_range(0.f, 1.f),
303
+ ::anno::in_group("Appearance")
304
+ ]],
305
+ uniform float bump_strength = 1.f [[
306
+ ::anno::description("Determines the degree of bumpiness."),
307
+ ::anno::display_name("Bump Strength"),
308
+ ::anno::hard_range(0.f, 2.f),
309
+ ::anno::soft_range(0.f, 1.f),
310
+ ::anno::in_group("Appearance")
311
+ ]],
312
+ float dirt = 0.f [[
313
+ ::anno::description("The strength of the dirtlayer."),
314
+ ::anno::display_name("Dirt Strength"),
315
+ ::anno::hard_range(0.f, 1.f),
316
+ ::anno::in_group("Appearance", "Dirt")
317
+ ]],
318
+ color dirt_color = color(0.f, 0.f, 0.f) [[
319
+ ::anno::description("Adjust the color of the dirt layer."),
320
+ ::anno::display_name("Dirt Color"),
321
+ ::anno::in_group("Appearance", "Dirt")
322
+ ]],
323
+ uniform float2 texture_translate = float2(0.f) [[
324
+ ::anno::description("Controls the position of the texture."),
325
+ ::anno::display_name("Texture Translate"),
326
+ ::anno::in_group("Transform")
327
+ ]],
328
+ uniform float texture_rotate = 0.f [[
329
+ ::anno::description("Rotation of the texture in degrees."),
330
+ ::anno::display_name("Texture Rotate"),
331
+ ::anno::in_group("Transform")
332
+ ]],
333
+ uniform float2 texture_scale = float2(1.f) [[
334
+ ::anno::description("Larger numbers increase the size."),
335
+ ::anno::display_name("Texture Scale"),
336
+ ::nvidia::core_definitions::dimension(float2(1.0, 1.0)),
337
+ ::anno::in_group("Transform")
338
+ ]],
339
+ uniform int uv_space_index = 0 [[
340
+ ::anno::description("Uses selected UV space for material."),
341
+ ::anno::display_name("UV Space Index"),
342
+ ::anno::in_group("Advanced")
343
+ ]]
344
+ )
345
+ [[
346
+ ::anno::description("A rough concrete material with a dirt and moss layer."),
347
+ ::anno::in_group("Concrete"),
348
+ ::anno::display_name("Concrete Rough"),
349
+ ::anno::copyright_notice(COPYRIGHT),
350
+ ::anno::thumbnail("./.thumbs/Concrete_Rough.Concrete_Rough.png"),
351
+ ::anno::key_words(string[]("floor", "wall", "concrete", "construction", "exterior", "cement", "unfinished", "rough", "worn", "gray")),
352
+ ::anno::author("NVIDIA vMaterials"),
353
+ ::anno::contributor("Ruediger Raab"),
354
+ ::anno::contributor("Maik Rohland")
355
+ ]]
356
+ =
357
+ let {
358
+ bool tmp0 = false;
359
+ material_surface tmp1(::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, ::math::pow(histogram_scan_small(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./textures/concrete_rough_ORM.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, ::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], ::math::lerp(0.0340000018f, 1.f, reflectivity), 1.f), 2.20000005f), ::df::microfacet_ggx_smith_bsdf(::math::lerp(::math::lerp(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./textures/concrete_rough_ORM.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, ::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.635890067f, ::math::lerp(0.465000033f, 0.852000058f, roughness)), ::math::lerp(0.709000051f, histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./textures/concrete_rough_ORM.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, ::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.635890067f, ::math::lerp(0.465000033f, 0.852000058f, roughness)), histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./textures/concrete_rough_ORM.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, ::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], 0.417000026f, 0.747000039f)), dirt), float3(::base::file_texture(texture_2d("./textures/moss_multi_R_rough_G_ao_B_height.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.478000015f, ::base::texture_coordinate_uvw, 0), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./textures/concrete_rough_ORM.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, ::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], 0.334000021f, ::math::lerp(1.f, 0.584000051f, moss_growth))) * ::math::lerp(::math::lerp(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./textures/concrete_rough_ORM.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, ::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.635890067f, ::math::lerp(0.465000033f, 0.852000058f, roughness)), ::math::lerp(0.709000051f, histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./textures/concrete_rough_ORM.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, ::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.635890067f, ::math::lerp(0.465000033f, 0.852000058f, roughness)), histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./textures/concrete_rough_ORM.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, ::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], 0.417000026f, 0.747000039f)), dirt), float3(::base::file_texture(texture_2d("./textures/moss_multi_R_rough_G_ao_B_height.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.478000015f, ::base::texture_coordinate_uvw, 0), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./textures/concrete_rough_ORM.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, ::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], 0.334000021f, ::math::lerp(1.f, 0.584000051f, moss_growth))), ::math::lerp(::math::lerp(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./textures/concrete_rough_ORM.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, ::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.635890067f, ::math::lerp(0.465000033f, 0.852000058f, roughness)), ::math::lerp(0.709000051f, histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./textures/concrete_rough_ORM.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, ::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.635890067f, ::math::lerp(0.465000033f, 0.852000058f, roughness)), histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./textures/concrete_rough_ORM.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, ::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], 0.417000026f, 0.747000039f)), dirt), float3(::base::file_texture(texture_2d("./textures/moss_multi_R_rough_G_ao_B_height.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.478000015f, ::base::texture_coordinate_uvw, 0), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./textures/concrete_rough_ORM.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, ::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], 0.334000021f, ::math::lerp(1.f, 0.584000051f, moss_growth))) * ::math::lerp(::math::lerp(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./textures/concrete_rough_ORM.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, ::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.635890067f, ::math::lerp(0.465000033f, 0.852000058f, roughness)), ::math::lerp(0.709000051f, histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./textures/concrete_rough_ORM.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, ::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.635890067f, ::math::lerp(0.465000033f, 0.852000058f, roughness)), histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./textures/concrete_rough_ORM.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, ::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], 0.417000026f, 0.747000039f)), dirt), float3(::base::file_texture(texture_2d("./textures/moss_multi_R_rough_G_ao_B_height.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.478000015f, ::base::texture_coordinate_uvw, 0), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./textures/concrete_rough_ORM.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, ::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], 0.334000021f, ::math::lerp(1.f, 0.584000051f, moss_growth))), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_rough_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.705882013f, 0.705882013f, 0.678430974f), 2.02700019f, true) : ::base::file_texture(texture_2d("./textures/concrete_rough_diff.jpg", ::tex::gamma_srgb), 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, ::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, color(0.f, 0.f, 0.f), ::base::color_layer_multiply, ::math::lerp(0.356000006f, 0.f, diffuse_brightness)).tint, nvidia::core_definitions::blend_colors(dirt_color, color(1.f, 1.f, 1.f), ::base::color_layer_blend, ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./textures/concrete_rough_ORM.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, ::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], 2.20000005f)).tint, ::base::color_layer_multiply, dirt * 0.699999988f).tint, ::base::file_texture(texture_2d("./textures/moss_diff.jpg", ::tex::gamma_srgb), 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.478000015f, ::base::texture_coordinate_uvw, 0), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, ::base::color_layer_multiply, histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./textures/concrete_rough_ORM.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, ::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], 0.334000021f, ::math::lerp(1.f, 0.584000051f, moss_growth))).tint, 0.f), bsdf(), ::state::normal()), ::state::normal()), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
360
+ material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
361
+ color tmp3 = color(1.f, 1.f, 1.f);
362
+ 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));
363
+ material_geometry tmp5(float3(0.f), 1.f, ::math::normalize(::math::lerp(infinite_tiling ? endless_normal(texture_2d("./textures/concrete_rough_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.5f, 0.5f, 1.f), 2.02700019f) : ::base::tangent_space_normal_texture(texture_2d("./textures/concrete_rough_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f), normalmap_normal(texture_2d("./textures/moss_norm.jpg", ::tex::gamma_linear), 2.f, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.478000015f, ::base::texture_coordinate_uvw, 0)), histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./textures/concrete_rough_ORM.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, ::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], 0.334000021f, ::math::lerp(1.f, 0.584000051f, moss_growth)))));
364
+ hair_bsdf tmp6 = hair_bsdf();
365
+ } in
366
+ material(
367
+ thin_walled: tmp0,
368
+ surface: tmp1,
369
+ backface: tmp2,
370
+ ior: tmp3,
371
+ volume: tmp4,
372
+ geometry: tmp5,
373
+ hair: tmp6);
374
+
375
+
376
+ export material Concrete_Rough_Dirty(*)
377
+ [[
378
+ ::anno::description("A rough concrete material with a dirt and moss layer."),
379
+ ::anno::in_group("Concrete"),
380
+ ::anno::display_name("Concrete Rough Dirty"),
381
+ ::anno::copyright_notice(COPYRIGHT),
382
+ ::anno::thumbnail("./.thumbs/Concrete_Rough.Concrete_Rough_Dirty.png"),
383
+ ::anno::key_words(string[]("floor", "wall", "concrete", "construction", "exterior", "cement", "unfinished", "rough", "worn", "dirty", "gray")),
384
+ ::anno::author("NVIDIA vMaterials"),
385
+ ::anno::contributor("Ruediger Raab"),
386
+ ::anno::contributor("Maik Rohland")
387
+ ]]
388
+ = Concrete_Rough(
389
+ infinite_tiling: true,
390
+ diffuse_brightness: 1.0f,
391
+ roughness: 0.5f,
392
+ reflectivity: 1.0f,
393
+ moss_growth: 0.0f,
394
+ bump_strength: 1.0f,
395
+ dirt: 1.0f,
396
+ dirt_color: color(0.0f),
397
+ texture_translate: float2(0.0f),
398
+ texture_rotate: 0.0f,
399
+ texture_scale: float2(1.0f),
400
+ uv_space_index: 0
401
+ );
402
+
403
+
404
+ export material Concrete_Rough_Mossy(*)
405
+ [[
406
+ ::anno::description("A rough concrete material with a dirt and moss layer."),
407
+ ::anno::in_group("Concrete"),
408
+ ::anno::display_name("Concrete Rough Mossy"),
409
+ ::anno::copyright_notice(COPYRIGHT),
410
+ ::anno::thumbnail("./.thumbs/Concrete_Rough.Concrete_Rough_Mossy.png"),
411
+ ::anno::key_words(string[]("floor", "wall", "concrete", "construction", "exterior", "cement", "unfinished", "rough", "worn", "dirty", "decayed", "gray")),
412
+ ::anno::author("NVIDIA vMaterials"),
413
+ ::anno::contributor("Ruediger Raab"),
414
+ ::anno::contributor("Maik Rohland")
415
+ ]]
416
+ = Concrete_Rough(
417
+ infinite_tiling: true,
418
+ diffuse_brightness: 1.0f,
419
+ roughness: 0.5f,
420
+ reflectivity: 1.0f,
421
+ moss_growth: 0.5f,
422
+ bump_strength: 1.0f,
423
+ dirt: 0.0f,
424
+ dirt_color: color(0.0f),
425
+ texture_translate: float2(0.0f),
426
+ texture_rotate: 0.0f,
427
+ texture_scale: float2(1.0f),
428
+ uv_space_index: 0
429
+ );
430
+
431
+
432
+ export material Concrete_Rough_Heavy_Decay(*)
433
+ [[
434
+ ::anno::description("A rough concrete material with a dirt and moss layer."),
435
+ ::anno::in_group("Concrete"),
436
+ ::anno::display_name("Concrete Rough Heavy Decay"),
437
+ ::anno::copyright_notice(COPYRIGHT),
438
+ ::anno::thumbnail("./.thumbs/Concrete_Rough.Concrete_Rough_Heavy_Decay.png"),
439
+ ::anno::key_words(string[]("floor", "wall", "concrete", "construction", "exterior", "cement", "unfinished", "rough", "worn", "dirty", "decayed", "gray")),
440
+ ::anno::author("NVIDIA vMaterials"),
441
+ ::anno::contributor("Ruediger Raab"),
442
+ ::anno::contributor("Maik Rohland")
443
+ ]]
444
+ = Concrete_Rough(
445
+ infinite_tiling: true,
446
+ diffuse_brightness: 1.0f,
447
+ roughness: 0.75f,
448
+ reflectivity: 1.0f,
449
+ moss_growth: 0.80f,
450
+ bump_strength: 1.0f,
451
+ dirt: 0.0f,
452
+ dirt_color: color(0.0f),
453
+ texture_translate: float2(0.0f),
454
+ texture_rotate: 0.0f,
455
+ texture_scale: float2(1.0f),
456
+ uv_space_index: 0
457
+ );
code/third_party/vMaterials_2/Concrete/Concrete_Wall_Aged.mdl ADDED
@@ -0,0 +1,436 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.5;
37
+
38
+ import ::anno::*;
39
+ import ::base::*;
40
+ import ::df::*;
41
+ import ::math::*;
42
+ import ::state::*;
43
+ import ::tex::*;
44
+ import ::nvidia::core_definitions::blend_colors;
45
+ import ::nvidia::core_definitions::dimension;
46
+
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
+
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
+ return ::base::texture_coordinate_info(
86
+ float3(r_position.x,r_position.y,r_position.z),
87
+ ::math::normalize(cos * coordinate.tangent_u - sin * coordinate.tangent_v),
88
+ ::math::normalize(cos * coordinate.tangent_v + sin * coordinate.tangent_u));
89
+ }
90
+
91
+ ::base::texture_coordinate_info vmat_transform(
92
+ float2 translation = float2(0.0, 0.0),
93
+ float rotation = 0.0, // rotation in degrees
94
+ float2 scaling = float2(1.0, 1.0),
95
+ uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw,
96
+ uniform int uv_space = 0
97
+ )
98
+ {
99
+ float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f;
100
+ float4x4 scale =
101
+ float4x4(1.0 /scaling.x, 0. , 0. , 0.,
102
+ 0. , 1.0 /scaling.y , 0. , 0.,
103
+ 0. , 0. , 1.0, 0.,
104
+ translation.x , translation.y , 0.0, 1.);
105
+
106
+ float s = ::math::sin(rotation_rad);
107
+ float c = ::math::cos(rotation_rad);
108
+ float4x4 rotate =
109
+ float4x4( c , -s , 0.0 , 0.0,
110
+ s , c , 0.0 , 0.0,
111
+ 0.0, 0.0 , 1.0 , 0.0,
112
+ 0. , 0.0 , 0.0 , 1.);
113
+
114
+ return transform_coordinate_2(scale*rotate, ::base::coordinate_source(system, uv_space));
115
+ }
116
+
117
+
118
+ float histogram_range(float input, float range, float position)
119
+ {
120
+ float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0);
121
+ float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0);
122
+ return ::math::lerp(low, high, input);
123
+ }
124
+
125
+
126
+
127
+ float uint2float(int x)
128
+ {
129
+ return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0);
130
+ }
131
+
132
+ int lowbias32(int x)
133
+ {
134
+ x ^= x >>> 16;
135
+ x *= 0x7feb352d;
136
+ x ^= x >>> 15;
137
+ x *= 0x846ca68b;
138
+ x ^= x >>> 16;
139
+ return x;
140
+ }
141
+
142
+ float2 rnd22(int2 p) {
143
+ float2 ret_val = float2(
144
+ uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f,
145
+ uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f
146
+ );
147
+ return ret_val;
148
+ }
149
+
150
+ float3 srgb2rgb(float3 val)
151
+ {
152
+ return ::math::pow(::math::max(val, float3(0.0f)), 2.2);
153
+ }
154
+
155
+ float2x2 invert_2x2(float2x2 M)
156
+ {
157
+ float det = M[0][0]*M[1][1] - M[0][1]*M[1][0];
158
+ //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/
159
+ return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]);
160
+ }
161
+
162
+ float3 nonrepeat_lookup(
163
+ uniform texture_2d texture = texture_2d(),
164
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
165
+ float texture_scale = 1.0,
166
+ float3 average_color = float3(0.5),
167
+ float patch_size = 8.0
168
+ )
169
+ {
170
+
171
+ float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale;
172
+ float Z = patch_size; // patch scale inside example texture
173
+ float CON = 1.0f;
174
+
175
+ float3 O = float3(0.f);
176
+ float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f);
177
+ float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space
178
+
179
+ float2 U = uv_in;
180
+ float2 V = M * uv_in; //pre-tilted hexa coordinates
181
+ int2 I = int2(::math::floor(V)); // hexa-tile id
182
+
183
+ // The mean color needs to be determined in Photoshop then to make the
184
+ // average color work out, take the float value and calculate the apropriate
185
+ // mean value as (value^(1/2.2))
186
+
187
+ float3 m = average_color;
188
+
189
+ float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W;
190
+ F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates
191
+
192
+ if( F[2] > 0.f )
193
+
194
+ O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON))
195
+ + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON))
196
+ + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON));
197
+ else
198
+ O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON))
199
+ + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON))
200
+ + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON));
201
+ O = m + O/::math::length(W);
202
+ O = ::math::clamp( (O), 0.0, 1.0);
203
+
204
+ return float3(O);
205
+ }
206
+
207
+ color endless_texture(
208
+ uniform texture_2d texture = texture_2d(),
209
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
210
+ float texture_scale = 10.0,
211
+ float3 average_color = float3(0.5, 0.5, 1.0),
212
+ float patch_size = 8.0,
213
+ bool gamma_correct_lookup = true
214
+ )
215
+ {
216
+ return gamma_correct_lookup ? color(srgb2rgb(
217
+ nonrepeat_lookup (
218
+ texture: texture,
219
+ uvw: uvw,
220
+ texture_scale: texture_scale,
221
+ average_color: average_color,
222
+ patch_size: patch_size
223
+ ))
224
+ ) : color(nonrepeat_lookup (
225
+ texture: texture,
226
+ uvw: uvw,
227
+ texture_scale: texture_scale,
228
+ average_color: average_color,
229
+ patch_size: patch_size
230
+ ));
231
+ }
232
+
233
+ float3 endless_normal(
234
+ uniform texture_2d texture = texture_2d(),
235
+ float factor = 1.0,
236
+ bool flip_tangent_u = false,
237
+ bool flip_tangent_v = false,
238
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
239
+ float texture_scale = 1.0,
240
+ float3 average_color = float3(0.5, 0.5, 1.0),
241
+ float patch_size = 8.0
242
+ )
243
+ {
244
+ float3 transformed_tangent_u = flip_tangent_u ? uvw.tangent_u : - uvw.tangent_u;
245
+ float3 transformed_tangent_v = flip_tangent_v ? uvw.tangent_v : - uvw.tangent_v;
246
+
247
+ if (flip_tangent_u)
248
+ transformed_tangent_u=-transformed_tangent_u;
249
+ if (flip_tangent_v)
250
+ transformed_tangent_v=-transformed_tangent_v;
251
+
252
+ // normalized Lookup
253
+ float3 tangent_space_normal =
254
+ (nonrepeat_lookup (
255
+ texture: texture,
256
+ uvw: uvw,
257
+ texture_scale: texture_scale,
258
+ average_color: average_color,
259
+ patch_size: patch_size
260
+ ) - 0.5) * (2.0 * factor);
261
+
262
+ return ::math::normalize(uvw.tangent_u * tangent_space_normal.x +
263
+ uvw.tangent_v * tangent_space_normal.y +
264
+ ::state::normal()*1.0);
265
+ }
266
+
267
+ export material Concrete_Wall_Aged(
268
+ uniform bool infinite_tiling = false [[
269
+ ::anno::description("Enables infinite tiling feature which removes repeating texture patterns. Note that depending on the material this feature changes the appearance of the material slightly."),
270
+ ::anno::display_name("Infinite Tiling"),
271
+ ::anno::in_group("Appearance")
272
+ ]],
273
+ float diffuse_brightness = 0.8f [[
274
+ ::anno::description("Adjusts the lightness of the material."),
275
+ ::anno::display_name("Diffuse Brightness"),
276
+ ::anno::in_group("Appearance"),
277
+ ::anno::hard_range(0.f, 1.f)
278
+ ]],
279
+ float roughness = 0.45f [[
280
+ ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."),
281
+ ::anno::display_name("Roughness"),
282
+ ::anno::in_group("Appearance"),
283
+ ::anno::hard_range(0.f, 1.f)
284
+ ]],
285
+ uniform float bump_strength = 1.f [[
286
+ ::anno::description("Specifies the strength of the bump."),
287
+ ::anno::display_name("Bump Strength"),
288
+ ::anno::in_group("Appearance"),
289
+ ::anno::hard_range(0.f, 3.f),
290
+ ::anno::soft_range(0.f, 1.f)
291
+ ]],
292
+ float grunge_weight = 0.0f [[
293
+ ::anno::description("Adjusts the shininess of the grunge reflection. Vallues less than 0.5 make it shinier, value greater than 0.5 make it rougher. Set to 0.5 for neutral setting."),
294
+ ::anno::display_name("Grunge Amount"),
295
+ ::anno::in_group("Appearance", "Grunge"),
296
+ ::anno::hard_range(0.f, 1.f)
297
+ ]],
298
+ float grunge_roughness = 0.65f [[
299
+ ::anno::description("Specifies the roughnes."),
300
+ ::anno::display_name("Grunge Roughness"),
301
+ ::anno::in_group("Appearance", "Grunge"),
302
+ ::anno::hard_range(0.f, 1.f)
303
+ ]],
304
+ color grunge_tint = color(0.0546f, 0.0478f, 0.0446f) [[
305
+ ::anno::description("Tints the grunge layered upon the concrete."),
306
+ ::anno::display_name("Grunge Tint"),
307
+ ::anno::in_group("Appearance", "Grunge")
308
+ ]],
309
+ float2 texture_translate = float2(0.f) [[
310
+ ::anno::description("Controls the position of the texture."),
311
+ ::anno::display_name("Texture Translate"),
312
+ ::anno::in_group("Transform")
313
+ ]],
314
+ float texture_rotate = 0.f [[
315
+ ::anno::description("Rotates angle of the texture in degrees."),
316
+ ::anno::display_name("Texture Rotate"),
317
+ ::anno::in_group("Transform"),
318
+ ::anno::soft_range(0.f, 360.f)
319
+ ]],
320
+ float2 texture_scale = float2(1.f) [[
321
+ ::anno::description("Larger numbers increase the size."),
322
+ ::anno::display_name("Texture Scale"),
323
+ ::nvidia::core_definitions::dimension(float2(1.0, 1.0)),
324
+ ::anno::in_group("Transform")
325
+ ]],
326
+ uniform bool roundcorners_enable = false [[
327
+ ::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."),
328
+ ::anno::display_name("Enable Round Corners"),
329
+ ::anno::in_group("Round Corners")
330
+ ]],
331
+ uniform float roundcorners_radius_mm = 1.5f [[
332
+ ::anno::description("Radius of the rounded corners in millimeters."),
333
+ ::anno::display_name("Round Corner Radius (mm)"),
334
+ ::anno::in_group("Round Corners"),
335
+ ::anno::soft_range(0.f, 10.f)
336
+ ]],
337
+ uniform bool roundcorners_across_materials = false [[
338
+ ::anno::description("Applies the round corner effect across different materials when enabled."),
339
+ ::anno::display_name("Across Materials"),
340
+ ::anno::in_group("Round Corners")
341
+ ]],
342
+ uniform int uv_space_index = 0 [[
343
+ ::anno::description("Uses selected UV space for material."),
344
+ ::anno::display_name("UV Space Index"),
345
+ ::anno::in_group("Advanced")
346
+ ]]
347
+ )
348
+ [[
349
+ ::anno::description("An old concrete wall."),
350
+ ::anno::in_group("Concrete"),
351
+ ::anno::display_name("Concrete Wall Aged"),
352
+ ::anno::copyright_notice(COPYRIGHT),
353
+ ::anno::thumbnail("./.thumbs/Concrete_Wall_Aged.Concrete_Wall_Aged.png"),
354
+ ::anno::key_words(string[]("concrete", "infinite tiling", "wall", "outdoor", "old", "construction", "aged", "paint", "worn", "scratched", "gray")),
355
+ ::anno::author("NVIDIA vMaterials"),
356
+ ::anno::contributor("Ruediger Raab"),
357
+ ::anno::contributor("Maik Rohland")
358
+ ]]
359
+ =
360
+ let {
361
+ bool tmp0 = false;
362
+ material_surface tmp1(::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 5.44000006f, float3(0.352941006f, 0.870588005f, 0.0549019985f), 5.44000006f, false) : ::base::file_texture(texture_2d("./textures/concrete_wall_aged_R_rough_G_ao_B_grunge.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, ::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], ::df::microfacet_ggx_smith_bsdf((histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 5.44000006f, float3(0.352941006f, 0.870588005f, 0.0549019985f), 5.44000006f, false) : ::base::file_texture(texture_2d("./textures/concrete_wall_aged_R_rough_G_ao_B_grunge.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, ::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, roughness * 0.25f + 0.600000024f) + grunge_weight * (grunge_roughness * 0.600000024f + -0.300000012f) * float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 5.44000006f, float3(0.352941006f, 0.870588005f, 0.0549019985f), 5.44000006f, false) : ::base::file_texture(texture_2d("./textures/concrete_wall_aged_R_rough_G_ao_B_grunge.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, ::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(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 5.44000006f, float3(0.352941006f, 0.870588005f, 0.0549019985f), 5.44000006f, false) : ::base::file_texture(texture_2d("./textures/concrete_wall_aged_R_rough_G_ao_B_grunge.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, ::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, roughness * 0.25f + 0.600000024f) + grunge_weight * (grunge_roughness * 0.600000024f + -0.300000012f) * float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 5.44000006f, float3(0.352941006f, 0.870588005f, 0.0549019985f), 5.44000006f, false) : ::base::file_texture(texture_2d("./textures/concrete_wall_aged_R_rough_G_ao_B_grunge.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, ::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(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 5.44000006f, float3(0.352941006f, 0.870588005f, 0.0549019985f), 5.44000006f, false) : ::base::file_texture(texture_2d("./textures/concrete_wall_aged_R_rough_G_ao_B_grunge.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, ::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, roughness * 0.25f + 0.600000024f) + grunge_weight * (grunge_roughness * 0.600000024f + -0.300000012f) * float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 5.44000006f, float3(0.352941006f, 0.870588005f, 0.0549019985f), 5.44000006f, false) : ::base::file_texture(texture_2d("./textures/concrete_wall_aged_R_rough_G_ao_B_grunge.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, ::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(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 5.44000006f, float3(0.352941006f, 0.870588005f, 0.0549019985f), 5.44000006f, false) : ::base::file_texture(texture_2d("./textures/concrete_wall_aged_R_rough_G_ao_B_grunge.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, ::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, roughness * 0.25f + 0.600000024f) + grunge_weight * (grunge_roughness * 0.600000024f + -0.300000012f) * float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 5.44000006f, float3(0.352941006f, 0.870588005f, 0.0549019985f), 5.44000006f, false) : ::base::file_texture(texture_2d("./textures/concrete_wall_aged_R_rough_G_ao_B_grunge.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, ::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::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_aged_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 5.44000006f, float3(0.576470971f, 0.560783982f, 0.517647028f), 5.44000006f, true) : ::base::file_texture(texture_2d("./textures/concrete_wall_aged_diff.jpg", ::tex::gamma_srgb), 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, ::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, grunge_tint, ::base::color_layer_multiply, float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 5.44000006f, float3(0.352941006f, 0.870588005f, 0.0549019985f), 5.44000006f, false) : ::base::file_texture(texture_2d("./textures/concrete_wall_aged_R_rough_G_ao_B_grunge.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, ::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] * grunge_weight).tint, color(0.f, 0.f, 0.f), ::base::color_layer_multiply, diffuse_brightness * -0.300000012f + 0.300000012f).tint, 0.f, ""), bsdf(), infinite_tiling ? endless_normal(texture_2d("./textures/concrete_wall_aged_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 5.44000006f, float3(0.5f, 0.5f, 1.f), 5.44000006f) : ::base::tangent_space_normal_texture(texture_2d("./textures/concrete_wall_aged_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), infinite_tiling ? endless_normal(texture_2d("./textures/concrete_wall_aged_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 5.44000006f, float3(0.5f, 0.5f, 1.f), 5.44000006f) : ::base::tangent_space_normal_texture(texture_2d("./textures/concrete_wall_aged_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
363
+ material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
364
+ color tmp3 = color(1.f, 1.f, 1.f);
365
+ 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));
366
+ 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());
367
+ hair_bsdf tmp6 = hair_bsdf();
368
+ } in
369
+ material(
370
+ thin_walled: tmp0,
371
+ surface: tmp1,
372
+ backface: tmp2,
373
+ ior: tmp3,
374
+ volume: tmp4,
375
+ geometry: tmp5,
376
+ hair: tmp6);
377
+
378
+
379
+ export material Concrete_Wall_Aged_Slight_Grunge(*)
380
+ [[
381
+ ::anno::description("An old concrete wall."),
382
+ ::anno::in_group("Concrete"),
383
+ ::anno::display_name("Concrete Wall Aged - Slight Grunge"),
384
+ ::anno::copyright_notice(COPYRIGHT),
385
+ ::anno::thumbnail("./.thumbs/Concrete_Wall_Aged.Concrete_Wall_Aged_Slight_Grunge.png"),
386
+ ::anno::key_words(string[]("concrete", "infinite tiling", "wall", "outdoor", "old", "construction", "aged", "paint", "worn", "scratched", "gray")),
387
+ ::anno::author("NVIDIA vMaterials"),
388
+ ::anno::contributor("Ruediger Raab"),
389
+ ::anno::contributor("Maik Rohland")
390
+ ]] = Concrete_Wall_Aged
391
+ (
392
+ infinite_tiling: false,
393
+ diffuse_brightness: 0.7f,
394
+ roughness: 0.33f,
395
+ bump_strength: 1.0f,
396
+ grunge_weight: 0.74f,
397
+ grunge_tint: color(0.0528f, 0.0399f, 0.0342f),
398
+ grunge_roughness: 0.81f,
399
+ texture_translate: float2(0.0f),
400
+ texture_rotate: 0.0f,
401
+ texture_scale: float2(1.0f),
402
+ roundcorners_enable: false,
403
+ roundcorners_radius_mm: 2.0f,
404
+ roundcorners_across_materials: false,
405
+ uv_space_index: 0
406
+ );
407
+
408
+
409
+ export material Concrete_Wall_Aged_Rough_Black_Grunge(*)
410
+ [[
411
+ ::anno::description("An old concrete wall."),
412
+ ::anno::in_group("Concrete"),
413
+ ::anno::display_name("Concrete Wall Aged - Black Grunge"),
414
+ ::anno::copyright_notice(COPYRIGHT),
415
+ ::anno::thumbnail("./.thumbs/Concrete_Wall_Aged.Concrete_Wall_Aged_Slight_Grunge.png"),
416
+ ::anno::key_words(string[]("concrete", "infinite tiling", "wall", "outdoor", "old", "construction", "aged", "paint", "worn", "grunge", "dirt", "dirty", "scratched", "gray")),
417
+ ::anno::author("NVIDIA vMaterials"),
418
+ ::anno::contributor("Ruediger Raab"),
419
+ ::anno::contributor("Maik Rohland")
420
+ ]] = Concrete_Wall_Aged
421
+ (
422
+ infinite_tiling: false,
423
+ diffuse_brightness: 0.7f,
424
+ roughness: 0.67f,
425
+ bump_strength: 1.0f,
426
+ grunge_weight: 1.0f,
427
+ grunge_tint: color(0.009696f, 0.005522f, 0.000992f),
428
+ grunge_roughness: 0.19f,
429
+ texture_translate: float2(0.0f),
430
+ texture_rotate: 0.0f,
431
+ texture_scale: float2(1.0f),
432
+ roundcorners_enable: false,
433
+ roundcorners_radius_mm: 2.0f,
434
+ roundcorners_across_materials: false,
435
+ uv_space_index: 0
436
+ );
code/third_party/vMaterials_2/Concrete/Concrete_Wall_Aged_Scratched.mdl ADDED
@@ -0,0 +1,462 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.5;
37
+
38
+ import ::anno::*;
39
+ import ::base::*;
40
+ import ::df::*;
41
+ import ::math::*;
42
+ import ::state::*;
43
+ import ::tex::*;
44
+ import ::nvidia::core_definitions::blend_colors;
45
+ import ::nvidia::core_definitions::dimension;
46
+
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
+
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
+ return ::base::texture_coordinate_info(
86
+ float3(r_position.x,r_position.y,r_position.z),
87
+ ::math::normalize(cos * coordinate.tangent_u - sin * coordinate.tangent_v),
88
+ ::math::normalize(cos * coordinate.tangent_v + sin * coordinate.tangent_u));
89
+ }
90
+
91
+ ::base::texture_coordinate_info vmat_transform(
92
+ float2 translation = float2(0.0, 0.0),
93
+ float rotation = 0.0, // rotation in degrees
94
+ float2 scaling = float2(1.0, 1.0),
95
+ uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw,
96
+ uniform int uv_space = 0
97
+ )
98
+ {
99
+ float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f;
100
+ float4x4 scale =
101
+ float4x4(1.0 /scaling.x, 0. , 0. , 0.,
102
+ 0. , 1.0 /scaling.y , 0. , 0.,
103
+ 0. , 0. , 1.0, 0.,
104
+ translation.x , translation.y , 0.0, 1.);
105
+
106
+ float s = ::math::sin(rotation_rad);
107
+ float c = ::math::cos(rotation_rad);
108
+ float4x4 rotate =
109
+ float4x4( c , -s , 0.0 , 0.0,
110
+ s , c , 0.0 , 0.0,
111
+ 0.0, 0.0 , 1.0 , 0.0,
112
+ 0. , 0.0 , 0.0 , 1.);
113
+
114
+ return transform_coordinate_2(scale*rotate, ::base::coordinate_source(system, uv_space));
115
+ }
116
+
117
+ float remap_xy_to_0_1(float input, float x, float y)
118
+ {
119
+ return (input - x)/(y - x);
120
+ }
121
+
122
+ float histogram_scan_big(float input, float width, float position)
123
+ {
124
+ return ::math::clamp(
125
+ remap_xy_to_0_1(input,
126
+ ::math::lerp(-width, 1.0, position),
127
+ ::math::lerp(0.0, 1.0 + width, position)),
128
+ 0.0,
129
+ 1.0);
130
+ }
131
+
132
+
133
+ float histogram_range(float input, float range, float position)
134
+ {
135
+ float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0);
136
+ float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0);
137
+ return ::math::lerp(low, high, input);
138
+ }
139
+
140
+
141
+
142
+ float uint2float(int x)
143
+ {
144
+ return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0);
145
+ }
146
+
147
+ int lowbias32(int x)
148
+ {
149
+ x ^= x >>> 16;
150
+ x *= 0x7feb352d;
151
+ x ^= x >>> 15;
152
+ x *= 0x846ca68b;
153
+ x ^= x >>> 16;
154
+ return x;
155
+ }
156
+
157
+ float2 rnd22(int2 p) {
158
+ float2 ret_val = float2(
159
+ uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f,
160
+ uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f
161
+ );
162
+ return ret_val;
163
+ }
164
+
165
+ float3 srgb2rgb(float3 val)
166
+ {
167
+ return ::math::pow(::math::max(val, float3(0.0f)), 2.2);
168
+ }
169
+
170
+ float2x2 invert_2x2(float2x2 M)
171
+ {
172
+ float det = M[0][0]*M[1][1] - M[0][1]*M[1][0];
173
+ //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/
174
+ return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]);
175
+ }
176
+
177
+ float3 nonrepeat_lookup(
178
+ uniform texture_2d texture = texture_2d(),
179
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
180
+ float texture_scale = 1.0,
181
+ float3 average_color = float3(0.5),
182
+ float patch_size = 8.0
183
+ )
184
+ {
185
+
186
+ float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale;
187
+ float Z = patch_size; // patch scale inside example texture
188
+ float CON = 1.0f;
189
+
190
+ float3 O = float3(0.f);
191
+ float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f);
192
+ float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space
193
+
194
+ float2 U = uv_in;
195
+ float2 V = M * uv_in; //pre-tilted hexa coordinates
196
+ int2 I = int2(::math::floor(V)); // hexa-tile id
197
+
198
+ // The mean color needs to be determined in Photoshop then to make the
199
+ // average color work out, take the float value and calculate the apropriate
200
+ // mean value as (value^(1/2.2))
201
+
202
+ float3 m = average_color;
203
+
204
+ float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W;
205
+ F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates
206
+
207
+ if( F[2] > 0.f )
208
+
209
+ O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON))
210
+ + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON))
211
+ + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON));
212
+ else
213
+ O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON))
214
+ + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON))
215
+ + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON));
216
+ O = m + O/::math::length(W);
217
+ O = ::math::clamp( (O), 0.0, 1.0);
218
+
219
+ return float3(O);
220
+ }
221
+
222
+ color endless_texture(
223
+ uniform texture_2d texture = texture_2d(),
224
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
225
+ float texture_scale = 10.0,
226
+ float3 average_color = float3(0.5, 0.5, 1.0),
227
+ float patch_size = 8.0,
228
+ bool gamma_correct_lookup = true
229
+ )
230
+ {
231
+ return gamma_correct_lookup ? color(srgb2rgb(
232
+ nonrepeat_lookup (
233
+ texture: texture,
234
+ uvw: uvw,
235
+ texture_scale: texture_scale,
236
+ average_color: average_color,
237
+ patch_size: patch_size
238
+ ))
239
+ ) : color(nonrepeat_lookup (
240
+ texture: texture,
241
+ uvw: uvw,
242
+ texture_scale: texture_scale,
243
+ average_color: average_color,
244
+ patch_size: patch_size
245
+ ));
246
+ }
247
+
248
+ float3 endless_normal(
249
+ uniform texture_2d texture = texture_2d(),
250
+ float factor = 1.0,
251
+ bool flip_tangent_u = false,
252
+ bool flip_tangent_v = false,
253
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
254
+ float texture_scale = 1.0,
255
+ float3 average_color = float3(0.5, 0.5, 1.0),
256
+ float patch_size = 8.0
257
+ )
258
+ {
259
+ float3 transformed_tangent_u = flip_tangent_u ? uvw.tangent_u : - uvw.tangent_u;
260
+ float3 transformed_tangent_v = flip_tangent_v ? uvw.tangent_v : - uvw.tangent_v;
261
+
262
+ if (flip_tangent_u)
263
+ transformed_tangent_u=-transformed_tangent_u;
264
+ if (flip_tangent_v)
265
+ transformed_tangent_v=-transformed_tangent_v;
266
+
267
+ // normalized Lookup
268
+ float3 tangent_space_normal =
269
+ (nonrepeat_lookup (
270
+ texture: texture,
271
+ uvw: uvw,
272
+ texture_scale: texture_scale,
273
+ average_color: average_color,
274
+ patch_size: patch_size
275
+ ) - 0.5) * (2.0 * factor);
276
+
277
+ return ::math::normalize(uvw.tangent_u * tangent_space_normal.x +
278
+ uvw.tangent_v * tangent_space_normal.y +
279
+ ::state::normal()*1.0);
280
+ }
281
+
282
+ export material Concrete_Wall_Aged_Scratched(
283
+ uniform bool infinite_tiling = false [[
284
+ ::anno::description("Enables infinite tiling feature which removes repeating texture patterns. Note that depending on the material this feature changes the appearance of the material slightly."),
285
+ ::anno::display_name("Infinite Tiling"),
286
+ ::anno::in_group("Appearance")
287
+ ]],
288
+ float diffuse_brightness = 1.f [[
289
+ ::anno::description("Adjusts the lightness of the material."),
290
+ ::anno::display_name("Diffuse Brightness"),
291
+ ::anno::in_group("Appearance"),
292
+ ::anno::hard_range(0.f, 1.f)
293
+ ]],
294
+ float roughness = 1.f [[
295
+ ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."),
296
+ ::anno::display_name("Roughness"),
297
+ ::anno::in_group("Appearance"),
298
+ ::anno::hard_range(0.f, 1.f)
299
+ ]],
300
+ float grunge = 0.f [[
301
+ ::anno::description("Adds a layer of grunge on top of the material."),
302
+ ::anno::display_name("Grunge"),
303
+ ::anno::in_group("Appearance"),
304
+ ::anno::hard_range(0.f, 1.f)
305
+ ]],
306
+ uniform float bump_strength = 1.f [[
307
+ ::anno::description("Specifies the strength of the bump."),
308
+ ::anno::display_name("Bump Strength"),
309
+ ::anno::in_group("Appearance"),
310
+ ::anno::soft_range(0.f, 2.f),
311
+ ::anno::hard_range(0.f, 3.f)
312
+ ]],
313
+ float2 texture_translate = float2(0.f) [[
314
+ ::anno::description("Controls the position of the texture."),
315
+ ::anno::display_name("Texture Translate"),
316
+ ::anno::in_group("Transform")
317
+ ]],
318
+ float texture_rotate = 0.f [[
319
+ ::anno::description("Rotates angle of the texture in degrees."),
320
+ ::anno::display_name("Texture Rotate"),
321
+ ::anno::in_group("Transform"),
322
+ ::anno::soft_range(0.f, 360.f)
323
+ ]],
324
+ float2 texture_scale = float2(1.f) [[
325
+ ::anno::description("Larger numbers increase the size."),
326
+ ::anno::display_name("Texture Scale"),
327
+ ::nvidia::core_definitions::dimension(float2(1.5, 1.5)),
328
+ ::anno::in_group("Transform")
329
+ ]],
330
+ uniform bool roundcorners_enable = false [[
331
+ ::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."),
332
+ ::anno::display_name("Enable Round Corners"),
333
+ ::anno::in_group("Round Corners")
334
+ ]],
335
+ uniform float roundcorners_radius_mm = 1.5f [[
336
+ ::anno::description("Radius of the rounded corners in millimeters."),
337
+ ::anno::display_name("Round Corner Radius (mm)"),
338
+ ::anno::in_group("Round Corners"),
339
+ ::anno::soft_range(0.f, 10.f)
340
+ ]],
341
+ uniform bool roundcorners_across_materials = false [[
342
+ ::anno::description("Applies the round corner effect across different materials when enabled."),
343
+ ::anno::display_name("Across Materials"),
344
+ ::anno::in_group("Round Corners")
345
+ ]],
346
+ uniform int uv_space_index = 0 [[
347
+ ::anno::description("Uses selected UV space for material."),
348
+ ::anno::display_name("UV Space Index"),
349
+ ::anno::in_group("Advanced")
350
+ ]]
351
+ )
352
+ [[
353
+ ::anno::description("A worn painted concrete wall that shows signs of damage."),
354
+ ::anno::in_group("Concrete"),
355
+ ::anno::display_name("Concrete Wall Aged Scratched - Rough"),
356
+ ::anno::copyright_notice(COPYRIGHT),
357
+ ::anno::thumbnail("./.thumbs/Concrete_Wall_Aged_Scratched.Concrete_Wall_Aged_Scratched.png"),
358
+ ::anno::key_words(string[]("concrete", "infinite tiling", "wall", "outdoor", "old", "construction", "aged", "paint", "worn", "scratched", "gray")),
359
+ ::anno::author("NVIDIA vMaterials"),
360
+ ::anno::contributor("Ruediger Raab"),
361
+ ::anno::contributor("Maik Rohland")
362
+ ]]
363
+ =
364
+ let {
365
+ material_surface tmp1(::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_aged_scratched_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.5999999f, float3(0.396077991f, 0.858824015f, 0.894118011f), 3.5999999f, false) : ::base::file_texture(texture_2d("./textures/concrete_wall_aged_scratched_R_rough_G_ao_B_grunge.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, ::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], 1.f, 0.649999976f), ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_aged_scratched_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.5999999f, float3(0.396077991f, 0.858824015f, 0.894118011f), 3.5999999f, false) : ::base::file_texture(texture_2d("./textures/concrete_wall_aged_scratched_R_rough_G_ao_B_grunge.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, ::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 - float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_aged_scratched_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.6f, float3(0.396f, 0.858f, 0.894f), 3.6f, false) : ::base::file_texture(texture_2d("./textures/concrete_wall_aged_scratched_R_rough_G_ao_B_grunge.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, ::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]) * (grunge * 0.299999982f), 1.f, roughness * 0.370000005f + 0.400000006f) * histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_aged_scratched_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.5999999f, float3(0.396077991f, 0.858824015f, 0.894118011f), 3.5999999f, false) : ::base::file_texture(texture_2d("./textures/concrete_wall_aged_scratched_R_rough_G_ao_B_grunge.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, ::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 - float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_aged_scratched_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.5999999f, float3(0.396077991f, 0.858824015f, 0.894118011f), 3.5999999f, false) : ::base::file_texture(texture_2d("./textures/concrete_wall_aged_scratched_R_rough_G_ao_B_grunge.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, ::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]) * (grunge * 0.299999982f), 1.f, roughness * 0.370000005f + 0.400000006f), histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_aged_scratched_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.5999999f, float3(0.396077991f, 0.858824015f, 0.894118011f), 3.5999999f, false) : ::base::file_texture(texture_2d("./textures/concrete_wall_aged_scratched_R_rough_G_ao_B_grunge.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, ::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 - float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_aged_scratched_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.5999999f, float3(0.396077991f, 0.858824015f, 0.894118011f), 3.5999999f, false) : ::base::file_texture(texture_2d("./textures/concrete_wall_aged_scratched_R_rough_G_ao_B_grunge.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, ::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]) * (grunge * 0.299999982f), 1.f, roughness * 0.370000005f + 0.400000006f) * histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_aged_scratched_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.5999999f, float3(0.396077991f, 0.858824015f, 0.894118011f), 3.5999999f, false) : ::base::file_texture(texture_2d("./textures/concrete_wall_aged_scratched_R_rough_G_ao_B_grunge.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, ::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 - float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_aged_scratched_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.5999999f, float3(0.396077991f, 0.858824015f, 0.894118011f), 3.5999999f, false) : ::base::file_texture(texture_2d("./textures/concrete_wall_aged_scratched_R_rough_G_ao_B_grunge.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, ::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]) * (grunge * 0.299999982f), 1.f, roughness * 0.370000005f + 0.400000006f), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_aged_scratched_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.5999999f, float3(0.596077979f, 0.568627f, 0.541176021f), 3.5999999f, true) : ::base::file_texture(texture_2d("./textures/concrete_wall_aged_scratched_diff.jpg", ::tex::gamma_srgb), 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, ::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, color(::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_aged_scratched_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.5999999f, float3(0.396077991f, 0.858824015f, 0.894118011f), 3.5999999f, false) : ::base::file_texture(texture_2d("./textures/concrete_wall_aged_scratched_R_rough_G_ao_B_grunge.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, ::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], 2.20000005f)), ::base::color_layer_multiply, grunge * 0.699999988f).tint, color(0.f, 0.f, 0.f), ::base::color_layer_multiply, diffuse_brightness * -0.300000012f + 0.300000012f).tint, 0.f), bsdf(), infinite_tiling ? endless_normal(texture_2d("./textures/concrete_wall_aged_scratched_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.5999999f, float3(0.501960993f, 0.505882025f, 0.988234997f), 3.5999999f) : ::base::tangent_space_normal_texture(texture_2d("./textures/concrete_wall_aged_scratched_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), infinite_tiling ? endless_normal(texture_2d("./textures/concrete_wall_aged_scratched_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.5999999f, float3(0.501960993f, 0.505882025f, 0.988234997f), 3.5999999f) : ::base::tangent_space_normal_texture(texture_2d("./textures/concrete_wall_aged_scratched_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
366
+ material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
367
+ color tmp3 = color(1.f, 1.f, 1.f);
368
+ 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));
369
+ 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());
370
+ } in
371
+ material(
372
+ thin_walled: false,
373
+ surface: tmp1,
374
+ backface: tmp2,
375
+ ior: tmp3,
376
+ volume: tmp4,
377
+ geometry: tmp5);
378
+
379
+
380
+
381
+ export material Concrete_Wall_Aged_Scratched_Shiny(*)
382
+ [[
383
+ ::anno::description("A worn painted concrete wall that shows signs of damage."),
384
+ ::anno::in_group("Concrete"),
385
+ ::anno::display_name("Concrete Wall Aged Scratched - Shiny"),
386
+ ::anno::copyright_notice(COPYRIGHT),
387
+ ::anno::thumbnail("./.thumbs/Concrete_Wall_Aged_Scratched.Concrete_Wall_Aged_Scratched_Shiny.png"),
388
+ ::anno::key_words(string[]("concrete", "infinite tiling", "wall", "outdoor", "old", "construction", "aged", "paint", "worn", "scratched", "gray")),
389
+ ::anno::author("NVIDIA vMaterials"),
390
+ ::anno::contributor("Ruediger Raab"),
391
+ ::anno::contributor("Maik Rohland")
392
+ ]] = Concrete_Wall_Aged_Scratched
393
+ (
394
+ infinite_tiling: true,
395
+ diffuse_brightness: 1.0f,
396
+ roughness: 0.03f,
397
+ grunge: 0.0f,
398
+ bump_strength: 1.0f,
399
+ texture_translate: float2(0.0f),
400
+ texture_rotate: 0.0f,
401
+ texture_scale: float2(1.0f),
402
+ roundcorners_enable: false,
403
+ roundcorners_radius_mm: 1.5f,
404
+ roundcorners_across_materials: false,
405
+ uv_space_index: 0
406
+ );
407
+
408
+
409
+ export material Concrete_Wall_Aged_Scratched_Medium_Grime(*)
410
+ [[
411
+ ::anno::description("A worn painted concrete wall that shows signs of damage."),
412
+ ::anno::in_group("Concrete"),
413
+ ::anno::display_name("Concrete Wall Aged Scratched - Medium Grime"),
414
+ ::anno::copyright_notice(COPYRIGHT),
415
+ ::anno::thumbnail("./.thumbs/Concrete_Wall_Aged_Scratched.Concrete_Wall_Aged_Scratched_Medium_Grime.png"),
416
+ ::anno::key_words(string[]("concrete", "infinite tiling", "wall", "outdoor", "old", "construction", "aged", "paint", "worn", "scratched", "gray")),
417
+ ::anno::author("NVIDIA vMaterials"),
418
+ ::anno::contributor("Ruediger Raab"),
419
+ ::anno::contributor("Maik Rohland")
420
+ ]] = Concrete_Wall_Aged_Scratched
421
+ (
422
+ infinite_tiling: true,
423
+ diffuse_brightness: 1.0f,
424
+ roughness: 0.8f,
425
+ grunge: 0.52f,
426
+ bump_strength: 1.0f,
427
+ texture_translate: float2(0.0f),
428
+ texture_rotate: 0.0f,
429
+ texture_scale: float2(1.0f),
430
+ roundcorners_enable: false,
431
+ roundcorners_radius_mm: 1.5f,
432
+ roundcorners_across_materials: false,
433
+ uv_space_index: 0
434
+ );
435
+
436
+
437
+ export material Concrete_Wall_Aged_Scratched_Heavy_Grime(*)
438
+ [[
439
+ ::anno::description("A worn painted concrete wall that shows signs of damage."),
440
+ ::anno::in_group("Concrete"),
441
+ ::anno::display_name("Concrete Wall Aged Scratched - Heavy Grime"),
442
+ ::anno::copyright_notice(COPYRIGHT),
443
+ ::anno::thumbnail("./.thumbs/Concrete_Wall_Aged_Scratched.Concrete_Wall_Aged_Scratched_Heavy_Grime.png"),
444
+ ::anno::key_words(string[]("concrete", "infinite tiling", "wall", "outdoor", "old", "construction", "aged", "paint", "dirty", "worn", "scratched", "gray")),
445
+ ::anno::author("NVIDIA vMaterials"),
446
+ ::anno::contributor("Ruediger Raab"),
447
+ ::anno::contributor("Maik Rohland")
448
+ ]] = Concrete_Wall_Aged_Scratched
449
+ (
450
+ infinite_tiling: true,
451
+ diffuse_brightness: .56f,
452
+ roughness: 0.71f,
453
+ grunge: 0.85f,
454
+ bump_strength: 1.0f,
455
+ texture_translate: float2(0.0f),
456
+ texture_rotate: 0.0f,
457
+ texture_scale: float2(1.0f),
458
+ roundcorners_enable: false,
459
+ roundcorners_radius_mm: 1.5f,
460
+ roundcorners_across_materials: false,
461
+ uv_space_index: 0
462
+ );
code/third_party/vMaterials_2/Concrete/Concrete_Wall_Even.mdl ADDED
@@ -0,0 +1,449 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.5;
37
+
38
+ import ::anno::*;
39
+ import ::base::*;
40
+ import ::df::*;
41
+ import ::math::*;
42
+ import ::state::*;
43
+ import ::tex::*;
44
+ import ::nvidia::core_definitions::blend_colors;
45
+ import ::nvidia::core_definitions::dimension;
46
+
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
+
62
+ ::base::texture_coordinate_info vmat_transform(
63
+ uniform float2 translation = float2(0.0, 0.0),
64
+ uniform float rotation = 0.0,
65
+ uniform float2 scaling = float2(1.0, 1.0),
66
+ uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw,
67
+ uniform int uv_space = 0
68
+ )
69
+ {
70
+ float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f;
71
+
72
+ float4x4 scale =
73
+ float4x4(1.0 /scaling.x, 0. , 0. , 0.,
74
+ 0. , 1.0 /scaling.y , 0. , 0.,
75
+ 0. , 0. , 1.0, 0.,
76
+ translation.x , translation.y , 0.0, 1.);
77
+
78
+ float s = ::math::sin(rotation_rad);
79
+ float c = ::math::cos(rotation_rad);
80
+ float4x4 rotate =
81
+ float4x4( c , -s , 0.0 , 0.0,
82
+ s , c , 0.0 , 0.0,
83
+ 0.0, 0.0 , 1.0 , 0.0,
84
+ 0. , 0.0 , 0.0 , 1.);
85
+
86
+ return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space));
87
+ }
88
+
89
+ float remap(float input, float low_1, float high_1, float low_2, float high_2)
90
+ {
91
+ return low_2 + ((input - low_1) * (high_2 - low_2))/(high_1 - low_1);
92
+ }
93
+
94
+ float histogram_scan(float input, float width, float position)
95
+ {
96
+ float low = ::math::clamp(1.0f - position * 2.0, 0.0f ,1.0f);
97
+ float high = ::math::clamp(position > 0.5f ? 1.0 : 2.0f - 2 * position, 0.0f, 1.0f);
98
+ //float center = (low + high)/2.0f);
99
+ float offset = ((high - low) / 2.0) * width;
100
+ low += offset;
101
+ high -= offset;
102
+ return ::math::clamp(
103
+ remap(input,
104
+ low,
105
+ high,
106
+ 0.0,
107
+ 1.0),
108
+ 0.0,
109
+ 1.0);
110
+ }
111
+
112
+
113
+ float histogram_range(float input, float range, float position)
114
+ {
115
+ float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0);
116
+ float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0);
117
+ return ::math::lerp(low, high, input);
118
+ }
119
+
120
+
121
+
122
+ float uint2float(int x)
123
+ {
124
+ return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0);
125
+ }
126
+
127
+ int lowbias32(int x)
128
+ {
129
+ x ^= x >>> 16;
130
+ x *= 0x7feb352d;
131
+ x ^= x >>> 15;
132
+ x *= 0x846ca68b;
133
+ x ^= x >>> 16;
134
+ return x;
135
+ }
136
+
137
+ float2 rnd22(int2 p) {
138
+ float2 ret_val = float2(
139
+ uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f,
140
+ uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f
141
+ );
142
+ return ret_val;
143
+ }
144
+
145
+ float3 srgb2rgb(float3 val)
146
+ {
147
+ return ::math::pow(::math::max(val, float3(0.0f)), 2.2);
148
+ }
149
+
150
+ float2x2 invert_2x2(float2x2 M)
151
+ {
152
+ float det = M[0][0]*M[1][1] - M[0][1]*M[1][0];
153
+ //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/
154
+ return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]);
155
+ }
156
+
157
+ float3 nonrepeat_lookup(
158
+ uniform texture_2d texture = texture_2d(),
159
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
160
+ float texture_scale = 1.0,
161
+ float3 average_color = float3(0.5),
162
+ float patch_size = 8.0
163
+ )
164
+ {
165
+
166
+ float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale;
167
+ float Z = patch_size; // patch scale inside example texture
168
+ float CON = 1.0f;
169
+
170
+ float3 O = float3(0.f);
171
+ float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f);
172
+ float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space
173
+
174
+ float2 U = uv_in;
175
+ float2 V = M * uv_in; //pre-tilted hexa coordinates
176
+ int2 I = int2(::math::floor(V)); // hexa-tile id
177
+
178
+ // The mean color needs to be determined in Photoshop then to make the
179
+ // average color work out, take the float value and calculate the apropriate
180
+ // mean value as (value^(1/2.2))
181
+
182
+ float3 m = average_color;
183
+
184
+ float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W;
185
+ F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates
186
+
187
+ if( F[2] > 0.f )
188
+
189
+ O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON))
190
+ + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON))
191
+ + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON));
192
+ else
193
+ O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON))
194
+ + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON))
195
+ + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON));
196
+ O = m + O/::math::length(W);
197
+ O = ::math::clamp( (O), 0.0, 1.0);
198
+
199
+ return float3(O);
200
+ }
201
+
202
+ color endless_texture(
203
+ uniform texture_2d texture = texture_2d(),
204
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
205
+ float texture_scale = 10.0,
206
+ float3 average_color = float3(0.5, 0.5, 1.0),
207
+ float patch_size = 8.0,
208
+ bool gamma_correct_lookup = true
209
+ )
210
+ {
211
+ return gamma_correct_lookup ? color(srgb2rgb(
212
+ nonrepeat_lookup (
213
+ texture: texture,
214
+ uvw: uvw,
215
+ texture_scale: texture_scale,
216
+ average_color: average_color,
217
+ patch_size: patch_size
218
+ ))
219
+ ) : color(nonrepeat_lookup (
220
+ texture: texture,
221
+ uvw: uvw,
222
+ texture_scale: texture_scale,
223
+ average_color: average_color,
224
+ patch_size: patch_size
225
+ ));
226
+ }
227
+
228
+ float3 endless_normal(
229
+ uniform texture_2d texture = texture_2d(),
230
+ float factor = 1.0,
231
+ bool flip_tangent_u = false,
232
+ bool flip_tangent_v = false,
233
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
234
+ float texture_scale = 1.0,
235
+ float3 average_color = float3(0.5, 0.5, 1.0),
236
+ float patch_size = 8.0
237
+ )
238
+ {
239
+ float3 transformed_tangent_u = flip_tangent_u ? uvw.tangent_u : - uvw.tangent_u;
240
+ float3 transformed_tangent_v = flip_tangent_v ? uvw.tangent_v : - uvw.tangent_v;
241
+
242
+ if (flip_tangent_u)
243
+ transformed_tangent_u=-transformed_tangent_u;
244
+ if (flip_tangent_v)
245
+ transformed_tangent_v=-transformed_tangent_v;
246
+
247
+ // normalized Lookup
248
+ float3 tangent_space_normal =
249
+ (nonrepeat_lookup (
250
+ texture: texture,
251
+ uvw: uvw,
252
+ texture_scale: texture_scale,
253
+ average_color: average_color,
254
+ patch_size: patch_size
255
+ ) - 0.5) * (2.0 * factor);
256
+
257
+ return ::math::normalize(uvw.tangent_u * tangent_space_normal.x +
258
+ uvw.tangent_v * tangent_space_normal.y +
259
+ ::state::normal()*1.0);
260
+ }
261
+
262
+
263
+ export material Concrete_Wall_Even(
264
+ uniform bool infinite_tiling = false [[
265
+ ::anno::description("Enables infinite tiling feature which removes repeating texture patterns. Note that depending on the material this feature changes the appearance of the material slightly."),
266
+ ::anno::display_name("Infinite Tiling"),
267
+ ::anno::in_group("Appearance")
268
+ ]],
269
+ color diffuse_tint = color(0.737205f) [[
270
+ ::anno::description("Choose the color of the concrete wall."),
271
+ ::anno::display_name("Diffuse Tint"),
272
+ ::anno::in_group("Appearance")
273
+ ]],
274
+ float diffuse_brightness = 0.65f [[
275
+ ::anno::description("Adjusts the lightness of the diffuse color."),
276
+ ::anno::display_name("Diffuse Brightness"),
277
+ ::anno::in_group("Appearance"),
278
+ ::anno::hard_range(0.f, 1.f)
279
+ ]],
280
+ float roughness = 0.62f [[
281
+ ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."),
282
+ ::anno::display_name("Roughness"),
283
+ ::anno::in_group("Appearance"),
284
+ ::anno::hard_range(0.f, 1.f)
285
+ ]],
286
+ float dirt_layer_weight = 0.0f [[
287
+ ::anno::description("Weight of the dirt layer."),
288
+ ::anno::display_name("Dirt Amount"),
289
+ ::anno::in_group("Appearance", "Dirt"),
290
+ ::anno::hard_range(0.f, 1.f)
291
+ ]],
292
+ color dirt_layer_color = color(0.6f, 0.6f, 0.6f) [[
293
+ ::anno::description("Set the color of the dirt layer."),
294
+ ::anno::display_name("Dirt Layer Color"),
295
+ ::anno::in_group("Appearance", "Dirt")
296
+ ]],
297
+ uniform float2 texture_translate = float2(0.f) [[
298
+ ::anno::description("Controls the position of the texture."),
299
+ ::anno::display_name("Texture Translate"),
300
+ ::anno::in_group("Transform")
301
+ ]],
302
+ uniform float texture_rotate = 0.f [[
303
+ ::anno::description("Rotates angle of the texture in degrees."),
304
+ ::anno::display_name("Texture Rotate"),
305
+ ::anno::in_group("Transform"),
306
+ ::anno::soft_range(0.f, 360.f)
307
+ ]],
308
+ uniform float2 texture_scale = float2(1.f) [[
309
+ ::anno::description("Larger numbers increase the size."),
310
+ ::anno::display_name("Texture Scale"),
311
+ ::nvidia::core_definitions::dimension(float2(1.5, 1.5)),
312
+ ::anno::in_group("Transform")
313
+ ]],
314
+ uniform bool roundcorners_enable = false [[
315
+ ::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."),
316
+ ::anno::display_name("Enable Round Corners"),
317
+ ::anno::in_group("Round Corners")
318
+ ]],
319
+ uniform float roundcorners_radius_mm = 1.5f [[
320
+ ::anno::description("Radius of the rounded corners in millimeters."),
321
+ ::anno::display_name("Round Corner Radius (mm)"),
322
+ ::anno::in_group("Round Corners"),
323
+ ::anno::soft_range(0.f, 10.f)
324
+ ]],
325
+ uniform bool roundcorners_across_materials = true [[
326
+ ::anno::description("Applies the round corner effect across different materials when enabled."),
327
+ ::anno::display_name("Across Materials"),
328
+ ::anno::in_group("Round Corners")
329
+ ]],
330
+ uniform int uv_space_index = 0 [[
331
+ ::anno::description("Uses selected UV space for material."),
332
+ ::anno::display_name("UV Space Index"),
333
+ ::anno::in_group("Transform")
334
+ ]]
335
+ )
336
+ [[
337
+ ::anno::description("A flat concrete wall."),
338
+ ::anno::in_group("Concrete"),
339
+ ::anno::display_name("Concrete Wall Even - Rough"),
340
+ ::anno::copyright_notice(COPYRIGHT),
341
+ ::anno::thumbnail("./.thumbs/Concrete_Wall_Even.Concrete_Wall_Even.png"),
342
+ ::anno::key_words(string[]("concrete", "wall", "outdoor", "indoor", "even", "new", "construction", "gray")),
343
+ ::anno::author("NVIDIA vMaterials"),
344
+ ::anno::contributor("Ruediger Raab"),
345
+ ::anno::contributor("Maik Rohland")
346
+ ]]
347
+ =
348
+ let {
349
+ bool tmp0 = false;
350
+ material_surface tmp1(::df::custom_curve_layer(0.0299999993f, 1.f, 5.f, histogram_scan(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_even_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.203922004f, 0.917647004f, 0.164706007f), 10.f, true) : ::base::file_texture(texture_2d("./textures/concrete_wall_even_R_rough_G_ao_B_grunge.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, ::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.919999957f, 0.109999999f), ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_even_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.203922004f, 0.917647004f, 0.164706007f), 10.f, true) : ::base::file_texture(texture_2d("./textures/concrete_wall_even_R_rough_G_ao_B_grunge.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, ::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] + float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_even_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.203922004f, 0.917647004f, 0.164706007f), 10.f, true) : ::base::file_texture(texture_2d("./textures/concrete_wall_even_R_rough_G_ao_B_grunge.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, ::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] * dirt_layer_weight * 0.50999999f, 1.f, roughness * 0.25f + 0.649999976f) * histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_even_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.203922004f, 0.917647004f, 0.164706007f), 10.f, true) : ::base::file_texture(texture_2d("./textures/concrete_wall_even_R_rough_G_ao_B_grunge.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, ::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] + float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_even_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.203922004f, 0.917647004f, 0.164706007f), 10.f, true) : ::base::file_texture(texture_2d("./textures/concrete_wall_even_R_rough_G_ao_B_grunge.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, ::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] * dirt_layer_weight * 0.50999999f, 1.f, roughness * 0.25f + 0.649999976f), histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_even_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.203922004f, 0.917647004f, 0.164706007f), 10.f, true) : ::base::file_texture(texture_2d("./textures/concrete_wall_even_R_rough_G_ao_B_grunge.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, ::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] + float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_even_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.203922004f, 0.917647004f, 0.164706007f), 10.f, true) : ::base::file_texture(texture_2d("./textures/concrete_wall_even_R_rough_G_ao_B_grunge.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, ::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] * dirt_layer_weight * 0.50999999f, 1.f, roughness * 0.25f + 0.649999976f) * histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_even_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.203922004f, 0.917647004f, 0.164706007f), 10.f, true) : ::base::file_texture(texture_2d("./textures/concrete_wall_even_R_rough_G_ao_B_grunge.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, ::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] + float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_even_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.203922004f, 0.917647004f, 0.164706007f), 10.f, true) : ::base::file_texture(texture_2d("./textures/concrete_wall_even_R_rough_G_ao_B_grunge.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, ::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] * dirt_layer_weight * 0.50999999f, 1.f, roughness * 0.25f + 0.649999976f), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_even_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.55686301f), 10.f, true) : ::base::file_texture(texture_2d("./textures/concrete_wall_even_diff.jpg", ::tex::gamma_srgb), 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, ::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, diffuse_tint, ::base::color_layer_overlay, 1.f).tint, dirt_layer_color, ::base::color_layer_multiply, float3(infinite_tiling ? endless_texture(texture_2d("./textures/concrete_wall_even_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.203922004f, 0.917647004f, 0.164706007f), 10.f, true) : ::base::file_texture(texture_2d("./textures/concrete_wall_even_R_rough_G_ao_B_grunge.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, ::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] * dirt_layer_weight).tint, color(0.f, 0.f, 0.f), ::base::color_layer_multiply, diffuse_brightness * -0.400000006f + 0.400000006f).tint, 0.f), bsdf(), infinite_tiling ? endless_normal(texture_2d("./textures/concrete_wall_even_norm.jpg", ::tex::gamma_linear), 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.498039007f, 0.498039007f, 0.996078014f), 10.f) : ::base::tangent_space_normal_texture(texture_2d("./textures/concrete_wall_even_norm.jpg", ::tex::gamma_linear), 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), infinite_tiling ? endless_normal(texture_2d("./textures/concrete_wall_even_norm.jpg", ::tex::gamma_linear), 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.498039007f, 0.498039007f, 0.996078014f), 10.f) : ::base::tangent_space_normal_texture(texture_2d("./textures/concrete_wall_even_norm.jpg", ::tex::gamma_linear), 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
351
+ material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
352
+ color tmp3 = color(1.f, 1.f, 1.f);
353
+ 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));
354
+ 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());
355
+ } in
356
+ material(
357
+ thin_walled: tmp0,
358
+ surface: tmp1,
359
+ backface: tmp2,
360
+ ior: tmp3,
361
+ volume: tmp4,
362
+ geometry: tmp5);
363
+
364
+ export material Concrete_Wall_Even_New_Shiny(*)
365
+ [[
366
+ ::anno::description("A flat concrete wall."),
367
+ ::anno::in_group("Concrete"),
368
+ ::anno::display_name("Concrete Wall Even - Shiny"),
369
+ ::anno::copyright_notice(COPYRIGHT),
370
+ ::anno::thumbnail("./.thumbs/Concrete_Wall_Even.Concrete_Wall_Even_New_Shiny.png"),
371
+ ::anno::key_words(string[]("concrete", "wall", "outdoor", "indoor", "even", "new", "shiny", "construction", "gray")),
372
+ ::anno::author("NVIDIA vMaterials"),
373
+ ::anno::contributor("Ruediger Raab"),
374
+ ::anno::contributor("Maik Rohland")
375
+ ]] = Concrete_Wall_Even
376
+ (
377
+ infinite_tiling: false,
378
+ diffuse_tint: color(0.6f, 0.6f, 0.6f),
379
+ diffuse_brightness: .65f,
380
+ roughness: .0f,
381
+ dirt_layer_weight: 0.0f,
382
+ dirt_layer_color: color(0.420508f, 0.378676f, 0.348865f),
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: 2.5f,
388
+ roundcorners_across_materials: false,
389
+ uv_space_index: 0
390
+ );
391
+
392
+
393
+
394
+ export material Concrete_Wall_Even_Brownish_Dirty(*)
395
+ [[
396
+ ::anno::description("A flat concrete wall with a brownish dirt layer on top."),
397
+ ::anno::in_group("Concrete"),
398
+ ::anno::display_name("Concrete Wall Even - Dirty Brownish"),
399
+ ::anno::copyright_notice(COPYRIGHT),
400
+ ::anno::thumbnail("./.thumbs/Concrete_Wall_Even.Concrete_Wall_Even_Brownish_Dirty.png"),
401
+ ::anno::key_words(string[]("concrete", "wall", "outdoor", "indoor", "even", "dirt", "dirty", "grunge", "construction", "gray")),
402
+ ::anno::author("NVIDIA vMaterials"),
403
+ ::anno::contributor("Ruediger Raab"),
404
+ ::anno::contributor("Maik Rohland")
405
+ ]] = Concrete_Wall_Even
406
+ (
407
+ infinite_tiling: false,
408
+ diffuse_tint: color(0.701170f, 0.645555f, 0.566810f),
409
+ diffuse_brightness: .65f,
410
+ roughness: .65f,
411
+ dirt_layer_weight: 1.0f,
412
+ dirt_layer_color: color(0.399293f, 0.358654f, 0.280124f),
413
+ texture_translate: float2(0.0f),
414
+ texture_rotate: 0.0f,
415
+ texture_scale: float2(1.0f),
416
+ roundcorners_enable: false,
417
+ roundcorners_radius_mm: 2.5f,
418
+ roundcorners_across_materials: false,
419
+ uv_space_index: 0
420
+ );
421
+
422
+
423
+ export material Concrete_Wall_Even_Greenish_Dirty(*)
424
+ [[
425
+ ::anno::description("A flat concrete wall."),
426
+ ::anno::in_group("Concrete"),
427
+ ::anno::display_name("Concrete Wall Even - Dirty Greenish"),
428
+ ::anno::copyright_notice(COPYRIGHT),
429
+ ::anno::thumbnail("./.thumbs/Concrete_Wall_Even.Concrete_Wall_Even_Greenish_Dirty.png"),
430
+ ::anno::key_words(string[]("concrete", "wall", "outdoor", "indoor", "even", "dirt", "dirty", "grunge", "construction", "gray")),
431
+ ::anno::author("NVIDIA vMaterials"),
432
+ ::anno::contributor("Ruediger Raab"),
433
+ ::anno::contributor("Maik Rohland")
434
+ ]] = Concrete_Wall_Even
435
+ (
436
+ infinite_tiling: false,
437
+ diffuse_tint: color(0.673049f, 0.701170f, 0.666117f),
438
+ diffuse_brightness: .65f,
439
+ roughness: .65f,
440
+ dirt_layer_weight: 1.0f,
441
+ dirt_layer_color: color(0.219520f, 0.271577f, 0.193972f),
442
+ texture_translate: float2(0.0f),
443
+ texture_rotate: 0.0f,
444
+ texture_scale: float2(1.0f),
445
+ roundcorners_enable: false,
446
+ roundcorners_radius_mm: 2.5f,
447
+ roundcorners_across_materials: false,
448
+ uv_space_index: 0
449
+ );
code/third_party/vMaterials_2/Concrete/Mortar.mdl ADDED
@@ -0,0 +1,626 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
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
+
74
+ /*
75
+ // Version 1
76
+ float4 r_position = float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1)* transform;
77
+ float4 r_tangent_u = float4(coordinate.tangent_u.x,coordinate.tangent_u.y,coordinate.tangent_u.z,1)* transform;
78
+ float4 r_tangent_v = float4(coordinate.tangent_v.x,coordinate.tangent_v.y,coordinate.tangent_v.z,1)* transform;
79
+ return ::base::texture_coordinate_info(
80
+ float3(r_position.x,r_position.y,r_position.z),
81
+ float3(r_tangent_u.x,r_tangent_u.y,r_tangent_u.z), // orthogonalization
82
+ float3(r_tangent_v.x,r_tangent_v.y,r_tangent_v.z));// orthogonalization
83
+ */
84
+
85
+ // Version 2
86
+ float4 r_position = transform * float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1);
87
+ //Try aproximating it for the case that the rotation is only aroud z and assuming the texture layout is nice and z is ~constant.
88
+ //just pretend there is no other rotation happening
89
+ //get rid of scaling and translation. Then extract fields where sin and cos would be in a simple 2d transform around z.
90
+ float4 u = transform[0];
91
+ float3 ru = ::math::normalize(float3(u.x,u.y,u.z));
92
+ float cos = ru.x;
93
+ float sin = -ru.y;
94
+ //TODO: at least also handle sign of z?
95
+ //TODO: handle tangent becoming 0
96
+
97
+
98
+ return ::base::texture_coordinate_info(
99
+ float3(r_position.x,r_position.y,r_position.z),
100
+ ::math::normalize(cos * coordinate.tangent_u - sin * coordinate.tangent_v),
101
+ ::math::normalize(cos * coordinate.tangent_v + sin * coordinate.tangent_u));
102
+ }
103
+
104
+ ::base::texture_coordinate_info vmat_transform(
105
+ float2 translation = float2(0.0, 0.0),
106
+ float rotation = 0.0, // rotation in degrees
107
+ float2 scaling = float2(1.0, 1.0),
108
+ uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw,
109
+ uniform int uv_space = 0
110
+ )
111
+ {
112
+ float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f;
113
+ float4x4 scale =
114
+ float4x4(1.0 /scaling.x, 0. , 0. , 0.,
115
+ 0. , 1.0 /scaling.y , 0. , 0.,
116
+ 0. , 0. , 1.0, 0.,
117
+ translation.x , translation.y , 0.0, 1.);
118
+
119
+ float s = ::math::sin(rotation_rad);
120
+ float c = ::math::cos(rotation_rad);
121
+ float4x4 rotate =
122
+ float4x4( c , -s , 0.0 , 0.0,
123
+ s , c , 0.0 , 0.0,
124
+ 0.0, 0.0 , 1.0 , 0.0,
125
+ 0. , 0.0 , 0.0 , 1.);
126
+
127
+ return transform_coordinate_2(scale*rotate, ::base::coordinate_source(system, uv_space));
128
+ }
129
+
130
+ float histogram_range(float input, float range = 1.0f, float position = 0.5f)
131
+ {
132
+ float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0);
133
+ float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0);
134
+ return ::math::lerp(low, high, input);
135
+ }
136
+
137
+
138
+ float remap_xy_to_0_1(float input, float x, float y)
139
+ {
140
+ return (input - x)/(y - x);
141
+ }
142
+
143
+ color remap(color input, color low, color high)
144
+ {
145
+ return low + input * (high - low);
146
+ }
147
+
148
+
149
+
150
+ float2x2 invert_2x2(float2x2 M)
151
+ {
152
+ float det = M[0][0]*M[1][1] - M[0][1]*M[1][0];
153
+ //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/
154
+ return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]);
155
+ }
156
+
157
+ int lowbias32(int x)
158
+ {
159
+ x ^= x >>> 16;
160
+ x *= 0x7feb352d;
161
+ x ^= x >>> 15;
162
+ x *= 0x846ca68b;
163
+ x ^= x >>> 16;
164
+ return x;
165
+ }
166
+
167
+
168
+ float uint2float(int x)
169
+ {
170
+ return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0);
171
+ }
172
+
173
+
174
+ float2 rnd22(int2 p) {
175
+ float2 ret_val = float2(
176
+ uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f,
177
+ uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f
178
+ );
179
+ return ret_val;
180
+ }
181
+
182
+ float3 srgb2rgb(float3 val)
183
+ {
184
+ return ::math::pow(::math::max(val, float3(0.0f)), 2.2);
185
+ }
186
+
187
+ float3 rgb2srgb(float3 val) [[ ::anno::unused() ]] {
188
+ return ::math::pow( ::math::max(val, float3(0.f)), float3(1./2.2) );
189
+ }
190
+
191
+
192
+ float3 nonrepeat_lookup(
193
+ uniform texture_2d texture = texture_2d(),
194
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
195
+ float texture_scale = 1.0,
196
+ float3 average_color = float3(0.5),
197
+ float patch_size = 8.0
198
+ )
199
+ {
200
+
201
+ float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale;
202
+ float Z = patch_size; // patch scale inside example texture
203
+
204
+ float3 O = float3(0.f);
205
+ float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f);
206
+ float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space
207
+
208
+ float2 U = uv_in;
209
+ float2 V = M * uv_in; //pre-tilted hexa coordinates
210
+ int2 I = int2(::math::floor(V)); // hexa-tile id
211
+
212
+ // The mean color needs to be determined in Photoshop then to make the
213
+ // average color work out, take the float value and calculate the apropriate
214
+ // mean value as (value^(1/2.2))
215
+
216
+ float3 m = average_color;
217
+
218
+ float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W;
219
+ F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates
220
+
221
+ if( F[2] > 0.f )
222
+ O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m)
223
+ + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m)
224
+ + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m);
225
+ else
226
+ O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m)
227
+ + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m)
228
+ + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m);
229
+ O = m + O/::math::length(W);
230
+ O = ::math::clamp( (O), 0.0, 1.0);
231
+
232
+ return float3(O);
233
+ }
234
+
235
+ color endless_texture(
236
+ uniform texture_2d texture = texture_2d(),
237
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
238
+ float texture_scale = 10.0,
239
+ float3 average_color = float3(0.5, 0.5, .5),
240
+ float patch_size = 8.0,
241
+ bool gamma_correct_lookup = true
242
+ )
243
+ {
244
+ return gamma_correct_lookup ? color(srgb2rgb(
245
+ nonrepeat_lookup (
246
+ texture: texture,
247
+ uvw: uvw,
248
+ texture_scale: texture_scale,
249
+ average_color: average_color,
250
+ patch_size: patch_size
251
+ ))
252
+ ) : color(nonrepeat_lookup (
253
+ texture: texture,
254
+ uvw: uvw,
255
+ texture_scale: texture_scale,
256
+ average_color: average_color,
257
+ patch_size: patch_size
258
+ ));
259
+ }
260
+
261
+ float3 endless_normal(
262
+ uniform texture_2d texture = texture_2d(),
263
+ float factor = 1.0,
264
+ bool flip_tangent_u = false,
265
+ bool flip_tangent_v = false,
266
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
267
+ float texture_scale = 10.0,
268
+ float3 average_color = float3(0.5, 0.5, 1.0),
269
+ float patch_size = 8.0
270
+ //bool srgb2rgb = false,
271
+ //bool rgb2srgb = false
272
+ )
273
+ {
274
+ float3 transformed_tangent_u = flip_tangent_u ? uvw.tangent_u : - uvw.tangent_u;
275
+ float3 transformed_tangent_v = flip_tangent_v ? uvw.tangent_v : - uvw.tangent_v;
276
+
277
+ if (flip_tangent_u)
278
+ transformed_tangent_u=-transformed_tangent_u;
279
+ if (flip_tangent_v)
280
+ transformed_tangent_v=-transformed_tangent_v;
281
+
282
+ // normalized Lookup
283
+ float3 tangent_space_normal =
284
+ (nonrepeat_lookup (
285
+ texture: texture,
286
+ uvw: uvw,
287
+ texture_scale: texture_scale,
288
+ average_color: average_color,
289
+ patch_size: patch_size
290
+ ) - 0.5) * (2.0 * factor);
291
+
292
+
293
+ return ::math::normalize(uvw.tangent_u * tangent_space_normal.x +
294
+ uvw.tangent_v * tangent_space_normal.y +
295
+ ::state::normal()*1.0);
296
+ //return ::state::normal();
297
+ }
298
+
299
+
300
+ float histogram_scan(float input, float width, float position)
301
+ {
302
+ float low = ::math::clamp(1.0f - position * 2.0, 0.0f ,1.0f);
303
+ float high = ::math::clamp(position > 0.5f ? 1.0 : 2.0f - 2 * position, 0.0f, 1.0f);
304
+ //float center = (low + high)/2.0f);
305
+ float offset = ((high - low) / 2.0) * width;
306
+ low += offset;
307
+ high -= offset;
308
+ return ::math::clamp(
309
+ remap_xy_to_0_1(input,
310
+ low,
311
+ high),
312
+ 0.0,
313
+ 1.0);
314
+ }
315
+
316
+
317
+
318
+
319
+ export material Mortar(
320
+ uniform bool infinite_tiling = true [[
321
+ ::anno::description("Enables infinite tiling feature which removes repeating texture patterns. Note that depending on the material this feature changes the appearance of the material slightly."),
322
+ ::anno::display_name("Infinite Tiling"),
323
+ ::anno::in_group("Appearance"),
324
+ ::anno::ui_order(0)
325
+ ]],
326
+ color mortar_tint = color(0.612066f) [[
327
+ ::anno::description("Choose a color to overlay the mortar with. Set to neutral gray for original tone."),
328
+ ::anno::display_name("Mortar Tint"),
329
+ ::anno::in_group("Appearance"),
330
+ ::anno::ui_order(1)
331
+ ]],
332
+
333
+ float brightness_adjust = 0.f [[
334
+ ::anno::description("Adjusts the final brightness of the grout."),
335
+ ::anno::display_name("Brightness"),
336
+ ::anno::in_group("Appearance"),
337
+ ::anno::hard_range(0.f, 1.f),
338
+ ::anno::ui_order(2)
339
+ ]],
340
+
341
+ float roughness = 0.71f [[
342
+ ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."),
343
+ ::anno::display_name("Roughness"),
344
+ ::anno::in_group("Appearance"),
345
+ ::anno::hard_range(0.f, 1.f),
346
+ ::anno::ui_order(3)
347
+ ]],
348
+ float diffuse_grain = 0.0f [[
349
+ ::anno::description("Darkens the mortar and adds a grainy overlay."),
350
+ ::anno::display_name("Diffuse Grain"),
351
+ ::anno::in_group("Appearance"),
352
+ ::anno::hard_range(0.f, 1.f),
353
+ ::anno::ui_order(4)
354
+ ]],
355
+ uniform float bump_strength = 0.78f [[
356
+ ::anno::description("Determines the degree of bumpiness."),
357
+ ::anno::display_name("Bump Strength"),
358
+ ::anno::in_group("Appearance"),
359
+ ::anno::hard_range(0.f, 2.f),
360
+ ::anno::soft_range(0.f, 1.f),
361
+ ::anno::ui_order(5)
362
+ ]],
363
+ float2 texture_translate = float2(0.f) [[
364
+ ::anno::description("Controls the position of the texture."),
365
+ ::anno::display_name("Texture Translate"),
366
+ ::anno::in_group("Transform"),
367
+ ::anno::ui_order(6)
368
+ ]],
369
+ float texture_rotate = 0.f [[
370
+ ::anno::description("Rotates angle of the texture in degrees."),
371
+ ::anno::display_name("Texture Rotate"),
372
+ ::anno::in_group("Transform"),
373
+ ::anno::soft_range(0.f, 360.f),
374
+ ::anno::ui_order(7)
375
+ ]],
376
+ float2 texture_scale = float2(1.f) [[
377
+ ::anno::description("Larger numbers increase the size."),
378
+ ::anno::display_name("Texture Scale"),
379
+ ::anno::in_group("Transform"),
380
+ ::nvidia::core_definitions::dimension(float2(.15f, .15f)),
381
+ ::anno::ui_order(8)
382
+ ]],
383
+ uniform int uv_space_index = 0 [[
384
+ ::anno::description("Uses selected UV space for material."),
385
+ ::anno::display_name("UV Space Index"),
386
+ ::anno::in_group("Advanced"),
387
+ ::anno::ui_order(9)
388
+ ]],
389
+ uniform bool roundcorners_enable = false [[
390
+ ::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."),
391
+ ::anno::display_name("Enable Round Corners"),
392
+ ::anno::in_group("Round Corners"),
393
+ ::anno::ui_order(10)
394
+ ]],
395
+ uniform float roundcorners_radius_mm = 1.5f [[
396
+ ::anno::description("Radius of the rounded corners in millimeters."),
397
+ ::anno::display_name("Round Corner Radius (mm)"),
398
+ ::anno::in_group("Round Corners"),
399
+ ::anno::soft_range(0.f, 10.f),
400
+ ::anno::ui_order(11)
401
+ ]],
402
+ uniform bool roundcorners_across_materials = true [[
403
+ ::anno::description("Applies the round corner effect across different materials when enabled."),
404
+ ::anno::display_name("Across Materials"),
405
+ ::anno::in_group("Round Corners"),
406
+ ::anno::ui_order(12)
407
+ ]]
408
+ )
409
+ [[
410
+ ::anno::description("Mortar material to fill grouts with."),
411
+ ::anno::display_name("Mortar Gray"),
412
+ ::anno::copyright_notice(COPYRIGHT),
413
+ ::anno::key_words(string[]("concrete", "mortar", "construction", "new", "cement", "hard", "rough", "new", "neutral", "gray")),
414
+ ::anno::author("NVIDIA vMaterials"),
415
+ ::anno::thumbnail("./.thumbs/Mortar.Mortar.png"),
416
+ ::anno::contributor("Ruediger Raab"),
417
+ ::anno::contributor("Maik Rohland")
418
+ ]]
419
+ =
420
+ let {
421
+ bool tmp0 = false;
422
+
423
+ material_surface tmp1(::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, histogram_scan(float3(infinite_tiling ? endless_texture(texture_2d("./textures/mortar_multi_R_rough_G_ao_B_noise.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.670588017f, 0.882353008f, 0.533333004f), 4.f, false) : ::base::file_texture(texture_2d("./textures/mortar_multi_R_rough_G_ao_B_noise.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, ::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.129999995f, ::math::lerp(0.140000001f, 0.50999999f, roughness)), ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/mortar_multi_R_rough_G_ao_B_noise.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.670588017f, 0.882353008f, 0.533333004f), 4.f, false) : ::base::file_texture(texture_2d("./textures/mortar_multi_R_rough_G_ao_B_noise.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, ::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.399999976f, 0.779999971f, roughness)) * histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/mortar_multi_R_rough_G_ao_B_noise.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.670588017f, 0.882353008f, 0.533333004f), 4.f, false) : ::base::file_texture(texture_2d("./textures/mortar_multi_R_rough_G_ao_B_noise.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, ::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.399999976f, 0.779999971f, roughness)), histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/mortar_multi_R_rough_G_ao_B_noise.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.670588017f, 0.882353008f, 0.533333004f), 4.f, false) : ::base::file_texture(texture_2d("./textures/mortar_multi_R_rough_G_ao_B_noise.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, ::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.399999976f, 0.779999971f, roughness)) * histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/mortar_multi_R_rough_G_ao_B_noise.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.670588017f, 0.882353008f, 0.533333004f), 4.f, false) : ::base::file_texture(texture_2d("./textures/mortar_multi_R_rough_G_ao_B_noise.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, ::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.399999976f, 0.779999971f, roughness)), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(remap(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(infinite_tiling ? endless_texture(texture_2d("./textures/mortar_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.517647028f, 0.517647028f, 0.513724983f), 4.f, true) : ::base::file_texture(texture_2d("./textures/mortar_diff.jpg", ::tex::gamma_srgb), 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, ::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, color(::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/mortar_multi_R_rough_G_ao_B_noise.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.670588017f, 0.882353008f, 0.533333004f), 4.f, false) : ::base::file_texture(texture_2d("./textures/mortar_multi_R_rough_G_ao_B_noise.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, ::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], 2.20000005f)), ::base::color_layer_multiply, 0.449999988f).tint, color(::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/mortar_multi_R_rough_G_ao_B_noise.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.670588017f, 0.882353008f, 0.533333004f), 4.f, false) : ::base::file_texture(texture_2d("./textures/mortar_multi_R_rough_G_ao_B_noise.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, ::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], 2.20000005f)), ::base::color_layer_hardlight, diffuse_grain).tint, color(brightness_adjust * 0.300000012f), color(1.f, 1.f, 1.f)), mortar_tint, ::base::color_layer_overlay, 1.f).tint, 0.f, ""), bsdf(), infinite_tiling ? endless_normal(texture_2d("./textures/mortar_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.501960993f, 0.498039007f, 0.964706004f), 4.f) : ::base::tangent_space_normal_texture(texture_2d("./textures/mortar_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), infinite_tiling ? endless_normal(texture_2d("./textures/mortar_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.501960993f, 0.498039007f, 0.964706004f), 4.f) : ::base::tangent_space_normal_texture(texture_2d("./textures/mortar_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
424
+ material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
425
+ color tmp3 = color(1.f, 1.f, 1.f);
426
+ 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));
427
+ 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());
428
+ } in
429
+ material(
430
+ thin_walled: tmp0,
431
+ surface: tmp1,
432
+ backface: tmp2,
433
+ ior: tmp3,
434
+ volume: tmp4,
435
+ geometry: tmp5);
436
+
437
+
438
+
439
+ export material Mortar_Moist(*)
440
+ [[
441
+ ::anno::description("Mortar material to fill grouts with."),
442
+ ::anno::display_name("Mortar Moist Gray"),
443
+ ::anno::copyright_notice(COPYRIGHT),
444
+ ::anno::key_words(string[]("concrete", "mortar", "construction", "new", "cement", "hard", "rough", "new", "neutral", "moist", "gray")),
445
+ ::anno::author("NVIDIA vMaterials"),
446
+ ::anno::thumbnail("./.thumbs/Mortar.Mortar_Moist.png"),
447
+ ::anno::contributor("Ruediger Raab"),
448
+ ::anno::contributor("Maik Rohland")
449
+ ]] = Mortar(
450
+ infinite_tiling: true,
451
+ mortar_tint: color(0.173439f),
452
+ brightness_adjust: 0.0f,
453
+ roughness: 0.0f,
454
+ diffuse_grain: 0.0f,
455
+ bump_strength: .78f,
456
+ texture_translate: float2(0.0f),
457
+ texture_rotate: 0.0f,
458
+ texture_scale: float2(1.0f),
459
+ uv_space_index: 0,
460
+ roundcorners_enable: false,
461
+ roundcorners_radius_mm: 1.5,
462
+ roundcorners_across_materials: true
463
+ );
464
+
465
+
466
+ export material Mortar_White(*)
467
+ [[
468
+ ::anno::description("Mortar material to fill grouts with."),
469
+ ::anno::display_name("Mortar White"),
470
+ ::anno::copyright_notice(COPYRIGHT),
471
+ ::anno::key_words(string[]("concrete", "mortar", "construction", "new", "cement", "hard", "rough", "new", "neutral", "light", "white")),
472
+ ::anno::author("NVIDIA vMaterials"),
473
+ ::anno::thumbnail("./.thumbs/Mortar.Mortar_White.png"),
474
+ ::anno::contributor("Ruediger Raab"),
475
+ ::anno::contributor("Maik Rohland")
476
+ ]] = Mortar(
477
+ infinite_tiling: true,
478
+ mortar_tint: color(0.974300f),
479
+ brightness_adjust: 0.23f,
480
+ roughness: 0.83f,
481
+ diffuse_grain: 0.0f,
482
+ bump_strength: .78f,
483
+ texture_translate: float2(0.0f),
484
+ texture_rotate: 0.0f,
485
+ texture_scale: float2(1.0f),
486
+ uv_space_index: 0,
487
+ roundcorners_enable: false,
488
+ roundcorners_radius_mm: 1.5,
489
+ roundcorners_across_materials: true
490
+ );
491
+
492
+
493
+
494
+ export material Mortar_Antique_White(*)
495
+ [[
496
+ ::anno::description("Mortar material to fill grouts with."),
497
+ ::anno::display_name("Mortar Antique White"),
498
+ ::anno::copyright_notice(COPYRIGHT),
499
+ ::anno::key_words(string[]("concrete", "mortar", "construction", "new", "cement", "hard", "rough", "new", "neutral", "light", "white")),
500
+ ::anno::author("NVIDIA vMaterials"),
501
+ ::anno::thumbnail("./.thumbs/Mortar.Mortar_Antique_White.png"),
502
+ ::anno::contributor("Ruediger Raab"),
503
+ ::anno::contributor("Maik Rohland")
504
+ ]] = Mortar(
505
+ infinite_tiling: true,
506
+ mortar_tint: color(1.000000f, 0.940601f, 0.766744f),
507
+ brightness_adjust: 0.44f,
508
+ roughness: 0.83f,
509
+ diffuse_grain: 0.0f,
510
+ bump_strength: .78f,
511
+ texture_translate: float2(0.0f),
512
+ texture_rotate: 0.0f,
513
+ texture_scale: float2(1.0f),
514
+ uv_space_index: 0,
515
+ roundcorners_enable: false,
516
+ roundcorners_radius_mm: 1.5,
517
+ roundcorners_across_materials: true
518
+ );
519
+
520
+
521
+ export material Mortar_Sand_White(*)
522
+ [[
523
+ ::anno::description("Mortar material to fill grouts with."),
524
+ ::anno::display_name("Mortar Sand White"),
525
+ ::anno::copyright_notice(COPYRIGHT),
526
+ ::anno::key_words(string[]("concrete", "mortar", "construction", "new", "cement", "hard", "rough", "new", "neutral", "sand", "light", "white")),
527
+ ::anno::author("NVIDIA vMaterials"),
528
+ ::anno::thumbnail("./.thumbs/Mortar.Mortar_Sand_White.png"),
529
+ ::anno::contributor("Ruediger Raab"),
530
+ ::anno::contributor("Maik Rohland")
531
+ ]] = Mortar(
532
+ infinite_tiling: true,
533
+ mortar_tint: color(1.000000f, 0.875138f, 0.673049f),
534
+ brightness_adjust: 0.18f,
535
+ roughness: 0.83f,
536
+ diffuse_grain: 0.0f,
537
+ bump_strength: .78f,
538
+ texture_translate: float2(0.0f),
539
+ texture_rotate: 0.0f,
540
+ texture_scale: float2(1.0f),
541
+ uv_space_index: 0,
542
+ roundcorners_enable: false,
543
+ roundcorners_radius_mm: 1.5,
544
+ roundcorners_across_materials: true
545
+ );
546
+
547
+
548
+ export material Mortar_Yellow(*)
549
+ [[
550
+ ::anno::description("Mortar material to fill grouts with."),
551
+ ::anno::display_name("Mortar Yellow"),
552
+ ::anno::copyright_notice(COPYRIGHT),
553
+ ::anno::key_words(string[]("concrete", "mortar", "construction", "new", "cement", "hard", "rough", "new", "warm", "yellow")),
554
+ ::anno::author("NVIDIA vMaterials"),
555
+ ::anno::thumbnail("./.thumbs/Mortar.Mortar_Yellow.png"),
556
+ ::anno::contributor("Ruediger Raab"),
557
+ ::anno::contributor("Maik Rohland")
558
+ ]] = Mortar(
559
+ infinite_tiling: true,
560
+ mortar_tint: color(1.000000f, 0.789314f, 0.470440f),
561
+ brightness_adjust: 0.22f,
562
+ roughness: 0.83f,
563
+ diffuse_grain: 0.0f,
564
+ bump_strength: .78f,
565
+ texture_translate: float2(0.0f),
566
+ texture_rotate: 0.0f,
567
+ texture_scale: float2(1.0f),
568
+ uv_space_index: 0,
569
+ roundcorners_enable: false,
570
+ roundcorners_radius_mm: 1.5,
571
+ roundcorners_across_materials: true
572
+ );
573
+
574
+
575
+ export material Mortar_Clay(*)
576
+ [[
577
+ ::anno::description("Mortar material to fill grouts with."),
578
+ ::anno::display_name("Mortar Clay"),
579
+ ::anno::copyright_notice(COPYRIGHT),
580
+ ::anno::key_words(string[]("concrete", "mortar", "construction", "new", "cement", "hard", "rough", "new", "warm", "clay")),
581
+ ::anno::author("NVIDIA vMaterials"),
582
+ ::anno::thumbnail("./.thumbs/Mortar.Mortar_Clay.png"),
583
+ ::anno::contributor("Ruediger Raab"),
584
+ ::anno::contributor("Maik Rohland")
585
+ ]] = Mortar(
586
+ infinite_tiling: true,
587
+ mortar_tint: color(0.941f, 0.53f, 0.41f),
588
+ brightness_adjust: 0.42f,
589
+ roughness: 0.83f,
590
+ diffuse_grain: 0.95f,
591
+ bump_strength: .78f,
592
+ texture_translate: float2(0.0f),
593
+ texture_rotate: 0.0f,
594
+ texture_scale: float2(1.0f),
595
+ uv_space_index: 0,
596
+ roundcorners_enable: false,
597
+ roundcorners_radius_mm: 1.5,
598
+ roundcorners_across_materials: true
599
+ );
600
+
601
+
602
+ export material Mortar_Tan(*)
603
+ [[
604
+ ::anno::description("Mortar material to fill grouts with."),
605
+ ::anno::display_name("Mortar Tan"),
606
+ ::anno::copyright_notice(COPYRIGHT),
607
+ ::anno::key_words(string[]("concrete", "mortar", "construction", "new", "cement", "hard", "rough", "new", "neutral", "brown", "tan")),
608
+ ::anno::author("NVIDIA vMaterials"),
609
+ ::anno::thumbnail("./.thumbs/Mortar.Mortar_Tan.png"),
610
+ ::anno::contributor("Ruediger Raab"),
611
+ ::anno::contributor("Maik Rohland")
612
+ ]] = Mortar(
613
+ infinite_tiling: true,
614
+ mortar_tint: color(0.598942f, 0.470440f, 0.358654f),
615
+ brightness_adjust: 0.42f,
616
+ roughness: 0.83f,
617
+ diffuse_grain: 0.95f,
618
+ bump_strength: .78f,
619
+ texture_translate: float2(0.0f),
620
+ texture_rotate: 0.0f,
621
+ texture_scale: float2(1.0f),
622
+ uv_space_index: 0,
623
+ roundcorners_enable: false,
624
+ roundcorners_radius_mm: 1.5,
625
+ roundcorners_across_materials: true
626
+ );
code/third_party/vMaterials_2/Concrete/Spongy_Concrete_Weathered.mdl ADDED
@@ -0,0 +1,467 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.4;
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 spongy, slightly worn concrete material";
62
+
63
+ ::base::texture_coordinate_info vmat_transform(
64
+ uniform float2 translation = float2(0.0, 0.0),
65
+ uniform float rotation = 0.0,
66
+ uniform float2 scaling = float2(1.0, 1.0),
67
+ uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw,
68
+ uniform int uv_space = 0
69
+ )
70
+ {
71
+ float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f;
72
+
73
+ float4x4 scale =
74
+ float4x4(1.0 /scaling.x, 0. , 0. , 0.,
75
+ 0. , 1.0 /scaling.y , 0. , 0.,
76
+ 0. , 0. , 1.0, 0.,
77
+ translation.x , translation.y , 0.0, 1.);
78
+
79
+ float s = ::math::sin(rotation_rad);
80
+ float c = ::math::cos(rotation_rad);
81
+ float4x4 rotate =
82
+ float4x4( c , -s , 0.0 , 0.0,
83
+ s , c , 0.0 , 0.0,
84
+ 0.0, 0.0 , 1.0 , 0.0,
85
+ 0. , 0.0 , 0.0 , 1.);
86
+
87
+ return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space));
88
+ }
89
+
90
+
91
+
92
+ float histogram_range(float input, float range, float position)
93
+ {
94
+ float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0);
95
+ float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0);
96
+ return ::math::lerp(low, high, input);
97
+ }
98
+
99
+ float remap_xy_to_0_1(float input, float x, float y)
100
+ {
101
+ return (input - x)/(y - x);
102
+ }
103
+
104
+ float histogram_scan_big(float input, float width, float position)
105
+ {
106
+ return ::math::clamp(
107
+ remap_xy_to_0_1(input,
108
+ ::math::lerp(-width, 1.0, position),
109
+ ::math::lerp(0.0, 1.0 + width, position)),
110
+ 0.0,
111
+ 1.0);
112
+ }
113
+
114
+
115
+
116
+ float uint2float(int x)
117
+ {
118
+ return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0);
119
+ }
120
+
121
+ int lowbias32(int x)
122
+ {
123
+ x ^= x >>> 16;
124
+ x *= 0x7feb352d;
125
+ x ^= x >>> 15;
126
+ x *= 0x846ca68b;
127
+ x ^= x >>> 16;
128
+ return x;
129
+ }
130
+
131
+ float2 rnd22(int2 p) {
132
+ float2 ret_val = float2(
133
+ uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f,
134
+ uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f
135
+ );
136
+ return ret_val;
137
+ }
138
+
139
+ float3 srgb2rgb(float3 val)
140
+ {
141
+ return ::math::pow(::math::max(val, float3(0.0f)), 2.2);
142
+ }
143
+
144
+ float2x2 invert_2x2(float2x2 M)
145
+ {
146
+ float det = M[0][0]*M[1][1] - M[0][1]*M[1][0];
147
+ //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/
148
+ return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]);
149
+ }
150
+
151
+ float3 nonrepeat_lookup(
152
+ uniform texture_2d texture = texture_2d(),
153
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
154
+ float texture_scale = 1.0,
155
+ float3 average_color = float3(0.5),
156
+ float patch_size = 8.0
157
+ )
158
+ {
159
+
160
+ float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale;
161
+ float Z = patch_size; // patch scale inside example texture
162
+ float CON = 1.0f;
163
+
164
+ float3 O = float3(0.f);
165
+ float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f);
166
+ float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space
167
+
168
+ float2 U = uv_in;
169
+ float2 V = M * uv_in; //pre-tilted hexa coordinates
170
+ int2 I = int2(::math::floor(V)); // hexa-tile id
171
+
172
+ // The mean color needs to be determined in Photoshop then to make the
173
+ // average color work out, take the float value and calculate the apropriate
174
+ // mean value as (value^(1/2.2))
175
+
176
+ float3 m = average_color;
177
+
178
+ float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W;
179
+ F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates
180
+
181
+ if( F[2] > 0.f )
182
+
183
+ O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON))
184
+ + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON))
185
+ + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON));
186
+ else
187
+ O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON))
188
+ + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON))
189
+ + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON));
190
+ O = m + O/::math::length(W);
191
+ O = ::math::clamp( (O), 0.0, 1.0);
192
+
193
+ return float3(O);
194
+ }
195
+
196
+ color endless_texture(
197
+ uniform texture_2d texture = texture_2d(),
198
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
199
+ float texture_scale = 10.0,
200
+ float3 average_color = float3(0.5, 0.5, 1.0),
201
+ float patch_size = 8.0,
202
+ bool gamma_correct_lookup = true
203
+ )
204
+ {
205
+ return gamma_correct_lookup ? color(srgb2rgb(
206
+ nonrepeat_lookup (
207
+ texture: texture,
208
+ uvw: uvw,
209
+ texture_scale: texture_scale,
210
+ average_color: average_color,
211
+ patch_size: patch_size
212
+ ))
213
+ ) : color(nonrepeat_lookup (
214
+ texture: texture,
215
+ uvw: uvw,
216
+ texture_scale: texture_scale,
217
+ average_color: average_color,
218
+ patch_size: patch_size
219
+ ));
220
+ }
221
+
222
+ float3 endless_normal(
223
+ uniform texture_2d texture = texture_2d(),
224
+ float factor = 1.0,
225
+ bool flip_tangent_u = false,
226
+ bool flip_tangent_v = false,
227
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
228
+ float texture_scale = 1.0,
229
+ float3 average_color = float3(0.5, 0.5, 1.0),
230
+ float patch_size = 8.0
231
+ )
232
+ {
233
+ float3 transformed_tangent_u = flip_tangent_u ? uvw.tangent_u : - uvw.tangent_u;
234
+ float3 transformed_tangent_v = flip_tangent_v ? uvw.tangent_v : - uvw.tangent_v;
235
+
236
+ if (flip_tangent_u)
237
+ transformed_tangent_u=-transformed_tangent_u;
238
+ if (flip_tangent_v)
239
+ transformed_tangent_v=-transformed_tangent_v;
240
+
241
+ // normalized Lookup
242
+ float3 tangent_space_normal =
243
+ (nonrepeat_lookup (
244
+ texture: texture,
245
+ uvw: uvw,
246
+ texture_scale: texture_scale,
247
+ average_color: average_color,
248
+ patch_size: patch_size
249
+ ) - 0.5) * (2.0 * factor);
250
+
251
+ return ::math::normalize(uvw.tangent_u * tangent_space_normal.x +
252
+ uvw.tangent_v * tangent_space_normal.y +
253
+ ::state::normal()*1.0);
254
+ }
255
+
256
+ float3 normalmap_normal(
257
+ uniform texture_2d texture,
258
+ float factor = 1.0,
259
+ ::base::texture_coordinate_info uvw = ::base::texture_coordinate_info()
260
+ )
261
+ {
262
+ float3 lookup = (::tex::lookup_float3(texture, float2(uvw.position.x, uvw.position.y)) - 0.5) * (factor * 2.0);
263
+ return ::math::normalize(uvw.tangent_u * lookup.x + uvw.tangent_v * lookup.y + ::state::normal());
264
+ }
265
+
266
+
267
+ export material Spongy_Concrete_Weathered(
268
+ uniform bool infinite_tiling = true [[
269
+ ::anno::display_name("Infinite Tiling"),
270
+ ::anno::description("Enables infinite tiling feature which removes repeating texture patterns."),
271
+ ::anno::in_group("Appearance")
272
+ ]],
273
+ float roughness = 0.12f [[
274
+ ::anno::display_name("Roughness"),
275
+ ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."),
276
+ ::anno::hard_range(0.0f, 1.0f),
277
+ ::anno::in_group("Appearance")
278
+ ]],
279
+ float concrete_brightness = 0.6f [[
280
+ ::anno::display_name("Brightness"),
281
+ ::anno::description("Adjusts the lightness of the material."),
282
+ ::anno::hard_range(0.0f, 1.0f),
283
+ ::anno::in_group("Appearance")
284
+ ]],
285
+ float wetness = 0.0f [[
286
+ ::anno::display_name("Wetness"),
287
+ ::anno::description("Adjusts the reflectivity of the water stains that flow down the material."),
288
+ ::anno::hard_range(0.0f, 1.0f),
289
+ ::anno::in_group("Appearance", "Wet Stains")
290
+ ]],
291
+ float water_darkening = 0.0 [[
292
+ ::anno::display_name("Water Darkening"),
293
+ ::anno::description("Adjusts the brightness of the water stains that flow down the material."),
294
+ ::anno::hard_range(0.0f, 1.0f),
295
+ ::anno::in_group("Appearance", "Wet Stains")
296
+ ]],
297
+ float dirt_deposit_amount = 0.0 [[
298
+ ::anno::display_name("Dirt Amount"),
299
+ ::anno::description("Adds a layer of dirt on top of the material."),
300
+ ::anno::hard_range(0.0f, 1.0f),
301
+ ::anno::in_group("Appearance", "Dirt Layer")
302
+ ]],
303
+ float dirt_brightness = 0.30f [[
304
+ ::anno::display_name("Dirt Brightness"),
305
+ ::anno::description("Adjusts the lightness of the dirt layer."),
306
+ ::anno::soft_range(0.0f, 1.0f),
307
+ ::anno::hard_range(0.0f, 2.0f),
308
+ ::anno::in_group("Appearance", "Dirt Layer")
309
+ ]],
310
+ float dirt_scale = 1.f [[
311
+ ::anno::display_name("Dirt Scale"),
312
+ ::anno::description("Adjusts the size of the dirt layer texture."),
313
+ ::anno::in_group("Appearance", "Dirt Layer")
314
+ ]],
315
+ uniform float2 texture_translate = float2(0.0f)
316
+ [[
317
+ ::anno::display_name("Translate"),
318
+ ::anno::description("Controls the position of the texture."),
319
+ ::anno::in_group("Adjustments")
320
+ ]],
321
+ uniform float texture_rotate = 0.f
322
+ [[
323
+ ::anno::display_name("Rotate"),
324
+ ::anno::description("Rotates angle of the texture in degrees."),
325
+ ::anno::in_group("Adjustments")
326
+ ]],
327
+ uniform float2 texture_scale = float2(1.0f)
328
+ [[
329
+ ::anno::display_name("Scale"),
330
+ ::anno::description("Larger numbers increase the size."),
331
+ ::nvidia::core_definitions::dimension(float2(1.0, 1.0)),
332
+ ::anno::in_group("Adjustments")
333
+ ]],
334
+ uniform int uv_space_index = 0 [[
335
+ ::anno::display_name("UV Space Index"),
336
+ ::anno::in_group("Advanced")
337
+ ]]
338
+ )
339
+ [[
340
+ ::anno::author("NVIDIA vMaterials"),
341
+ ::anno::display_name("Concrete Weathered - Shiny"),
342
+ ::anno::description(DESCRIPTION),
343
+ ::anno::copyright_notice(COPYRIGHT),
344
+ ::anno::thumbnail("./.thumbs/Spongy_Concrete_Weathered.Spongy_Concrete_Weathered.png"),
345
+ ::anno::key_words(string[]("aec", "concrete", "facade", "wall", "infinite tiling", "construction", "architecture", "exterior", "weathered", "worn", "aged", "multimaterial", "gray"))
346
+ ]]
347
+ =
348
+ let {
349
+ bool tmp0 = false;
350
+ float remap_dirt_deposit_amount = dirt_deposit_amount * 1.7;
351
+
352
+ material_surface tmp1(
353
+ ::df::weighted_layer(histogram_range(float3(endless_texture(texture_2d("./textures/spongy_concrete_weathered_mask_dirt.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 4.f / dirt_scale, float3(0.629999995f), 8.f, true))[0], 0.980000019f, ::math::lerp(1.f, 0.672000051f, remap_dirt_deposit_amount)), ::df::custom_curve_layer(0.0299999993f, 1.f, 5.f, ::math::pow(histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/spongy_concrete_weathered_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.513999999f, 0.875f, 0.787999988f), 8.f, false) : ::base::file_texture(texture_2d("./textures/spongy_concrete_weathered_multi_R_rough_G_ao_B_height.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, ::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.197000012f, 0.699999988f), 2.20000005f), ::df::microfacet_ggx_smith_bsdf((histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/spongy_concrete_weathered_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.513999999f, 0.875f, 0.787999988f), 8.f, false) : ::base::file_texture(texture_2d("./textures/spongy_concrete_weathered_multi_R_rough_G_ao_B_height.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, ::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], ::math::lerp(0.295000017f, 0.873000026f, roughness), ::math::lerp(0.5f, 0.951000035f, roughness)) - wetness * ::base::file_texture(texture_2d("./textures/spongy_concrete_weathered_mask_wet.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::transform_coordinate(::base::rotation_translation_scale(float3(0.f), float3(0.f), float3(1.f)), ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0))), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono) * (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/spongy_concrete_weathered_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.513999999f, 0.875f, 0.787999988f), 8.f, false) : ::base::file_texture(texture_2d("./textures/spongy_concrete_weathered_multi_R_rough_G_ao_B_height.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, ::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], ::math::lerp(0.295000017f, 0.873000026f, roughness), ::math::lerp(0.5f, 0.951000035f, roughness)) - wetness * ::base::file_texture(texture_2d("./textures/spongy_concrete_weathered_mask_wet.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::transform_coordinate(::base::rotation_translation_scale(float3(0.f), float3(0.f), float3(1.f)), ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0))), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono), (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/spongy_concrete_weathered_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.513999999f, 0.875f, 0.787999988f), 8.f, false) : ::base::file_texture(texture_2d("./textures/spongy_concrete_weathered_multi_R_rough_G_ao_B_height.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, ::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], ::math::lerp(0.295000017f, 0.873000026f, roughness), ::math::lerp(0.5f, 0.951000035f, roughness)) - wetness * ::base::file_texture(texture_2d("./textures/spongy_concrete_weathered_mask_wet.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::transform_coordinate(::base::rotation_translation_scale(float3(0.f), float3(0.f), float3(1.f)), ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0))), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono) * (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/spongy_concrete_weathered_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.513999999f, 0.875f, 0.787999988f), 8.f, false) : ::base::file_texture(texture_2d("./textures/spongy_concrete_weathered_multi_R_rough_G_ao_B_height.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, ::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], ::math::lerp(0.295000017f, 0.873000026f, roughness), ::math::lerp(0.5f, 0.951000035f, roughness)) - wetness * ::base::file_texture(texture_2d("./textures/spongy_concrete_weathered_mask_wet.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::transform_coordinate(::base::rotation_translation_scale(float3(0.f), float3(0.f), float3(1.f)), ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0))), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(::nvidia::core_definitions::blend_colors(infinite_tiling ? endless_texture(texture_2d("./textures/spongy_concrete_weathered_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.722000003f, 0.713999987f, 0.709999979f), 8.f, true) : ::base::file_texture(texture_2d("./textures/spongy_concrete_weathered_diff.jpg", ::tex::gamma_srgb), 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, ::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, color(::math::lerp(0.349999994f, 0.899999976f, concrete_brightness) - ::base::file_texture(texture_2d("./textures/spongy_concrete_weathered_mask_wet.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::transform_coordinate(::base::rotation_translation_scale(float3(0.f), float3(0.f), float3(1.f)), ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0))), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono * ::math::lerp(0.f, 0.561000049f, water_darkening)), ::base::color_layer_multiply, 1.f).tint, 0.f, ""), ::state::normal()), ::df::diffuse_reflection_bsdf(dirt_brightness * color(0.31854701f, 0.275550991f, 0.252952009f), 0.f, ""), ::state::normal()),
354
+ material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
355
+ material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
356
+ color tmp3 = color(1.f, 1.f, 1.f);
357
+ 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));
358
+ material_geometry tmp5(
359
+ float3(0.f),
360
+ 1.f,
361
+ infinite_tiling ? endless_normal(texture_2d("./textures/spongy_concrete_weathered_norm.jpg", ::tex::gamma_linear), 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.5f, 0.5f, 1.f), 8.f) : normalmap_normal(texture_2d("./textures/spongy_concrete_weathered_norm.jpg", ::tex::gamma_linear), 1.f, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index)));
362
+ } in
363
+ material(
364
+ thin_walled: tmp0,
365
+ surface: tmp1,
366
+ backface: tmp2,
367
+ ior: tmp3,
368
+ volume: tmp4,
369
+ geometry: tmp5);
370
+
371
+
372
+ // 2
373
+ export material Spongy_Concrete_Weathered_Rough(*)
374
+ [[
375
+ ::anno::author("NVIDIA vMaterials"),
376
+ ::anno::display_name("Concrete Weathered - Rough"),
377
+ ::anno::description(DESCRIPTION),
378
+ ::anno::copyright_notice(COPYRIGHT),
379
+ ::anno::thumbnail("./.thumbs/Spongy_Concrete_Weathered.Spongy_Concrete_Weathered_Rough.png"),
380
+ ::anno::key_words(string[]("aec", "concrete", "facade", "wall", "infinite tiling", "construction", "architecture", "exterior", "weathered", "worn", "aged", "multimaterial", "gray"))
381
+ ]] = Spongy_Concrete_Weathered (
382
+ infinite_tiling: true,
383
+ roughness: 0.75f,
384
+ concrete_brightness: 0.6f,
385
+ wetness: 0.0f,
386
+ water_darkening: 0.0f,
387
+ dirt_deposit_amount: 0.0f,
388
+ dirt_brightness: 0.0f,
389
+ dirt_scale: 1.f,
390
+ texture_translate: float2(0.0f),
391
+ texture_rotate: 0.f,
392
+ texture_scale: float2(1.0f),
393
+ uv_space_index: 0
394
+ );
395
+
396
+ // 3
397
+ export material Spongy_Concrete_Weathered_Dark_Dirt(*)
398
+ [[
399
+ ::anno::author("NVIDIA vMaterials"),
400
+ ::anno::display_name("Concrete Weathered - Dark Dirt"),
401
+ ::anno::description(DESCRIPTION),
402
+ ::anno::copyright_notice(COPYRIGHT),
403
+ ::anno::thumbnail("./.thumbs/Spongy_Concrete_Weathered.Spongy_Concrete_Weathered_Dark_Dirt.png"),
404
+ ::anno::key_words(string[]("aec", "concrete", "facade", "wall", "infinite tiling", "construction", "architecture", "exterior", "weathered", "worn", "aged", "multimaterial", "gray"))
405
+ ]] = Spongy_Concrete_Weathered (
406
+ infinite_tiling: true,
407
+ roughness: 0.55f,
408
+ concrete_brightness: 0.79f,
409
+ wetness: 0.0f,
410
+ water_darkening: 0.0f,
411
+ dirt_deposit_amount: 1.0f,
412
+ dirt_brightness: 0.2f,
413
+ dirt_scale: 1.f,
414
+ texture_translate: float2(0.0f),
415
+ texture_rotate: 0.f,
416
+ texture_scale: float2(1.0f),
417
+ uv_space_index: 0
418
+ );
419
+
420
+
421
+ // 4
422
+ export material Spongy_Concrete_Weathered_Light_Dirt(*)
423
+ [[
424
+ ::anno::author("NVIDIA vMaterials"),
425
+ ::anno::display_name("Concrete Weathered - Light Dirt"),
426
+ ::anno::description(DESCRIPTION),
427
+ ::anno::copyright_notice(COPYRIGHT),
428
+ ::anno::thumbnail("./.thumbs/Spongy_Concrete_Weathered.Spongy_Concrete_Weathered_Light_Dirt.png"),
429
+ ::anno::key_words(string[]("aec", "concrete", "facade", "wall", "infinite tiling", "construction", "architecture", "exterior", "weathered", "worn", "aged", "dirt", "multimaterial", "gray"))
430
+ ]] = Spongy_Concrete_Weathered (
431
+ infinite_tiling: true,
432
+ roughness: 0.55f,
433
+ concrete_brightness: 0.55f,
434
+ wetness: 0.0f,
435
+ water_darkening: 0.0f,
436
+ dirt_deposit_amount: 1.0f,
437
+ dirt_brightness: 0.8f,
438
+ dirt_scale: 1.f,
439
+ texture_translate: float2(0.0f),
440
+ texture_rotate: 0.f,
441
+ texture_scale: float2(1.0f),
442
+ uv_space_index: 0
443
+ );
444
+
445
+ // 5
446
+ export material Spongy_Concrete_Weathered_Wet_Flows(*)
447
+ [[
448
+ ::anno::author("NVIDIA vMaterials"),
449
+ ::anno::display_name("Concrete Weathered - Wet Flows"),
450
+ ::anno::description(DESCRIPTION),
451
+ ::anno::copyright_notice(COPYRIGHT),
452
+ ::anno::thumbnail("./.thumbs/Spongy_Concrete_Weathered.Spongy_Concrete_Weathered_Wet_Flows.png"),
453
+ ::anno::key_words(string[]("aec", "concrete", "facade", "wall", "infinite tiling", "construction", "architecture", "exterior", "weathered", "worn", "aged", "dirt", "multimaterial", "gray"))
454
+ ]] = Spongy_Concrete_Weathered (
455
+ infinite_tiling: true,
456
+ roughness: 0.69f,
457
+ concrete_brightness: 0.6f,
458
+ wetness: 0.8f,
459
+ water_darkening: 0.7f,
460
+ dirt_deposit_amount: 0.0f,
461
+ dirt_brightness: 0.25f,
462
+ dirt_scale: 1.f,
463
+ texture_translate: float2(0.0f),
464
+ texture_rotate: 0.f,
465
+ texture_scale: float2(1.0f),
466
+ uv_space_index: 0
467
+ );
code/third_party/vMaterials_2/Concrete/Spongy_Concrete_Weathered_Mossy.mdl ADDED
@@ -0,0 +1,393 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.4;
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 spongy concrete material with a worn, mossy appearance.";
62
+
63
+ ::base::texture_coordinate_info vmat_transform(
64
+ uniform float2 translation = float2(0.0, 0.0),
65
+ uniform float rotation = 0.0,
66
+ uniform float2 scaling = float2(1.0, 1.0),
67
+ uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw,
68
+ uniform int uv_space = 0
69
+ )
70
+ {
71
+ float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f;
72
+
73
+ float4x4 scale =
74
+ float4x4(1.0 /scaling.x, 0. , 0. , 0.,
75
+ 0. , 1.0 /scaling.y , 0. , 0.,
76
+ 0. , 0. , 1.0, 0.,
77
+ translation.x , translation.y , 0.0, 1.);
78
+
79
+ float s = ::math::sin(rotation_rad);
80
+ float c = ::math::cos(rotation_rad);
81
+ float4x4 rotate =
82
+ float4x4( c , -s , 0.0 , 0.0,
83
+ s , c , 0.0 , 0.0,
84
+ 0.0, 0.0 , 1.0 , 0.0,
85
+ 0. , 0.0 , 0.0 , 1.);
86
+
87
+ return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space));
88
+ }
89
+
90
+
91
+
92
+ float histogram_range(float input, float range, float position)
93
+ {
94
+ float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0);
95
+ float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0);
96
+ return ::math::lerp(low, high, input);
97
+ }
98
+
99
+ float remap_xy_to_0_1(float input, float x, float y)
100
+ {
101
+ return (input - x)/(y - x);
102
+ }
103
+
104
+ float histogram_scan_big(float input, float width, float position)
105
+ {
106
+ return ::math::clamp(
107
+ remap_xy_to_0_1(input,
108
+ ::math::lerp(-width, 1.0, position),
109
+ ::math::lerp(0.0, 1.0 + width, position)),
110
+ 0.0,
111
+ 1.0);
112
+ }
113
+
114
+
115
+
116
+ float uint2float(int x)
117
+ {
118
+ return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0);
119
+ }
120
+
121
+ int lowbias32(int x)
122
+ {
123
+ x ^= x >>> 16;
124
+ x *= 0x7feb352d;
125
+ x ^= x >>> 15;
126
+ x *= 0x846ca68b;
127
+ x ^= x >>> 16;
128
+ return x;
129
+ }
130
+
131
+ float2 rnd22(int2 p) {
132
+ float2 ret_val = float2(
133
+ uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f,
134
+ uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f
135
+ );
136
+ return ret_val;
137
+ }
138
+
139
+ float3 srgb2rgb(float3 val)
140
+ {
141
+ return ::math::pow(::math::max(val, float3(0.0f)), 2.2);
142
+ }
143
+
144
+ float2x2 invert_2x2(float2x2 M)
145
+ {
146
+ float det = M[0][0]*M[1][1] - M[0][1]*M[1][0];
147
+ //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/
148
+ return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]);
149
+ }
150
+
151
+ float3 nonrepeat_lookup(
152
+ uniform texture_2d texture = texture_2d(),
153
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
154
+ float texture_scale = 1.0,
155
+ float3 average_color = float3(0.5),
156
+ float patch_size = 8.0
157
+ )
158
+ {
159
+
160
+ float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale;
161
+ float Z = patch_size; // patch scale inside example texture
162
+ float CON = 1.0f;
163
+
164
+ float3 O = float3(0.f);
165
+ float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f);
166
+ float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space
167
+
168
+ float2 U = uv_in;
169
+ float2 V = M * uv_in; //pre-tilted hexa coordinates
170
+ int2 I = int2(::math::floor(V)); // hexa-tile id
171
+
172
+ // The mean color needs to be determined in Photoshop then to make the
173
+ // average color work out, take the float value and calculate the apropriate
174
+ // mean value as (value^(1/2.2))
175
+
176
+ float3 m = average_color;
177
+
178
+ float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W;
179
+ F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates
180
+
181
+ if( F[2] > 0.f )
182
+
183
+ O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON))
184
+ + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON))
185
+ + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON));
186
+ else
187
+ O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON))
188
+ + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON))
189
+ + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON));
190
+ O = m + O/::math::length(W);
191
+ O = ::math::clamp( (O), 0.0, 1.0);
192
+
193
+ return float3(O);
194
+ }
195
+
196
+ color endless_texture(
197
+ uniform texture_2d texture = texture_2d(),
198
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
199
+ float texture_scale = 10.0,
200
+ float3 average_color = float3(0.5, 0.5, 1.0),
201
+ float patch_size = 8.0,
202
+ bool gamma_correct_lookup = true
203
+ )
204
+ {
205
+ return gamma_correct_lookup ? color(srgb2rgb(
206
+ nonrepeat_lookup (
207
+ texture: texture,
208
+ uvw: uvw,
209
+ texture_scale: texture_scale,
210
+ average_color: average_color,
211
+ patch_size: patch_size
212
+ ))
213
+ ) : color(nonrepeat_lookup (
214
+ texture: texture,
215
+ uvw: uvw,
216
+ texture_scale: texture_scale,
217
+ average_color: average_color,
218
+ patch_size: patch_size
219
+ ));
220
+ }
221
+
222
+
223
+ float3 normalmap_normal(
224
+ uniform texture_2d texture,
225
+ float factor = 1.0,
226
+ ::base::texture_coordinate_info uvw = ::base::texture_coordinate_info()
227
+ )
228
+ {
229
+ float3 lookup = (::tex::lookup_float3(texture, float2(uvw.position.x, uvw.position.y)) - 0.5) * (factor * 2.0);
230
+ return ::math::normalize(uvw.tangent_u * lookup.x + uvw.tangent_v * lookup.y + ::state::normal());
231
+ }
232
+
233
+
234
+ export material Spongy_Concrete_Weathered_Mossy(
235
+ float roughness = 0.12f [[
236
+ ::anno::description("Adjusts the roughness of the material."),
237
+ ::anno::display_name("Roughness"),
238
+ ::anno::hard_range(0.0f, 1.0f),
239
+ ::anno::in_group("Appearance")
240
+ ]],
241
+ float brightness = 0.6f [[
242
+ ::anno::description("Adjusts the brightness of the material."),
243
+ ::anno::display_name("Brightness"),
244
+ ::anno::hard_range(0.0f, 1.0f),
245
+ ::anno::in_group("Appearance")
246
+ ]],
247
+ float bump_factor = 1.f [[
248
+ ::anno::description("Drives the intensity of the surface bump."),
249
+ ::anno::display_name("Bump Factor"),
250
+ ::anno::hard_range(0.0f, 1.0f),
251
+ ::anno::in_group("Appearance")
252
+ ]],
253
+ float dirt_amount = 0.f [[
254
+ ::anno::description("Adds a thin layer of dirt on top of the material."),
255
+ ::anno::display_name("Dirt Amount"),
256
+ ::anno::hard_range(0.0f, 1.0f),
257
+ ::anno::in_group("Appearance", "Dirt Layer")
258
+ ]],
259
+ float dirt_brightness = 0.0f [[
260
+ ::anno::description("Adjusts the brightness of the dirt layer."),
261
+ ::anno::display_name("Dirt Brightness"),
262
+ ::anno::hard_range(0.0f, 1.0f),
263
+ ::anno::in_group("Appearance", "Dirt Layer")
264
+ ]],
265
+ float dirt_scale = 1.f [[
266
+ ::anno::description("Scales the size of the dirt layer."),
267
+ ::anno::display_name("Dirt Scale"),
268
+ ::anno::in_group("Appearance", "Dirt Layer")
269
+ ]],
270
+ uniform float2 texture_translate = float2(0.0f)
271
+ [[
272
+ ::anno::display_name("Translate"),
273
+ ::anno::description("Controls the position of the texture."),
274
+ ::anno::in_group("Adjustments")
275
+ ]],
276
+ uniform float texture_rotate = 0.f
277
+ [[
278
+ ::anno::display_name("Rotate"),
279
+ ::anno::description("Rotates angle of the texture in degrees."),
280
+ ::anno::soft_range(0.0f, 360.0f),
281
+ ::anno::in_group("Adjustments")
282
+ ]],
283
+ uniform float2 texture_scale = float2(1.0f)
284
+ [[
285
+ ::anno::display_name("Scale"),
286
+ ::anno::description("Larger numbers increase the size."),
287
+ ::nvidia::core_definitions::dimension(float2(1.0, 1.0)),
288
+ ::anno::in_group("Adjustments")
289
+ ]],
290
+ uniform int uv_space_index = 0 [[
291
+ ::anno::description("Use the selected texture space."),
292
+ ::anno::display_name("UV Space Index"),
293
+ ::anno::in_group("Advanced")
294
+ ]]
295
+ )
296
+ [[
297
+ ::anno::author("NVIDIA vMaterials"),
298
+ ::anno::display_name("Concrete Spongy Weathered Mossy - Shiny"),
299
+ ::anno::description(DESCRIPTION),
300
+ ::anno::copyright_notice(COPYRIGHT),
301
+ ::anno::thumbnail("./.thumbs/Spongy_Concrete_Weathered_Mossy.Spongy_Concrete_Weathered_Mossy.png"),
302
+ ::anno::key_words(string[]("aec", "concrete", "facade", "wall", "construction", "architecture", "multimaterial", "exterior", "weathered", "aged", "mossy", "gray"))
303
+ ]]
304
+ =
305
+ let {
306
+ bool tmp0 = false;
307
+ material_surface tmp1(
308
+ ::df::weighted_layer(histogram_range(float3(endless_texture(texture_2d("./textures/spongy_concrete_dirt_mask.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.f / dirt_scale, float3(0.629999995f), 8.f, true))[0], 0.980000019f, ::math::lerp(1.f, 0.672000051f, dirt_amount)), ::df::custom_curve_layer(0.0299999993f, 1.f, 5.f, ::math::pow(histogram_scan_big(float3(::base::file_texture(texture_2d("./textures/spongy_concrete_weatheredMoss_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.354692012f, 0.354692012f, 0.354692012f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.178000003f, 0.338000029f), 2.20000005f), ::df::microfacet_ggx_smith_bsdf(histogram_range(histogram_scan_big(float3(::base::file_texture(texture_2d("./textures/spongy_concrete_weatheredMoss_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.354692012f, 0.354692012f, 0.354692012f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.611000001f, ::math::lerp(0.443000019f, 0.275000006f, roughness)), 1.f, ::math::lerp(0.638999999f, 0.75f, roughness)) * histogram_range(histogram_scan_big(float3(::base::file_texture(texture_2d("./textures/spongy_concrete_weatheredMoss_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.354692012f, 0.354692012f, 0.354692012f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.611000001f, ::math::lerp(0.443000019f, 0.275000006f, roughness)), 1.f, ::math::lerp(0.638999999f, 0.75f, roughness)), histogram_range(histogram_scan_big(float3(::base::file_texture(texture_2d("./textures/spongy_concrete_weatheredMoss_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.354692012f, 0.354692012f, 0.354692012f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.611000001f, ::math::lerp(0.443000019f, 0.275000006f, roughness)), 1.f, ::math::lerp(0.638999999f, 0.75f, roughness)) * histogram_range(histogram_scan_big(float3(::base::file_texture(texture_2d("./textures/spongy_concrete_weatheredMoss_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.354692012f, 0.354692012f, 0.354692012f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.611000001f, ::math::lerp(0.443000019f, 0.275000006f, roughness)), 1.f, ::math::lerp(0.638999999f, 0.75f, roughness)), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(::base::file_texture(texture_2d("./textures/spongy_concrete_weatheredMoss_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(::math::lerp(0.59800005f, 0.899999976f, brightness)), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, 0.f, ""), ::state::normal()), ::df::diffuse_reflection_bsdf(dirt_brightness * color(0.31854701f, 0.275550991f, 0.252952009f), 0.f, ""), ::state::normal()),
309
+ material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
310
+ material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
311
+ color tmp3 = color(1.f, 1.f, 1.f);
312
+ 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));
313
+ material_geometry tmp5(
314
+ float3(0.f),
315
+ 1.f,
316
+ normalmap_normal(texture_2d("./textures/spongy_concrete_weatheredMoss_norm.jpg", ::tex::gamma_linear), bump_factor, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index)));
317
+ } in
318
+ material(
319
+ thin_walled: tmp0,
320
+ surface: tmp1,
321
+ backface: tmp2,
322
+ ior: tmp3,
323
+ volume: tmp4,
324
+ geometry: tmp5);
325
+
326
+
327
+ // 2
328
+ export material Spongy_Concrete_Weathered_Mossy_Rough(*)
329
+ [[
330
+ ::anno::author("NVIDIA vMaterials"),
331
+ ::anno::display_name("Concrete Spongy Weathered Mossy - Rough"),
332
+ ::anno::description(DESCRIPTION),
333
+ ::anno::copyright_notice(COPYRIGHT),
334
+ ::anno::thumbnail("./.thumbs/Spongy_Concrete_Weathered_Mossy.Spongy_Concrete_Weathered_Mossy_Rough.png"),
335
+ ::anno::key_words(string[]("aec", "concrete", "facade", "wall", "construction", "architecture", "multimaterial", "exterior", "weathered", "aged", "mossy", "gray"))
336
+ ]] = Spongy_Concrete_Weathered_Mossy(
337
+ roughness: 0.75f,
338
+ brightness: 0.6f,
339
+ bump_factor: 1.0f,
340
+ dirt_amount: 0.0f,
341
+ dirt_brightness: 0.0f,
342
+ dirt_scale: 1.0f,
343
+ texture_translate: float2(0.0f),
344
+ texture_rotate: 0.0f,
345
+ texture_scale: float2(1.0f),
346
+ uv_space_index: 0
347
+ );
348
+
349
+
350
+ // 3
351
+ export material Spongy_Concrete_Weathered_Mossy_Dark_Dirt(*)
352
+ [[
353
+ ::anno::author("NVIDIA vMaterials"),
354
+ ::anno::display_name("Concrete Spongy Weathered Mossy - Dark Dirt"),
355
+ ::anno::description(DESCRIPTION),
356
+ ::anno::copyright_notice(COPYRIGHT),
357
+ ::anno::thumbnail("./.thumbs/Spongy_Concrete_Weathered_Mossy.Spongy_Concrete_Weathered_Mossy_Dark_Dirt.png"),
358
+ ::anno::key_words(string[]("aec", "concrete", "facade", "wall", "construction", "architecture", "multimaterial", "exterior", "weathered", "aged", "mossy", "dirt", "gray"))
359
+ ]] = Spongy_Concrete_Weathered_Mossy(
360
+ roughness: 0.55f,
361
+ brightness: 0.79f,
362
+ bump_factor: 1.0f,
363
+ dirt_amount: 1.0f,
364
+ dirt_brightness: 0.2f,
365
+ dirt_scale: 1.0f,
366
+ texture_translate: float2(0.0f),
367
+ texture_rotate: 0.0f,
368
+ texture_scale: float2(1.0f),
369
+ uv_space_index: 0
370
+ );
371
+
372
+
373
+ // 4
374
+ export material Spongy_Concrete_Weathered_Mossy_Light_Dirt(*)
375
+ [[
376
+ ::anno::author("NVIDIA vMaterials"),
377
+ ::anno::display_name("Concrete Spongy Weathered Mossy - Light Dirt"),
378
+ ::anno::description(DESCRIPTION),
379
+ ::anno::copyright_notice(COPYRIGHT),
380
+ ::anno::thumbnail("./.thumbs/Spongy_Concrete_Weathered_Mossy.Spongy_Concrete_Weathered_Mossy_Light_Dirt.png"),
381
+ ::anno::key_words(string[]("aec", "concrete", "facade", "wall", "construction", "architecture", "multimaterial", "exterior", "weathered", "aged", "mossy", "dirt", "gray"))
382
+ ]] = Spongy_Concrete_Weathered_Mossy(
383
+ roughness: 0.35f,
384
+ brightness: 0.59f,
385
+ bump_factor: 1.0f,
386
+ dirt_amount: 1.0f,
387
+ dirt_brightness: 0.9f,
388
+ dirt_scale: 1.0f,
389
+ texture_translate: float2(0.0f),
390
+ texture_rotate: 0.0f,
391
+ texture_scale: float2(1.0f),
392
+ uv_space_index: 0
393
+ );
code/third_party/vMaterials_2/Concrete/Stone_Pores_Weathered.mdl ADDED
@@ -0,0 +1,706 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ const string DESCRIPTION = "A stone wall material";
63
+
64
+
65
+
66
+ float remap(float input, float low_1, float high_1, float low_2, float high_2)
67
+ {
68
+ return low_2 + ((input - low_1) * (high_2 - low_2))/(high_1 - low_1);
69
+ }
70
+
71
+
72
+ float3 transform_internal_to_tangent(float3 n)
73
+ [[
74
+ ::anno::hidden()
75
+ ]]
76
+ {
77
+ return
78
+ n.x* float3(::state::texture_tangent_u(0).x,::state::texture_tangent_v(0).x,::state::normal().x)+
79
+ n.y* float3(::state::texture_tangent_u(0).y,::state::texture_tangent_v(0).y,::state::normal().y)+
80
+ n.z* float3(::state::texture_tangent_u(0).z,::state::texture_tangent_v(0).z,::state::normal().z);
81
+ }
82
+
83
+ // Returns the normal n in internal space, given n is in tangent space.
84
+ float3 transform_tangent_to_internal(float3 n)
85
+ [[
86
+ ::anno::hidden()
87
+ ]]
88
+ {
89
+ return ::state::texture_tangent_u(0) * n.x +
90
+ ::state::texture_tangent_v(0) * n.y +
91
+ ::state::normal() * n.z ;
92
+ }
93
+ ::base::texture_coordinate_info transform_coordinate_2(
94
+ float4x4 transform
95
+ [[ ::anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix.") ]],
96
+ ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info()
97
+ [[ ::anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection.") ]]
98
+ ) [[
99
+ ::anno::description("Transform a texture coordinate by a matrix.") ,
100
+ ::anno::noinline()
101
+ ]]
102
+ {
103
+
104
+ // Version 2
105
+ float4 r_position = transform * float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1);
106
+ //Try aproximating it for the case that the rotation is only aroud z and assuming the texture layout is nice and z is ~constant.
107
+ //just pretend there is no other rotation happening
108
+ //get rid of scaling and translation. Then extract fields where sin and cos would be in a simple 2d transform around z.
109
+ float4 u = transform[0];
110
+ float3 ru = ::math::normalize(float3(u.x,u.y,u.z));
111
+ float cos = ru.x;
112
+ float sin = -ru.y;
113
+
114
+
115
+ return ::base::texture_coordinate_info(
116
+ float3(r_position.x,r_position.y,r_position.z),
117
+ ::math::normalize(cos * coordinate.tangent_u - sin * coordinate.tangent_v),
118
+ ::math::normalize(cos * coordinate.tangent_v + sin * coordinate.tangent_u));
119
+ }
120
+
121
+
122
+ ::base::texture_coordinate_info vmat_transform(
123
+ float2 translation = float2(0.0, 0.0),
124
+ float rotation = 0.0, // rotation in degrees
125
+ float2 scaling = float2(1.0, 1.0),
126
+ uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw,
127
+ uniform int uv_space = 0
128
+ )
129
+ {
130
+ float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f;
131
+ float4x4 scale =
132
+ float4x4(1.0 /scaling.x, 0. , 0. , 0.,
133
+ 0. , 1.0 /scaling.y , 0. , 0.,
134
+ 0. , 0. , 1.0, 0.,
135
+ translation.x , translation.y , 0.0, 1.);
136
+
137
+ float s = ::math::sin(rotation_rad);
138
+ float c = ::math::cos(rotation_rad);
139
+ float4x4 rotate =
140
+ float4x4( c , -s , 0.0 , 0.0,
141
+ s , c , 0.0 , 0.0,
142
+ 0.0, 0.0 , 1.0 , 0.0,
143
+ 0. , 0.0 , 0.0 , 1.);
144
+
145
+ return transform_coordinate_2(scale*rotate, ::base::coordinate_source(system, uv_space));
146
+ }
147
+
148
+
149
+ float3 add_detail_normal(float3 nd = ::state::normal(), float3 n = ::state::normal())
150
+ {
151
+ // http://blog.selfshadow.com/publications/blending-in-detail/
152
+ float3 n_t = transform_internal_to_tangent(n);
153
+ float3 nd_t = transform_internal_to_tangent(nd);
154
+
155
+ n_t=n_t + float3(0.,0.,1.);
156
+ nd_t = nd_t * float3(-1.,-1.,1.);
157
+
158
+ n = n_t*::math::dot(n_t, nd_t)/n_t.z - nd_t;
159
+ return ::math::normalize(transform_tangent_to_internal(n));
160
+ }
161
+
162
+ float remap_xy_to_0_1(float input, float x, float y)
163
+ {
164
+ return (input - x)/(y - x);
165
+ }
166
+
167
+ float histogram_scan_small(float input, float width, float position)
168
+ {
169
+ return ::math::clamp(
170
+ remap_xy_to_0_1(input,
171
+ ::math::lerp(0.0, 1.0 - width, position),
172
+ ::math::lerp(width, 1.0 , position)),
173
+ 0.0,
174
+ 1.0);
175
+ }
176
+
177
+
178
+
179
+ float histogram_scan_big(float input, float width, float position)
180
+ {
181
+ return ::math::clamp(
182
+ remap_xy_to_0_1(input,
183
+ ::math::lerp(-width, 1.0, position),
184
+ ::math::lerp(0.0, 1.0 + width, position)),
185
+ 0.0,
186
+ 1.0);
187
+ }
188
+
189
+ int lowbias32(int x)
190
+ {
191
+ x ^= x >>> 16;
192
+ x *= 0x7feb352d;
193
+ x ^= x >>> 15;
194
+ x *= 0x846ca68b;
195
+ x ^= x >>> 16;
196
+ return x;
197
+ }
198
+
199
+ float uint2float(int x)
200
+ {
201
+ return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0);
202
+ }
203
+
204
+ float histogram_range(float input, float range = 1.0f, float position = 0.5f)
205
+ {
206
+ float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0);
207
+ float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0);
208
+ return ::math::lerp(low, high, input);
209
+ }
210
+
211
+
212
+
213
+ float2 rnd22(int2 p) {
214
+ float2 ret_val = float2(
215
+ uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f,
216
+ uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f
217
+ );
218
+ return ret_val;
219
+ }
220
+
221
+ float2x2 invert_2x2(float2x2 M)
222
+ {
223
+ float det = M[0][0]*M[1][1] - M[0][1]*M[1][0];
224
+ //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/
225
+ return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]);
226
+ }
227
+
228
+ color hue_shift(
229
+ color input = color(1.0, 0.0, 0.0),
230
+ float hue_adjust = 0.0f
231
+ )
232
+ {
233
+ float3 in_color = float3(input);
234
+ float3 kRGBToYPrime = float3 (0.299, 0.587, 0.114);
235
+ float3 kRGBToI = float3 (0.596, -0.275, -0.321);
236
+ float3 kRGBToQ = float3 (0.212, -0.523, 0.311);
237
+
238
+
239
+ //color converted = color(kRGBToQ);
240
+ float3 kYIQToR = float3 (1.0, 0.956, 0.621);
241
+ float3 kYIQToG = float3 (1.0, -0.272, -0.647);
242
+ float3 kYIQToB = float3 (1.0, -1.107, 1.704);
243
+
244
+ float YPrime = ::math::dot(in_color, kRGBToYPrime);
245
+ float I = ::math::dot(in_color, kRGBToI);
246
+ float Q = ::math::dot(in_color, kRGBToQ);
247
+ float hue = ::math::atan2(Q, I);
248
+ float chroma = ::math::sqrt(I * I + Q * Q);
249
+
250
+ hue += hue_adjust;
251
+
252
+ Q = chroma * ::math::sin(hue);
253
+ I = chroma * ::math::cos(hue);
254
+
255
+ float3 yIQ = float3 (YPrime, I, Q);
256
+
257
+ return color(::math::dot (yIQ, kYIQToR),::math::dot (yIQ, kYIQToG), ::math::dot (yIQ, kYIQToB) );
258
+ }
259
+
260
+ // Taken from https://www.shadertoy.com/view/4tlBWB
261
+ float3 hsv2rgb(float3 c)
262
+ {
263
+ float4 K = float4(1.0, 2.0/3.0, 1.0/3.0, 3.0);
264
+ float3 p = ::math::abs(::math::frac(float3(c.x) + float3(K.x, K.y, K.z)) * 6.0 - float3(K.w));
265
+ return c.z * ::math::lerp(float3(K.x), ::math::clamp(p - float3(K.x), 0.0, 1.0), c.y);
266
+ }
267
+
268
+
269
+ float3 srgb2rgb(float3 val)
270
+ {
271
+ return ::math::pow(::math::max(val, float3(0.0f)), 2.2);
272
+ }
273
+ float3 nonrepeat_lookup(
274
+ uniform texture_2d texture = texture_2d(),
275
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
276
+ float texture_scale = 1.0,
277
+ float3 average_color = float3(0.5),
278
+ float patch_size = 8.0
279
+ )
280
+ {
281
+
282
+ float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale;
283
+ float Z = patch_size; // patch scale inside example texture
284
+ float CON = 1.0f;
285
+
286
+ float3 O = float3(0.f);
287
+ float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f);
288
+ float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space
289
+
290
+ float2 U = uv_in;
291
+ float2 V = M * uv_in; //pre-tilted hexa coordinates
292
+ int2 I = int2(::math::floor(V)); // hexa-tile id
293
+
294
+ // The mean color needs to be determined in Photoshop then to make the
295
+ // average color work out, take the float value and calculate the apropriate
296
+ // mean value as (value^(1/2.2))
297
+
298
+ float3 m = average_color;
299
+
300
+ float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W;
301
+ F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates
302
+
303
+ if( F[2] > 0.f )
304
+
305
+ O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON))
306
+ + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON))
307
+ + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON));
308
+ else
309
+ O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON))
310
+ + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON))
311
+ + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON));
312
+ O = m + O/::math::length(W);
313
+ O = ::math::clamp( (O), 0.0, 1.0);
314
+
315
+ return float3(O);
316
+ }
317
+ color endless_texture(
318
+ uniform texture_2d texture = texture_2d(),
319
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
320
+ float texture_scale = 10.0,
321
+ float3 average_color = float3(0.5, 0.5, 1.0),
322
+ float patch_size = 8.0,
323
+ bool gamma_correct_lookup = true
324
+ )
325
+ {
326
+ return gamma_correct_lookup ? color(srgb2rgb(
327
+ nonrepeat_lookup (
328
+ texture: texture,
329
+ uvw: uvw,
330
+ texture_scale: texture_scale,
331
+ average_color: average_color,
332
+ patch_size: patch_size
333
+ ))
334
+ ) : color(nonrepeat_lookup (
335
+ texture: texture,
336
+ uvw: uvw,
337
+ texture_scale: texture_scale,
338
+ average_color: average_color,
339
+ patch_size: patch_size
340
+ ));
341
+ }
342
+
343
+
344
+
345
+ float3 endless_normal(
346
+ uniform texture_2d texture = texture_2d(),
347
+ float factor = 1.0,
348
+ bool flip_tangent_u = false,
349
+ bool flip_tangent_v = false,
350
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
351
+ float texture_scale = 1.0,
352
+ float3 average_color = float3(0.5, 0.5, 1.0),
353
+ float patch_size = 8.0
354
+ //bool srgb2rgb = false,
355
+ //bool rgb2srgb = false
356
+ )
357
+ {
358
+ float3 transformed_tangent_u = flip_tangent_u ? uvw.tangent_u : - uvw.tangent_u;
359
+ float3 transformed_tangent_v = flip_tangent_v ? uvw.tangent_v : - uvw.tangent_v;
360
+
361
+ if (flip_tangent_u)
362
+ transformed_tangent_u=-transformed_tangent_u;
363
+ if (flip_tangent_v)
364
+ transformed_tangent_v=-transformed_tangent_v;
365
+
366
+ // normalized Lookup
367
+ float3 tangent_space_normal =
368
+ (nonrepeat_lookup (
369
+ texture: texture,
370
+ uvw: uvw,
371
+ texture_scale: texture_scale,
372
+ average_color: average_color,
373
+ patch_size: patch_size
374
+ ) - 0.5) * (2.0 * factor);
375
+
376
+
377
+ return ::math::normalize(uvw.tangent_u * tangent_space_normal.x +
378
+ uvw.tangent_v * tangent_space_normal.y +
379
+ ::state::normal()*1.0);
380
+ //return ::state::normal();
381
+ }
382
+
383
+ export material Stone_Pores_Weathered(
384
+ uniform bool infinite_tiling = true [[
385
+ ::anno::description("Enables infinite tiling feature which removes repeating texture patterns. Note that depending on the material this feature changes the appearance of the material slightly.\t."),
386
+ ::anno::display_name("Infinite Tiling"),
387
+ ::anno::in_group("Appearance")
388
+ ]],
389
+ float stone_diffuse_brightness = 0.8f [[
390
+ ::anno::description("Adjusts the lightness of the stones and pebbles."),
391
+ ::anno::display_name("Brightness"),
392
+ ::anno::in_group("Appearance", "Stone"),
393
+ ::anno::hard_range(0.f, 1.f)
394
+ ]],
395
+ float reflection_roughness = 1.f [[
396
+ ::anno::description("Controls the roughness appearance. Smaller areas are highlighted."),
397
+ ::anno::display_name("Roughness"),
398
+ ::anno::in_group("Appearance", "Stone"),
399
+ ::anno::hard_range(0.f, 1.f)
400
+ ]],
401
+ uniform float stones_bump_strength = 1.f [[
402
+ ::anno::description("Drives the bumpiness of the stones."),
403
+ ::anno::display_name("Bump Strength"),
404
+ ::anno::in_group("Appearance", "Stone"),
405
+ ::anno::hard_range(0.f, 1.f)
406
+ ]],
407
+ float moss_brightness = 0.6f [[
408
+ ::anno::description("Adjusts the brightness of the moss."),
409
+ ::anno::display_name("Brightness"),
410
+ ::anno::in_group("Appearance", "Moss"),
411
+ ::anno::hard_range(0.f, 1.f)
412
+ ]],
413
+ float moss_saturation = 0.79f [[
414
+ ::anno::description("Controls the saturation of the moss."),
415
+ ::anno::display_name("Saturation"),
416
+ ::anno::in_group("Appearance", "Moss"),
417
+ ::anno::hard_range(0.f, 1.f)
418
+ ]],
419
+ float moss_distribution_amount = 0.f [[
420
+ ::anno::description("A lower value makes the moss grow more unevenly across the surface."),
421
+ ::anno::display_name("Coverage"),
422
+ ::anno::in_group("Appearance", "Moss"),
423
+ ::anno::hard_range(0.f, 1.f)
424
+ ]],
425
+ float moss_height_growth = 1.f [[
426
+ ::anno::description("Controls the growth of the moss material."),
427
+ ::anno::display_name("Growth"),
428
+ ::anno::in_group("Appearance", "Moss"),
429
+ ::anno::hard_range(0.f, 1.f)
430
+ ]],
431
+ float moss_weight = 1.f [[
432
+ ::anno::description("Decreasing this parameter makes the moss layer more transparent."),
433
+ ::anno::display_name("Weight"),
434
+ ::anno::in_group("Appearance", "Moss"),
435
+ ::anno::hard_range(0.f, 1.f)
436
+ ]],
437
+ float moss_moisture = 1.f [[
438
+ ::anno::description("Makes mossy areas more reflectivy to give them a wet appearance."),
439
+ ::anno::display_name("Moisture"),
440
+ ::anno::in_group("Appearance", "Moss"),
441
+ ::anno::hard_range(0.f, 1.f)
442
+ ]],
443
+ uniform float moss_bump_factor = 1.f [[
444
+ ::anno::description("Determines the degree of bumpiness of the moss."),
445
+ ::anno::display_name("Bump Strength"),
446
+ ::anno::in_group("Appearance", "Moss"),
447
+ ::anno::hard_range(0.f, 1.f)
448
+ ]],
449
+ float2 texture_translate = float2(0.f) [[
450
+ ::anno::description("Controls the position of the texture."),
451
+ ::anno::display_name("Translate"),
452
+ ::anno::in_group("Transform")
453
+ ]],
454
+ float texture_rotate = 0.f [[
455
+ ::anno::description("Rotates angle of the texture in degrees."),
456
+ ::anno::display_name("Rotate"),
457
+ ::anno::in_group("Transform")
458
+ ]],
459
+ float2 texture_scale = float2(0.5f) [[
460
+ ::anno::description("Larger numbers increase the size."),
461
+ ::anno::display_name("Scale"),
462
+ ::nvidia::core_definitions::dimension(float2(1.2f, 1.2f)),
463
+ ::anno::in_group("Transform")
464
+ ]],
465
+ uniform bool enable_round_corners = false [[
466
+ ::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."),
467
+ ::anno::display_name("Enable Round Corners"),
468
+ ::anno::in_group("Round Corners")
469
+ ]],
470
+ uniform bool across_materials = true [[
471
+ ::anno::description("Applies the round corner effect across different materials when enabled."),
472
+ ::anno::display_name("Across Materials"),
473
+ ::anno::in_group("Round Corners")
474
+ ]],
475
+ uniform float radius = 0.00200000009f [[
476
+ ::anno::description("Radius of the rounded corners in millimeters."),
477
+ ::anno::display_name("Round Corner Radius"),
478
+ ::anno::in_group("Round Corners")
479
+ ]],
480
+ uniform int uv_space_index = 0 [[
481
+ ::anno::description("Use selected UV space for material."),
482
+ ::anno::display_name("UV Space Index"),
483
+ ::anno::in_group("Advanced")
484
+ ]])
485
+ [[
486
+ ::anno::display_name("Stone Pores Weathered"),
487
+ ::anno::description(DESCRIPTION),
488
+ ::anno::copyright_notice(COPYRIGHT),
489
+ ::anno::key_words(string[]("dielectric", "infinite", "stone", "nature", "moss", "weathered", "pores", "wall", "exterior", "rough", "plant", "urban", "city", "industrial")),
490
+ ::anno::thumbnail("./.thumbs/Stone_Pores_Weathered.Stone_Pores_Weathered.png"),
491
+ ::anno::author("NVIDIA vMaterials"),
492
+ ::anno::contributor("Maik Rohland"),
493
+ ::anno::contributor("Ruediger Raab")
494
+ ]]
495
+ =
496
+ let {
497
+ bool tmp0 = false;
498
+ material_surface tmp1(::df::custom_curve_layer(0.0299999993f, 1.f, 5.f, histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./textures/multi_stone.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, ::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.209999993f, 0.75999999f), ::df::microfacet_ggx_smith_bsdf(::math::lerp(::math::lerp(::math::lerp(-0.419999987f, 1.75f, float3(::base::file_texture(texture_2d("./textures/multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0]), 0.75f - ::math::clamp(remap(float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./textures/multi_stone.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, ::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], 0.5f, 1.f, 0.f, 1.f), 0.f, 1.f) * ::math::lerp(1.20000005f, -1.f, reflection_roughness), histogram_scan_small(float3(::base::file_texture(texture_2d("./textures/multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.200000003f, 0.600000024f)), histogram_range(::math::lerp(1.f, 0.f, float3(::base::file_texture(texture_2d("./textures/multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), 0.48999998f, ::math::lerp(1.f, 0.680000007f, moss_moisture)), ::math::lerp(0.f, ::math::lerp(histogram_scan_big(float3(::base::file_texture(texture_2d("./textures/multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.379000008f, ::math::lerp(0.817000031f, 0.100000001f, moss_distribution_amount)), float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./textures/multi_stone.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, ::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::clamp(histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./textures/multi_stone.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, ::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], 0.150000006f, ::math::lerp(0.200000003f, 0.680000007f, moss_height_growth)), 0.f, 1.f)), ::math::lerp(0.f, 2.f, moss_weight))) * ::math::lerp(::math::lerp(::math::lerp(-0.419999987f, 1.75f, float3(::base::file_texture(texture_2d("./textures/multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0]), 0.75f - ::math::clamp(remap(float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./textures/multi_stone.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, ::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], 0.5f, 1.f, 0.f, 1.f), 0.f, 1.f) * ::math::lerp(1.20000005f, -1.f, reflection_roughness), histogram_scan_small(float3(::base::file_texture(texture_2d("./textures/multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.200000003f, 0.600000024f)), histogram_range(::math::lerp(1.f, 0.f, float3(::base::file_texture(texture_2d("./textures/multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), 0.48999998f, ::math::lerp(1.f, 0.680000007f, moss_moisture)), ::math::lerp(0.f, ::math::lerp(histogram_scan_big(float3(::base::file_texture(texture_2d("./textures/multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.379000008f, ::math::lerp(0.817000031f, 0.100000001f, moss_distribution_amount)), float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./textures/multi_stone.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, ::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::clamp(histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./textures/multi_stone.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, ::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], 0.150000006f, ::math::lerp(0.200000003f, 0.680000007f, moss_height_growth)), 0.f, 1.f)), ::math::lerp(0.f, 2.f, moss_weight))), ::math::lerp(::math::lerp(::math::lerp(-0.419999987f, 1.75f, float3(::base::file_texture(texture_2d("./textures/multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0]), 0.75f - ::math::clamp(remap(float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./textures/multi_stone.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, ::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], 0.5f, 1.f, 0.f, 1.f), 0.f, 1.f) * ::math::lerp(1.20000005f, -1.f, reflection_roughness), histogram_scan_small(float3(::base::file_texture(texture_2d("./textures/multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.200000003f, 0.600000024f)), histogram_range(::math::lerp(1.f, 0.f, float3(::base::file_texture(texture_2d("./textures/multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), 0.48999998f, ::math::lerp(1.f, 0.680000007f, moss_moisture)), ::math::lerp(0.f, ::math::lerp(histogram_scan_big(float3(::base::file_texture(texture_2d("./textures/multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.379000008f, ::math::lerp(0.817000031f, 0.100000001f, moss_distribution_amount)), float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./textures/multi_stone.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, ::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::clamp(histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./textures/multi_stone.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, ::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], 0.150000006f, ::math::lerp(0.200000003f, 0.680000007f, moss_height_growth)), 0.f, 1.f)), ::math::lerp(0.f, 2.f, moss_weight))) * ::math::lerp(::math::lerp(::math::lerp(-0.419999987f, 1.75f, float3(::base::file_texture(texture_2d("./textures/multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0]), 0.75f - ::math::clamp(remap(float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./textures/multi_stone.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, ::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], 0.5f, 1.f, 0.f, 1.f), 0.f, 1.f) * ::math::lerp(1.20000005f, -1.f, reflection_roughness), histogram_scan_small(float3(::base::file_texture(texture_2d("./textures/multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.200000003f, 0.600000024f)), histogram_range(::math::lerp(1.f, 0.f, float3(::base::file_texture(texture_2d("./textures/multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), 0.48999998f, ::math::lerp(1.f, 0.680000007f, moss_moisture)), ::math::lerp(0.f, ::math::lerp(histogram_scan_big(float3(::base::file_texture(texture_2d("./textures/multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.379000008f, ::math::lerp(0.817000031f, 0.100000001f, moss_distribution_amount)), float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./textures/multi_stone.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, ::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::clamp(histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./textures/multi_stone.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, ::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], 0.150000006f, ::math::lerp(0.200000003f, 0.680000007f, moss_height_growth)), 0.f, 1.f)), ::math::lerp(0.f, 2.f, moss_weight))), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(::math::lerp(nvidia::core_definitions::blend_colors(infinite_tiling ? endless_texture(texture_2d("./textures/stone_diff.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.49019599f, 0.466666996f, 0.435294002f), 8.f, true) : ::base::file_texture(texture_2d("./textures/stone_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, color(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./textures/multi_stone.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, ::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.5f, 0.200000003f)), ::base::color_layer_multiply, ::math::lerp(1.f, 0.f, stone_diffuse_brightness)).tint, hue_shift(nvidia::core_definitions::blend_colors(::base::file_texture(texture_2d("./textures/moss_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, color(::math::pow(hsv2rgb(float3(0.2214614f, ::math::lerp(0.f, 0.699999988f, moss_saturation), ::math::lerp(0.175000012f, 0.699999988f, moss_brightness))), 2.20000005f)), ::base::color_layer_overlay, 1.f).tint, 5.95100021f), moss_height_growth * ::math::lerp(histogram_scan_big(float3(::base::file_texture(texture_2d("./textures/multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.379000008f, ::math::lerp(0.817000031f, 0.100000001f, moss_distribution_amount)), float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./textures/multi_stone.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, ::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::clamp(histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./textures/multi_stone.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, ::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], 0.150000006f, ::math::lerp(0.200000003f, 0.680000007f, moss_height_growth)), 0.f, 1.f))), 0.f, ""), bsdf(), add_detail_normal(::math::lerp(::state::normal(), ::base::tangent_space_normal_texture(texture_2d("./textures/moss_norm.jpg", ::tex::gamma_linear), ::math::lerp(0.f, 2.f, moss_bump_factor), false, false, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f), ::math::lerp(0.f, 2.f, moss_weight) * ::math::lerp(histogram_scan_big(float3(::base::file_texture(texture_2d("./textures/multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.379000008f, ::math::lerp(0.817000031f, 0.100000001f, moss_distribution_amount)), float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./textures/multi_stone.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, ::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::clamp(histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./textures/multi_stone.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, ::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], 0.150000006f, ::math::lerp(0.200000003f, 0.680000007f, moss_height_growth)), 0.f, 1.f))), infinite_tiling ? endless_normal(texture_2d("./textures/stone_norm.jpg", ::tex::gamma_linear), ::math::lerp(0.f, 2.f, stones_bump_strength), false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 1.f, float3(0.498039007f, 0.501960993f, 0.882353008f), 3.f) : ::base::tangent_space_normal_texture(texture_2d("./textures/stone_norm.jpg", ::tex::gamma_linear), ::math::lerp(0.f, 2.f, stones_bump_strength), false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f))), add_detail_normal(::math::lerp(::state::normal(), ::base::tangent_space_normal_texture(texture_2d("./textures/moss_norm.jpg", ::tex::gamma_linear), ::math::lerp(0.f, 2.f, moss_bump_factor), false, false, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f), ::math::lerp(0.f, 2.f, moss_weight) * ::math::lerp(histogram_scan_big(float3(::base::file_texture(texture_2d("./textures/multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.379000008f, ::math::lerp(0.817000031f, 0.100000001f, moss_distribution_amount)), float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./textures/multi_stone.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, ::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::clamp(histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./textures/multi_stone.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, ::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], 0.150000006f, ::math::lerp(0.200000003f, 0.680000007f, moss_height_growth)), 0.f, 1.f))), infinite_tiling ? endless_normal(texture_2d("./textures/stone_norm.jpg", ::tex::gamma_linear), ::math::lerp(0.f, 2.f, stones_bump_strength), false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 1.f, float3(0.498039007f, 0.501960993f, 0.882353008f), 3.f) : ::base::tangent_space_normal_texture(texture_2d("./textures/stone_norm.jpg", ::tex::gamma_linear), ::math::lerp(0.f, 2.f, stones_bump_strength), false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f))), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
499
+ material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
500
+ color tmp3 = color(1.f, 1.f, 1.f);
501
+ material_geometry tmp5(float3(0.f), 1.f, enable_round_corners ? ::state::rounded_corner_normal(radius, across_materials, 1.f) : ::state::normal());
502
+ } in
503
+ material(
504
+ thin_walled: tmp0,
505
+ surface: tmp1,
506
+ backface: tmp2,
507
+ ior: tmp3,
508
+ geometry: tmp5);
509
+
510
+ export material Dry_Bright_Stone(*)
511
+ [[
512
+ ::anno::display_name("Dry Bright Stone"),
513
+ ::anno::description(DESCRIPTION),
514
+ ::anno::copyright_notice(COPYRIGHT),
515
+ ::anno::key_words(string[]("dielectric", "infinite", "stone", "nature", "moss", "weathered", "pores", "wall", "exterior", "rough", "plant", "urban", "city", "industrial", "dry", "bright")),
516
+ ::anno::thumbnail("./.thumbs/Stone_Pores_Weathered.Dry_Bright_Stone.png"),
517
+ ::anno::author("NVIDIA vMaterials"),
518
+ ::anno::contributor("Maik Rohland"),
519
+ ::anno::contributor("Ruediger Raab")
520
+ ]]
521
+ = Stone_Pores_Weathered
522
+ (
523
+ infinite_tiling: false,
524
+ stone_diffuse_brightness: 0.6f,
525
+ reflection_roughness: 0.7f,
526
+ stones_bump_strength: 1.f,
527
+ moss_brightness: 0.f,
528
+ moss_saturation: 0.f,
529
+ moss_distribution_amount: 0.f,
530
+ moss_height_growth: 0.f,
531
+ moss_weight: 0.f,
532
+ moss_moisture: 0.f,
533
+ moss_bump_factor: 0.f,
534
+ texture_translate: float2(0.0f),
535
+ texture_rotate: 0.0f,
536
+ texture_scale: float2(1.0f),
537
+ enable_round_corners: false,
538
+ radius: 1.5f,
539
+ across_materials: true,
540
+ uv_space_index: 0
541
+ );
542
+
543
+ export material Matte_Stone(*)
544
+ [[
545
+ ::anno::display_name("Matte Stone"),
546
+ ::anno::description(DESCRIPTION),
547
+ ::anno::copyright_notice(COPYRIGHT),
548
+ ::anno::key_words(string[]("dielectric", "infinite", "stone", "nature", "moss", "weathered", "pores", "wall", "exterior", "rough", "plant", "urban", "city", "industrial", "dry", "matte")),
549
+ ::anno::thumbnail("./.thumbs/Stone_Pores_Weathered.Matte_Stone.png"),
550
+ ::anno::author("NVIDIA vMaterials"),
551
+ ::anno::contributor("Maik Rohland"),
552
+ ::anno::contributor("Ruediger Raab")
553
+ ]]
554
+ = Stone_Pores_Weathered
555
+ (
556
+ infinite_tiling: false,
557
+ stone_diffuse_brightness: 0.2f,
558
+ reflection_roughness: 0.f,
559
+ stones_bump_strength: 0.8f,
560
+ moss_brightness: 0.f,
561
+ moss_saturation: 0.f,
562
+ moss_distribution_amount: 0.f,
563
+ moss_height_growth: 0.f,
564
+ moss_weight: 0.f,
565
+ moss_moisture: 0.f,
566
+ moss_bump_factor: 0.f,
567
+ texture_translate: float2(0.0f),
568
+ texture_rotate: 0.0f,
569
+ texture_scale: float2(1.0f),
570
+ enable_round_corners: false,
571
+ radius: 1.5f,
572
+ across_materials: true,
573
+ uv_space_index: 0
574
+ );
575
+
576
+ export material Slightly_Grown_Moss(*)
577
+ [[
578
+ ::anno::display_name("Slightly Grown Moss"),
579
+ ::anno::description(DESCRIPTION),
580
+ ::anno::copyright_notice(COPYRIGHT),
581
+ ::anno::key_words(string[]("dielectric", "infinite", "stone", "nature", "moss", "weathered", "pores", "wall", "exterior", "rough", "plant", "urban", "city", "industrial", "dry", "slightly", "grown")),
582
+ ::anno::thumbnail("./.thumbs/Stone_Pores_Weathered.Slightly_Grown_Moss.png"),
583
+ ::anno::author("NVIDIA vMaterials"),
584
+ ::anno::contributor("Maik Rohland"),
585
+ ::anno::contributor("Ruediger Raab")
586
+ ]]
587
+ = Stone_Pores_Weathered
588
+ (
589
+ infinite_tiling: false,
590
+ stone_diffuse_brightness: 1.f,
591
+ reflection_roughness: 0.8f,
592
+ stones_bump_strength: 0.5f,
593
+ moss_brightness: 0.8f,
594
+ moss_saturation: 0.89f,
595
+ moss_distribution_amount: 1.f,
596
+ moss_height_growth: 0.55f,
597
+ moss_weight: 1.f,
598
+ moss_moisture: 0.5f,
599
+ moss_bump_factor: 1.f,
600
+ texture_translate: float2(0.0f),
601
+ texture_rotate: 0.0f,
602
+ texture_scale: float2(1.0f),
603
+ enable_round_corners: false,
604
+ radius: 1.5f,
605
+ across_materials: true,
606
+ uv_space_index: 0
607
+ );
608
+
609
+ export material Soft_Grown_Moss(*)
610
+ [[
611
+ ::anno::display_name("Soft Grown Moss"),
612
+ ::anno::description(DESCRIPTION),
613
+ ::anno::copyright_notice(COPYRIGHT),
614
+ ::anno::key_words(string[]("dielectric", "infinite", "stone", "nature", "moss", "weathered", "pores", "wall", "exterior", "rough", "plant", "urban", "city", "industrial", "dry", "soft", "grown")),
615
+ ::anno::thumbnail("./.thumbs/Stone_Pores_Weathered.Soft_Grown_Moss.png"),
616
+ ::anno::author("NVIDIA vMaterials"),
617
+ ::anno::contributor("Maik Rohland"),
618
+ ::anno::contributor("Ruediger Raab")
619
+ ]]
620
+ = Stone_Pores_Weathered
621
+ (
622
+ infinite_tiling: false,
623
+ stone_diffuse_brightness: 1.f,
624
+ reflection_roughness: 0.8f,
625
+ stones_bump_strength: 0.5f,
626
+ moss_brightness: 0.8f,
627
+ moss_saturation: 0.9f,
628
+ moss_distribution_amount: 1.f,
629
+ moss_height_growth: 0.8f,
630
+ moss_weight: 1.f,
631
+ moss_moisture: 0.7f,
632
+ moss_bump_factor: 1.f,
633
+ texture_translate: float2(0.0f),
634
+ texture_rotate: 0.0f,
635
+ texture_scale: float2(1.0f),
636
+ enable_round_corners: false,
637
+ radius: 1.5f,
638
+ across_materials: true,
639
+ uv_space_index: 0
640
+ );
641
+
642
+ export material Saturated_Green_Patches(*)
643
+ [[
644
+ ::anno::display_name("Saturated Green Patches"),
645
+ ::anno::description(DESCRIPTION),
646
+ ::anno::copyright_notice(COPYRIGHT),
647
+ ::anno::key_words(string[]("dielectric", "infinite", "stone", "nature", "moss", "weathered", "pores", "wall", "exterior", "rough", "plant", "urban", "city", "industrial", "dry", "saturated", "green")),
648
+ ::anno::thumbnail("./.thumbs/Stone_Pores_Weathered.Saturated_Green_Patches.png"),
649
+ ::anno::author("NVIDIA vMaterials"),
650
+ ::anno::contributor("Maik Rohland"),
651
+ ::anno::contributor("Ruediger Raab")
652
+ ]]
653
+ = Stone_Pores_Weathered
654
+ (
655
+ infinite_tiling: false,
656
+ stone_diffuse_brightness: 0.f,
657
+ reflection_roughness: 1.f,
658
+ stones_bump_strength: 1.f,
659
+ moss_brightness: 0.8f,
660
+ moss_saturation: 0.85f,
661
+ moss_distribution_amount: 0.6f,
662
+ moss_height_growth: 0.9f,
663
+ moss_weight: 1.f,
664
+ moss_moisture: .21f,
665
+ moss_bump_factor: 1.f,
666
+ texture_translate: float2(0.0f),
667
+ texture_rotate: 0.0f,
668
+ texture_scale: float2(1.0f),
669
+ enable_round_corners: false,
670
+ radius: 1.5f,
671
+ across_materials: true,
672
+ uv_space_index: 0
673
+ );
674
+
675
+ export material Fadely_Yellowish_Moss(*)
676
+ [[
677
+ ::anno::display_name("Fadely Yellowish Moss"),
678
+ ::anno::description(DESCRIPTION),
679
+ ::anno::copyright_notice(COPYRIGHT),
680
+ ::anno::key_words(string[]("dielectric", "infinite", "stone", "nature", "moss", "weathered", "pores", "wall", "exterior", "rough", "plant", "urban", "city", "industrial", "dry", "fadely", "yellowish")),
681
+ ::anno::thumbnail("./.thumbs/Stone_Pores_Weathered.Fadely_Yellowish_Moss.png"),
682
+ ::anno::author("NVIDIA vMaterials"),
683
+ ::anno::contributor("Maik Rohland"),
684
+ ::anno::contributor("Ruediger Raab")
685
+ ]]
686
+ = Stone_Pores_Weathered
687
+ (
688
+ infinite_tiling: false,
689
+ stone_diffuse_brightness: 0.f,
690
+ reflection_roughness: 0.8f,
691
+ stones_bump_strength: 0.2f,
692
+ moss_brightness: 1.f,
693
+ moss_saturation: 0.f,
694
+ moss_distribution_amount: .69f,
695
+ moss_height_growth: 1.f,
696
+ moss_weight: 0.25f,
697
+ moss_moisture: 1.f,
698
+ moss_bump_factor: 1.f,
699
+ texture_translate: float2(0.0f),
700
+ texture_rotate: 0.0f,
701
+ texture_scale: float2(1.0f),
702
+ enable_round_corners: false,
703
+ radius: 1.5f,
704
+ across_materials: true,
705
+ uv_space_index: 0
706
+ );
code/third_party/vMaterials_2/Concrete/textures/concrete_wall_even_R_rough_G_ao_B_grunge.jpg ADDED

Git LFS Details

  • SHA256: f30119a03f87bebc2746077477727a09edc61911d288604b5dcbc9406424cfa4
  • Pointer size: 132 Bytes
  • Size of remote file: 6.28 MB
code/third_party/vMaterials_2/Concrete/textures/concrete_wall_even_diff.jpg ADDED

Git LFS Details

  • SHA256: 664db388d9f7f4fa6e28c29f133d89ffecd7f4acfb6cb7f58be69d2ec57e8d06
  • Pointer size: 132 Bytes
  • Size of remote file: 1.12 MB
code/third_party/vMaterials_2/Concrete/textures/moss_diff.jpg ADDED

Git LFS Details

  • SHA256: 5f01800b456e31f6575e429a8eb9751d7a71fa0ee61d3e16effa9d7709babaf8
  • Pointer size: 131 Bytes
  • Size of remote file: 991 kB
code/third_party/vMaterials_2/Concrete/textures/precastconcrete_diff.png ADDED

Git LFS Details

  • SHA256: bac81f3d1b2a872a249df7137cc4e852ccb4c459cba002b6a7360bcf87c3cca3
  • Pointer size: 132 Bytes
  • Size of remote file: 7.24 MB
code/third_party/vMaterials_2/Concrete/textures/spongy_concrete_weathered_norm.jpg ADDED

Git LFS Details

  • SHA256: e6f7efa75f2bde78bc8a7f57c835423d9b369aec29c7e442c89d9f3a0cd70429
  • Pointer size: 132 Bytes
  • Size of remote file: 2.75 MB
code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Flaxen.png ADDED

Git LFS Details

  • SHA256: 17b5ec038061a31d907f1cbb6fc8d92c83035c1393756f30b07ee8975db4aff6
  • Pointer size: 130 Bytes
  • Size of remote file: 97.3 kB
code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Mustard.png ADDED

Git LFS Details

  • SHA256: d26d208b1b7be7961a0d83b588ebc29fcab8c0efa5b211a30580e63743df959b
  • Pointer size: 131 Bytes
  • Size of remote file: 102 kB
code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Potters_Clay.png ADDED

Git LFS Details

  • SHA256: 316fd5e1e7fd37ca825e627af6aaccc43515b16b0c805371d773d81db5181ec8
  • Pointer size: 130 Bytes
  • Size of remote file: 94.9 kB
code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Purple.png ADDED

Git LFS Details

  • SHA256: 484c94630b4b5c6a448a84aa9d68934463257ef295b6a229c05e29c66cd49d3e
  • Pointer size: 130 Bytes
  • Size of remote file: 95.2 kB
code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Rosy_Peach.png ADDED

Git LFS Details

  • SHA256: 09f6e6564257bcaea7524bf64240a7a7966c4fe08361ff766a31f9acd348fb60
  • Pointer size: 130 Bytes
  • Size of remote file: 98.7 kB
code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Smoke.png ADDED

Git LFS Details

  • SHA256: 8e1d226a6365b0ea0d1828fee2aa9ccd829bdd7ecfd0edd01d90a48f4ca3968c
  • Pointer size: 130 Bytes
  • Size of remote file: 89 kB
code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Teal.png ADDED

Git LFS Details

  • SHA256: b8cf66e3276595464299569f9206a121c28f35634ca08be1d46747a472608d9e
  • Pointer size: 130 Bytes
  • Size of remote file: 90.3 kB
code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Denim.Cotton_Denim_Independence_Blue.png ADDED

Git LFS Details

  • SHA256: 7d6ee16f11786a3efcaa5a0a8b24a6714836a6e5acbdbe003deca9d224c489ce
  • Pointer size: 130 Bytes
  • Size of remote file: 90.4 kB
code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Denim.Cotton_Denim_Washed_Blue.png ADDED

Git LFS Details

  • SHA256: fad6333521c8915dbc70d536f99a04482b90c4ca92b5d7721a2831fc79f4e5b0
  • Pointer size: 130 Bytes
  • Size of remote file: 96.9 kB
code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry.png ADDED

Git LFS Details

  • SHA256: 5213ccf164f5e4adb42004310d467d9dd0b3d50e8e472b64137268836581863d
  • Pointer size: 130 Bytes
  • Size of remote file: 98.6 kB
code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Dark_Blue.png ADDED

Git LFS Details

  • SHA256: 64e7491a70249528ee99491df7c274f9e91b1b4fd4617625e82ec5a7268eb047
  • Pointer size: 130 Bytes
  • Size of remote file: 84.2 kB
code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Dark_Gray.png ADDED

Git LFS Details

  • SHA256: 77c0d8a36aab88f7729ec3fc731052796d610fe8cc64119706a7ac2809271b0b
  • Pointer size: 130 Bytes
  • Size of remote file: 80.8 kB
code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Harbor_Gray.png ADDED

Git LFS Details

  • SHA256: 41e9f7b51f3e55eba75e580f0384081849fba07337845290fc62470b12cb58f8
  • Pointer size: 130 Bytes
  • Size of remote file: 91.7 kB
code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Mid_Gray.png ADDED

Git LFS Details

  • SHA256: adc0b2f999fbdf4053bb494c227dec6daffcfd55ff99490bfaf767b0ea98a005
  • Pointer size: 130 Bytes
  • Size of remote file: 84 kB
code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford.png ADDED

Git LFS Details

  • SHA256: 4799c7f9ded72e4b2db92e6484259e1cf083304afd5263387d133b3bc730a219
  • Pointer size: 130 Bytes
  • Size of remote file: 96 kB
code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Coffee_Bean.png ADDED

Git LFS Details

  • SHA256: ee99e24fa54493064f3ac65aff0af47ac5e549d723f0f1a52af8a45a7553b07e
  • Pointer size: 130 Bytes
  • Size of remote file: 84.4 kB
code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Fog.png ADDED

Git LFS Details

  • SHA256: e3790da0df49a4054916bffd25a80814af5d3fc98d968bb9bc7d08907f0602dd
  • Pointer size: 130 Bytes
  • Size of remote file: 98.4 kB
code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Fuchsia.png ADDED

Git LFS Details

  • SHA256: 863d902be0e425dba15a73fe680d455125f708e7ab5e1a978927424224c6d6bb
  • Pointer size: 130 Bytes
  • Size of remote file: 97.6 kB
code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Peacock.png ADDED

Git LFS Details

  • SHA256: a51a879c9f18c9536a63cd64d4aff3e22cb9d34e180eabfc2f23a567e67187be
  • Pointer size: 130 Bytes
  • Size of remote file: 92.8 kB
code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Roughly_Woven.Fabric_Cotton_Roughly_Woven_Dark_Red.png ADDED

Git LFS Details

  • SHA256: 3ac97d1e9e000832895992f8806628f5e64df2e145502254bdf364bacf58e7f6
  • Pointer size: 130 Bytes
  • Size of remote file: 97.9 kB
code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Roughly_Woven.Fabric_Cotton_Roughly_Woven_Green.png ADDED

Git LFS Details

  • SHA256: 730717a06293f839df697db50290b591572c2e1552d63019884171e4eaef7548
  • Pointer size: 131 Bytes
  • Size of remote file: 106 kB
code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Roughly_Woven.Fabric_Cotton_Roughly_Woven_Orange.png ADDED

Git LFS Details

  • SHA256: a69bc4b58491ccb45e58dcdd73491a5764c69e0c4b5f988a21098fe5ec49dcbc
  • Pointer size: 131 Bytes
  • Size of remote file: 109 kB
code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey.png ADDED

Git LFS Details

  • SHA256: 476809432f20a4c82b7447b31a3a20eaebc1c41fde908fdb3ae4e16f8e9c5348
  • Pointer size: 130 Bytes
  • Size of remote file: 95 kB
code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Amethyst.png ADDED

Git LFS Details

  • SHA256: 9e5404857faf5a57d17ebe4edc86e83988efce37dba5cc98fbb7a01531ea162d
  • Pointer size: 130 Bytes
  • Size of remote file: 95.9 kB
code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Brick_Red.png ADDED

Git LFS Details

  • SHA256: 48156dadbf254fd28a67902d6920c96dc64f9a48bb81d75d50436ab5d9c067b8
  • Pointer size: 130 Bytes
  • Size of remote file: 96.5 kB
code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Bubblegum.png ADDED

Git LFS Details

  • SHA256: e70b5304b13d66c27788961e0e49970f0ad20ffe67784e9b652250d93a8789f1
  • Pointer size: 131 Bytes
  • Size of remote file: 100 kB
code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Charcoal.png ADDED

Git LFS Details

  • SHA256: ed37ee07400728960fe1e49fe2cae0941da3749de70d3ce6b06d52cd7612e972
  • Pointer size: 130 Bytes
  • Size of remote file: 82.8 kB
code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Grass_Green.png ADDED

Git LFS Details

  • SHA256: c6a34395227a226b427e3ce85c6d6b8b0a60351617339098024e2ed2b70fe630
  • Pointer size: 130 Bytes
  • Size of remote file: 98.6 kB
code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Gray.png ADDED

Git LFS Details

  • SHA256: 204adbaef6a180fec53fb9411ea9b267da7042175f22873d54ecec1a7dfe8ade
  • Pointer size: 130 Bytes
  • Size of remote file: 86.6 kB
code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Navy_Blue.png ADDED

Git LFS Details

  • SHA256: ef979c00cb71b79e6e6e42497b1a0411ca041ca5f89a10fd6306015e34f986d1
  • Pointer size: 130 Bytes
  • Size of remote file: 89.3 kB
code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Orange.png ADDED

Git LFS Details

  • SHA256: 691de691805c9599cb037396d2feb49df550b5a0dd40d8c4791bf26cdef9244e
  • Pointer size: 131 Bytes
  • Size of remote file: 102 kB
code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Purple.png ADDED

Git LFS Details

  • SHA256: 9bb56037f41a298428e22cbc8c2d0e6c75491289c65daec28aa443c8d2c503e3
  • Pointer size: 130 Bytes
  • Size of remote file: 92.6 kB
code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Teal.png ADDED

Git LFS Details

  • SHA256: d5625c1501f28944be7786c7bfb14c33bbfeeeb3fe098e8a501f7c2af0219219
  • Pointer size: 130 Bytes
  • Size of remote file: 98.6 kB