Datasets:

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

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/Carpet/Carpet_Woven.mdl +404 -0
  2. code/third_party/vMaterials_2/Carpet/Fabric_Carpet_Long_Floor.mdl +490 -0
  3. code/third_party/vMaterials_2/Carpet/Rug_Carpet.mdl +698 -0
  4. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl.png +3 -0
  5. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting.png +3 -0
  6. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Amazon_Clay.png +3 -0
  7. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Ash_Brown.png +3 -0
  8. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Autumn.png +3 -0
  9. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Black.png +3 -0
  10. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Burgundy.png +3 -0
  11. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Champagne.png +3 -0
  12. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Chocolate.png +3 -0
  13. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Crimson.png +3 -0
  14. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Electric.png +3 -0
  15. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Flaxen.png +3 -0
  16. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Lavender.png +3 -0
  17. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Mint.png +3 -0
  18. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Mustard.png +3 -0
  19. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Olive.png +3 -0
  20. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Potters_Clay.png +3 -0
  21. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Purple.png +3 -0
  22. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Rose.png +3 -0
  23. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Rosy_Peach.png +3 -0
  24. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Silver.png +3 -0
  25. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Sky_Blue.png +3 -0
  26. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Smoke.png +3 -0
  27. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Teal.png +3 -0
  28. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl.png +3 -0
  29. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl@Cotton_Denim.png +3 -0
  30. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl@Cotton_Denim_Black.png +3 -0
  31. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl@Cotton_Denim_Bleached_Light_Blue.png +3 -0
  32. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl@Cotton_Denim_Carbon.png +3 -0
  33. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl@Cotton_Denim_Independence_Blue.png +3 -0
  34. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl@Cotton_Denim_Light_Blue.png +3 -0
  35. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl@Cotton_Denim_Washed_Blue.png +3 -0
  36. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl.png +3 -0
  37. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry.png +3 -0
  38. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Brown.png +3 -0
  39. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Burgundy.png +3 -0
  40. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Dark_Blue.png +3 -0
  41. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Dark_Gray.png +3 -0
  42. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Electric_Blue.png +3 -0
  43. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Fox_Red.png +3 -0
  44. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Fuchsia.png +3 -0
  45. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Gray.png +3 -0
  46. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Harbor_Gray.png +3 -0
  47. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Mid_Gray.png +3 -0
  48. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Olive_Green.png +3 -0
  49. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Petrol.png +3 -0
  50. code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Saffron.png +3 -0
code/third_party/vMaterials_2/Carpet/Carpet_Woven.mdl ADDED
@@ -0,0 +1,404 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2024 NVIDIA Corporation. All rights reserved.
3
+ ******************************************************************************
4
+
5
+ Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge,
6
+ to any person obtaining a copy of the sample definition code that uses our
7
+ Material Definition Language (the "MDL Materials"), to reproduce and distribute
8
+ the MDL Materials, including without limitation the rights to use, copy, merge,
9
+ publish, distribute, and sell modified and unmodified copies of the MDL
10
+ Materials, and to permit persons to whom the MDL Materials is furnished to do
11
+ so, in all cases solely for use with NVIDIA's Material Definition Language,
12
+ subject to the following further conditions:
13
+
14
+ 1. The above copyright notices, this list of conditions, and the disclaimer
15
+ that follows shall be retained in all copies of one or more of the MDL
16
+ Materials, including in any software with which the MDL Materials are bundled,
17
+ redistributed, and/or sold, and included either as stand-alone text files,
18
+ human-readable headers or in the appropriate machine-readable metadata fields
19
+ within text or binary files as long as those fields can be easily viewed by the
20
+ user, as applicable.
21
+ 2. The name of NVIDIA shall not be used to promote, endorse or advertise any
22
+ Modified Version without specific prior written permission, except a) to comply
23
+ with the notice requirements otherwise contained herein; or b) to acknowledge
24
+ the contribution(s) of NVIDIA.
25
+
26
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
27
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
28
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
29
+ TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR
30
+ ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL,
31
+ INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF
32
+ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE
33
+ THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.
34
+ */
35
+
36
+
37
+ mdl 1.5;
38
+
39
+ import ::anno::*;
40
+ import ::base::*;
41
+ import ::df::*;
42
+ import ::math::*;
43
+ import ::state::*;
44
+ import ::tex::*;
45
+ import ::nvidia::core_definitions::blend_colors;
46
+ import ::nvidia::core_definitions::dimension;
47
+
48
+
49
+ const string COPYRIGHT =
50
+ " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
51
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
52
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
53
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
54
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
55
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
56
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
57
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
58
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
59
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
60
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
61
+
62
+ annotation preview_scale( float f);
63
+
64
+
65
+ float remap_xy_to_0_1(float input, float x, float y)
66
+ {
67
+ return (input - x)/(y - x);
68
+ }
69
+
70
+ float histogram_scan_big(float input, float width, float position)
71
+ {
72
+ return ::math::clamp(
73
+ remap_xy_to_0_1(input,
74
+ ::math::lerp(-width, 1.0, position),
75
+ ::math::lerp(0.0, 1.0 + width, position)),
76
+ 0.0,
77
+ 1.0);
78
+ }
79
+
80
+
81
+ float histogram_range(float input, float range = 1.0f, float position = 0.5f)
82
+ {
83
+ float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0);
84
+ float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0);
85
+ return ::math::lerp(low, high, input);
86
+ }
87
+
88
+
89
+ ::base::texture_coordinate_info transform_coordinate_2(
90
+ float4x4 transform
91
+ [[ ::anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix.") ]],
92
+ ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info()
93
+ [[ ::anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection.") ]]
94
+ ) [[
95
+ ::anno::description("Transform a texture coordinate by a matrix.") ,
96
+ ::anno::noinline()
97
+ ]]
98
+ {
99
+ // Version 2
100
+ float4 r_position = transform * float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1);
101
+ //Try aproximating it for the case that the rotation is only aroud z and assuming the texture layout is nice and z is ~constant.
102
+ //just pretend there is no other rotation happening
103
+ //get rid of scaling and translation. Then extract fields where sin and cos would be in a simple 2d transform around z.
104
+ float4 u = transform[0];
105
+ float3 ru = ::math::normalize(float3(u.x,u.y,u.z));
106
+ float cos = ru.x;
107
+ float sin = -ru.y;
108
+
109
+ return ::base::texture_coordinate_info(
110
+ float3(r_position.x,r_position.y,r_position.z),
111
+ ::math::normalize(cos * coordinate.tangent_u - sin * coordinate.tangent_v),
112
+ ::math::normalize(cos * coordinate.tangent_v + sin * coordinate.tangent_u));
113
+ }
114
+
115
+
116
+ // Takes the standard input that every material has. It combines a couple of
117
+ // functions in one convenience function.
118
+ ::base::texture_coordinate_info vmat_transform(
119
+ float2 translation = float2(0.0, 0.0),
120
+ float rotation = 0.0, // rotation in degrees
121
+ float2 scaling = float2(1.0, 1.0),
122
+ uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw,
123
+ uniform int uv_space = 0
124
+ )
125
+ {
126
+ float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f;
127
+ float4x4 scale =
128
+ float4x4(1.0 /scaling.x, 0. , 0. , 0.,
129
+ 0. , 1.0 /scaling.y , 0. , 0.,
130
+ 0. , 0. , 1.0, 0.,
131
+ translation.x , translation.y , 0.0, 1.);
132
+
133
+ float s = ::math::sin(rotation_rad);
134
+ float c = ::math::cos(rotation_rad);
135
+ float4x4 rotate =
136
+ float4x4( c , -s , 0.0 , 0.0,
137
+ s , c , 0.0 , 0.0,
138
+ 0.0, 0.0 , 1.0 , 0.0,
139
+ 0. , 0.0 , 0.0 , 1.);
140
+
141
+ return transform_coordinate_2(scale*rotate, ::base::coordinate_source(system, uv_space));
142
+ }
143
+
144
+ export material Carpet_Woven(
145
+ color color_diffuse = color(0.71f) [[
146
+ ::anno::description("Sets the color of the fabric."),
147
+ ::anno::display_name("Color"),
148
+ ::anno::in_group("Appearance")
149
+ ]],
150
+ float color_variation = 0.175f [[
151
+ ::anno::description("Increasing this value adds brightness variation to the material."),
152
+ ::anno::display_name("Color Variation"),
153
+ ::anno::hard_range(0.0, 1.0),
154
+ ::anno::in_group("Appearance")
155
+ ]],
156
+ float roughness = 0.60f [[
157
+ ::anno::description("Increasing this value makes the material appear rougher."),
158
+ ::anno::display_name("Roughness"),
159
+ ::anno::hard_range(0.0, 1.0),
160
+ ::anno::in_group("Appearance")
161
+ ]],
162
+ float reflectivity = 1.f [[
163
+ ::anno::description("Adjusts how much light is reflected from the material."),
164
+ ::anno::display_name("Reflectivity"),
165
+ ::anno::hard_range(0.0, 1.0),
166
+ ::anno::in_group("Appearance")
167
+ ]],
168
+ uniform float2 texture_translate = float2(0.f) [[
169
+ ::anno::display_name("Translate"),
170
+ ::anno::description("Translates the material."),
171
+ ::anno::in_group("Transform")
172
+ ]],
173
+ uniform float texture_rotate = 0.f [[
174
+ ::anno::display_name("Rotate"),
175
+ ::anno::description("Rotates the material."),
176
+ ::anno::soft_range(0.0, 360.0),
177
+ ::anno::in_group("Transform")
178
+ ]],
179
+ uniform float2 texture_scale = float2(1.f) [[
180
+ ::anno::display_name("Scale"),
181
+ ::anno::description("Scales the material."),
182
+ ::nvidia::core_definitions::dimension(float2(1.0, 1.0)),
183
+ ::preview_scale(2.0f),
184
+ ::anno::in_group("Transform")
185
+ ]],
186
+ uniform bool enable_round_corners = false [[
187
+ ::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."),
188
+ ::anno::display_name("Enable Round Corners"),
189
+ ::anno::in_group("Round Corners")
190
+ ]],
191
+ uniform float radius_mm = 0.f [[
192
+ ::anno::description("Radius of the rounded corners."),
193
+ ::anno::display_name("Round Corner Radius (mm)"),
194
+ ::anno::in_group("Round Corners")
195
+ ]],
196
+ uniform bool across_materials = true [[
197
+ ::anno::description("Applies the round corner effect across different materials when enabled."),
198
+ ::anno::display_name("Across Materials"),
199
+ ::anno::in_group("Round Corners")
200
+ ]],
201
+ uniform int uv_space_index = 0 [[
202
+ ::anno::description("Uses selected UV space for material."),
203
+ ::anno::display_name("UV Space Index"),
204
+ ::anno::in_group("Advanced")
205
+ ]]
206
+ )
207
+ [[
208
+ ::anno::author("NVIDIA vMaterials"),
209
+ ::anno::display_name("Woven Carpet - White"),
210
+ ::anno::description("A roughly woven carpet."),
211
+ ::anno::copyright_notice(COPYRIGHT),
212
+ ::anno::thumbnail("./.thumbs/Carpet_Woven.Carpet_Woven.png"),
213
+ ::anno::key_words(string[]("fabric", "woven", "carpet", "rough", "design", "interior", "floor", "white"))
214
+ ]]
215
+ =
216
+ let {
217
+ bool tmp0 = false;
218
+ material_surface tmp1(
219
+ ::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, ::math::pow(histogram_scan_big(float3(::base::file_texture(texture_2d("./textures/carpet_rough_woven_multi_R_rough_G_ao_B_vari.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.406000018f, 1.f, reflectivity), ::math::lerp(0.721000016f, 0.431000024f, reflectivity)), 2.20000005f), ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(::base::file_texture(texture_2d("./textures/carpet_rough_woven_multi_R_rough_G_ao_B_vari.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.602000058f, 0.867000043f, roughness)) * histogram_range(float3(::base::file_texture(texture_2d("./textures/carpet_rough_woven_multi_R_rough_G_ao_B_vari.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.602000058f, 0.867000043f, roughness)), histogram_range(float3(::base::file_texture(texture_2d("./textures/carpet_rough_woven_multi_R_rough_G_ao_B_vari.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.602000058f, 0.867000043f, roughness)) * histogram_range(float3(::base::file_texture(texture_2d("./textures/carpet_rough_woven_multi_R_rough_G_ao_B_vari.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.602000058f, 0.867000043f, 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(::base::file_texture(texture_2d("./textures/carpet_rough_woven_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_diffuse, ::base::color_layer_multiply, 1.f, true).tint, color(::math::pow(float3(::base::file_texture(texture_2d("./textures/carpet_rough_woven_multi_R_rough_G_ao_B_vari.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_overlay, color_variation * 0.699999988f, true).tint, 0.f), bsdf(), ::base::tangent_space_normal_texture(texture_2d("./textures/carpet_rough_woven_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)), ::base::tangent_space_normal_texture(texture_2d("./textures/carpet_rough_woven_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)),
220
+ material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
221
+ material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
222
+ color tmp3 = color(1.f, 1.f, 1.f);
223
+ 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));
224
+ material_geometry tmp5(
225
+ float3(0.f),
226
+ 1.f,
227
+ enable_round_corners ? ::state::rounded_corner_normal(radius_mm * 0.00100000005f, across_materials, 1.f) : ::state::normal());
228
+ hair_bsdf tmp6 = hair_bsdf();
229
+ } in
230
+ material(
231
+ thin_walled: tmp0,
232
+ surface: tmp1,
233
+ backface: tmp2,
234
+ ior: tmp3,
235
+ volume: tmp4,
236
+ geometry: tmp5,
237
+ hair: tmp6);
238
+
239
+
240
+ // 2
241
+ export material Carpet_Woven_Orange(*)
242
+ [[
243
+ ::anno::author("NVIDIA vMaterials"),
244
+ ::anno::contributor("Rüdiger Raab"),
245
+ ::anno::contributor("Maik Rohland"),
246
+ ::anno::display_name("Woven Carpet - Orange"),
247
+ ::anno::description("A roughly woven carpet."),
248
+ ::anno::copyright_notice(COPYRIGHT),
249
+ ::anno::thumbnail("./.thumbs/Carpet_Woven.Carpet_Woven_Orange.png"),
250
+ ::anno::key_words(string[]("fabric", "woven", "carpet", "rough", "design", "interior", "floor", "orange", "saturated", "warm"))
251
+ ]]= Carpet_Woven(
252
+ // Appearance
253
+ color_diffuse: color(0.673049f, 0.259027f, 0.031551f),
254
+ color_variation: 0.175f,
255
+ roughness: 0.60f,
256
+ reflectivity: 1.0f,
257
+ // Transform
258
+ texture_translate: float2(0.0f),
259
+ texture_rotate: 0.0f,
260
+ texture_scale: float2(1.0f),
261
+ // Round Corners
262
+ enable_round_corners: false,
263
+ radius_mm: 1.5f,
264
+ across_materials: false,
265
+ // Advanced
266
+ uv_space_index: 0
267
+ );
268
+
269
+ // 3
270
+ export material Carpet_Woven_Cherry_Red(*)
271
+ [[
272
+ ::anno::author("NVIDIA vMaterials"),
273
+ ::anno::display_name("Woven Carpet - Cherry Red"),
274
+ ::anno::description("A roughly woven carpet."),
275
+ ::anno::copyright_notice(COPYRIGHT),
276
+ ::anno::thumbnail("./.thumbs/Carpet_Woven.Carpet_Woven_Cherry_Red.png"),
277
+ ::anno::key_words(string[]("fabric", "woven", "carpet", "rough", "design", "interior", "floor", "red", "cherry", "saturated", "warm"))
278
+ ]]= Carpet_Woven(
279
+ // Appearance
280
+ color_diffuse: color(0.659224f, 0.054592, 0.030257f),
281
+ color_variation: 0.175f,
282
+ roughness: 0.60f,
283
+ reflectivity: 1.0f,
284
+ // Transform
285
+ texture_translate: float2(0.0f),
286
+ texture_rotate: 0.0f,
287
+ texture_scale: float2(1.0f),
288
+ // Round Corners
289
+ enable_round_corners: false,
290
+ radius_mm: 1.5f,
291
+ across_materials: false,
292
+ // Advanced
293
+ uv_space_index: 0
294
+ );
295
+
296
+ // 4
297
+ export material Carpet_Woven_Bordeaux(*)
298
+ [[
299
+ ::anno::author("NVIDIA vMaterials"),
300
+ ::anno::display_name("Woven Carpet - Bordeaux"),
301
+ ::anno::description("A roughly woven carpet."),
302
+ ::anno::copyright_notice(COPYRIGHT),
303
+ ::anno::thumbnail("./.thumbs/Carpet_Woven.Carpet_Woven_Bordeaux.png"),
304
+ ::anno::key_words(string[]("fabric", "woven", "carpet", "rough", "design", "interior", "floor", "red", "bordeaux", "saturated", "warm"))
305
+ ]]= Carpet_Woven(
306
+ // Appearance
307
+ color_diffuse: color(0.363604f, 0.016068f, 0.086901f),
308
+ color_variation: 0.175f,
309
+ roughness: 0.60f,
310
+ reflectivity: 1.0f,
311
+ // Transform
312
+ texture_translate: float2(0.0f),
313
+ texture_rotate: 0.0f,
314
+ texture_scale: float2(1.0f),
315
+ // Round Corners
316
+ enable_round_corners: false,
317
+ radius_mm: 1.5f,
318
+ across_materials: false,
319
+ // Advanced
320
+ uv_space_index: 0
321
+ );
322
+
323
+ // 5
324
+ export material Carpet_Woven_Green(*)
325
+ [[
326
+ ::anno::author("NVIDIA vMaterials"),
327
+ ::anno::display_name("Woven Carpet - Green"),
328
+ ::anno::description("A roughly woven carpet."),
329
+ ::anno::copyright_notice(COPYRIGHT),
330
+ ::anno::thumbnail("./.thumbs/Carpet_Woven.Carpet_Woven_Green.png"),
331
+ ::anno::key_words(string[]("fabric", "woven", "carpet", "rough", "design", "interior", "floor", "green", "light"))
332
+ ]]= Carpet_Woven(
333
+ // Appearance
334
+ color_diffuse: color(0.259027f, 0.529523f, 0.034230f),
335
+ color_variation: 0.175f,
336
+ roughness: 0.60f,
337
+ reflectivity: 1.0f,
338
+ // Transform
339
+ texture_translate: float2(0.0f),
340
+ texture_rotate: 0.0f,
341
+ texture_scale: float2(1.0f),
342
+ // Round Corners
343
+ enable_round_corners: false,
344
+ radius_mm: 1.5f,
345
+ across_materials: false,
346
+ // Advanced
347
+ uv_space_index: 0
348
+ );
349
+
350
+
351
+ // 6
352
+ export material Carpet_Woven_Dark_Blue_Gray(*)
353
+ [[
354
+ ::anno::author("NVIDIA vMaterials"),
355
+ ::anno::display_name("Woven Carpet - Dark Blue Gray"),
356
+ ::anno::description("A roughly woven carpet."),
357
+ ::anno::copyright_notice(COPYRIGHT),
358
+ ::anno::thumbnail("./.thumbs/Carpet_Woven.Carpet_Woven_Dark_Blue_Gray.png"),
359
+ ::anno::key_words(string[]("fabric", "woven", "carpet", "rough", "design", "interior", "floor", "blue", "dark", "cool"))
360
+ ]]= Carpet_Woven(
361
+ // Appearance
362
+ color_diffuse: color(0.025371f, 0.058187f, 0.130352f),
363
+ color_variation: 0.175f,
364
+ roughness: 0.60f,
365
+ reflectivity: 1.0f,
366
+ // Transform
367
+ texture_translate: float2(0.0f),
368
+ texture_rotate: 0.0f,
369
+ texture_scale: float2(1.0f),
370
+ // Round Corners
371
+ enable_round_corners: false,
372
+ radius_mm: 1.5f,
373
+ across_materials: false,
374
+ // Advanced
375
+ uv_space_index: 0
376
+ );
377
+
378
+
379
+ // 7
380
+ export material Carpet_Woven_Sky_Blue(*)
381
+ [[
382
+ ::anno::author("NVIDIA vMaterials"),
383
+ ::anno::display_name("Woven Carpet - Sky Blue"),
384
+ ::anno::description("A roughly woven carpet."),
385
+ ::anno::copyright_notice(COPYRIGHT),
386
+ ::anno::thumbnail("./.thumbs/Carpet_Woven.Carpet_Woven_Sky_Blue.png"),
387
+ ::anno::key_words(string[]("fabric", "woven", "carpet", "rough", "design", "interior", "floor", "blue", "sky", "cool"))
388
+ ]]= Carpet_Woven(
389
+ // Appearance
390
+ color_diffuse: color(0.069727f, 0.344026f, 0.632043f),
391
+ color_variation: 0.175f,
392
+ roughness: 0.60f,
393
+ reflectivity: 1.0f,
394
+ // Transform
395
+ texture_translate: float2(0.0f),
396
+ texture_rotate: 0.0f,
397
+ texture_scale: float2(1.0f),
398
+ // Round Corners
399
+ enable_round_corners: false,
400
+ radius_mm: 1.5f,
401
+ across_materials: false,
402
+ // Advanced
403
+ uv_space_index: 0
404
+ );
code/third_party/vMaterials_2/Carpet/Fabric_Carpet_Long_Floor.mdl ADDED
@@ -0,0 +1,490 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 floor carpet material with long hair fibers.";
62
+
63
+
64
+
65
+ float remap(float input, float low, float high)
66
+ {
67
+ //return low + input * (high - low);
68
+ return ::math::lerp(low, high, input);
69
+ }
70
+
71
+ float remap(float input, float low_1, float high_1, float low_2, float high_2)
72
+ {
73
+ return low_2 + ((input - low_1) * (high_2 - low_2))/(high_1 - low_1);
74
+ }
75
+
76
+
77
+ float histogram_pos_range(float input, float range, float position)
78
+ {
79
+ float range_half = range/2.0;
80
+ float subtract_low = (position + range_half) > 1.0 ? (position + range/2.0) - 1.0 : 0.0;
81
+ float low = position - range_half - subtract_low;
82
+
83
+ float add_high = (position - range_half) < 0.0 ? ::math::abs(position - range_half) : 0.0;
84
+ float high = position + range_half + add_high;
85
+ return remap(input, low, high);
86
+ }
87
+
88
+ ::base::texture_coordinate_info vmat_transform(
89
+ uniform float2 translation = float2(0.0, 0.0),
90
+ uniform float rotation = 0.0,
91
+ uniform float2 scaling = float2(1.0, 1.0),
92
+ uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw,
93
+ uniform int uv_space = 0
94
+ )
95
+ {
96
+ float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f;
97
+
98
+ float4x4 scale =
99
+ float4x4(1.0 /scaling.x, 0. , 0. , 0.,
100
+ 0. , 1.0 /scaling.y , 0. , 0.,
101
+ 0. , 0. , 1.0, 0.,
102
+ translation.x , translation.y , 0.0, 1.);
103
+
104
+ float s = ::math::sin(rotation_rad);
105
+ float c = ::math::cos(rotation_rad);
106
+ float4x4 rotate =
107
+ float4x4( c , -s , 0.0 , 0.0,
108
+ s , c , 0.0 , 0.0,
109
+ 0.0, 0.0 , 1.0 , 0.0,
110
+ 0. , 0.0 , 0.0 , 1.);
111
+
112
+ return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space));
113
+ }
114
+
115
+
116
+ float3 srgb2rgb(float3 val)
117
+ {
118
+ return ::math::pow(::math::max(val, float3(0.0f)), 2.2);
119
+ }
120
+
121
+ float uint2float(int x)
122
+ {
123
+ return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0);
124
+ }
125
+
126
+ int lowbias32(int x)
127
+ {
128
+ x ^= x >>> 16;
129
+ x *= 0x7feb352d;
130
+ x ^= x >>> 15;
131
+ x *= 0x846ca68b;
132
+ x ^= x >>> 16;
133
+ return x;
134
+ }
135
+
136
+ float2 rnd22(int2 p) {
137
+ float2 ret_val = float2(
138
+ uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f,
139
+ uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f
140
+ );
141
+ return ret_val;
142
+ }
143
+
144
+
145
+ float2x2 invert_2x2(float2x2 M)
146
+ {
147
+ float det = M[0][0]*M[1][1] - M[0][1]*M[1][0];
148
+ //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/
149
+ return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]);
150
+ }
151
+
152
+ float3 nonrepeat_lookup(
153
+ uniform texture_2d texture = texture_2d(),
154
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
155
+ float texture_scale = 1.0,
156
+ float3 average_color = float3(0.5),
157
+ float patch_size = 8.0
158
+ )
159
+ {
160
+
161
+ float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale;
162
+ float Z = patch_size; // patch scale inside example texture
163
+ float CON = 1.0f;
164
+
165
+ float3 O = float3(0.f);
166
+ float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f);
167
+ float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space
168
+
169
+ float2 U = uv_in;
170
+ float2 V = M * uv_in; //pre-tilted hexa coordinates
171
+ int2 I = int2(::math::floor(V)); // hexa-tile id
172
+
173
+ // The mean color needs to be determined in Photoshop then to make the
174
+ // average color work out, take the float value and calculate the apropriate
175
+ // mean value as (value^(1/2.2))
176
+
177
+ float3 m = average_color;
178
+
179
+ float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W;
180
+ F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates
181
+
182
+ if( F[2] > 0.f )
183
+
184
+ O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON))
185
+ + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON))
186
+ + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON));
187
+ else
188
+ O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON))
189
+ + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON))
190
+ + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON));
191
+ O = m + O/::math::length(W);
192
+ O = ::math::clamp( (O), 0.0, 1.0);
193
+
194
+ return float3(O);
195
+ }
196
+
197
+ color endless_texture(
198
+ uniform texture_2d texture = texture_2d(),
199
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
200
+ float texture_scale = 10.0,
201
+ float3 average_color = float3(0.5, 0.5, 1.0),
202
+ float patch_size = 8.0,
203
+ bool gamma_correct_lookup = true
204
+ )
205
+ {
206
+ return gamma_correct_lookup ? color(srgb2rgb(
207
+ nonrepeat_lookup (
208
+ texture: texture,
209
+ uvw: uvw,
210
+ texture_scale: texture_scale,
211
+ average_color: average_color,
212
+ patch_size: patch_size
213
+ ))
214
+ ) : color(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
+ }
222
+
223
+ float3 endless_normal(
224
+ uniform texture_2d texture = texture_2d(),
225
+ float factor = 1.0,
226
+ bool flip_tangent_u = false,
227
+ bool flip_tangent_v = false,
228
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
229
+ float texture_scale = 1.0,
230
+ float3 average_color = float3(0.5, 0.5, 1.0),
231
+ float patch_size = 8.0
232
+ )
233
+ {
234
+ float3 transformed_tangent_u = flip_tangent_u ? uvw.tangent_u : - uvw.tangent_u;
235
+ float3 transformed_tangent_v = flip_tangent_v ? uvw.tangent_v : - uvw.tangent_v;
236
+
237
+ if (flip_tangent_u)
238
+ transformed_tangent_u=-transformed_tangent_u;
239
+ if (flip_tangent_v)
240
+ transformed_tangent_v=-transformed_tangent_v;
241
+
242
+ // normalized Lookup
243
+ float3 tangent_space_normal =
244
+ (nonrepeat_lookup (
245
+ texture: texture,
246
+ uvw: uvw,
247
+ texture_scale: texture_scale,
248
+ average_color: average_color,
249
+ patch_size: patch_size
250
+ ) - 0.5) * (2.0 * factor);
251
+
252
+ return ::math::normalize(uvw.tangent_u * tangent_space_normal.x +
253
+ uvw.tangent_v * tangent_space_normal.y +
254
+ ::state::normal()*1.0);
255
+ }
256
+
257
+ float3 normalmap_normal(
258
+ uniform texture_2d texture,
259
+ float factor = 1.0,
260
+ ::base::texture_coordinate_info uvw = ::base::texture_coordinate_info()
261
+ )
262
+ {
263
+ float3 lookup = (::tex::lookup_float3(texture, float2(uvw.position.x, uvw.position.y)) - 0.5) * (factor * 2.0);
264
+ return ::math::normalize(uvw.tangent_u * lookup.x + uvw.tangent_v * lookup.y + ::state::normal());
265
+ }
266
+
267
+
268
+ export material Fabric_Carpet_Long_Floor(
269
+ uniform bool infinite_tiling = true [[
270
+ ::anno::description("Enables the infinite tiling feature which removes artifacts of repeating texture patterns."),
271
+ ::anno::display_name("Infinite Tiling"),
272
+ ::anno::in_group("Appearance")
273
+ ]],
274
+ color carpet_color = color(1.f, 1.f, 1.f) [[
275
+ ::anno::description("Adjusts the overall color of the carpet."),
276
+ ::anno::display_name("Carpet Color"),
277
+ ::anno::in_group("Appearance")
278
+ ]],
279
+ float ao_amount = 0.5f [[
280
+ ::anno::description("Produces a more contrasted appearance while also darkening the overall appearance."),
281
+ ::anno::display_name("Carpet Contrast"),
282
+ ::anno::hard_range(0.0f, 1.0f),
283
+ ::anno::in_group("Appearance")
284
+ ]],
285
+ float carpet_bump_factor = 1.f [[
286
+ ::anno::description("Adjusts the bump factor of the material."),
287
+ ::anno::display_name("Carpet Bump Factor"),
288
+ ::anno::soft_range(0.0, 1.0),
289
+ ::anno::in_group("Appearance")
290
+ ]],
291
+ uniform float2 texture_translate = float2(0.f) [[
292
+ ::anno::display_name("Translate"),
293
+ ::anno::description("Offsets the position of the material."),
294
+ ::anno::in_group("Transform")
295
+ ]],
296
+ uniform float texture_rotate = 0.f [[
297
+ ::anno::description("Rotates the material."),
298
+ ::anno::display_name("Rotate"),
299
+ ::anno::in_group("Transform")
300
+ ]],
301
+ uniform float2 texture_scale = float2(1.0f) [[
302
+ ::anno::description("Scales the material."),
303
+ ::anno::display_name("Scale"),
304
+ ::nvidia::core_definitions::dimension(float2(1.0, 1.0)),
305
+ ::anno::in_group("Transform")
306
+ ]],
307
+ uniform int uv_space_index = 0 [[
308
+ ::anno::description("Use selected UV space for material."),
309
+ ::anno::display_name("UV Space Index"),
310
+ ::anno::in_group("Advanced")
311
+ ]])
312
+ [[
313
+ ::anno::author("NVIDIA vMaterials"),
314
+ ::anno::display_name("Long Floor Carpet - Natural"),
315
+ ::anno::description(DESCRIPTION),
316
+ ::anno::copyright_notice(COPYRIGHT),
317
+ ::anno::thumbnail("./.thumbs/Fabric_Carpet_Long_Floor.Fabric_Carpet_Long_Floor.png"),
318
+ ::anno::key_words(string[]("carpet", "floor", "interior", "soft", "fabric", "long", "natural", "neutral"))
319
+ ]]
320
+ =
321
+ let {
322
+ bool tmp0 = false;
323
+
324
+ float2 corrected_scale = 0.33 * texture_scale;
325
+
326
+ material_surface tmp1(
327
+ ::df::custom_curve_layer(0.0780000016f, 0.606000006f, 5.f, ::math::pow(::math::clamp(remap(float3(infinite_tiling ? endless_texture(texture_2d("./textures/long_floor_carpet_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, corrected_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.838999987f, 0.68f, 1.f), 8.f, false) : ::base::file_texture(texture_2d("./textures/long_floor_carpet_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, corrected_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, 0.653000057f, 0.f, 1.f), 0.f, 1.f), 2.20000005f), ::df::microfacet_ggx_smith_bsdf(histogram_pos_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/long_floor_carpet_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, corrected_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.838999987f, 0.68599999f, 1.f), 8.f, false) : ::base::file_texture(texture_2d("./textures/long_floor_carpet_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, corrected_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.830000043f, 0.745000064f) * histogram_pos_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/long_floor_carpet_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, corrected_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.838999987f, 0.68599999f, 1.f), 8.f, false) : ::base::file_texture(texture_2d("./textures/long_floor_carpet_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, corrected_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.830000043f, 0.745000064f), histogram_pos_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/long_floor_carpet_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, corrected_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.838999987f, 0.68599999f, 1.f), 8.f, false) : ::base::file_texture(texture_2d("./textures/long_floor_carpet_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, corrected_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.830000043f, 0.745000064f) * histogram_pos_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/long_floor_carpet_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, corrected_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.838999987f, 0.68599999f, 1.f), 8.f, false) : ::base::file_texture(texture_2d("./textures/long_floor_carpet_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, corrected_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.830000043f, 0.745000064f), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(::nvidia::core_definitions::blend_colors(::nvidia::core_definitions::blend_colors(carpet_color, infinite_tiling ? endless_texture(texture_2d("./textures/long_floor_carpet_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, corrected_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.596000016f, 0.549000025f, 0.493999988f), 8.f, true) : ::base::file_texture(texture_2d("./textures/long_floor_carpet_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, corrected_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, ::base::color_layer_multiply, 1.f).tint, color(::math::pow(::math::clamp(remap(float3(infinite_tiling ? endless_texture(texture_2d("./textures/long_floor_carpet_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, corrected_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.838999987f, 0.68599999f, 1.f), 8.f, false) : ::base::file_texture(texture_2d("./textures/long_floor_carpet_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, corrected_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, 0.736000061f, ::math::lerp(1.f, 0.349999994f, ao_amount), 1.f), 0.f, 1.f), 2.20000005f)), ::base::color_layer_multiply, 1.f).tint, 0.f, ""), ::state::normal()),
328
+ material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
329
+ material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
330
+ color tmp3 = color(1.f, 1.f, 1.f);
331
+ 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));
332
+ material_geometry tmp5(
333
+ float3(0.f),
334
+ 1.f,
335
+ infinite_tiling ? endless_normal(texture_2d("./textures/long_floor_carpet_norm.jpg", ::tex::gamma_linear), 1.f, false, false, vmat_transform(texture_translate, texture_rotate, corrected_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.5f, 0.5f, 1.f), 8.f) : normalmap_normal(texture_2d("./textures/long_floor_carpet_norm.jpg", ::tex::gamma_linear), ::math::lerp(0.f, 0.699999988f, carpet_bump_factor), vmat_transform(texture_translate, texture_rotate, corrected_scale, ::base::texture_coordinate_uvw, uv_space_index)));
336
+ } in
337
+ material(
338
+ thin_walled: tmp0,
339
+ surface: tmp1,
340
+ backface: tmp2,
341
+ ior: tmp3,
342
+ volume: tmp4,
343
+ geometry: tmp5);
344
+
345
+ export material Fabric_Carpet_Long_Floor_Blue(*)
346
+ [[
347
+ ::anno::author("NVIDIA vMaterials"),
348
+ ::anno::display_name("Long Floor Carpet - Blue"),
349
+ ::anno::description(DESCRIPTION),
350
+ ::anno::copyright_notice(COPYRIGHT),
351
+ ::anno::thumbnail("./.thumbs/Fabric_Carpet_Long_Floor.Fabric_Carpet_Long_Floor_Blue.png"),
352
+ ::anno::key_words(string[]("carpet", "floor", "interior", "soft", "fabric", "long", "blue", "cool"))
353
+ ]]
354
+ = Fabric_Carpet_Long_Floor(
355
+ infinite_tiling: true,
356
+ carpet_color: color(0.160444f, 0.547994f, .9f),
357
+ ao_amount: 0.8f,
358
+ carpet_bump_factor: 1.0f,
359
+ texture_translate: float2(0.0f),
360
+ texture_rotate: 0.0f,
361
+ texture_scale: float2(1.0),
362
+ uv_space_index: 0
363
+ );
364
+
365
+ export material Fabric_Carpet_Long_Floor_Rose(*)
366
+ [[
367
+ ::anno::author("NVIDIA vMaterials"),
368
+ ::anno::display_name("Long Floor Carpet - Rose"),
369
+ ::anno::description(DESCRIPTION),
370
+ ::anno::copyright_notice(COPYRIGHT),
371
+ ::anno::thumbnail("./.thumbs/Fabric_Carpet_Long_Floor.Fabric_Carpet_Long_Floor_Rose.png"),
372
+ ::anno::key_words(string[]("carpet", "floor", "interior", "soft", "fabric", "long", "rose", "warm"))
373
+ ]]
374
+ = Fabric_Carpet_Long_Floor(
375
+ infinite_tiling: true,
376
+ carpet_color: color(0.744530f, 0.378676f, 0.715465f),
377
+ ao_amount: 0.8f,
378
+ carpet_bump_factor: 1.0f,
379
+ texture_translate: float2(0.0f),
380
+ texture_rotate: 0.0f,
381
+ texture_scale: float2(1.0),
382
+ uv_space_index: 0
383
+ );
384
+
385
+
386
+ export material Fabric_Carpet_Long_Floor_Light_Green(*)
387
+ [[
388
+ ::anno::author("NVIDIA vMaterials"),
389
+ ::anno::display_name("Long Floor Carpet - Light Green"),
390
+ ::anno::description(DESCRIPTION),
391
+ ::anno::copyright_notice(COPYRIGHT),
392
+ ::anno::thumbnail("./.thumbs/Fabric_Carpet_Long_Floor.Fabric_Carpet_Long_Floor_Light_Green.png"),
393
+ ::anno::key_words(string[]("carpet", "floor", "interior", "soft", "fabric", "long", "green", "light"))
394
+ ]]
395
+ = Fabric_Carpet_Long_Floor(
396
+ infinite_tiling: true,
397
+ carpet_color: color(0.505432f, 0.827726f, 0.133209f),
398
+ ao_amount: 0.8f,
399
+ carpet_bump_factor: 1.0f,
400
+ texture_translate: float2(0.0f),
401
+ texture_rotate: 0.0f,
402
+ texture_scale: float2(1.0f),
403
+ uv_space_index: 0
404
+ );
405
+
406
+
407
+ export material Fabric_Carpet_Long_Floor_Yellow(*)
408
+ [[
409
+ ::anno::author("NVIDIA vMaterials"),
410
+ ::anno::display_name("Long Floor Carpet - Yellow"),
411
+ ::anno::description(DESCRIPTION),
412
+ ::anno::copyright_notice(COPYRIGHT),
413
+ ::anno::thumbnail("./.thumbs/Fabric_Carpet_Long_Floor.Fabric_Carpet_Long_Floor_Yellow.png"),
414
+ ::anno::key_words(string[]("carpet", "floor", "interior", "soft", "fabric", "long", "yellow", "warm"))
415
+ ]]
416
+ = Fabric_Carpet_Long_Floor(
417
+ infinite_tiling: true,
418
+ carpet_color: color(0.907547f, 0.907547f, 0.180144f),
419
+ ao_amount: 0.8f,
420
+ carpet_bump_factor: 1.0f,
421
+ texture_translate: float2(0.0f),
422
+ texture_rotate: 0.0f,
423
+ texture_scale: float2(1.0f),
424
+ uv_space_index: 0
425
+ );
426
+
427
+
428
+ export material Fabric_Carpet_Long_Floor_Orange(*)
429
+ [[
430
+ ::anno::author("NVIDIA vMaterials"),
431
+ ::anno::display_name("Long Floor Carpet - Orange"),
432
+ ::anno::description(DESCRIPTION),
433
+ ::anno::copyright_notice(COPYRIGHT),
434
+ ::anno::thumbnail("./.thumbs/Fabric_Carpet_Long_Floor.Fabric_Carpet_Long_Floor_Orange.png"),
435
+ ::anno::key_words(string[]("carpet", "floor", "interior", "soft", "fabric", "long", "orange", "warm"))
436
+ ]]
437
+ = Fabric_Carpet_Long_Floor(
438
+ infinite_tiling: true,
439
+ carpet_color: color(0.907547f, 0.293216f, 0.084642f),
440
+ ao_amount: 0.8f,
441
+ carpet_bump_factor: 1.0f,
442
+ texture_translate: float2(0.0f),
443
+ texture_rotate: 0.0f,
444
+ texture_scale: float2(1.0f),
445
+ uv_space_index: 0
446
+ );
447
+
448
+
449
+ export material Fabric_Carpet_Long_Floor_Green(*)
450
+ [[
451
+ ::anno::author("NVIDIA vMaterials"),
452
+ ::anno::display_name("Long Floor Carpet - Green"),
453
+ ::anno::description(DESCRIPTION),
454
+ ::anno::copyright_notice(COPYRIGHT),
455
+ ::anno::thumbnail("./.thumbs/Fabric_Carpet_Long_Floor.Fabric_Carpet_Long_Floor_Green.png"),
456
+ ::anno::key_words(string[]("carpet", "floor", "interior", "soft", "fabric", "long", "green"))
457
+ ]]
458
+ = Fabric_Carpet_Long_Floor(
459
+ infinite_tiling: true,
460
+ carpet_color: color(0.267358f, 0.464741f, 0.051122f),
461
+ ao_amount: 0.8f,
462
+ carpet_bump_factor: 1.0f,
463
+ texture_translate: float2(0.0f),
464
+ texture_rotate: 0.0f,
465
+ texture_scale: float2(1.0f),
466
+ uv_space_index: 0
467
+ );
468
+
469
+
470
+ export material Fabric_Carpet_Long_Floor_Bordeaux(*)
471
+ [[
472
+ ::anno::author("NVIDIA vMaterials"),
473
+ ::anno::display_name("Long Floor Carpet - Bordeaux"),
474
+ ::anno::description(DESCRIPTION),
475
+ ::anno::copyright_notice(COPYRIGHT),
476
+ ::anno::thumbnail("./.thumbs/Fabric_Carpet_Long_Floor.Fabric_Carpet_Long_Floor_Bordeaux.png"),
477
+ ::anno::key_words(string[]("carpet", "floor", "interior", "soft", "fabric", "long", "bordeaux", "red", "warm"))
478
+ ]]
479
+ = Fabric_Carpet_Long_Floor(
480
+ infinite_tiling: true,
481
+ carpet_color: color(0.618686f, 0.017936f, 0.141980f),
482
+ ao_amount: 0.8f,
483
+ carpet_bump_factor: 1.0f,
484
+ texture_translate: float2(0.0f),
485
+ texture_rotate: 0.0f,
486
+ texture_scale: float2(1.0f),
487
+ uv_space_index: 0
488
+ );
489
+
490
+
code/third_party/vMaterials_2/Carpet/Rug_Carpet.mdl ADDED
@@ -0,0 +1,698 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2024 NVIDIA Corporation. All rights reserved. *
3
+ ******************************************************************************
4
+
5
+ Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge,
6
+ to any person obtaining a copy of the sample definition code that uses our
7
+ Material Definition Language (the "MDL Materials"), to reproduce and distribute
8
+ the MDL Materials, including without limitation the rights to use, copy, merge,
9
+ publish, distribute, and sell modified and unmodified copies of the MDL
10
+ Materials, and to permit persons to whom the MDL Materials is furnished to do
11
+ so, in all cases solely for use with NVIDIA's Material Definition Language,
12
+ subject to the following further conditions:
13
+
14
+ 1. The above copyright notices, this list of conditions, and the disclaimer
15
+ that follows shall be retained in all copies of one or more of the MDL
16
+ Materials, including in any software with which the MDL Materials are bundled,
17
+ redistributed, and/or sold, and included either as stand-alone text files,
18
+ human-readable headers or in the appropriate machine-readable metadata fields
19
+ within text or binary files as long as those fields can be easily viewed by the
20
+ user, as applicable.
21
+ 2. The name of NVIDIA shall not be used to promote, endorse or advertise any
22
+ Modified Version without specific prior written permission, except a) to comply
23
+ with the notice requirements otherwise contained herein; or b) to acknowledge
24
+ the contribution(s) of NVIDIA.
25
+
26
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
27
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
28
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
29
+ TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR
30
+ ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL,
31
+ INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF
32
+ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE
33
+ THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.
34
+ */
35
+
36
+ mdl 1.6;
37
+
38
+ import ::anno::*;
39
+ import ::base::*;
40
+ import ::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
+ float remap(float input, float low, float high)
63
+ {
64
+ //return low + input * (high - low);
65
+ return ::math::lerp(low, high, input);
66
+ }
67
+
68
+ float3 normalmap_normal(
69
+ uniform texture_2d texture,
70
+ float factor = 1.0,
71
+ ::base::texture_coordinate_info uvw = ::base::texture_coordinate_info()
72
+ )
73
+ {
74
+ float3 lookup = (::tex::lookup_float3(texture, float2(uvw.position.x, uvw.position.y)) - float3(0.5)) * (factor * 2.0);
75
+ return ::math::normalize(uvw.tangent_u * lookup.x + uvw.tangent_v * lookup.y + ::state::normal() * (lookup.z + (1.0 - factor)));
76
+ }
77
+
78
+
79
+ ::base::texture_coordinate_info transform_coordinate_2(
80
+ float4x4 transform
81
+ [[ anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix.") ]],
82
+ ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info()
83
+ [[ anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection.") ]]
84
+ ) [[
85
+ ::anno::description("Transform a texture coordinate by a matrix.") ,
86
+ ::anno::noinline()
87
+ ]]
88
+ {
89
+ // Version 2
90
+ float4 r_position = transform * float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1);
91
+ //try aproximating it for the case that the rotation is only aroud z and assuming the texture layout is nice and z is ~constant.
92
+ //just pretend there is no other rotation happening
93
+ //get rid of scaling and translation. Then extract fields where sin and cos would be in a simple 2d transform around z.
94
+ float4 u = transform[0];
95
+ float3 ru = ::math::normalize(float3(u.x,u.y,u.z));
96
+ float cos = ru.x;
97
+ float sin = -ru.y;
98
+
99
+
100
+ return ::base::texture_coordinate_info(
101
+ float3(r_position.x,r_position.y,r_position.z),
102
+ math::normalize(cos * coordinate.tangent_u - sin * coordinate.tangent_v),
103
+ math::normalize(cos * coordinate.tangent_v + sin * coordinate.tangent_u));
104
+ }
105
+
106
+ // Takes the standard input that every material has. It combines a couple of
107
+ // functions in one convenience function.
108
+ ::base::texture_coordinate_info vmat_transform(
109
+ float2 translation = float2(0.0, 0.0),
110
+ float rotation = 0.0, // rotation in degrees
111
+ float2 scaling = float2(1.0, 1.0),
112
+ uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw,
113
+ uniform int uv_space = 0
114
+ )
115
+ {
116
+ float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f;
117
+ float4x4 scale =
118
+ float4x4(1.0 /scaling.x, 0. , 0. , 0.,
119
+ 0. , 1.0 /scaling.y , 0. , 0.,
120
+ 0. , 0. , 1.0, 0.,
121
+ translation.x , translation.y , 0.0, 1.);
122
+
123
+ float s = ::math::sin(rotation_rad);
124
+ float c = ::math::cos(rotation_rad);
125
+ float4x4 rotate =
126
+ float4x4( c , -s , 0.0 , 0.0,
127
+ s , c , 0.0 , 0.0,
128
+ 0.0, 0.0 , 1.0 , 0.0,
129
+ 0. , 0.0 , 0.0 , 1.);
130
+
131
+ return transform_coordinate_2(scale*rotate, ::base::coordinate_source(system, uv_space));
132
+ }
133
+
134
+ ::base::texture_coordinate_info vmat_transform_post_scale(
135
+ ::base::texture_coordinate_info uvw,
136
+ float2 scale = float2(1.0f)
137
+ )
138
+ {
139
+ return ::base::texture_coordinate_info(
140
+ position: float3(uvw.position.x / scale.x,
141
+ uvw.position.y / scale.y,
142
+ uvw.position.z),
143
+ tangent_u: uvw.tangent_u,
144
+ tangent_v: uvw.tangent_v
145
+ );
146
+ }
147
+
148
+
149
+ float3 rgb2hsl(float3 c)
150
+ [[
151
+ ::anno::description("Converts a color value to HSL. The function outputs the hue to \n"
152
+ "lie in the range from 0.0-1.0."),
153
+ ::anno::author("NVIDIA vMaterials")
154
+ ]]
155
+ {
156
+ float3 hsl;
157
+ float cMax = ::math::max(::math::max(c.x, c.y), c.z);
158
+ float cMin = ::math::min(::math::min(c.x, c.y), c.z);
159
+ float delta = cMax - cMin;
160
+
161
+ hsl.z = (cMax + cMin) / 2.0;
162
+ hsl.x = ((cMax == cMin) ? 0 :
163
+ (cMax == c.x) ? (c.y - c.z) / delta + ((c.z > c.y) ? 6.0f : 0.0f):
164
+ (cMax == c.y) ? (c.z - c.x) / delta + 2.0 : (c.x - c.y) / delta + 4.0) / 6.0f;
165
+ hsl.y = (hsl.z == 0.0 || hsl.z == 1.0) ? 0.0 : delta / (1.0 - ::math::abs(2.0 * hsl.z - 1.0));
166
+ return hsl;
167
+ }
168
+
169
+
170
+ // converts a HSL value back to a color
171
+ // The Hue is expected to lie in the range
172
+ float f_n(float n, float a, float h, float l) {
173
+ float k = ::math::fmod(n + h * 12.f, 12.f);
174
+
175
+ return l - a * ::math::max(-1.0f, ::math::min(::math::min(k-3.0f, 9.0f-k), 1.0f));
176
+ }
177
+
178
+ color hsl2rgb(float3 hsl)
179
+ [[
180
+ ::anno::description("Converts a HSL value back to a color. Note that the hue is expected to \n"
181
+ "lie in the range from 0.0-1.0."),
182
+ ::anno::author("NVIDIA vMaterials")
183
+ ]]
184
+ {
185
+ float h = hsl.x, s = hsl.y, l = hsl.z;
186
+ float a = s * ::math::min(l, 1.0f - l);
187
+ return color(f_n(0.0, a, h, l),
188
+ f_n(8.0, a, h, l),
189
+ f_n(4.0, a, h, l));
190
+ }
191
+
192
+ float histogram_range(float input, float range = 1.0f, float position = 0.5f)
193
+ {
194
+ float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0);
195
+ float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0);
196
+ return ::math::lerp(low, high, input);
197
+ }
198
+
199
+ base::anisotropy_return anisotropy_conversion(
200
+ float roughness = 0.0 ,
201
+ float anisotropy = 0.0 ,
202
+ float anisotropy_rotation = 0.0 ,
203
+ float3 tangent_u = state::texture_tangent_u(0)
204
+ )
205
+ {
206
+ base::anisotropy_return return_value(
207
+ roughness_u: roughness * roughness,
208
+ roughness_v: roughness * roughness,
209
+ tangent_u: tangent_u
210
+ );
211
+ if (anisotropy > 0.f) {
212
+ // Allows for infinite anisotropy when roughness==0, full roughness when anisotropy==0 (saturated later on)
213
+ return_value.roughness_u += math::pow(anisotropy,4);
214
+
215
+ if (anisotropy_rotation > 0.f && anisotropy_rotation < 1.f) {
216
+ float3 tangent_v = math::cross(state::normal(), tangent_u); // assumed these are normalized already
217
+ float rotation_angle = 2.f * math::PI * anisotropy_rotation;
218
+ return_value.tangent_u = tangent_u * math::cos(rotation_angle) - tangent_v * math::sin(rotation_angle);
219
+ }
220
+ }
221
+ return_value.roughness_u = math::min(1.f, return_value.roughness_u);
222
+ return_value.roughness_v = math::min(1.f, return_value.roughness_v);
223
+
224
+ return return_value;
225
+ }
226
+
227
+ export material Rug_Carpet_Base(
228
+ color carpet_color = color(0.139f, 0.139f, 0.139f) [[
229
+ ::anno::description("Adjusts the color of the rug while keeping bright fibers well visible."),
230
+ ::anno::display_name("Carpet Color"),
231
+ ::anno::in_group("Appearance"),
232
+ ::anno::ui_order(0)
233
+ ]],
234
+ float roughness = 0.48f [[
235
+ ::anno::description("Higher values lead to a less shiny appearance of the carpet."),
236
+ ::anno::display_name("Reflection Roughness"),
237
+ ::anno::in_group("Appearance"),
238
+ ::anno::hard_range(0.f, 1.f),
239
+ ::anno::ui_order(1)
240
+ ]],
241
+ float roughness_variation = 0.04f [[
242
+ ::anno::description("Adds variation to the roughness of the rug."),
243
+ ::anno::display_name("Roughness Variation"),
244
+ ::anno::in_group("Appearance"),
245
+ ::anno::hard_range(0.f, 1.f),
246
+ ::anno::ui_order(2)
247
+ ]],
248
+ float pattern_AO = 0.59f [[
249
+ ::anno::description("Adds darkening around the pattern of the rug."),
250
+ ::anno::display_name("Pattern Visibility"),
251
+ ::anno::in_group("Appearance"),
252
+ ::anno::hard_range(0.f, 1.f),
253
+ ::anno::ui_order(3)
254
+ ]],
255
+ float bump_strength = 1.f [[
256
+ ::anno::description("Adjusts the bumpiness of the pattern."),
257
+ ::anno::display_name("Bump Strength"),
258
+ ::anno::in_group("Appearance"),
259
+ ::anno::hard_range(0.f, 2.f),
260
+ ::anno::soft_range(0.f, 1.f),
261
+ ::anno::ui_order(4)
262
+ ]],
263
+ uniform float2 texture_translate = float2(0.f) [[
264
+ ::anno::description("Controls the position of the texture."),
265
+ ::anno::display_name("Texture Translate"),
266
+ ::anno::in_group("Transform"),
267
+ ::anno::ui_order(5)
268
+ ]],
269
+ uniform float texture_rotate = 0.f [[
270
+ ::anno::description("Rotates angle of the texture in degrees."),
271
+ ::anno::display_name("Texture Rotate"),
272
+ ::anno::in_group("Transform"),
273
+ ::anno::soft_range(0.f, 360.f),
274
+ ::anno::ui_order(6)
275
+ ]],
276
+ uniform float2 texture_scale = float2(1.f) [[
277
+ ::anno::description("Larger numbers increase the size."),
278
+ ::anno::display_name("Texture Scale"),
279
+ ::anno::in_group("Transform"),
280
+ ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)),
281
+ ::anno::ui_order(7)
282
+ ]],
283
+ uniform bool roundcorners_enable = false [[
284
+ ::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."),
285
+ ::anno::display_name("Enable Round Corners"),
286
+ ::anno::in_group("Round Corners"),
287
+ ::anno::ui_order(8)
288
+ ]],
289
+ uniform float roundcorners_radius_mm = 1.5f [[
290
+ ::anno::description("Radius of the rounded corners in millimeters."),
291
+ ::anno::display_name("Round Corner Radius (mm)"),
292
+ ::anno::in_group("Round Corners"),
293
+ ::anno::soft_range(0.f, 10.f),
294
+ ::anno::ui_order(9)
295
+ ]],
296
+ uniform bool roundcorners_across_materials = false [[
297
+ ::anno::description("Applies the round corner effect across different materials when enabled."),
298
+ ::anno::display_name("Across Materials"),
299
+ ::anno::in_group("Round Corners"),
300
+ ::anno::ui_order(10)
301
+ ]],
302
+ uniform int uv_space_index = 0 [[
303
+ ::anno::description("Uses selected UV space for material."),
304
+ ::anno::display_name("UV Space Index"),
305
+ ::anno::in_group("Transform"),
306
+ ::anno::ui_order(11)
307
+ ]],
308
+ // the exchangeable textures
309
+ uniform texture_2d rug_fibers = texture_2d("./textures/rug_carpet_multi_fibers.jpg", ::tex::gamma_linear),
310
+ uniform texture_2d rug_aniso = texture_2d("./textures/rug_carpet_anisotropy.jpg", ::tex::gamma_linear),
311
+ uniform texture_2d rug_multi_R_rough_G_ao_B_patternao = texture_2d("./textures/rug_carpet_01_multi_R_rough_G_ao_B_bumpao.jpg", ::tex::gamma_linear),
312
+ uniform texture_2d rug_normal = texture_2d("./textures/rug_carpet_01_norm.jpg", ::tex::gamma_linear)
313
+ )
314
+ [[
315
+ ::anno::author("NVIDIA vMaterials"),
316
+ ::anno::contributor("Rüdiger Raab"),
317
+ ::anno::contributor("Maik Rohland"),
318
+ ::anno::display_name("Rug Carpet Template"),
319
+ ::anno::description("Template for Rug Carpet Material."),
320
+ ::anno::copyright_notice(COPYRIGHT),
321
+ ::anno::thumbnail("./.thumbs/Rug_Carpet.Rug_Carpet_Base.png"),
322
+ ::anno::key_words(string[]("carpet", "fabric", "design", "automotive", "architecture", "interior", "new", "rough", "bumped", "gray")),
323
+ ::anno::hidden()
324
+ ]]
325
+ =
326
+ let {
327
+
328
+
329
+ bool tmp0 = false;
330
+ material_surface tmp1(::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(anisotropy_conversion(remap(roughness, 0.370000005f, 0.229999989f) * roughness_variation * ::base::file_texture(rug_aniso, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).mono + histogram_range(float3(::base::file_texture(rug_multi_R_rough_G_ao_B_patternao, 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.5f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, 1.f, remap(roughness, 0.370000005f, 0.680000007f)), 0.680000007f, ::base::file_texture(rug_aniso, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).mono, ::state::texture_tangent_u(0)).roughness_u, anisotropy_conversion(remap(roughness, 0.370000005f, 0.229999989f) * roughness_variation * ::base::file_texture(rug_aniso, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).mono + histogram_range(float3(::base::file_texture(rug_multi_R_rough_G_ao_B_patternao, 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.5f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, 1.f, remap(roughness, 0.370000005f, 0.680000007f)), 0.680000007f, ::base::file_texture(rug_aniso, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).mono, ::state::texture_tangent_u(0)).roughness_v, color(::math::lerp(1.f, float3(::base::file_texture(rug_multi_R_rough_G_ao_B_patternao, 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.5f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).y, 0.310000002f) * float3(::base::file_texture(rug_multi_R_rough_G_ao_B_patternao, 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.5f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).z), color(0.f, 0.f, 0.f), anisotropy_conversion(remap(roughness, 0.370000005f, 0.229999989f) * roughness_variation * ::base::file_texture(rug_aniso, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).mono + histogram_range(float3(::base::file_texture(rug_multi_R_rough_G_ao_B_patternao, 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.5f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, 1.f, remap(roughness, 0.370000005f, 0.680000007f)), 0.680000007f, ::base::file_texture(rug_aniso, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).mono, ::state::texture_tangent_u(0)).tangent_u, ::df::scatter_reflect), ::df::weighted_layer(0.5f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(hsl2rgb(rgb2hsl(float3(carpet_color)) * float3(1.f, 1.f, 0.519999981f)), carpet_color, ::base::color_layer_blend, float3(::math::pow(::base::file_texture(rug_fibers, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index), float2(1.f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint, 2.20000005f)).x, true).tint, hsl2rgb(float3(rgb2hsl(float3(carpet_color)).x, rgb2hsl(float3(carpet_color)).y * 0.5f, remap(rgb2hsl(float3(carpet_color)).z, 0.519999981f, 1.f))), ::base::color_layer_blend, float3(::math::pow(::base::file_texture(rug_fibers, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index), float2(1.f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint, 2.20000005f)).y, true).tint, hsl2rgb(float3(rgb2hsl(float3(carpet_color)).x, rgb2hsl(float3(carpet_color)).y, remap(rgb2hsl(float3(carpet_color)).z, 0.5f, 1.f))), ::base::color_layer_blend, float3(::math::pow(::base::file_texture(rug_fibers, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index), float2(1.f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint, 2.20000005f)).z, true).tint, color(float3(::base::file_texture(rug_multi_R_rough_G_ao_B_patternao, 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.5f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).z), ::base::color_layer_multiply, pattern_AO, true).tint, color(float3(::base::file_texture(rug_multi_R_rough_G_ao_B_patternao, 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.5f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).y), ::base::color_layer_multiply, 0.550000012f, true).tint, 0.f), bsdf(), normalmap_normal(rug_normal, bump_strength, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index))), normalmap_normal(rug_normal, bump_strength, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index))), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
331
+ material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
332
+ color tmp3 = color(1.f, 1.f, 1.f);
333
+ 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));
334
+ 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());
335
+ } in
336
+ material(
337
+ thin_walled: tmp0,
338
+ surface: tmp1,
339
+ backface: tmp2,
340
+ ior: tmp3,
341
+ volume: tmp4,
342
+ geometry: tmp5);
343
+
344
+
345
+ // 1
346
+ export material Rug_Carpet_Lines(
347
+ color carpet_color = color(0.139f, 0.139f, 0.139f) [[
348
+ ::anno::description("Adjusts the color of the rug while keeping bright fibers well visible."),
349
+ ::anno::display_name("Carpet Color"),
350
+ ::anno::in_group("Appearance"),
351
+ ::anno::ui_order(0)
352
+ ]],
353
+ float roughness = 0.48f [[
354
+ ::anno::description("Higher values lead to a less shiny appearance of the carpet."),
355
+ ::anno::display_name("Roughness"),
356
+ ::anno::in_group("Appearance"),
357
+ ::anno::hard_range(0.f, 1.f),
358
+ ::anno::ui_order(1)
359
+ ]],
360
+ float roughness_variation = 0.04f [[
361
+ ::anno::description("Adds variation to the roughness of the rug."),
362
+ ::anno::display_name("Roughness Variation"),
363
+ ::anno::in_group("Appearance"),
364
+ ::anno::hard_range(0.f, 1.f),
365
+ ::anno::ui_order(2)
366
+ ]],
367
+ float pattern_AO = 0.59f [[
368
+ ::anno::description("Adds darkening around the pattern of the rug."),
369
+ ::anno::display_name("Pattern Visibility"),
370
+ ::anno::in_group("Appearance"),
371
+ ::anno::hard_range(0.f, 1.f),
372
+ ::anno::ui_order(3)
373
+ ]],
374
+ float bump_strength = 1.f [[
375
+ ::anno::description("Adjusts the bumpiness of the pattern."),
376
+ ::anno::display_name("Bump Strength"),
377
+ ::anno::in_group("Appearance"),
378
+ ::anno::hard_range(0.f, 2.f),
379
+ ::anno::soft_range(0.f, 1.f),
380
+ ::anno::ui_order(4)
381
+ ]],
382
+ uniform float2 texture_translate = float2(0.f) [[
383
+ ::anno::description("Controls the position of the texture."),
384
+ ::anno::display_name("Texture Translate"),
385
+ ::anno::in_group("Transform"),
386
+ ::anno::ui_order(5)
387
+ ]],
388
+ uniform float texture_rotate = 0.f [[
389
+ ::anno::description("Rotates angle of the texture in degrees."),
390
+ ::anno::display_name("Texture Rotate"),
391
+ ::anno::in_group("Transform"),
392
+ ::anno::soft_range(0.f, 360.f),
393
+ ::anno::ui_order(6)
394
+ ]],
395
+ uniform float2 texture_scale = float2(1.f) [[
396
+ ::anno::description("Larger numbers increase the size."),
397
+ ::anno::display_name("Texture Scale"),
398
+ ::anno::in_group("Transform"),
399
+ ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)),
400
+ ::anno::ui_order(7)
401
+ ]],
402
+ uniform bool roundcorners_enable = false [[
403
+ ::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."),
404
+ ::anno::display_name("Enable Round Corners"),
405
+ ::anno::in_group("Round Corners"),
406
+ ::anno::ui_order(8)
407
+ ]],
408
+ uniform float roundcorners_radius_mm = 1.5f [[
409
+ ::anno::description("Radius of the rounded corners in millimeters."),
410
+ ::anno::display_name("Round Corner Radius (mm)"),
411
+ ::anno::in_group("Round Corners"),
412
+ ::anno::soft_range(0.f, 10.f),
413
+ ::anno::ui_order(9)
414
+ ]],
415
+ uniform bool roundcorners_across_materials = false [[
416
+ ::anno::description("Applies the round corner effect across different materials when enabled."),
417
+ ::anno::display_name("Across Materials"),
418
+ ::anno::in_group("Round Corners"),
419
+ ::anno::ui_order(10)
420
+ ]],
421
+ uniform int uv_space_index = 0 [[
422
+ ::anno::description("Uses selected UV space for material."),
423
+ ::anno::display_name("UV Space Index"),
424
+ ::anno::in_group("Transform"),
425
+ ::anno::ui_order(11)
426
+ ]]
427
+ )
428
+ [[
429
+ ::anno::author("NVIDIA vMaterials"),
430
+ ::anno::contributor("Rüdiger Raab"),
431
+ ::anno::contributor("Maik Rohland"),
432
+ ::anno::display_name("Rug Carpet - Lines Pattern"),
433
+ ::anno::description("Rug Carpet Material with line pattern."),
434
+ ::anno::copyright_notice(COPYRIGHT),
435
+ ::anno::thumbnail("./.thumbs/Rug_Carpet.Rug_Carpet_Lines.png"),
436
+ ::anno::key_words(string[]("carpet", "fabric", "design", "automotive", "architecture", "pattern", "lines", "interior", "new", "rough", "bumped", "gray"))
437
+ ]] = Rug_Carpet_Base(
438
+ carpet_color: carpet_color,
439
+ roughness: roughness,
440
+ roughness_variation: roughness_variation,
441
+ pattern_AO: pattern_AO,
442
+ bump_strength: bump_strength,
443
+ texture_translate: texture_translate,
444
+ texture_rotate: texture_rotate,
445
+ texture_scale: texture_scale,
446
+ roundcorners_enable: roundcorners_enable,
447
+ roundcorners_radius_mm: roundcorners_radius_mm,
448
+ roundcorners_across_materials: roundcorners_across_materials,
449
+ uv_space_index: uv_space_index,
450
+ rug_fibers: texture_2d("./textures/rug_carpet_multi_fibers.jpg", ::tex::gamma_linear),
451
+ rug_aniso: texture_2d("./textures/rug_carpet_anisotropy.jpg", ::tex::gamma_linear),
452
+ rug_multi_R_rough_G_ao_B_patternao: texture_2d("./textures/rug_carpet_01_multi_R_rough_G_ao_B_bumpao.jpg", ::tex::gamma_linear),
453
+ rug_normal: texture_2d("./textures/rug_carpet_01_norm.jpg", ::tex::gamma_linear)
454
+ );
455
+
456
+
457
+ // 2
458
+ export material Rug_Carpet_Hexagonal(
459
+ color carpet_color = color(0.139f, 0.139f, 0.139f) [[
460
+ ::anno::description("Adjusts the color of the rug while keeping bright fibers well visible."),
461
+ ::anno::display_name("Carpet Color"),
462
+ ::anno::in_group("Appearance"),
463
+ ::anno::ui_order(0)
464
+ ]],
465
+ float roughness = 0.48f [[
466
+ ::anno::description("Higher values lead to a less shiny appearance of the carpet."),
467
+ ::anno::display_name("Roughness"),
468
+ ::anno::in_group("Appearance"),
469
+ ::anno::hard_range(0.f, 1.f),
470
+ ::anno::ui_order(1)
471
+ ]],
472
+ float roughness_variation = 0.04f [[
473
+ ::anno::description("Adds variation to the roughness of the rug."),
474
+ ::anno::display_name("Roughness Variation"),
475
+ ::anno::in_group("Appearance"),
476
+ ::anno::hard_range(0.f, 1.f),
477
+ ::anno::ui_order(2)
478
+ ]],
479
+ float pattern_AO = 0.59f [[
480
+ ::anno::description("Adds darkening around the pattern of the rug."),
481
+ ::anno::display_name("Pattern Visibility"),
482
+ ::anno::in_group("Appearance"),
483
+ ::anno::hard_range(0.f, 1.f),
484
+ ::anno::ui_order(3)
485
+ ]],
486
+ float bump_strength = 1.f [[
487
+ ::anno::description("Adjusts the bumpiness of the pattern."),
488
+ ::anno::display_name("Bump Strength"),
489
+ ::anno::in_group("Appearance"),
490
+ ::anno::hard_range(0.f, 2.f),
491
+ ::anno::soft_range(0.f, 1.f),
492
+ ::anno::ui_order(4)
493
+ ]],
494
+ uniform float2 texture_translate = float2(0.f) [[
495
+ ::anno::description("Controls the position of the texture."),
496
+ ::anno::display_name("Texture Translate"),
497
+ ::anno::in_group("Transform"),
498
+ ::anno::ui_order(5)
499
+ ]],
500
+ uniform float texture_rotate = 0.f [[
501
+ ::anno::description("Rotates angle of the texture in degrees."),
502
+ ::anno::display_name("Texture Rotate"),
503
+ ::anno::in_group("Transform"),
504
+ ::anno::soft_range(0.f, 360.f),
505
+ ::anno::ui_order(6)
506
+ ]],
507
+ uniform float2 texture_scale = float2(1.f) [[
508
+ ::anno::description("Larger numbers increase the size."),
509
+ ::anno::display_name("Texture Scale"),
510
+ ::anno::in_group("Transform"),
511
+ ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)),
512
+ ::anno::ui_order(7)
513
+ ]],
514
+ uniform bool roundcorners_enable = false [[
515
+ ::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."),
516
+ ::anno::display_name("Enable Round Corners"),
517
+ ::anno::in_group("Round Corners"),
518
+ ::anno::ui_order(8)
519
+ ]],
520
+ uniform float roundcorners_radius_mm = 1.5f [[
521
+ ::anno::description("Radius of the rounded corners in millimeters."),
522
+ ::anno::display_name("Round Corner Radius (mm)"),
523
+ ::anno::in_group("Round Corners"),
524
+ ::anno::soft_range(0.f, 10.f),
525
+ ::anno::ui_order(9)
526
+ ]],
527
+ uniform bool roundcorners_across_materials = false [[
528
+ ::anno::description("Applies the round corner effect across different materials when enabled."),
529
+ ::anno::display_name("Across Materials"),
530
+ ::anno::in_group("Round Corners"),
531
+ ::anno::ui_order(10)
532
+ ]],
533
+ uniform int uv_space_index = 0 [[
534
+ ::anno::description("Uses selected UV space for material."),
535
+ ::anno::display_name("UV Space Index"),
536
+ ::anno::in_group("Transform"),
537
+ ::anno::ui_order(11)
538
+ ]]
539
+ )
540
+ [[
541
+ ::anno::author("NVIDIA vMaterials"),
542
+ ::anno::contributor("Rüdiger Raab"),
543
+ ::anno::contributor("Maik Rohland"),
544
+ ::anno::display_name("Rug Carpet - Hexagonal Pattern"),
545
+ ::anno::description("Rug carpet material with hexagonal pattern."),
546
+ ::anno::copyright_notice(COPYRIGHT),
547
+ ::anno::thumbnail("./.thumbs/Rug_Carpet.Rug_Carpet_Hexagonal.png"),
548
+ ::anno::key_words(string[]("carpet", "fabric", "design", "automotive", "architecture", "pattern", "hexagonal", "interior", "new", "rough", "bumped", "gray"))
549
+ ]] = Rug_Carpet_Base(
550
+ carpet_color: carpet_color,
551
+ roughness: roughness,
552
+ roughness_variation: roughness_variation,
553
+ pattern_AO: pattern_AO,
554
+ bump_strength: bump_strength,
555
+ texture_translate: texture_translate,
556
+ texture_rotate: texture_rotate,
557
+ texture_scale: texture_scale,
558
+ roundcorners_enable: roundcorners_enable,
559
+ roundcorners_radius_mm: roundcorners_radius_mm,
560
+ roundcorners_across_materials: roundcorners_across_materials,
561
+ uv_space_index: uv_space_index,
562
+ rug_fibers: texture_2d("./textures/rug_carpet_multi_fibers.jpg", ::tex::gamma_linear),
563
+ rug_aniso: texture_2d("./textures/rug_carpet_anisotropy.jpg", ::tex::gamma_linear),
564
+ rug_multi_R_rough_G_ao_B_patternao: texture_2d("./textures/rug_carpet_02_multi_R_rough_G_ao_B_bumpao.jpg", ::tex::gamma_linear),
565
+ rug_normal: texture_2d("./textures/rug_carpet_02_norm.jpg", ::tex::gamma_linear)
566
+ );
567
+
568
+
569
+ // 3
570
+ export material Rug_Carpet_Honeycomb(
571
+ color carpet_color = color(0.139f, 0.139f, 0.139f) [[
572
+ ::anno::description("Adjusts the color of the rug while keeping bright fibers well visible."),
573
+ ::anno::display_name("Carpet Color"),
574
+ ::anno::in_group("Appearance"),
575
+ ::anno::ui_order(0)
576
+ ]],
577
+ float roughness = 0.48f [[
578
+ ::anno::description("Higher values lead to a less shiny appearance of the carpet."),
579
+ ::anno::display_name("Roughness"),
580
+ ::anno::in_group("Appearance"),
581
+ ::anno::hard_range(0.f, 1.f),
582
+ ::anno::ui_order(1)
583
+ ]],
584
+ float roughness_variation = 0.04f [[
585
+ ::anno::description("Adds variation to the roughness of the rug."),
586
+ ::anno::display_name("Roughness Variation"),
587
+ ::anno::in_group("Appearance"),
588
+ ::anno::hard_range(0.f, 1.f),
589
+ ::anno::ui_order(2)
590
+ ]],
591
+ float pattern_AO = 0.59f [[
592
+ ::anno::description("Adds darkening around the pattern of the rug."),
593
+ ::anno::display_name("Pattern Visibility"),
594
+ ::anno::in_group("Appearance"),
595
+ ::anno::hard_range(0.f, 1.f),
596
+ ::anno::ui_order(3)
597
+ ]],
598
+ float bump_strength = 1.f [[
599
+ ::anno::description("Adjusts the bumpiness of the pattern."),
600
+ ::anno::display_name("Bump Strength"),
601
+ ::anno::in_group("Appearance"),
602
+ ::anno::hard_range(0.f, 2.f),
603
+ ::anno::soft_range(0.f, 1.f),
604
+ ::anno::ui_order(4)
605
+ ]],
606
+ uniform float2 texture_translate = float2(0.f) [[
607
+ ::anno::description("Controls the position of the texture."),
608
+ ::anno::display_name("Texture Translate"),
609
+ ::anno::in_group("Transform"),
610
+ ::anno::ui_order(5)
611
+ ]],
612
+ uniform float texture_rotate = 0.f [[
613
+ ::anno::description("Rotates angle of the texture in degrees."),
614
+ ::anno::display_name("Texture Rotate"),
615
+ ::anno::in_group("Transform"),
616
+ ::anno::soft_range(0.f, 360.f),
617
+ ::anno::ui_order(6)
618
+ ]],
619
+ uniform float2 texture_scale = float2(1.f) [[
620
+ ::anno::description("Larger numbers increase the size."),
621
+ ::anno::display_name("Texture Scale"),
622
+ ::anno::in_group("Transform"),
623
+ ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)),
624
+ ::anno::ui_order(7)
625
+ ]],
626
+ uniform bool roundcorners_enable = false [[
627
+ ::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."),
628
+ ::anno::display_name("Enable Round Corners"),
629
+ ::anno::in_group("Round Corners"),
630
+ ::anno::ui_order(8)
631
+ ]],
632
+ uniform float roundcorners_radius_mm = 1.5f [[
633
+ ::anno::description("Radius of the rounded corners in millimeters."),
634
+ ::anno::display_name("Round Corner Radius (mm)"),
635
+ ::anno::in_group("Round Corners"),
636
+ ::anno::soft_range(0.f, 10.f),
637
+ ::anno::ui_order(9)
638
+ ]],
639
+ uniform bool roundcorners_across_materials = false [[
640
+ ::anno::description("Applies the round corner effect across different materials when enabled."),
641
+ ::anno::display_name("Across Materials"),
642
+ ::anno::in_group("Round Corners"),
643
+ ::anno::ui_order(10)
644
+ ]],
645
+ uniform int uv_space_index = 0 [[
646
+ ::anno::description("Uses selected UV space for material."),
647
+ ::anno::display_name("UV Space Index"),
648
+ ::anno::in_group("Transform"),
649
+ ::anno::ui_order(11)
650
+ ]]
651
+ )
652
+ [[
653
+ ::anno::author("NVIDIA vMaterials"),
654
+ ::anno::contributor("Rüdiger Raab"),
655
+ ::anno::contributor("Maik Rohland"),
656
+ ::anno::display_name("Rug Carpet - Honeycomb"),
657
+ ::anno::description("Rug carpet material with stylized honeycomb pattern."),
658
+ ::anno::copyright_notice(COPYRIGHT),
659
+ ::anno::thumbnail("./.thumbs/Rug_Carpet.Rug_Carpet_Honeycomb.png"),
660
+ ::anno::key_words(string[]("carpet", "fabric", "design", "automotive", "architecture", "pattern", "honeycomb", "modern", "hexagonal", "interior", "new", "rough", "bumped", "gray"))
661
+ ]] = Rug_Carpet_Base(
662
+ carpet_color: carpet_color,
663
+ roughness: roughness,
664
+ roughness_variation: roughness_variation,
665
+ pattern_AO: pattern_AO,
666
+ bump_strength: bump_strength,
667
+ texture_translate: texture_translate,
668
+ texture_rotate: texture_rotate,
669
+ texture_scale: texture_scale,
670
+ roundcorners_enable: roundcorners_enable,
671
+ roundcorners_radius_mm: roundcorners_radius_mm,
672
+ roundcorners_across_materials: roundcorners_across_materials,
673
+ uv_space_index: uv_space_index,
674
+ rug_fibers: texture_2d("./textures/rug_carpet_multi_fibers.jpg", ::tex::gamma_linear),
675
+ rug_aniso: texture_2d("./textures/rug_carpet_anisotropy.jpg", ::tex::gamma_linear),
676
+ rug_multi_R_rough_G_ao_B_patternao: texture_2d("./textures/rug_carpet_03_multi_R_rough_G_ao_B_bumpao.jpg", ::tex::gamma_linear),
677
+ rug_normal: texture_2d("./textures/rug_carpet_03_norm.jpg", ::tex::gamma_linear)
678
+ );
679
+
680
+
681
+
682
+
683
+
684
+
685
+
686
+
687
+
688
+
689
+
690
+
691
+
692
+
693
+
694
+
695
+
696
+
697
+
698
+
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl.png ADDED

Git LFS Details

  • SHA256: c36c403b456bb0b6d5138b34e2900fbd18c9cb91a4d5bef4aab40899b3ef1593
  • Pointer size: 130 Bytes
  • Size of remote file: 87.7 kB
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting.png ADDED

Git LFS Details

  • SHA256: c36c403b456bb0b6d5138b34e2900fbd18c9cb91a4d5bef4aab40899b3ef1593
  • Pointer size: 130 Bytes
  • Size of remote file: 87.7 kB
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Amazon_Clay.png ADDED

Git LFS Details

  • SHA256: a1cb2434e3eb3f61a710acf3a384cd19d8ffd6b4107d6e86353ea710aa21c6c9
  • Pointer size: 130 Bytes
  • Size of remote file: 80.1 kB
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Ash_Brown.png ADDED

Git LFS Details

  • SHA256: dd769c5c84777dda911320c1a70f5b351c2b9d707fb213e42c2d3b35e5013254
  • Pointer size: 130 Bytes
  • Size of remote file: 78.2 kB
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Autumn.png ADDED

Git LFS Details

  • SHA256: 2cc9a3545ff7119738c983c980a23e032b1ba8f450bfdfa4f1974dc8d7d7f679
  • Pointer size: 130 Bytes
  • Size of remote file: 91.4 kB
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Black.png ADDED

Git LFS Details

  • SHA256: 4348250afc13d70fc37c132bb7ccb8961191767002be30cb4ca627a8043ff26d
  • Pointer size: 130 Bytes
  • Size of remote file: 75.4 kB
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Burgundy.png ADDED

Git LFS Details

  • SHA256: 759c87275bf896bf3ce4d8252dd2fde42878fa0481f1ad3ce784bda7ab80ecb4
  • Pointer size: 130 Bytes
  • Size of remote file: 86.3 kB
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Champagne.png ADDED

Git LFS Details

  • SHA256: ff84886757f9606840f94b8a90a9f8fb2c04a9d9d11f2f70493e73b4df8bb362
  • Pointer size: 130 Bytes
  • Size of remote file: 87.5 kB
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Chocolate.png ADDED

Git LFS Details

  • SHA256: 661d44ca7e86e684a04ff4fe0c6b34b0be1c7e57267afb8588b3ac2756f228a2
  • Pointer size: 130 Bytes
  • Size of remote file: 82.9 kB
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Crimson.png ADDED

Git LFS Details

  • SHA256: d28e549df3d2a7f312fc4f883b12107d0dc9e35556fdfce2b0c1acf646547794
  • Pointer size: 130 Bytes
  • Size of remote file: 89.8 kB
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Electric.png ADDED

Git LFS Details

  • SHA256: 21e0b706a56080e17296a99af5a5b2dba23f78e23cdf175d50b1c6330e4c8c89
  • Pointer size: 130 Bytes
  • Size of remote file: 91.8 kB
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Flaxen.png ADDED

Git LFS Details

  • SHA256: 89d11c663515a847599f8fd012e009b2463e13fd05758f5231069779d64544ab
  • Pointer size: 130 Bytes
  • Size of remote file: 90.5 kB
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Lavender.png ADDED

Git LFS Details

  • SHA256: a595e267c71cc66b23052e104e0f89d5fb3958969dccd00adb1e40e0a2f7da6e
  • Pointer size: 130 Bytes
  • Size of remote file: 88.3 kB
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Mint.png ADDED

Git LFS Details

  • SHA256: 2cf2c09658eb077690d0d74b4819ab5c2b13b8d232b949ef899855a874b4c31a
  • Pointer size: 130 Bytes
  • Size of remote file: 87.3 kB
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Mustard.png ADDED

Git LFS Details

  • SHA256: 459473432193f45f7fd8a65669593171d394be382f3989a9d18c749fec5b8fe0
  • Pointer size: 130 Bytes
  • Size of remote file: 92.7 kB
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Olive.png ADDED

Git LFS Details

  • SHA256: 79a71517149613a63d90d3ad99ca9accd94ec9fc79a89691088414884916a6c1
  • Pointer size: 130 Bytes
  • Size of remote file: 80.9 kB
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Potters_Clay.png ADDED

Git LFS Details

  • SHA256: 4d9a701e53266e74f354eee49106d08fe99a36428220735951d46dce62a9296b
  • Pointer size: 130 Bytes
  • Size of remote file: 86.9 kB
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Purple.png ADDED

Git LFS Details

  • SHA256: 11b48f5e13337f17acb6b686b776f8797a58fcd986d26514441d1373e1e2fb55
  • Pointer size: 130 Bytes
  • Size of remote file: 87.4 kB
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Rose.png ADDED

Git LFS Details

  • SHA256: a7844c39742d199aa6c9bd28341313baf87e8c5da592e252539732c8c19c1f02
  • Pointer size: 130 Bytes
  • Size of remote file: 93.1 kB
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Rosy_Peach.png ADDED

Git LFS Details

  • SHA256: 8d3518fb1e8e23147dd6394b08a8d008bb01cf2615cc1c5ce280c1785e676332
  • Pointer size: 130 Bytes
  • Size of remote file: 89.9 kB
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Silver.png ADDED

Git LFS Details

  • SHA256: aba8f8bee918c9e32c85852ef39d1209c7cb16702a308b33c9b19aaa69929648
  • Pointer size: 130 Bytes
  • Size of remote file: 86 kB
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Sky_Blue.png ADDED

Git LFS Details

  • SHA256: 79365652a491901bdf7581a86d7a3ca908cc3fcd7385cc66ea539e8e8c2978d1
  • Pointer size: 130 Bytes
  • Size of remote file: 89.8 kB
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Smoke.png ADDED

Git LFS Details

  • SHA256: 8a65c6f0e5b0f21b785ce1e9a65f9a6ab6805f4cb7adb53c3e2765a2f72f16ff
  • Pointer size: 130 Bytes
  • Size of remote file: 82.7 kB
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Teal.png ADDED

Git LFS Details

  • SHA256: 78bbaa11db2da3af6144b55db1f300518af1122f70dc579eb705e0d838a311bf
  • Pointer size: 130 Bytes
  • Size of remote file: 83.6 kB
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl.png ADDED

Git LFS Details

  • SHA256: 1ef1c26afe35ad0cb917e97727148110651527d14e2ded6dbeccb027ba8d3522
  • Pointer size: 131 Bytes
  • Size of remote file: 105 kB
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl@Cotton_Denim.png ADDED

Git LFS Details

  • SHA256: 1ef1c26afe35ad0cb917e97727148110651527d14e2ded6dbeccb027ba8d3522
  • Pointer size: 131 Bytes
  • Size of remote file: 105 kB
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl@Cotton_Denim_Black.png ADDED

Git LFS Details

  • SHA256: 686a61a2ce698c6f911f72b0d205ec6830db8f4aa218fb8fca8f4e7a28ad9469
  • Pointer size: 131 Bytes
  • Size of remote file: 101 kB
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl@Cotton_Denim_Bleached_Light_Blue.png ADDED

Git LFS Details

  • SHA256: 892881d316288e3991ef3b5151acab3cdeaca07ceb3489b59dff4f2779799c5a
  • Pointer size: 131 Bytes
  • Size of remote file: 110 kB
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl@Cotton_Denim_Carbon.png ADDED

Git LFS Details

  • SHA256: eae70d67b4575bcfb174a1d4e5d7c4ded3df69738d291a8dd94e742af21c0a06
  • Pointer size: 130 Bytes
  • Size of remote file: 99.4 kB
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl@Cotton_Denim_Independence_Blue.png ADDED

Git LFS Details

  • SHA256: 976a9cfe26190cb4850db2597c4849f0ca0b5b8aec976ea4ededc76a24e05d37
  • Pointer size: 131 Bytes
  • Size of remote file: 101 kB
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl@Cotton_Denim_Light_Blue.png ADDED

Git LFS Details

  • SHA256: c956d7f17710bd0a582f44b7012c84eb366586b8dc0720d14007a0603ad293dd
  • Pointer size: 131 Bytes
  • Size of remote file: 108 kB
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl@Cotton_Denim_Washed_Blue.png ADDED

Git LFS Details

  • SHA256: f1725e4dc9b590dd70d83eeab068ba12a50303b4975f31b509d1126184268af2
  • Pointer size: 131 Bytes
  • Size of remote file: 109 kB
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl.png ADDED

Git LFS Details

  • SHA256: d2ad70013d2ac91ac68441d5ed870b36c71602a1d43076f0d221ce7539dfb434
  • Pointer size: 130 Bytes
  • Size of remote file: 92 kB
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry.png ADDED

Git LFS Details

  • SHA256: d2ad70013d2ac91ac68441d5ed870b36c71602a1d43076f0d221ce7539dfb434
  • Pointer size: 130 Bytes
  • Size of remote file: 92 kB
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Brown.png ADDED

Git LFS Details

  • SHA256: 6eeaeb2d756c138cc53b7be41a6810a5684f8fa2d80089d6fda27a87c34b4013
  • Pointer size: 130 Bytes
  • Size of remote file: 83.3 kB
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Burgundy.png ADDED

Git LFS Details

  • SHA256: 3139ab5592e83d1cc9cee09be417cbc032601f32bcf1b6ad2fd8de5421aedf20
  • Pointer size: 130 Bytes
  • Size of remote file: 81.1 kB
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Dark_Blue.png ADDED

Git LFS Details

  • SHA256: d8641942218b943da251ac408f9b27d94084215ade5d5340cfd99a912c1c1e4b
  • Pointer size: 130 Bytes
  • Size of remote file: 78.7 kB
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Dark_Gray.png ADDED

Git LFS Details

  • SHA256: f640f6220775405e0beadc4d8872804669504700c99e589d49e5471a67565345
  • Pointer size: 130 Bytes
  • Size of remote file: 71.4 kB
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Electric_Blue.png ADDED

Git LFS Details

  • SHA256: dac9972f25be4fec8568228fdbb89db2ec08f39178cb675a1f457df343e2b39e
  • Pointer size: 130 Bytes
  • Size of remote file: 91.2 kB
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Fox_Red.png ADDED

Git LFS Details

  • SHA256: cc8e22a031e19a4091e7924d4fa5f38738ec647a91982c90ad818c5bbb72810d
  • Pointer size: 130 Bytes
  • Size of remote file: 86 kB
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Fuchsia.png ADDED

Git LFS Details

  • SHA256: 47d462ccecf056e1a45e15b5200238f4b21eeaadb55266f9f9edcd6389e27c36
  • Pointer size: 130 Bytes
  • Size of remote file: 90.3 kB
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Gray.png ADDED

Git LFS Details

  • SHA256: 0acdb6d2233be824e67f5d57042bbe990ed8ebc43dc4190d00b0d900d9d56962
  • Pointer size: 130 Bytes
  • Size of remote file: 87.1 kB
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Harbor_Gray.png ADDED

Git LFS Details

  • SHA256: d3d6933e6d3ee8b5076e8941b44efb713858b314a6cf6f67f65c02f055b3ab8f
  • Pointer size: 130 Bytes
  • Size of remote file: 87.4 kB
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Mid_Gray.png ADDED

Git LFS Details

  • SHA256: 1e553bd8bc485071d7eed438d41a0dc562c899dc90b1141f2efa8e8284434e09
  • Pointer size: 130 Bytes
  • Size of remote file: 75.7 kB
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Olive_Green.png ADDED

Git LFS Details

  • SHA256: c43ff6bcbe955e66c7e5137b172b22de2a0200a2348150267292fd0b75443f08
  • Pointer size: 130 Bytes
  • Size of remote file: 79.7 kB
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Petrol.png ADDED

Git LFS Details

  • SHA256: f45fb4dacec0324457567bc2215f0ca1d540e516a2de2ed94e79cd1d6a40fc93
  • Pointer size: 130 Bytes
  • Size of remote file: 86.6 kB
code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Saffron.png ADDED

Git LFS Details

  • SHA256: e5abaf30e856e1a5c1b59a4362c1b6710f92e25b6014e938850290c051a66d04
  • Pointer size: 130 Bytes
  • Size of remote file: 89.1 kB