littleTang commited on
Commit
fc3312d
·
verified ·
1 Parent(s): 1f89e37

Add files using upload-large-folder tool

Browse files
Files changed (50) hide show
  1. Material/Fluid/Leather_Pumpkin.mdl +47 -0
  2. Material/Fluid/Linen_Blue.mdl +47 -0
  3. Material/Fluid/Linen_Red.mdl +47 -0
  4. Material/Fluid/Linen_Yellow.mdl +47 -0
  5. Material/material_0022/Concrete_Polished.mdl +42 -0
  6. Material/material_0033/Brass.mdl +54 -0
  7. Material/material_0044/RustedMetal.mdl +54 -0
  8. Material/material_0047/Steel_Carbon.mdl +47 -0
  9. Material/material_0066/Water.mdl +19 -0
  10. Material/material_0075/Ceramic_Tile_12.mdl +54 -0
  11. Material/material_0082/Gravel_River_Rock.mdl +42 -0
  12. Material/material_0084/Marble_Smooth.mdl +54 -0
  13. Material/material_0103/Linen_Beige.mdl +47 -0
  14. Material/material_0122/Mahogany_Planks.mdl +54 -0
  15. Material/material_0142/Carpaint_03.mdl +177 -0
  16. Material/material_0161/Fabric_Denim_01.mdl +177 -0
  17. Material/material_0192/Leather_Grain_05.mdl +177 -0
  18. Material/material_0211/Metal_Dark_Dirty.mdl +177 -0
  19. Material/material_0234/Plastic_Grain_02.mdl +177 -0
  20. Material/material_0244/Reflectors_01_Glow_Yellow.mdl +177 -0
  21. Material/material_0263/UI_Screen_01.mdl +177 -0
  22. Material/material_0271/Tire_Supercar_01.mdl +177 -0
  23. Material/material_0281/Wood_Grain_Raw_03.mdl +177 -0
  24. Material/material_0299/Ceramic_Tiles_Glazed_Square_Brick.mdl +0 -0
  25. Material/material_0310/Concrete_Rough.mdl +457 -0
  26. Material/material_0311/Concrete_Wall_Aged.mdl +436 -0
  27. Material/material_0349/Wood_Tiles_Walnut_Multicolor.mdl +1588 -0
  28. Material/material_0362/Small_Cobblestone.mdl +335 -0
  29. Material/material_0370/Pull_Up_Leather.mdl +1727 -0
  30. Material/material_0380/Aluminum_Foil.mdl +501 -0
  31. Material/material_0384/Aluminum_Sheet.mdl +1330 -0
  32. Material/material_0404/Bronze_Sheet_Punched.mdl +1267 -0
  33. Material/material_0407/Chromium_Brushed.mdl +301 -0
  34. Material/material_0415/Copper_Brushed.mdl +301 -0
  35. Material/material_0417/Copper_Hammered.mdl +263 -0
  36. Material/material_0423/Diamond_Plate_Quintuple_Tear.mdl +544 -0
  37. Material/material_0427/Gold.mdl +380 -0
  38. Material/material_0439/Iron_Pitted_Steel.mdl +506 -0
  39. Material/material_0447/Nickel.mdl +379 -0
  40. Material/material_0454/PCB_Copper.mdl +342 -0
  41. Material/material_0460/Platinum_Knurling.mdl +359 -0
  42. Material/material_0464/Silver.mdl +378 -0
  43. Material/material_0474/Stainless_Steel_Brushed_Punched.mdl +0 -0
  44. Material/material_0475/Stainless_Steel_Milled.mdl +327 -0
  45. Material/material_0481/Titanium.mdl +378 -0
  46. Material/material_0497/Zinc_Foil.mdl +498 -0
  47. Material/material_0557/OSB_Wood_Splattered.mdl +423 -0
  48. Material/material_0569/Wood_Tiles_Pine_Multicolor.mdl +1591 -0
  49. Material/material_0572/Wood_Tiles_Walnut.mdl +0 -0
  50. README.md +4 -4
Material/Fluid/Leather_Pumpkin.mdl ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.4;
2
+
3
+ import ::OmniPBR::OmniPBR;
4
+ import ::anno::author;
5
+ import ::anno::description;
6
+ import ::anno::display_name;
7
+ import ::anno::key_words;
8
+ import ::anno::version;
9
+ import ::tex::gamma_mode;
10
+ import ::state::normal;
11
+
12
+ export material Leather_Pumpkin(*)
13
+ = ::OmniPBR::OmniPBR(
14
+ diffuse_color_constant: color(1.f, 1.f, 1.f),
15
+ diffuse_texture: texture_2d("./Leather_Pumpkin/Leather_Pumpkin_BaseColor.png", ::tex::gamma_srgb),
16
+ albedo_desaturation: 0.f,
17
+ albedo_add: 0.f,
18
+ albedo_brightness: 1.f,
19
+ diffuse_tint: color(1.f, 1.f, 1.f),
20
+ reflection_roughness_constant: 1.0f,
21
+ reflection_roughness_texture_influence: 1.f,
22
+ reflectionroughness_texture: texture_2d(),
23
+ metallic_constant: 0.f,
24
+ metallic_texture_influence: 1.f,
25
+ metallic_texture: texture_2d(),
26
+ specular_level: 0.5f,
27
+ enable_ORM_texture: true,
28
+ ORM_texture: texture_2d("./Leather_Pumpkin/Leather_Brown_ORM.png", ::tex::gamma_linear),
29
+ ao_to_diffuse: 0.f,
30
+ ao_texture: texture_2d(),
31
+ enable_emission: false,
32
+ emissive_color: color(0.f, 0.f, 0.f),
33
+ emissive_mask_texture: texture_2d(),
34
+ emissive_intensity: 0.f,
35
+ bump_factor: 1.f,
36
+ normalmap_texture: texture_2d("./Leather_Pumpkin/Leather_Brown_N.png", ::tex::gamma_linear),
37
+ detail_bump_factor: 0.3f,
38
+ detail_normalmap_texture: texture_2d(),
39
+ project_uvw: false,
40
+ world_or_object: false,
41
+ uv_space_index: 0,
42
+ texture_translate: float2(0.f),
43
+ texture_rotate: 0.f,
44
+ texture_scale: float2(2.f),
45
+ detail_texture_translate: float2(0.f),
46
+ detail_texture_rotate: 0.f,
47
+ detail_texture_scale: float2(1.f));
Material/Fluid/Linen_Blue.mdl ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.4;
2
+
3
+ import ::OmniPBR::OmniPBR;
4
+ import ::anno::author;
5
+ import ::anno::description;
6
+ import ::anno::display_name;
7
+ import ::anno::key_words;
8
+ import ::anno::version;
9
+ import ::tex::gamma_mode;
10
+ import ::state::normal;
11
+
12
+ export material Linen_Blue(*)
13
+ = ::OmniPBR::OmniPBR(
14
+ diffuse_color_constant: color(0.200000003f, 0.200000003f, 0.200000003f),
15
+ diffuse_texture: texture_2d("./Linen_Blue/Linen_Blue_BaseColor.png" /* tag 2956, version 3373013613 */, ::tex::gamma_srgb),
16
+ albedo_desaturation: 0.f,
17
+ albedo_add: 0.f,
18
+ albedo_brightness: 1.f,
19
+ diffuse_tint: color(1.f, 1.f, 1.f),
20
+ reflection_roughness_constant: 0.5f,
21
+ reflection_roughness_texture_influence: 1.f,
22
+ reflectionroughness_texture: texture_2d(),
23
+ metallic_constant: 0.f,
24
+ metallic_texture_influence: 1.f,
25
+ metallic_texture: texture_2d(),
26
+ specular_level: 0.5f,
27
+ enable_ORM_texture: true,
28
+ ORM_texture: texture_2d("./Linen_Blue/Linen_Blue_ORM.png", ::tex::gamma_linear),
29
+ ao_to_diffuse: 0.f,
30
+ ao_texture: texture_2d(),
31
+ enable_emission: false,
32
+ emissive_color: color(1.f, 0.100000001f, 0.100000001f),
33
+ emissive_mask_texture: texture_2d(),
34
+ emissive_intensity: 40.f,
35
+ bump_factor: 1.f,
36
+ normalmap_texture: texture_2d("./Linen_Blue/Linen_Blue_N.png", ::tex::gamma_linear),
37
+ detail_bump_factor: 1.0f,
38
+ detail_normalmap_texture: texture_2d("./Linen_Blue/Linen_Blue_DN.png", ::tex::gamma_linear),
39
+ project_uvw: false,
40
+ world_or_object: false,
41
+ uv_space_index: 0,
42
+ texture_translate: float2(0.f),
43
+ texture_rotate: 0.f,
44
+ texture_scale: float2(1.f),
45
+ detail_texture_translate: float2(0.f),
46
+ detail_texture_rotate: 0.f,
47
+ detail_texture_scale: float2(10.f,10.f));
Material/Fluid/Linen_Red.mdl ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.4;
2
+
3
+ import ::OmniPBR::OmniPBR;
4
+ import ::anno::author;
5
+ import ::anno::description;
6
+ import ::anno::display_name;
7
+ import ::anno::key_words;
8
+ import ::anno::version;
9
+ import ::tex::gamma_mode;
10
+ import ::state::normal;
11
+
12
+ export material Linen_Red(*)
13
+ = ::OmniPBR::OmniPBR(
14
+ diffuse_color_constant: color(0.200000003f, 0.200000003f, 0.200000003f),
15
+ diffuse_texture: texture_2d("./Linen_Blue/Linen_Blue_BaseColor.png" /* tag 2956, version 3373013613 */, ::tex::gamma_srgb),
16
+ albedo_desaturation: 1.f,
17
+ albedo_add: 0.f,
18
+ albedo_brightness: 1.f,
19
+ diffuse_tint: color(0.85f, 0.1f, 0.1f),
20
+ reflection_roughness_constant: 0.5f,
21
+ reflection_roughness_texture_influence: 1.f,
22
+ reflectionroughness_texture: texture_2d(),
23
+ metallic_constant: 0.f,
24
+ metallic_texture_influence: 1.f,
25
+ metallic_texture: texture_2d(),
26
+ specular_level: 0.5f,
27
+ enable_ORM_texture: true,
28
+ ORM_texture: texture_2d("./Linen_Blue/Linen_Blue_ORM.png", ::tex::gamma_linear),
29
+ ao_to_diffuse: 0.f,
30
+ ao_texture: texture_2d(),
31
+ enable_emission: false,
32
+ emissive_color: color(1.f, 0.100000001f, 0.100000001f),
33
+ emissive_mask_texture: texture_2d(),
34
+ emissive_intensity: 40.f,
35
+ bump_factor: 1.f,
36
+ normalmap_texture: texture_2d("./Linen_Blue/Linen_Blue_N.png", ::tex::gamma_linear),
37
+ detail_bump_factor: 1.0f,
38
+ detail_normalmap_texture: texture_2d("./Linen_Blue/Linen_Blue_DN.png", ::tex::gamma_linear),
39
+ project_uvw: false,
40
+ world_or_object: false,
41
+ uv_space_index: 0,
42
+ texture_translate: float2(0.f),
43
+ texture_rotate: 0.f,
44
+ texture_scale: float2(1.f),
45
+ detail_texture_translate: float2(0.f),
46
+ detail_texture_rotate: 0.f,
47
+ detail_texture_scale: float2(10.f,10.f));
Material/Fluid/Linen_Yellow.mdl ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.4;
2
+
3
+ import ::OmniPBR::OmniPBR;
4
+ import ::anno::author;
5
+ import ::anno::description;
6
+ import ::anno::display_name;
7
+ import ::anno::key_words;
8
+ import ::anno::version;
9
+ import ::tex::gamma_mode;
10
+ import ::state::normal;
11
+
12
+ export material Linen_Yellow(*)
13
+ = ::OmniPBR::OmniPBR(
14
+ diffuse_color_constant: color(0.200000003f, 0.200000003f, 0.200000003f),
15
+ diffuse_texture: texture_2d("./Linen_Blue/Linen_Blue_BaseColor.png" /* tag 2956, version 3373013613 */, ::tex::gamma_srgb),
16
+ albedo_desaturation: 1.f,
17
+ albedo_add: 0.f,
18
+ albedo_brightness: 1.f,
19
+ diffuse_tint: color(0.95f, 0.82f, 0.15f),
20
+ reflection_roughness_constant: 0.5f,
21
+ reflection_roughness_texture_influence: 1.f,
22
+ reflectionroughness_texture: texture_2d(),
23
+ metallic_constant: 0.f,
24
+ metallic_texture_influence: 1.f,
25
+ metallic_texture: texture_2d(),
26
+ specular_level: 0.5f,
27
+ enable_ORM_texture: true,
28
+ ORM_texture: texture_2d("./Linen_Blue/Linen_Blue_ORM.png", ::tex::gamma_linear),
29
+ ao_to_diffuse: 0.f,
30
+ ao_texture: texture_2d(),
31
+ enable_emission: false,
32
+ emissive_color: color(1.f, 0.100000001f, 0.100000001f),
33
+ emissive_mask_texture: texture_2d(),
34
+ emissive_intensity: 40.f,
35
+ bump_factor: 1.f,
36
+ normalmap_texture: texture_2d("./Linen_Blue/Linen_Blue_N.png", ::tex::gamma_linear),
37
+ detail_bump_factor: 1.0f,
38
+ detail_normalmap_texture: texture_2d("./Linen_Blue/Linen_Blue_DN.png", ::tex::gamma_linear),
39
+ project_uvw: false,
40
+ world_or_object: false,
41
+ uv_space_index: 0,
42
+ texture_translate: float2(0.f),
43
+ texture_rotate: 0.f,
44
+ texture_scale: float2(1.f),
45
+ detail_texture_translate: float2(0.f),
46
+ detail_texture_rotate: 0.f,
47
+ detail_texture_scale: float2(10.f,10.f));
Material/material_0022/Concrete_Polished.mdl ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.4;
2
+
3
+ using ::OmniPBR import OmniPBR;
4
+ import ::tex::gamma_mode;
5
+ import ::state::normal;
6
+
7
+ export material Concrete_Polished(*)
8
+ = OmniPBR(
9
+ diffuse_color_constant: color(1.0, 1.0, 1.0),
10
+ diffuse_texture: texture_2d("./Concrete_Polished_BaseColor.png", ::tex::gamma_srgb),
11
+ albedo_desaturation: 0.f,
12
+ albedo_add: 0.f,
13
+ albedo_brightness: 1.f,
14
+ diffuse_tint: color(1.f, 1.f, 1.f),
15
+ reflection_roughness_constant: 0.000000,
16
+ reflection_roughness_texture_influence: 1.f,
17
+ reflectionroughness_texture: texture_2d(),
18
+ metallic_constant: 0.000000,
19
+ metallic_texture_influence: 1.f,
20
+ metallic_texture: texture_2d(),
21
+ specular_level: 0.5f,
22
+ enable_ORM_texture: true,
23
+ ORM_texture: texture_2d("./Concrete_Polished_ORM.png", ::tex::gamma_linear),
24
+ ao_to_diffuse: 0.f,
25
+ ao_texture: texture_2d(),
26
+ enable_emission: false,
27
+ emissive_color: color(0.0, 0.0, 0.0),
28
+ emissive_mask_texture: texture_2d(),
29
+ emissive_intensity: 0.0,
30
+ bump_factor: 1.f,
31
+ normalmap_texture: texture_2d("./Concrete_Polished_Normal.png", ::tex::gamma_linear),
32
+ detail_bump_factor: 0.3f,
33
+ detail_normalmap_texture: texture_2d(),
34
+ project_uvw: false,
35
+ world_or_object: false,
36
+ uv_space_index: 0,
37
+ texture_translate: 0.f,
38
+ texture_rotate: 0.f,
39
+ texture_scale: 1.f,
40
+ detail_texture_translate: 0.f,
41
+ detail_texture_rotate: 0.f,
42
+ detail_texture_scale: 1.f);
Material/material_0033/Brass.mdl ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.4;
2
+
3
+ import ::OmniPBR::OmniPBR;
4
+ import ::anno::author;
5
+ import ::anno::description;
6
+ import ::anno::display_name;
7
+ import ::anno::key_words;
8
+ import ::anno::version;
9
+ import ::tex::gamma_mode;
10
+ import ::state::normal;
11
+
12
+ export material Brass(*)
13
+ [[
14
+ ::anno::display_name("Omni PBR "),
15
+ ::anno::description("Omni PBR, supports ORM textures"),
16
+ ::anno::version(1, 0, 0, ""),
17
+ ::anno::author("NVIDIA CORPORATION"),
18
+ ::anno::key_words(string[]("omni", "PBR", "omniverse", "generic"))
19
+ ]]
20
+ = ::OmniPBR::OmniPBR(
21
+ diffuse_color_constant: color(0.200000003f, 0.200000003f, 0.200000003f),
22
+ diffuse_texture: texture_2d("./Brass_BaseColor.png" /* tag 2784, version 2867840297 */, ::tex::gamma_srgb),
23
+ albedo_desaturation: 0.f,
24
+ albedo_add: 0.f,
25
+ albedo_brightness: 1.f,
26
+ diffuse_tint: color(1.f, 1.f, 1.f),
27
+ reflection_roughness_constant: 0.5f,
28
+ reflection_roughness_texture_influence: 1.f,
29
+ reflectionroughness_texture: texture_2d(),
30
+ metallic_constant: 0.5f,
31
+ metallic_texture_influence: 1.f,
32
+ metallic_texture: texture_2d(),
33
+ specular_level: 0.5f,
34
+ enable_ORM_texture: true,
35
+ ORM_texture: texture_2d("./Brass_ORM.png" /* tag 2786, version 3429153493 */, ::tex::gamma_linear),
36
+ ao_to_diffuse: 0.f,
37
+ ao_texture: texture_2d(),
38
+ enable_emission: false,
39
+ emissive_color: color(1.f, 0.100000001f, 0.100000001f),
40
+ emissive_mask_texture: texture_2d(),
41
+ emissive_intensity: 40.f,
42
+ bump_factor: 1.f,
43
+ normalmap_texture: texture_2d("./Brass_N.png" /* tag 2788, version 4097231851 */, ::tex::gamma_linear),
44
+ detail_bump_factor: 0.300000012f,
45
+ detail_normalmap_texture: texture_2d(),
46
+ project_uvw: false,
47
+ world_or_object: false,
48
+ uv_space_index: 0,
49
+ texture_translate: 0.f,
50
+ texture_rotate: 0.f,
51
+ texture_scale: 1.f,
52
+ detail_texture_translate: 0.f,
53
+ detail_texture_rotate: 0.f,
54
+ detail_texture_scale: 1.f);
Material/material_0044/RustedMetal.mdl ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.4;
2
+
3
+ import ::OmniPBR::OmniPBR;
4
+ import ::anno::author;
5
+ import ::anno::description;
6
+ import ::anno::display_name;
7
+ import ::anno::key_words;
8
+ import ::anno::version;
9
+ import ::tex::gamma_mode;
10
+ import ::state::normal;
11
+
12
+ export material RustedMetal(*)
13
+ [[
14
+ ::anno::display_name("Omni PBR "),
15
+ ::anno::description("Omni PBR, supports ORM textures"),
16
+ ::anno::version(1, 0, 0, ""),
17
+ ::anno::author("NVIDIA CORPORATION"),
18
+ ::anno::key_words(string[]("omni", "PBR", "omniverse", "generic"))
19
+ ]]
20
+ = ::OmniPBR::OmniPBR(
21
+ diffuse_color_constant: color(0.200000003f, 0.200000003f, 0.200000003f),
22
+ diffuse_texture: texture_2d("./RustedMetal_BaseColor.png" /* tag 2819, version 846163455 */, ::tex::gamma_srgb),
23
+ albedo_desaturation: 0.f,
24
+ albedo_add: 0.f,
25
+ albedo_brightness: 1.f,
26
+ diffuse_tint: color(1.f, 1.f, 1.f),
27
+ reflection_roughness_constant: 0.5f,
28
+ reflection_roughness_texture_influence: 1.f,
29
+ reflectionroughness_texture: texture_2d(),
30
+ metallic_constant: 0.5f,
31
+ metallic_texture_influence: 1.f,
32
+ metallic_texture: texture_2d(),
33
+ specular_level: 0.5f,
34
+ enable_ORM_texture: true,
35
+ ORM_texture: texture_2d("./RustedMetal_ORM.png" /* tag 2821, version 3917274441 */, ::tex::gamma_linear),
36
+ ao_to_diffuse: 0.f,
37
+ ao_texture: texture_2d(),
38
+ enable_emission: false,
39
+ emissive_color: color(1.f, 0.100000001f, 0.100000001f),
40
+ emissive_mask_texture: texture_2d(),
41
+ emissive_intensity: 40.f,
42
+ bump_factor: 1.f,
43
+ normalmap_texture: texture_2d("./RustedMetal_N.png" /* tag 2823, version 960080622 */, ::tex::gamma_linear),
44
+ detail_bump_factor: 0.300000012f,
45
+ detail_normalmap_texture: texture_2d(),
46
+ project_uvw: false,
47
+ world_or_object: false,
48
+ uv_space_index: 0,
49
+ texture_translate: 0.f,
50
+ texture_rotate: 0.f,
51
+ texture_scale: 1.f,
52
+ detail_texture_translate: 0.f,
53
+ detail_texture_rotate: 0.f,
54
+ detail_texture_scale: 1.f);
Material/material_0047/Steel_Carbon.mdl ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.4;
2
+
3
+ import ::OmniPBR::OmniPBR;
4
+ import ::anno::author;
5
+ import ::anno::description;
6
+ import ::anno::display_name;
7
+ import ::anno::key_words;
8
+ import ::anno::version;
9
+ import ::tex::gamma_mode;
10
+ import ::state::normal;
11
+
12
+ export material Steel_Carbon(*)
13
+ = ::OmniPBR::OmniPBR(
14
+ diffuse_color_constant: color(0.200000003f, 0.200000003f, 0.200000003f),
15
+ diffuse_texture: texture_2d("./Steel_Carbon_BaseColor.png" /* tag 3107, version 2706352012 */, ::tex::gamma_srgb),
16
+ albedo_desaturation: 0.f,
17
+ albedo_add: 0.f,
18
+ albedo_brightness: 1.f,
19
+ diffuse_tint: color(1.f, 1.f, 1.f),
20
+ reflection_roughness_constant: 0.5f,
21
+ reflection_roughness_texture_influence: 1.f,
22
+ reflectionroughness_texture: texture_2d(),
23
+ metallic_constant: 0.f,
24
+ metallic_texture_influence: 1.f,
25
+ metallic_texture: texture_2d(),
26
+ specular_level: 0.5f,
27
+ enable_ORM_texture: true,
28
+ ORM_texture: texture_2d("./Steel_Carbon_ORM.png" /* tag 3109, version 880241343 */, ::tex::gamma_linear),
29
+ ao_to_diffuse: 0.f,
30
+ ao_texture: texture_2d(),
31
+ enable_emission: false,
32
+ emissive_color: color(1.f, 0.100000001f, 0.100000001f),
33
+ emissive_mask_texture: texture_2d(),
34
+ emissive_intensity: 40.f,
35
+ bump_factor: 1.f,
36
+ normalmap_texture: texture_2d("./Steel_Carbon_N.png" /* tag 3111, version 1659240673 */, ::tex::gamma_linear),
37
+ detail_bump_factor: 0.300000012f,
38
+ detail_normalmap_texture: texture_2d(),
39
+ project_uvw: false,
40
+ world_or_object: false,
41
+ uv_space_index: 0,
42
+ texture_translate: 0.f,
43
+ texture_rotate: 0.f,
44
+ texture_scale: 1.f,
45
+ detail_texture_translate: 0.f,
46
+ detail_texture_rotate: 0.f,
47
+ detail_texture_scale: 1.f);
Material/material_0066/Water.mdl ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.5;
2
+
3
+ using ..::Templates::GlassWithVolume import GlassWithVolume;
4
+ import ::tex::gamma_mode;
5
+ import ::state::normal;
6
+
7
+ export material Water(*)
8
+ = GlassWithVolume(
9
+ thin_walled: false,
10
+ transmission_color: color(0.612f, 0.714f, 0.747f),
11
+ roughness_texture: texture_2d(),
12
+ ior: 1.333f,
13
+ transmission_color_texture: texture_2d(),
14
+ roughness_texture_influence: 0.f,
15
+ roughness: 0.f,
16
+ reflection_color_texture: texture_2d(),
17
+ reflection_color: color(1.f, 1.f, 1.f),
18
+ depth: 0.0001f,
19
+ normal_map_texture: texture_2d("./Water_Normal.png", ::tex::gamma_linear));
Material/material_0075/Ceramic_Tile_12.mdl ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.4;
2
+
3
+ import ::OmniPBR::OmniPBR;
4
+ import ::anno::author;
5
+ import ::anno::description;
6
+ import ::anno::display_name;
7
+ import ::anno::key_words;
8
+ import ::anno::version;
9
+ import ::tex::gamma_mode;
10
+ import ::state::normal;
11
+
12
+ export material Ceramic_Tile_12(*)
13
+ [[
14
+ ::anno::display_name("Omni PBR "),
15
+ ::anno::description("Omni PBR, supports ORM textures"),
16
+ ::anno::version(1, 0, 0, ""),
17
+ ::anno::author("NVIDIA CORPORATION"),
18
+ ::anno::key_words(string[]("omni", "PBR", "omniverse", "generic"))
19
+ ]]
20
+ = ::OmniPBR::OmniPBR(
21
+ diffuse_color_constant: color(0.200000003f, 0.200000003f, 0.200000003f),
22
+ diffuse_texture: texture_2d("./Ceramic_Tile_12_BaseColor.png" /* tag 2963, version 4196739352 */, ::tex::gamma_srgb),
23
+ albedo_desaturation: 0.f,
24
+ albedo_add: 0.f,
25
+ albedo_brightness: 1.f,
26
+ diffuse_tint: color(1.f, 1.f, 1.f),
27
+ reflection_roughness_constant: 0.5f,
28
+ reflection_roughness_texture_influence: 1.f,
29
+ reflectionroughness_texture: texture_2d(),
30
+ metallic_constant: 0.f,
31
+ metallic_texture_influence: 1.f,
32
+ metallic_texture: texture_2d(),
33
+ specular_level: 0.5f,
34
+ enable_ORM_texture: true,
35
+ ORM_texture: texture_2d("./Ceramic_Tile_12_ORM.png" /* tag 2965, version 1936676617 */, ::tex::gamma_linear),
36
+ ao_to_diffuse: 0.f,
37
+ ao_texture: texture_2d(),
38
+ enable_emission: false,
39
+ emissive_color: color(1.f, 0.100000001f, 0.100000001f),
40
+ emissive_mask_texture: texture_2d(),
41
+ emissive_intensity: 40.f,
42
+ bump_factor: 1.f,
43
+ normalmap_texture: texture_2d("./Ceramic_Tile_12_N.png" /* tag 2967, version 3347509962 */, ::tex::gamma_linear),
44
+ detail_bump_factor: 0.300000012f,
45
+ detail_normalmap_texture: texture_2d(),
46
+ project_uvw: false,
47
+ world_or_object: false,
48
+ uv_space_index: 0,
49
+ texture_translate: 0.f,
50
+ texture_rotate: 0.f,
51
+ texture_scale: 1.f,
52
+ detail_texture_translate: 0.f,
53
+ detail_texture_rotate: 0.f,
54
+ detail_texture_scale: 1.f);
Material/material_0082/Gravel_River_Rock.mdl ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.4;
2
+
3
+ using ::OmniPBR import OmniPBR;
4
+ import ::tex::gamma_mode;
5
+ import ::state::normal;
6
+
7
+ export material Gravel_River_Rock(*)
8
+ = OmniPBR(
9
+ diffuse_color_constant: color(1.0, 1.0, 1.0),
10
+ diffuse_texture: texture_2d("./Gravel_River_Rock_BaseColor.png", ::tex::gamma_srgb),
11
+ albedo_desaturation: 0.f,
12
+ albedo_add: 0.f,
13
+ albedo_brightness: 1.f,
14
+ diffuse_tint: color(1.f, 1.f, 1.f),
15
+ reflection_roughness_constant: 1.000000,
16
+ reflection_roughness_texture_influence: 1.f,
17
+ reflectionroughness_texture: texture_2d(),
18
+ metallic_constant: 0.000000,
19
+ metallic_texture_influence: 1.f,
20
+ metallic_texture: texture_2d(),
21
+ specular_level: 0.5f,
22
+ enable_ORM_texture: true,
23
+ ORM_texture: texture_2d("./Gravel_River_Rock_ORM.png", ::tex::gamma_linear),
24
+ ao_to_diffuse: 0.25f,
25
+ ao_texture: texture_2d(),
26
+ enable_emission: false,
27
+ emissive_color: color(0.0, 0.0, 0.0),
28
+ emissive_mask_texture: texture_2d(),
29
+ emissive_intensity: 0.0,
30
+ bump_factor: 1.f,
31
+ normalmap_texture: texture_2d("./Gravel_River_Rock_Normal.png", ::tex::gamma_linear),
32
+ detail_bump_factor: 0.3f,
33
+ detail_normalmap_texture: texture_2d(),
34
+ project_uvw: false,
35
+ world_or_object: false,
36
+ uv_space_index: 0,
37
+ texture_translate: 0.f,
38
+ texture_rotate: 0.f,
39
+ texture_scale: 1.f,
40
+ detail_texture_translate: 0.f,
41
+ detail_texture_rotate: 0.f,
42
+ detail_texture_scale: 1.f);
Material/material_0084/Marble_Smooth.mdl ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.4;
2
+
3
+ import ::OmniPBR::OmniPBR;
4
+ import ::anno::author;
5
+ import ::anno::description;
6
+ import ::anno::display_name;
7
+ import ::anno::key_words;
8
+ import ::anno::version;
9
+ import ::tex::gamma_mode;
10
+ import ::state::normal;
11
+
12
+ export material Marble_Smooth(*)
13
+ [[
14
+ ::anno::display_name("Omni PBR "),
15
+ ::anno::description("Omni PBR, supports ORM textures"),
16
+ ::anno::version(1, 0, 0, ""),
17
+ ::anno::author("NVIDIA CORPORATION"),
18
+ ::anno::key_words(string[]("omni", "PBR", "omniverse", "generic"))
19
+ ]]
20
+ = ::OmniPBR::OmniPBR(
21
+ diffuse_color_constant: color(0.200000003f, 0.200000003f, 0.200000003f),
22
+ diffuse_texture: texture_2d("./Marble_Smooth_BaseColor.png" /* tag 2791, version 1295500887 */, ::tex::gamma_srgb),
23
+ albedo_desaturation: 0.f,
24
+ albedo_add: 0.f,
25
+ albedo_brightness: 1.f,
26
+ diffuse_tint: color(1.f, 1.f, 1.f),
27
+ reflection_roughness_constant: 0.5f,
28
+ reflection_roughness_texture_influence: 1.f,
29
+ reflectionroughness_texture: texture_2d(),
30
+ metallic_constant: 0.f,
31
+ metallic_texture_influence: 1.f,
32
+ metallic_texture: texture_2d(),
33
+ specular_level: 0.5f,
34
+ enable_ORM_texture: true,
35
+ ORM_texture: texture_2d("./Marble_Smooth_ORM.png" /* tag 2793, version 1362976242 */, ::tex::gamma_linear),
36
+ ao_to_diffuse: 0.f,
37
+ ao_texture: texture_2d(),
38
+ enable_emission: false,
39
+ emissive_color: color(1.f, 0.100000001f, 0.100000001f),
40
+ emissive_mask_texture: texture_2d(),
41
+ emissive_intensity: 40.f,
42
+ bump_factor: 1.f,
43
+ normalmap_texture: texture_2d("./Marble_Smooth_N.png" /* tag 2795, version 4147619283 */, ::tex::gamma_linear),
44
+ detail_bump_factor: 0.300000012f,
45
+ detail_normalmap_texture: texture_2d(),
46
+ project_uvw: false,
47
+ world_or_object: false,
48
+ uv_space_index: 0,
49
+ texture_translate: 0.f,
50
+ texture_rotate: 0.f,
51
+ texture_scale: 1.f,
52
+ detail_texture_translate: 0.f,
53
+ detail_texture_rotate: 0.f,
54
+ detail_texture_scale: 1.f);
Material/material_0103/Linen_Beige.mdl ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.4;
2
+
3
+ import ::OmniPBR::OmniPBR;
4
+ import ::anno::author;
5
+ import ::anno::description;
6
+ import ::anno::display_name;
7
+ import ::anno::key_words;
8
+ import ::anno::version;
9
+ import ::tex::gamma_mode;
10
+ import ::state::normal;
11
+
12
+ export material Linen_Beige(*)
13
+ = ::OmniPBR::OmniPBR(
14
+ diffuse_color_constant: color(0.200000003f, 0.200000003f, 0.200000003f),
15
+ diffuse_texture: texture_2d("./Linen_Beige_BaseColor.png" /* tag 2956, version 3373013613 */, ::tex::gamma_srgb),
16
+ albedo_desaturation: 0.f,
17
+ albedo_add: 0.f,
18
+ albedo_brightness: 1.f,
19
+ diffuse_tint: color(1.f, 1.f, 1.f),
20
+ reflection_roughness_constant: 0.5f,
21
+ reflection_roughness_texture_influence: 1.f,
22
+ reflectionroughness_texture: texture_2d(),
23
+ metallic_constant: 0.f,
24
+ metallic_texture_influence: 1.f,
25
+ metallic_texture: texture_2d(),
26
+ specular_level: 0.5f,
27
+ enable_ORM_texture: true,
28
+ ORM_texture: texture_2d("./Linen_Beige_ORM.png", ::tex::gamma_linear),
29
+ ao_to_diffuse: 0.f,
30
+ ao_texture: texture_2d(),
31
+ enable_emission: false,
32
+ emissive_color: color(1.f, 0.100000001f, 0.100000001f),
33
+ emissive_mask_texture: texture_2d(),
34
+ emissive_intensity: 40.f,
35
+ bump_factor: 1.f,
36
+ normalmap_texture: texture_2d("./Linen_Beige_N.png", ::tex::gamma_linear),
37
+ detail_bump_factor: 1.0f,
38
+ detail_normalmap_texture: texture_2d("./Linen_Beige_DN.png", ::tex::gamma_linear),
39
+ project_uvw: false,
40
+ world_or_object: false,
41
+ uv_space_index: 0,
42
+ texture_translate: 0.f,
43
+ texture_rotate: 0.f,
44
+ texture_scale: 1.f,
45
+ detail_texture_translate: 0.f,
46
+ detail_texture_rotate: 0.f,
47
+ detail_texture_scale: float2(10.f,10.f));
Material/material_0122/Mahogany_Planks.mdl ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.4;
2
+
3
+ import ::OmniPBR::OmniPBR;
4
+ import ::anno::author;
5
+ import ::anno::description;
6
+ import ::anno::display_name;
7
+ import ::anno::key_words;
8
+ import ::anno::version;
9
+ import ::tex::gamma_mode;
10
+ import ::state::normal;
11
+
12
+ export material Mahogany_Planks(*)
13
+ [[
14
+ ::anno::display_name("Omni PBR "),
15
+ ::anno::description("Omni PBR, supports ORM textures"),
16
+ ::anno::version(1, 0, 0, ""),
17
+ ::anno::author("NVIDIA CORPORATION"),
18
+ ::anno::key_words(string[]("omni", "PBR", "omniverse", "generic"))
19
+ ]]
20
+ = ::OmniPBR::OmniPBR(
21
+ diffuse_color_constant: color(0.200000003f, 0.200000003f, 0.200000003f),
22
+ diffuse_texture: texture_2d("./Mahogany_Planks_BaseColor.png" /* tag 2746, version 2957239479 */, ::tex::gamma_srgb),
23
+ albedo_desaturation: 0.f,
24
+ albedo_add: 0.f,
25
+ albedo_brightness: 1.f,
26
+ diffuse_tint: color(.25, .25, .25),
27
+ reflection_roughness_constant: 0.5f,
28
+ reflection_roughness_texture_influence: 0.f,
29
+ reflectionroughness_texture: texture_2d(),
30
+ metallic_constant: 0.f,
31
+ metallic_texture_influence: 0.f,
32
+ metallic_texture: texture_2d(),
33
+ specular_level: 0.5f,
34
+ enable_ORM_texture: true,
35
+ ORM_texture: texture_2d("./Mahogany_Planks_ORM.png" /* tag 2748, version 2172705328 */, ::tex::gamma_linear),
36
+ ao_to_diffuse: 0.f,
37
+ ao_texture: texture_2d(),
38
+ enable_emission: false,
39
+ emissive_color: color(1.f, 0.100000001f, 0.100000001f),
40
+ emissive_mask_texture: texture_2d(),
41
+ emissive_intensity: 40.f,
42
+ bump_factor: 1.f,
43
+ normalmap_texture: texture_2d("./Mahogany_Planks_N.png" /* tag 2750, version 3347756142 */, ::tex::gamma_linear),
44
+ detail_bump_factor: 0.300000012f,
45
+ detail_normalmap_texture: texture_2d(),
46
+ project_uvw: false,
47
+ world_or_object: false,
48
+ uv_space_index: 0,
49
+ texture_translate: 0.f,
50
+ texture_rotate: 0.f,
51
+ texture_scale: 1.f,
52
+ detail_texture_translate: 0.f,
53
+ detail_texture_rotate: 0.f,
54
+ detail_texture_scale: 1.f);
Material/material_0142/Carpaint_03.mdl ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.8;
2
+
3
+ import ::state::normal;
4
+ import ::OmniSurface::OmniShared::emission_mode;
5
+ import ..::Templates::OmniUber_Automotive::*;
6
+ import ::tex::gamma_mode;
7
+
8
+ export material Carpaint_03(*)
9
+ = Templates::OmniUber_Automotive::OmniUber_Automotive(
10
+ uvs_mode_01: Templates::OmniUber_Automotive::triplanar,
11
+ uv_scale_01: float2(1.f),
12
+ uv_offset_01: float2(0.f),
13
+ uv_offset_time_01: float2(0.f),
14
+ uv_rotation_01: 0.f,
15
+ triplanar_blend_range_01: 0.5f,
16
+ uvs_mode_02: Templates::OmniUber_Automotive::triplanar,
17
+ uv_scale_02: float2(8.f),
18
+ uv_offset_02: float2(0.f),
19
+ uv_offset_time_02: float2(0.f),
20
+ uv_rotation_02: 0.f,
21
+ triplanar_blend_range_02: 0.5f,
22
+ uvs_mode_03: Templates::OmniUber_Automotive::triplanar,
23
+ uv_scale_03: float2(1.f),
24
+ uv_offset_03: float2(0.f),
25
+ uv_offset_time_03: float2(0.f),
26
+ uv_rotation_03: 0.f,
27
+ triplanar_blend_range_03: 0.5f,
28
+ uvs_mode_04: Templates::OmniUber_Automotive::triplanar,
29
+ uv_scale_04: float2(1.f),
30
+ uv_offset_04: float2(0.f),
31
+ uv_offset_time_04: float2(0.f),
32
+ uv_rotation_04: 0.f,
33
+ triplanar_blend_range_04: 0.5f,
34
+ enable_opacity: false,
35
+ uv_set_opacity: Templates::OmniUber_Automotive::uv_set_1,
36
+ opacity_image: texture_2d(),
37
+ opacity_channel: Templates::OmniUber_Automotive::a,
38
+ geometry_opacity_threshold: 0.150000006f,
39
+ uv_set_layer_0: Templates::OmniUber_Automotive::uv_set_1,
40
+ base_color_image: texture_2d(),
41
+ diffuse_reflection_color: color(0.694117665f, 0.137254909f, 0.f),
42
+ base_color_scale: 1.f,
43
+ base_color_offset: 0.f,
44
+ base_color_desaturation: 0.f,
45
+ metalness_image: texture_2d(),
46
+ metalness_channel: Templates::OmniUber_Automotive::b,
47
+ metalness: 0.f,
48
+ specular_reflection_weight: 1.f,
49
+ specular_reflection_color: color(1.f, 1.f, 1.f),
50
+ cavity_image: texture_2d(),
51
+ cavity_channel: Templates::OmniUber_Automotive::r,
52
+ roughness_image: texture_2d(),
53
+ roughness_channel: Templates::OmniUber_Automotive::g,
54
+ roughness_u: 1.f,
55
+ roughness_range_position: float2(1.f),
56
+ normal_image: texture_2d(),
57
+ normal_flip_green: true,
58
+ normal_scale: 1.f,
59
+ enable_layer_1: false,
60
+ layer_1_order: Templates::OmniUber_Automotive::above,
61
+ layer_1_blend_source: Templates::OmniUber_Automotive::texture,
62
+ layer_1_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_1,
63
+ layer_1_blend_splatmap: texture_2d(),
64
+ layer_1_blend_splatmap_channel: Templates::OmniUber_Automotive::r,
65
+ layer_1_blend_direction: float3(0.f, 1.f, 0.f),
66
+ layer_1_blend_axis: Templates::OmniUber_Automotive::y,
67
+ layer_1_blend_object_space: true,
68
+ layer_1_blend_scale: 1.f,
69
+ layer_1_blend_offset: 0.f,
70
+ layer_1_blend_primvar_name: "",
71
+ layer_1_uv_set_detail: Templates::OmniUber_Automotive::uv_set_1,
72
+ layer_1_blend_detail_image: texture_2d(),
73
+ layer_1_blend_detail_image_channel: Templates::OmniUber_Automotive::r,
74
+ layer_1_blend_threshold: 0.330000013f,
75
+ layer_1_blend_factor_override: 0.f,
76
+ uv_set_layer_1: Templates::OmniUber_Automotive::uv_set_1,
77
+ layer_1_base_color_image: texture_2d(),
78
+ layer_1_diffuse_reflection_color: color(1.f, 1.f, 1.f),
79
+ layer_1_base_color_offset: 0.f,
80
+ layer_1_base_color_scale: 1.f,
81
+ layer_1_base_color_desaturation: 0.f,
82
+ layer_1_metalness_image: texture_2d(),
83
+ layer_1_metalness_channel: Templates::OmniUber_Automotive::b,
84
+ layer_1_metalness: 1.f,
85
+ layer_1_specular_reflection_weight: 1.f,
86
+ layer_1_cavity_image: texture_2d(),
87
+ layer_1_cavity_channel: Templates::OmniUber_Automotive::r,
88
+ layer_1_roughness_image: texture_2d(),
89
+ layer_1_roughness_channel: Templates::OmniUber_Automotive::g,
90
+ layer_1_roughness_u: 1.f,
91
+ layer_1_roughness_range_position: float2(1.f, 0.5f),
92
+ layer_1_normal_image: texture_2d(),
93
+ layer_1_normal_flip_green: true,
94
+ layer_1_normal_scale: 1.f,
95
+ enable_layer_2: false,
96
+ layer_2_order: Templates::OmniUber_Automotive::above,
97
+ layer_2_blend_source: Templates::OmniUber_Automotive::texture,
98
+ layer_2_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_2,
99
+ layer_2_blend_splatmap: texture_2d(),
100
+ layer_2_blend_splatmap_channel: Templates::OmniUber_Automotive::r,
101
+ layer_2_blend_direction: float3(0.f, 1.f, 0.f),
102
+ layer_2_blend_axis: Templates::OmniUber_Automotive::y,
103
+ layer_2_blend_object_space: true,
104
+ layer_2_blend_scale: 1.f,
105
+ layer_2_blend_offset: 0.f,
106
+ layer_2_blend_primvar_name: "",
107
+ layer_2_uv_set_detail: Templates::OmniUber_Automotive::uv_set_2,
108
+ layer_2_blend_detail_image: texture_2d(),
109
+ layer_2_blend_detail_image_channel: Templates::OmniUber_Automotive::r,
110
+ layer_2_blend_threshold: 0.330000013f,
111
+ layer_2_blend_factor_override: 0.f,
112
+ uv_set_layer_2: Templates::OmniUber_Automotive::uv_set_2,
113
+ layer_2_base_color_image: texture_2d(),
114
+ layer_2_diffuse_reflection_color: color(1.f, 1.f, 1.f),
115
+ layer_2_base_color_offset: 0.f,
116
+ layer_2_base_color_scale: 1.f,
117
+ layer_2_base_color_desaturation: 0.f,
118
+ layer_2_metalness_image: texture_2d(),
119
+ layer_2_metalness_channel: Templates::OmniUber_Automotive::b,
120
+ layer_2_metalness: 1.f,
121
+ layer_2_specular_reflection_weight: 1.f,
122
+ layer_2_cavity_image: texture_2d(),
123
+ layer_2_cavity_channel: Templates::OmniUber_Automotive::r,
124
+ layer_2_roughness_image: texture_2d(),
125
+ layer_2_roughness_channel: Templates::OmniUber_Automotive::g,
126
+ layer_2_roughness_u: 1.f,
127
+ layer_2_roughness_range_position: float2(1.f, 0.5f),
128
+ layer_2_normal_image: texture_2d(),
129
+ layer_2_normal_flip_green: true,
130
+ layer_2_normal_scale: 1.f,
131
+ enable_anisotropy: false,
132
+ uv_set_anisotropy: Templates::OmniUber_Automotive::uv_set_1,
133
+ anisotropic_roughness_u: 1.f,
134
+ anisotropic_roughness_v: 0.25f,
135
+ anisotropic_direction_image: texture_2d(),
136
+ anisotropic_direction_channel: Templates::OmniUber_Automotive::r,
137
+ anisotropic_direction: 0.f,
138
+ enable_detail_normal: false,
139
+ uv_set_detail_normal: Templates::OmniUber_Automotive::uv_set_1,
140
+ uv_set_detail_weight: Templates::OmniUber_Automotive::uv_set_1,
141
+ detail_normal_image: texture_2d(),
142
+ detail_normal_flip_green: true,
143
+ detail_normal_scale: 1.f,
144
+ detail_normal_weight_image: texture_2d(),
145
+ detail_normal_weight_channel: Templates::OmniUber_Automotive::r,
146
+ enable_emission: false,
147
+ uv_set_emission: Templates::OmniUber_Automotive::uv_set_1,
148
+ uv_set_emission_mask: Templates::OmniUber_Automotive::uv_set_1,
149
+ emission_image: texture_2d(),
150
+ emission_mask_image: texture_2d(),
151
+ emission_mode: OmniSurface::OmniShared::emission_lx,
152
+ emission_intensity: 1.f,
153
+ emission_color: color(1.f, 1.f, 1.f),
154
+ emission_use_temperature: false,
155
+ emission_temperature: 6500.f,
156
+ enable_coat: true,
157
+ coat_color: color(0.5f, 0.499996483f, 0.499995023f),
158
+ coat_mask_image: texture_2d(),
159
+ coat_mask_channel: Templates::OmniUber_Automotive::r,
160
+ coat_roughness_image: texture_2d("./noise_scratch2.png", ::tex::gamma_default, ""),
161
+ coat_roughness_channel: Templates::OmniUber_Automotive::r,
162
+ coat_roughness: 0.0599999987f,
163
+ coat_ior: 1.60000002f,
164
+ coat_anisotropy: 0.f,
165
+ coat_anisotropy_rotation: 0.f,
166
+ coat_affect_color: 0.f,
167
+ coat_affect_roughness: 0.f,
168
+ coat_normal_image: texture_2d(),
169
+ coat_normal_flip_green: true,
170
+ uv_set_coat_roughness_normal: Templates::OmniUber_Automotive::uv_set_1,
171
+ uv_set_coat_mask: Templates::OmniUber_Automotive::uv_set_2,
172
+ enable_flakes: true,
173
+ flake_color: color(1.f, 0.999989986f, 0.999989986f),
174
+ flake_size: 0.0899999961f,
175
+ flakes_density: 0.280000001f,
176
+ flakes_spread: 0.150000006f,
177
+ flake_roughness: 0.25f);
Material/material_0161/Fabric_Denim_01.mdl ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.8;
2
+
3
+ import ::state::normal;
4
+ import ::OmniSurface::OmniShared::emission_mode;
5
+ import ..::Templates::OmniUber_Automotive::*;
6
+ import ::tex::gamma_mode;
7
+
8
+ export material Fabric_Denim_01(*)
9
+ = Templates::OmniUber_Automotive::OmniUber_Automotive(
10
+ uvs_mode_01: Templates::OmniUber_Automotive::triplanar,
11
+ uv_scale_01: float2(1.f),
12
+ uv_offset_01: float2(0.f),
13
+ uv_offset_time_01: float2(0.f),
14
+ uv_rotation_01: 0.f,
15
+ triplanar_blend_range_01: 0.5f,
16
+ uvs_mode_02: Templates::OmniUber_Automotive::triplanar,
17
+ uv_scale_02: float2(1.f),
18
+ uv_offset_02: float2(0.f),
19
+ uv_offset_time_02: float2(0.f),
20
+ uv_rotation_02: 0.f,
21
+ triplanar_blend_range_02: 0.5f,
22
+ uvs_mode_03: Templates::OmniUber_Automotive::triplanar,
23
+ uv_scale_03: float2(0.200000003f),
24
+ uv_offset_03: float2(0.f),
25
+ uv_offset_time_03: float2(0.f),
26
+ uv_rotation_03: 0.f,
27
+ triplanar_blend_range_03: 0.5f,
28
+ uvs_mode_04: Templates::OmniUber_Automotive::triplanar,
29
+ uv_scale_04: float2(1.f),
30
+ uv_offset_04: float2(0.f),
31
+ uv_offset_time_04: float2(0.f),
32
+ uv_rotation_04: 0.f,
33
+ triplanar_blend_range_04: 0.5f,
34
+ enable_opacity: false,
35
+ uv_set_opacity: Templates::OmniUber_Automotive::uv_set_1,
36
+ opacity_image: texture_2d(),
37
+ opacity_channel: Templates::OmniUber_Automotive::a,
38
+ geometry_opacity_threshold: 0.150000006f,
39
+ uv_set_layer_0: Templates::OmniUber_Automotive::uv_set_1,
40
+ base_color_image: texture_2d("./ov_fabric_denim_01_basecolor.png", ::tex::gamma_default, ""),
41
+ diffuse_reflection_color: color(0.702970266f, 0.418846399f, 0.199522913f),
42
+ base_color_scale: 1.f,
43
+ base_color_offset: 0.f,
44
+ base_color_desaturation: 0.f,
45
+ metalness_image: texture_2d("./ov_fabric_denim_01_orm.png", ::tex::gamma_linear, ""),
46
+ metalness_channel: Templates::OmniUber_Automotive::b,
47
+ metalness: 0.f,
48
+ specular_reflection_weight: 1.f,
49
+ specular_reflection_color: color(1.f, 1.f, 1.f),
50
+ cavity_image: texture_2d("./ov_fabric_denim_01_orm.png", ::tex::gamma_linear, ""),
51
+ cavity_channel: Templates::OmniUber_Automotive::r,
52
+ roughness_image: texture_2d("./ov_fabric_denim_01_orm.png", ::tex::gamma_default, ""),
53
+ roughness_channel: Templates::OmniUber_Automotive::g,
54
+ roughness_u: 1.f,
55
+ roughness_range_position: float2(1.f, 0.699999988f),
56
+ normal_image: texture_2d("./ov_fabric_denim_01_normal.png", ::tex::gamma_linear, ""),
57
+ normal_flip_green: true,
58
+ normal_scale: 1.f,
59
+ enable_layer_1: false,
60
+ layer_1_order: Templates::OmniUber_Automotive::above,
61
+ layer_1_blend_source: Templates::OmniUber_Automotive::texture,
62
+ layer_1_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_3,
63
+ layer_1_blend_splatmap: texture_2d("./leather_blend_mask_04.png", ::tex::gamma_linear, ""),
64
+ layer_1_blend_splatmap_channel: Templates::OmniUber_Automotive::r,
65
+ layer_1_blend_direction: float3(0.f, 1.f, 0.f),
66
+ layer_1_blend_axis: Templates::OmniUber_Automotive::y,
67
+ layer_1_blend_object_space: true,
68
+ layer_1_blend_scale: 1.f,
69
+ layer_1_blend_offset: 0.f,
70
+ layer_1_blend_primvar_name: "",
71
+ layer_1_uv_set_detail: Templates::OmniUber_Automotive::uv_set_1,
72
+ layer_1_blend_detail_image: texture_2d(),
73
+ layer_1_blend_detail_image_channel: Templates::OmniUber_Automotive::r,
74
+ layer_1_blend_threshold: 1.f,
75
+ layer_1_blend_factor_override: 0.f,
76
+ uv_set_layer_1: Templates::OmniUber_Automotive::uv_set_1,
77
+ layer_1_base_color_image: texture_2d(),
78
+ layer_1_diffuse_reflection_color: color(1.f, 1.f, 1.f),
79
+ layer_1_base_color_offset: 0.f,
80
+ layer_1_base_color_scale: 1.f,
81
+ layer_1_base_color_desaturation: 0.f,
82
+ layer_1_metalness_image: texture_2d(),
83
+ layer_1_metalness_channel: Templates::OmniUber_Automotive::b,
84
+ layer_1_metalness: 1.f,
85
+ layer_1_specular_reflection_weight: 1.f,
86
+ layer_1_cavity_image: texture_2d(),
87
+ layer_1_cavity_channel: Templates::OmniUber_Automotive::r,
88
+ layer_1_roughness_image: texture_2d(),
89
+ layer_1_roughness_channel: Templates::OmniUber_Automotive::g,
90
+ layer_1_roughness_u: 1.f,
91
+ layer_1_roughness_range_position: float2(1.f, 0.5f),
92
+ layer_1_normal_image: texture_2d(),
93
+ layer_1_normal_flip_green: true,
94
+ layer_1_normal_scale: 1.f,
95
+ enable_layer_2: false,
96
+ layer_2_order: Templates::OmniUber_Automotive::above,
97
+ layer_2_blend_source: Templates::OmniUber_Automotive::texture,
98
+ layer_2_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_2,
99
+ layer_2_blend_splatmap: texture_2d(),
100
+ layer_2_blend_splatmap_channel: Templates::OmniUber_Automotive::r,
101
+ layer_2_blend_direction: float3(0.f, 1.f, 0.f),
102
+ layer_2_blend_axis: Templates::OmniUber_Automotive::y,
103
+ layer_2_blend_object_space: true,
104
+ layer_2_blend_scale: 1.f,
105
+ layer_2_blend_offset: 0.f,
106
+ layer_2_blend_primvar_name: "",
107
+ layer_2_uv_set_detail: Templates::OmniUber_Automotive::uv_set_2,
108
+ layer_2_blend_detail_image: texture_2d(),
109
+ layer_2_blend_detail_image_channel: Templates::OmniUber_Automotive::r,
110
+ layer_2_blend_threshold: 0.330000013f,
111
+ layer_2_blend_factor_override: 0.f,
112
+ uv_set_layer_2: Templates::OmniUber_Automotive::uv_set_2,
113
+ layer_2_base_color_image: texture_2d(),
114
+ layer_2_diffuse_reflection_color: color(1.f, 1.f, 1.f),
115
+ layer_2_base_color_offset: 0.f,
116
+ layer_2_base_color_scale: 1.f,
117
+ layer_2_base_color_desaturation: 0.f,
118
+ layer_2_metalness_image: texture_2d(),
119
+ layer_2_metalness_channel: Templates::OmniUber_Automotive::b,
120
+ layer_2_metalness: 1.f,
121
+ layer_2_specular_reflection_weight: 1.f,
122
+ layer_2_cavity_image: texture_2d(),
123
+ layer_2_cavity_channel: Templates::OmniUber_Automotive::r,
124
+ layer_2_roughness_image: texture_2d(),
125
+ layer_2_roughness_channel: Templates::OmniUber_Automotive::g,
126
+ layer_2_roughness_u: 1.f,
127
+ layer_2_roughness_range_position: float2(1.f, 0.5f),
128
+ layer_2_normal_image: texture_2d(),
129
+ layer_2_normal_flip_green: true,
130
+ layer_2_normal_scale: 1.f,
131
+ enable_anisotropy: false,
132
+ uv_set_anisotropy: Templates::OmniUber_Automotive::uv_set_1,
133
+ anisotropic_roughness_u: 1.f,
134
+ anisotropic_roughness_v: 0.25f,
135
+ anisotropic_direction_image: texture_2d(),
136
+ anisotropic_direction_channel: Templates::OmniUber_Automotive::r,
137
+ anisotropic_direction: 0.f,
138
+ enable_detail_normal: true,
139
+ uv_set_detail_normal: Templates::OmniUber_Automotive::uv_set_2,
140
+ uv_set_detail_weight: Templates::OmniUber_Automotive::uv_set_1,
141
+ detail_normal_image: texture_2d("./ov_clouds_01_normal.png", ::tex::gamma_linear, ""),
142
+ detail_normal_flip_green: true,
143
+ detail_normal_scale: 1.f,
144
+ detail_normal_weight_image: texture_2d(),
145
+ detail_normal_weight_channel: Templates::OmniUber_Automotive::r,
146
+ enable_emission: false,
147
+ uv_set_emission: Templates::OmniUber_Automotive::uv_set_1,
148
+ uv_set_emission_mask: Templates::OmniUber_Automotive::uv_set_1,
149
+ emission_image: texture_2d(),
150
+ emission_mask_image: texture_2d(),
151
+ emission_mode: OmniSurface::OmniShared::emission_lx,
152
+ emission_intensity: 1.f,
153
+ emission_color: color(1.f, 1.f, 1.f),
154
+ emission_use_temperature: false,
155
+ emission_temperature: 6500.f,
156
+ enable_coat: false,
157
+ coat_color: color(1.f, 1.f, 1.f),
158
+ coat_mask_image: texture_2d(),
159
+ coat_mask_channel: Templates::OmniUber_Automotive::r,
160
+ coat_roughness_image: texture_2d(),
161
+ coat_roughness_channel: Templates::OmniUber_Automotive::r,
162
+ coat_roughness: 0.f,
163
+ coat_ior: 1.60000002f,
164
+ coat_anisotropy: 0.f,
165
+ coat_anisotropy_rotation: 0.f,
166
+ coat_affect_color: 0.f,
167
+ coat_affect_roughness: 0.f,
168
+ coat_normal_image: texture_2d(),
169
+ coat_normal_flip_green: true,
170
+ uv_set_coat_roughness_normal: Templates::OmniUber_Automotive::uv_set_1,
171
+ uv_set_coat_mask: Templates::OmniUber_Automotive::uv_set_1,
172
+ enable_flakes: false,
173
+ flake_color: color(1.f, 1.f, 1.f),
174
+ flake_size: 0.125f,
175
+ flakes_density: 0.25f,
176
+ flakes_spread: 0.150000006f,
177
+ flake_roughness: 0.0500000007f);
Material/material_0192/Leather_Grain_05.mdl ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.8;
2
+
3
+ import ::state::normal;
4
+ import ::OmniSurface::OmniShared::emission_mode;
5
+ import ..::Templates::OmniUber_Automotive::*;
6
+ import ::tex::gamma_mode;
7
+
8
+ export material Leather_Grain_05(*)
9
+ = Templates::OmniUber_Automotive::OmniUber_Automotive(
10
+ uvs_mode_01: Templates::OmniUber_Automotive::triplanar,
11
+ uv_scale_01: float2(2.f),
12
+ uv_offset_01: float2(0.f),
13
+ uv_offset_time_01: float2(0.f),
14
+ uv_rotation_01: 0.f,
15
+ triplanar_blend_range_01: 0.5f,
16
+ uvs_mode_02: Templates::OmniUber_Automotive::triplanar,
17
+ uv_scale_02: float2(0.075000003f),
18
+ uv_offset_02: float2(0.f),
19
+ uv_offset_time_02: float2(0.f),
20
+ uv_rotation_02: 0.f,
21
+ triplanar_blend_range_02: 0.5f,
22
+ uvs_mode_03: Templates::OmniUber_Automotive::triplanar,
23
+ uv_scale_03: float2(0.5f),
24
+ uv_offset_03: float2(0.f),
25
+ uv_offset_time_03: float2(0.f),
26
+ uv_rotation_03: 0.f,
27
+ triplanar_blend_range_03: 0.5f,
28
+ uvs_mode_04: Templates::OmniUber_Automotive::triplanar,
29
+ uv_scale_04: float2(1.f),
30
+ uv_offset_04: float2(0.f),
31
+ uv_offset_time_04: float2(0.f),
32
+ uv_rotation_04: 0.f,
33
+ triplanar_blend_range_04: 0.5f,
34
+ enable_opacity: false,
35
+ uv_set_opacity: Templates::OmniUber_Automotive::uv_set_1,
36
+ opacity_image: texture_2d(),
37
+ opacity_channel: Templates::OmniUber_Automotive::a,
38
+ geometry_opacity_threshold: 0.150000006f,
39
+ uv_set_layer_0: Templates::OmniUber_Automotive::uv_set_1,
40
+ base_color_image: texture_2d("./ov_leather_I_01_basecolor.png", ::tex::gamma_default, ""),
41
+ diffuse_reflection_color: color(0.343234301f, 0.266462207f, 0.133668795f),
42
+ base_color_scale: 1.f,
43
+ base_color_offset: 0.f,
44
+ base_color_desaturation: 0.f,
45
+ metalness_image: texture_2d("./ov_leather_I_01_orm.png", ::tex::gamma_linear, ""),
46
+ metalness_channel: Templates::OmniUber_Automotive::b,
47
+ metalness: 0.f,
48
+ specular_reflection_weight: 1.f,
49
+ specular_reflection_color: color(1.f, 1.f, 1.f),
50
+ cavity_image: texture_2d("./ov_leather_I_01_orm.png", ::tex::gamma_linear, ""),
51
+ cavity_channel: Templates::OmniUber_Automotive::r,
52
+ roughness_image: texture_2d("./ov_leather_I_01_orm.png", ::tex::gamma_default, ""),
53
+ roughness_channel: Templates::OmniUber_Automotive::g,
54
+ roughness_u: 1.f,
55
+ roughness_range_position: float2(0.850000024f, 0.649999976f),
56
+ normal_image: texture_2d("./ov_leather_I_01_normal.png", ::tex::gamma_linear, ""),
57
+ normal_flip_green: true,
58
+ normal_scale: 1.25f,
59
+ enable_layer_1: true,
60
+ layer_1_order: Templates::OmniUber_Automotive::above,
61
+ layer_1_blend_source: Templates::OmniUber_Automotive::texture,
62
+ layer_1_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_3,
63
+ layer_1_blend_splatmap: texture_2d("./leather_blend_mask_04.png", ::tex::gamma_linear, ""),
64
+ layer_1_blend_splatmap_channel: Templates::OmniUber_Automotive::r,
65
+ layer_1_blend_direction: float3(0.f, 1.f, 0.f),
66
+ layer_1_blend_axis: Templates::OmniUber_Automotive::y,
67
+ layer_1_blend_object_space: true,
68
+ layer_1_blend_scale: 1.f,
69
+ layer_1_blend_offset: 0.f,
70
+ layer_1_blend_primvar_name: "",
71
+ layer_1_uv_set_detail: Templates::OmniUber_Automotive::uv_set_1,
72
+ layer_1_blend_detail_image: texture_2d(),
73
+ layer_1_blend_detail_image_channel: Templates::OmniUber_Automotive::r,
74
+ layer_1_blend_threshold: 1.f,
75
+ layer_1_blend_factor_override: 0.f,
76
+ uv_set_layer_1: Templates::OmniUber_Automotive::uv_set_1,
77
+ layer_1_base_color_image: texture_2d("./ov_leather_I_01_basecolor.png", ::tex::gamma_default, ""),
78
+ layer_1_diffuse_reflection_color: color(0.44884491f, 0.348991692f, 0.179241687f),
79
+ layer_1_base_color_offset: 0.f,
80
+ layer_1_base_color_scale: 1.f,
81
+ layer_1_base_color_desaturation: 0.f,
82
+ layer_1_metalness_image: texture_2d("./ov_leather_I_01_orm.png", ::tex::gamma_default, ""),
83
+ layer_1_metalness_channel: Templates::OmniUber_Automotive::b,
84
+ layer_1_metalness: 1.f,
85
+ layer_1_specular_reflection_weight: 1.f,
86
+ layer_1_cavity_image: texture_2d("./ov_leather_I_01_orm.png", ::tex::gamma_default, ""),
87
+ layer_1_cavity_channel: Templates::OmniUber_Automotive::r,
88
+ layer_1_roughness_image: texture_2d("./ov_leather_I_01_orm.png", ::tex::gamma_default, ""),
89
+ layer_1_roughness_channel: Templates::OmniUber_Automotive::g,
90
+ layer_1_roughness_u: 1.f,
91
+ layer_1_roughness_range_position: float2(0.850000024f, 0.649999976f),
92
+ layer_1_normal_image: texture_2d("./ov_leather_I_01_normal.png", ::tex::gamma_linear, ""),
93
+ layer_1_normal_flip_green: true,
94
+ layer_1_normal_scale: 1.f,
95
+ enable_layer_2: false,
96
+ layer_2_order: Templates::OmniUber_Automotive::above,
97
+ layer_2_blend_source: Templates::OmniUber_Automotive::texture,
98
+ layer_2_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_2,
99
+ layer_2_blend_splatmap: texture_2d(),
100
+ layer_2_blend_splatmap_channel: Templates::OmniUber_Automotive::r,
101
+ layer_2_blend_direction: float3(0.f, 1.f, 0.f),
102
+ layer_2_blend_axis: Templates::OmniUber_Automotive::y,
103
+ layer_2_blend_object_space: true,
104
+ layer_2_blend_scale: 1.f,
105
+ layer_2_blend_offset: 0.f,
106
+ layer_2_blend_primvar_name: "",
107
+ layer_2_uv_set_detail: Templates::OmniUber_Automotive::uv_set_2,
108
+ layer_2_blend_detail_image: texture_2d(),
109
+ layer_2_blend_detail_image_channel: Templates::OmniUber_Automotive::r,
110
+ layer_2_blend_threshold: 0.330000013f,
111
+ layer_2_blend_factor_override: 0.f,
112
+ uv_set_layer_2: Templates::OmniUber_Automotive::uv_set_2,
113
+ layer_2_base_color_image: texture_2d(),
114
+ layer_2_diffuse_reflection_color: color(1.f, 1.f, 1.f),
115
+ layer_2_base_color_offset: 0.f,
116
+ layer_2_base_color_scale: 1.f,
117
+ layer_2_base_color_desaturation: 0.f,
118
+ layer_2_metalness_image: texture_2d(),
119
+ layer_2_metalness_channel: Templates::OmniUber_Automotive::b,
120
+ layer_2_metalness: 1.f,
121
+ layer_2_specular_reflection_weight: 1.f,
122
+ layer_2_cavity_image: texture_2d(),
123
+ layer_2_cavity_channel: Templates::OmniUber_Automotive::r,
124
+ layer_2_roughness_image: texture_2d(),
125
+ layer_2_roughness_channel: Templates::OmniUber_Automotive::g,
126
+ layer_2_roughness_u: 1.f,
127
+ layer_2_roughness_range_position: float2(1.f, 0.5f),
128
+ layer_2_normal_image: texture_2d(),
129
+ layer_2_normal_flip_green: true,
130
+ layer_2_normal_scale: 1.f,
131
+ enable_anisotropy: false,
132
+ uv_set_anisotropy: Templates::OmniUber_Automotive::uv_set_1,
133
+ anisotropic_roughness_u: 1.f,
134
+ anisotropic_roughness_v: 0.25f,
135
+ anisotropic_direction_image: texture_2d(),
136
+ anisotropic_direction_channel: Templates::OmniUber_Automotive::r,
137
+ anisotropic_direction: 0.f,
138
+ enable_detail_normal: true,
139
+ uv_set_detail_normal: Templates::OmniUber_Automotive::uv_set_2,
140
+ uv_set_detail_weight: Templates::OmniUber_Automotive::uv_set_1,
141
+ detail_normal_image: texture_2d("./ov_clouds_01_normal.png", ::tex::gamma_linear, ""),
142
+ detail_normal_flip_green: true,
143
+ detail_normal_scale: 1.f,
144
+ detail_normal_weight_image: texture_2d(),
145
+ detail_normal_weight_channel: Templates::OmniUber_Automotive::r,
146
+ enable_emission: false,
147
+ uv_set_emission: Templates::OmniUber_Automotive::uv_set_1,
148
+ uv_set_emission_mask: Templates::OmniUber_Automotive::uv_set_1,
149
+ emission_image: texture_2d(),
150
+ emission_mask_image: texture_2d(),
151
+ emission_mode: OmniSurface::OmniShared::emission_lx,
152
+ emission_intensity: 1.f,
153
+ emission_color: color(1.f, 1.f, 1.f),
154
+ emission_use_temperature: false,
155
+ emission_temperature: 6500.f,
156
+ enable_coat: false,
157
+ coat_color: color(1.f, 1.f, 1.f),
158
+ coat_mask_image: texture_2d(),
159
+ coat_mask_channel: Templates::OmniUber_Automotive::r,
160
+ coat_roughness_image: texture_2d(),
161
+ coat_roughness_channel: Templates::OmniUber_Automotive::r,
162
+ coat_roughness: 0.f,
163
+ coat_ior: 1.60000002f,
164
+ coat_anisotropy: 0.f,
165
+ coat_anisotropy_rotation: 0.f,
166
+ coat_affect_color: 0.f,
167
+ coat_affect_roughness: 0.f,
168
+ coat_normal_image: texture_2d(),
169
+ coat_normal_flip_green: true,
170
+ uv_set_coat_roughness_normal: Templates::OmniUber_Automotive::uv_set_1,
171
+ uv_set_coat_mask: Templates::OmniUber_Automotive::uv_set_1,
172
+ enable_flakes: false,
173
+ flake_color: color(1.f, 1.f, 1.f),
174
+ flake_size: 0.125f,
175
+ flakes_density: 0.25f,
176
+ flakes_spread: 0.150000006f,
177
+ flake_roughness: 0.0500000007f);
Material/material_0211/Metal_Dark_Dirty.mdl ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.8;
2
+
3
+ import ::state::normal;
4
+ import ::OmniSurface::OmniShared::emission_mode;
5
+ import ..::Templates::OmniUber_Automotive::*;
6
+ import ::tex::gamma_mode;
7
+
8
+ export material Metal_Dark_Dirty(*)
9
+ = Templates::OmniUber_Automotive::OmniUber_Automotive(
10
+ uvs_mode_01: Templates::OmniUber_Automotive::triplanar,
11
+ uv_scale_01: float2(1.f),
12
+ uv_offset_01: float2(0.f),
13
+ uv_offset_time_01: float2(0.f),
14
+ uv_rotation_01: 0.f,
15
+ triplanar_blend_range_01: 0.5f,
16
+ uvs_mode_02: Templates::OmniUber_Automotive::triplanar,
17
+ uv_scale_02: float2(3.f),
18
+ uv_offset_02: float2(0.f),
19
+ uv_offset_time_02: float2(0.f),
20
+ uv_rotation_02: 0.f,
21
+ triplanar_blend_range_02: 0.5f,
22
+ uvs_mode_03: Templates::OmniUber_Automotive::triplanar,
23
+ uv_scale_03: float2(1.f),
24
+ uv_offset_03: float2(0.f),
25
+ uv_offset_time_03: float2(0.f),
26
+ uv_rotation_03: 0.f,
27
+ triplanar_blend_range_03: 0.5f,
28
+ uvs_mode_04: Templates::OmniUber_Automotive::triplanar,
29
+ uv_scale_04: float2(1.f),
30
+ uv_offset_04: float2(0.f),
31
+ uv_offset_time_04: float2(0.f),
32
+ uv_rotation_04: 0.f,
33
+ triplanar_blend_range_04: 0.5f,
34
+ enable_opacity: false,
35
+ uv_set_opacity: Templates::OmniUber_Automotive::uv_set_1,
36
+ opacity_image: texture_2d(),
37
+ opacity_channel: Templates::OmniUber_Automotive::a,
38
+ geometry_opacity_threshold: 0.150000006f,
39
+ uv_set_layer_0: Templates::OmniUber_Automotive::uv_set_1,
40
+ base_color_image: texture_2d("./ov_plastic_grain_b_01_basecolor.png", ::tex::gamma_default, ""),
41
+ diffuse_reflection_color: color(0.511551142f, 0.508555591f, 0.504797995f),
42
+ base_color_scale: 1.f,
43
+ base_color_offset: 0.f,
44
+ base_color_desaturation: 0.f,
45
+ metalness_image: texture_2d(),
46
+ metalness_channel: Templates::OmniUber_Automotive::b,
47
+ metalness: 1.f,
48
+ specular_reflection_weight: 1.f,
49
+ specular_reflection_color: color(1.f, 1.f, 1.f),
50
+ cavity_image: texture_2d("./ov_plastic_grain_b_01_orm.png", ::tex::gamma_linear, ""),
51
+ cavity_channel: Templates::OmniUber_Automotive::r,
52
+ roughness_image: texture_2d("./ov_plastic_grain_b_01_orm.png", ::tex::gamma_default, ""),
53
+ roughness_channel: Templates::OmniUber_Automotive::g,
54
+ roughness_u: 1.f,
55
+ roughness_range_position: float2(1.f, 0.75f),
56
+ normal_image: texture_2d("./ov_plastic_grain_b_01_normal.png", ::tex::gamma_linear, ""),
57
+ normal_flip_green: true,
58
+ normal_scale: 1.f,
59
+ enable_layer_1: true,
60
+ layer_1_order: Templates::OmniUber_Automotive::above,
61
+ layer_1_blend_source: Templates::OmniUber_Automotive::texture,
62
+ layer_1_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_2,
63
+ layer_1_blend_splatmap: texture_2d("./perlin1.png", ::tex::gamma_linear, ""),
64
+ layer_1_blend_splatmap_channel: Templates::OmniUber_Automotive::r,
65
+ layer_1_blend_direction: float3(0.f, 1.f, 0.f),
66
+ layer_1_blend_axis: Templates::OmniUber_Automotive::y,
67
+ layer_1_blend_object_space: true,
68
+ layer_1_blend_scale: 1.f,
69
+ layer_1_blend_offset: 0.f,
70
+ layer_1_blend_primvar_name: "",
71
+ layer_1_uv_set_detail: Templates::OmniUber_Automotive::uv_set_2,
72
+ layer_1_blend_detail_image: texture_2d("./ov_plastic_grain_c_01_roughness.png", ::tex::gamma_default, ""),
73
+ layer_1_blend_detail_image_channel: Templates::OmniUber_Automotive::r,
74
+ layer_1_blend_threshold: 0.429999977f,
75
+ layer_1_blend_factor_override: 0.f,
76
+ uv_set_layer_1: Templates::OmniUber_Automotive::uv_set_1,
77
+ layer_1_base_color_image: texture_2d("./ov_metal_a_01_basecolor.png", ::tex::gamma_default, ""),
78
+ layer_1_diffuse_reflection_color: color(0.0924092531f, 0.0823846087f, 0.071060583f),
79
+ layer_1_base_color_offset: 0.f,
80
+ layer_1_base_color_scale: 1.f,
81
+ layer_1_base_color_desaturation: 0.f,
82
+ layer_1_metalness_image: texture_2d("./ov_metal_a_01_orm.png", ::tex::gamma_default, ""),
83
+ layer_1_metalness_channel: Templates::OmniUber_Automotive::b,
84
+ layer_1_metalness: 0.f,
85
+ layer_1_specular_reflection_weight: 1.f,
86
+ layer_1_cavity_image: texture_2d("./ov_metal_a_01_orm.png", ::tex::gamma_default, ""),
87
+ layer_1_cavity_channel: Templates::OmniUber_Automotive::r,
88
+ layer_1_roughness_image: texture_2d("./ov_metal_a_01_orm.png", ::tex::gamma_default, ""),
89
+ layer_1_roughness_channel: Templates::OmniUber_Automotive::g,
90
+ layer_1_roughness_u: 1.f,
91
+ layer_1_roughness_range_position: float2(0.949999988f, 0.699999988f),
92
+ layer_1_normal_image: texture_2d("./ov_metal_a_01_normal.png", ::tex::gamma_linear, ""),
93
+ layer_1_normal_flip_green: true,
94
+ layer_1_normal_scale: 2.f,
95
+ enable_layer_2: false,
96
+ layer_2_order: Templates::OmniUber_Automotive::above,
97
+ layer_2_blend_source: Templates::OmniUber_Automotive::texture,
98
+ layer_2_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_2,
99
+ layer_2_blend_splatmap: texture_2d(),
100
+ layer_2_blend_splatmap_channel: Templates::OmniUber_Automotive::r,
101
+ layer_2_blend_direction: float3(0.f, 1.f, 0.f),
102
+ layer_2_blend_axis: Templates::OmniUber_Automotive::y,
103
+ layer_2_blend_object_space: true,
104
+ layer_2_blend_scale: 1.f,
105
+ layer_2_blend_offset: 0.f,
106
+ layer_2_blend_primvar_name: "",
107
+ layer_2_uv_set_detail: Templates::OmniUber_Automotive::uv_set_2,
108
+ layer_2_blend_detail_image: texture_2d(),
109
+ layer_2_blend_detail_image_channel: Templates::OmniUber_Automotive::r,
110
+ layer_2_blend_threshold: 0.330000013f,
111
+ layer_2_blend_factor_override: 0.f,
112
+ uv_set_layer_2: Templates::OmniUber_Automotive::uv_set_2,
113
+ layer_2_base_color_image: texture_2d(),
114
+ layer_2_diffuse_reflection_color: color(1.f, 1.f, 1.f),
115
+ layer_2_base_color_offset: 0.f,
116
+ layer_2_base_color_scale: 1.f,
117
+ layer_2_base_color_desaturation: 0.f,
118
+ layer_2_metalness_image: texture_2d(),
119
+ layer_2_metalness_channel: Templates::OmniUber_Automotive::b,
120
+ layer_2_metalness: 1.f,
121
+ layer_2_specular_reflection_weight: 1.f,
122
+ layer_2_cavity_image: texture_2d(),
123
+ layer_2_cavity_channel: Templates::OmniUber_Automotive::r,
124
+ layer_2_roughness_image: texture_2d(),
125
+ layer_2_roughness_channel: Templates::OmniUber_Automotive::g,
126
+ layer_2_roughness_u: 1.f,
127
+ layer_2_roughness_range_position: float2(1.f, 0.5f),
128
+ layer_2_normal_image: texture_2d(),
129
+ layer_2_normal_flip_green: true,
130
+ layer_2_normal_scale: 1.f,
131
+ enable_anisotropy: false,
132
+ uv_set_anisotropy: Templates::OmniUber_Automotive::uv_set_1,
133
+ anisotropic_roughness_u: 1.f,
134
+ anisotropic_roughness_v: 0.25f,
135
+ anisotropic_direction_image: texture_2d(),
136
+ anisotropic_direction_channel: Templates::OmniUber_Automotive::r,
137
+ anisotropic_direction: 0.f,
138
+ enable_detail_normal: false,
139
+ uv_set_detail_normal: Templates::OmniUber_Automotive::uv_set_1,
140
+ uv_set_detail_weight: Templates::OmniUber_Automotive::uv_set_1,
141
+ detail_normal_image: texture_2d(),
142
+ detail_normal_flip_green: true,
143
+ detail_normal_scale: 1.f,
144
+ detail_normal_weight_image: texture_2d(),
145
+ detail_normal_weight_channel: Templates::OmniUber_Automotive::r,
146
+ enable_emission: false,
147
+ uv_set_emission: Templates::OmniUber_Automotive::uv_set_1,
148
+ uv_set_emission_mask: Templates::OmniUber_Automotive::uv_set_1,
149
+ emission_image: texture_2d(),
150
+ emission_mask_image: texture_2d(),
151
+ emission_mode: OmniSurface::OmniShared::emission_lx,
152
+ emission_intensity: 1.f,
153
+ emission_color: color(1.f, 1.f, 1.f),
154
+ emission_use_temperature: false,
155
+ emission_temperature: 6500.f,
156
+ enable_coat: false,
157
+ coat_color: color(1.f, 1.f, 1.f),
158
+ coat_mask_image: texture_2d(),
159
+ coat_mask_channel: Templates::OmniUber_Automotive::r,
160
+ coat_roughness_image: texture_2d(),
161
+ coat_roughness_channel: Templates::OmniUber_Automotive::r,
162
+ coat_roughness: 0.f,
163
+ coat_ior: 1.60000002f,
164
+ coat_anisotropy: 0.f,
165
+ coat_anisotropy_rotation: 0.f,
166
+ coat_affect_color: 0.f,
167
+ coat_affect_roughness: 0.f,
168
+ coat_normal_image: texture_2d(),
169
+ coat_normal_flip_green: true,
170
+ uv_set_coat_roughness_normal: Templates::OmniUber_Automotive::uv_set_1,
171
+ uv_set_coat_mask: Templates::OmniUber_Automotive::uv_set_1,
172
+ enable_flakes: false,
173
+ flake_color: color(1.f, 1.f, 1.f),
174
+ flake_size: 0.125f,
175
+ flakes_density: 0.25f,
176
+ flakes_spread: 0.150000006f,
177
+ flake_roughness: 0.0500000007f);
Material/material_0234/Plastic_Grain_02.mdl ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.8;
2
+
3
+ import ::state::normal;
4
+ import ::OmniSurface::OmniShared::emission_mode;
5
+ import ..::Templates::OmniUber_Automotive::*;
6
+ import ::tex::gamma_mode;
7
+
8
+ export material Plastic_Grain_02(*)
9
+ = Templates::OmniUber_Automotive::OmniUber_Automotive(
10
+ uvs_mode_01: Templates::OmniUber_Automotive::triplanar,
11
+ uv_scale_01: float2(1.f),
12
+ uv_offset_01: float2(0.f),
13
+ uv_offset_time_01: float2(0.f),
14
+ uv_rotation_01: 0.f,
15
+ triplanar_blend_range_01: 0.5f,
16
+ uvs_mode_02: Templates::OmniUber_Automotive::triplanar,
17
+ uv_scale_02: float2(0.0500000007f),
18
+ uv_offset_02: float2(0.f),
19
+ uv_offset_time_02: float2(0.f),
20
+ uv_rotation_02: 0.f,
21
+ triplanar_blend_range_02: 0.5f,
22
+ uvs_mode_03: Templates::OmniUber_Automotive::triplanar,
23
+ uv_scale_03: float2(1.f),
24
+ uv_offset_03: float2(0.f),
25
+ uv_offset_time_03: float2(0.f),
26
+ uv_rotation_03: 0.f,
27
+ triplanar_blend_range_03: 0.5f,
28
+ uvs_mode_04: Templates::OmniUber_Automotive::triplanar,
29
+ uv_scale_04: float2(1.f),
30
+ uv_offset_04: float2(0.f),
31
+ uv_offset_time_04: float2(0.f),
32
+ uv_rotation_04: 0.f,
33
+ triplanar_blend_range_04: 0.5f,
34
+ enable_opacity: false,
35
+ uv_set_opacity: Templates::OmniUber_Automotive::uv_set_1,
36
+ opacity_image: texture_2d(),
37
+ opacity_channel: Templates::OmniUber_Automotive::a,
38
+ geometry_opacity_threshold: 0.150000006f,
39
+ uv_set_layer_0: Templates::OmniUber_Automotive::uv_set_1,
40
+ base_color_image: texture_2d("./ov_plastic_grain_b_01_basecolor.png", ::tex::gamma_default, ""),
41
+ diffuse_reflection_color: color(0.0941176489f, 0.0941176489f, 0.0941176489f),
42
+ base_color_scale: 1.f,
43
+ base_color_offset: 0.170000002f,
44
+ base_color_desaturation: 0.f,
45
+ metalness_image: texture_2d("./ov_plastic_grain_b_01_orm.png", ::tex::gamma_linear, ""),
46
+ metalness_channel: Templates::OmniUber_Automotive::b,
47
+ metalness: 0.f,
48
+ specular_reflection_weight: 1.f,
49
+ specular_reflection_color: color(1.f, 1.f, 1.f),
50
+ cavity_image: texture_2d("./ov_plastic_grain_b_01_orm.png", ::tex::gamma_linear, ""),
51
+ cavity_channel: Templates::OmniUber_Automotive::r,
52
+ roughness_image: texture_2d("./ov_plastic_grain_b_01_orm.png", ::tex::gamma_default, ""),
53
+ roughness_channel: Templates::OmniUber_Automotive::g,
54
+ roughness_u: 1.f,
55
+ roughness_range_position: float2(0.649999976f, 0.629999995f),
56
+ normal_image: texture_2d("./ov_plastic_grain_b_01_normal.png", ::tex::gamma_linear, ""),
57
+ normal_flip_green: true,
58
+ normal_scale: 0.5f,
59
+ enable_layer_1: false,
60
+ layer_1_order: Templates::OmniUber_Automotive::above,
61
+ layer_1_blend_source: Templates::OmniUber_Automotive::texture,
62
+ layer_1_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_1,
63
+ layer_1_blend_splatmap: texture_2d(),
64
+ layer_1_blend_splatmap_channel: Templates::OmniUber_Automotive::r,
65
+ layer_1_blend_direction: float3(0.f, 1.f, 0.f),
66
+ layer_1_blend_axis: Templates::OmniUber_Automotive::y,
67
+ layer_1_blend_object_space: true,
68
+ layer_1_blend_scale: 1.f,
69
+ layer_1_blend_offset: 0.f,
70
+ layer_1_blend_primvar_name: "",
71
+ layer_1_uv_set_detail: Templates::OmniUber_Automotive::uv_set_1,
72
+ layer_1_blend_detail_image: texture_2d(),
73
+ layer_1_blend_detail_image_channel: Templates::OmniUber_Automotive::r,
74
+ layer_1_blend_threshold: 0.330000013f,
75
+ layer_1_blend_factor_override: 0.f,
76
+ uv_set_layer_1: Templates::OmniUber_Automotive::uv_set_1,
77
+ layer_1_base_color_image: texture_2d(),
78
+ layer_1_diffuse_reflection_color: color(1.f, 1.f, 1.f),
79
+ layer_1_base_color_offset: 0.f,
80
+ layer_1_base_color_scale: 1.f,
81
+ layer_1_base_color_desaturation: 0.f,
82
+ layer_1_metalness_image: texture_2d(),
83
+ layer_1_metalness_channel: Templates::OmniUber_Automotive::b,
84
+ layer_1_metalness: 1.f,
85
+ layer_1_specular_reflection_weight: 1.f,
86
+ layer_1_cavity_image: texture_2d(),
87
+ layer_1_cavity_channel: Templates::OmniUber_Automotive::r,
88
+ layer_1_roughness_image: texture_2d(),
89
+ layer_1_roughness_channel: Templates::OmniUber_Automotive::g,
90
+ layer_1_roughness_u: 1.f,
91
+ layer_1_roughness_range_position: float2(0.949999988f, 0.5f),
92
+ layer_1_normal_image: texture_2d(),
93
+ layer_1_normal_flip_green: true,
94
+ layer_1_normal_scale: 1.f,
95
+ enable_layer_2: false,
96
+ layer_2_order: Templates::OmniUber_Automotive::above,
97
+ layer_2_blend_source: Templates::OmniUber_Automotive::texture,
98
+ layer_2_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_2,
99
+ layer_2_blend_splatmap: texture_2d(),
100
+ layer_2_blend_splatmap_channel: Templates::OmniUber_Automotive::r,
101
+ layer_2_blend_direction: float3(0.f, 1.f, 0.f),
102
+ layer_2_blend_axis: Templates::OmniUber_Automotive::y,
103
+ layer_2_blend_object_space: true,
104
+ layer_2_blend_scale: 1.f,
105
+ layer_2_blend_offset: 0.f,
106
+ layer_2_blend_primvar_name: "",
107
+ layer_2_uv_set_detail: Templates::OmniUber_Automotive::uv_set_2,
108
+ layer_2_blend_detail_image: texture_2d(),
109
+ layer_2_blend_detail_image_channel: Templates::OmniUber_Automotive::r,
110
+ layer_2_blend_threshold: 0.330000013f,
111
+ layer_2_blend_factor_override: 0.f,
112
+ uv_set_layer_2: Templates::OmniUber_Automotive::uv_set_2,
113
+ layer_2_base_color_image: texture_2d(),
114
+ layer_2_diffuse_reflection_color: color(1.f, 1.f, 1.f),
115
+ layer_2_base_color_offset: 0.f,
116
+ layer_2_base_color_scale: 1.f,
117
+ layer_2_base_color_desaturation: 0.f,
118
+ layer_2_metalness_image: texture_2d(),
119
+ layer_2_metalness_channel: Templates::OmniUber_Automotive::b,
120
+ layer_2_metalness: 1.f,
121
+ layer_2_specular_reflection_weight: 1.f,
122
+ layer_2_cavity_image: texture_2d(),
123
+ layer_2_cavity_channel: Templates::OmniUber_Automotive::r,
124
+ layer_2_roughness_image: texture_2d(),
125
+ layer_2_roughness_channel: Templates::OmniUber_Automotive::g,
126
+ layer_2_roughness_u: 1.f,
127
+ layer_2_roughness_range_position: float2(1.f, 0.5f),
128
+ layer_2_normal_image: texture_2d(),
129
+ layer_2_normal_flip_green: true,
130
+ layer_2_normal_scale: 1.f,
131
+ enable_anisotropy: false,
132
+ uv_set_anisotropy: Templates::OmniUber_Automotive::uv_set_1,
133
+ anisotropic_roughness_u: 1.f,
134
+ anisotropic_roughness_v: 0.25f,
135
+ anisotropic_direction_image: texture_2d(),
136
+ anisotropic_direction_channel: Templates::OmniUber_Automotive::r,
137
+ anisotropic_direction: 0.f,
138
+ enable_detail_normal: true,
139
+ uv_set_detail_normal: Templates::OmniUber_Automotive::uv_set_2,
140
+ uv_set_detail_weight: Templates::OmniUber_Automotive::uv_set_1,
141
+ detail_normal_image: texture_2d("./ov_clouds_01_normal.png", ::tex::gamma_linear, ""),
142
+ detail_normal_flip_green: true,
143
+ detail_normal_scale: 0.5f,
144
+ detail_normal_weight_image: texture_2d(),
145
+ detail_normal_weight_channel: Templates::OmniUber_Automotive::r,
146
+ enable_emission: false,
147
+ uv_set_emission: Templates::OmniUber_Automotive::uv_set_1,
148
+ uv_set_emission_mask: Templates::OmniUber_Automotive::uv_set_1,
149
+ emission_image: texture_2d(),
150
+ emission_mask_image: texture_2d(),
151
+ emission_mode: OmniSurface::OmniShared::emission_lx,
152
+ emission_intensity: 1.f,
153
+ emission_color: color(1.f, 1.f, 1.f),
154
+ emission_use_temperature: false,
155
+ emission_temperature: 6500.f,
156
+ enable_coat: false,
157
+ coat_color: color(1.f, 1.f, 1.f),
158
+ coat_mask_image: texture_2d(),
159
+ coat_mask_channel: Templates::OmniUber_Automotive::r,
160
+ coat_roughness_image: texture_2d(),
161
+ coat_roughness_channel: Templates::OmniUber_Automotive::r,
162
+ coat_roughness: 0.f,
163
+ coat_ior: 1.60000002f,
164
+ coat_anisotropy: 0.f,
165
+ coat_anisotropy_rotation: 0.f,
166
+ coat_affect_color: 0.f,
167
+ coat_affect_roughness: 0.f,
168
+ coat_normal_image: texture_2d(),
169
+ coat_normal_flip_green: true,
170
+ uv_set_coat_roughness_normal: Templates::OmniUber_Automotive::uv_set_1,
171
+ uv_set_coat_mask: Templates::OmniUber_Automotive::uv_set_1,
172
+ enable_flakes: false,
173
+ flake_color: color(1.f, 1.f, 1.f),
174
+ flake_size: 0.125f,
175
+ flakes_density: 0.25f,
176
+ flakes_spread: 0.150000006f,
177
+ flake_roughness: 0.0500000007f);
Material/material_0244/Reflectors_01_Glow_Yellow.mdl ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.8;
2
+
3
+ import ::state::normal;
4
+ import ::OmniSurface::OmniShared::emission_mode;
5
+ import ..::Templates::OmniUber_Automotive::*;
6
+ import ::tex::gamma_mode;
7
+
8
+ export material Reflectors_01_Glow_Yellow(*)
9
+ = Templates::OmniUber_Automotive::OmniUber_Automotive(
10
+ uvs_mode_01: Templates::OmniUber_Automotive::texture_coord_0,
11
+ uv_scale_01: float2(1.f),
12
+ uv_offset_01: float2(0.f),
13
+ uv_offset_time_01: float2(0.f),
14
+ uv_rotation_01: 0.f,
15
+ triplanar_blend_range_01: 0.f,
16
+ uvs_mode_02: Templates::OmniUber_Automotive::texture_coord_0,
17
+ uv_scale_02: float2(1.f),
18
+ uv_offset_02: float2(0.f),
19
+ uv_offset_time_02: float2(0.f),
20
+ uv_rotation_02: 0.f,
21
+ triplanar_blend_range_02: 0.f,
22
+ uvs_mode_03: Templates::OmniUber_Automotive::texture_coord_0,
23
+ uv_scale_03: float2(1.f),
24
+ uv_offset_03: float2(0.f),
25
+ uv_offset_time_03: float2(0.f),
26
+ uv_rotation_03: 0.f,
27
+ triplanar_blend_range_03: 0.f,
28
+ uvs_mode_04: Templates::OmniUber_Automotive::texture_coord_0,
29
+ uv_scale_04: float2(1.f),
30
+ uv_offset_04: float2(0.f),
31
+ uv_offset_time_04: float2(0.f),
32
+ uv_rotation_04: 0.f,
33
+ triplanar_blend_range_04: 0.f,
34
+ enable_opacity: false,
35
+ uv_set_opacity: Templates::OmniUber_Automotive::uv_set_1,
36
+ opacity_image: texture_2d(),
37
+ opacity_channel: Templates::OmniUber_Automotive::a,
38
+ geometry_opacity_threshold: 0.150000006f,
39
+ uv_set_layer_0: Templates::OmniUber_Automotive::uv_set_1,
40
+ base_color_image: texture_2d("./ov_reflectors_pattern_01_basecolor.png", ::tex::gamma_default, ""),
41
+ diffuse_reflection_color: color(1.f, 0.435643554f, 0.f),
42
+ base_color_scale: 1.f,
43
+ base_color_offset: 0.f,
44
+ base_color_desaturation: 0.f,
45
+ metalness_image: texture_2d("./ov_reflectors_pattern_01_orm.png", ::tex::gamma_linear, ""),
46
+ metalness_channel: Templates::OmniUber_Automotive::b,
47
+ metalness: 0.5f,
48
+ specular_reflection_weight: 1.f,
49
+ specular_reflection_color: color(1.f, 1.f, 1.f),
50
+ cavity_image: texture_2d("./ov_reflectors_pattern_01_orm.png", ::tex::gamma_linear, ""),
51
+ cavity_channel: Templates::OmniUber_Automotive::r,
52
+ roughness_image: texture_2d("./ov_reflectors_pattern_01_orm.png", ::tex::gamma_default, ""),
53
+ roughness_channel: Templates::OmniUber_Automotive::g,
54
+ roughness_u: 1.f,
55
+ roughness_range_position: float2(0.f, 0.125f),
56
+ normal_image: texture_2d("./ov_reflectors_pattern_01_normal.png", ::tex::gamma_linear, ""),
57
+ normal_flip_green: true,
58
+ normal_scale: 1.f,
59
+ enable_layer_1: false,
60
+ layer_1_order: Templates::OmniUber_Automotive::above,
61
+ layer_1_blend_source: Templates::OmniUber_Automotive::texture,
62
+ layer_1_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_1,
63
+ layer_1_blend_splatmap: texture_2d(),
64
+ layer_1_blend_splatmap_channel: Templates::OmniUber_Automotive::r,
65
+ layer_1_blend_direction: float3(0.f, 1.f, 0.f),
66
+ layer_1_blend_axis: Templates::OmniUber_Automotive::y,
67
+ layer_1_blend_object_space: true,
68
+ layer_1_blend_scale: 1.f,
69
+ layer_1_blend_offset: 0.f,
70
+ layer_1_blend_primvar_name: "",
71
+ layer_1_uv_set_detail: Templates::OmniUber_Automotive::uv_set_1,
72
+ layer_1_blend_detail_image: texture_2d(),
73
+ layer_1_blend_detail_image_channel: Templates::OmniUber_Automotive::r,
74
+ layer_1_blend_threshold: 0.330000013f,
75
+ layer_1_blend_factor_override: 0.f,
76
+ uv_set_layer_1: Templates::OmniUber_Automotive::uv_set_1,
77
+ layer_1_base_color_image: texture_2d(),
78
+ layer_1_diffuse_reflection_color: color(1.f, 1.f, 1.f),
79
+ layer_1_base_color_offset: 0.f,
80
+ layer_1_base_color_scale: 1.f,
81
+ layer_1_base_color_desaturation: 0.f,
82
+ layer_1_metalness_image: texture_2d(),
83
+ layer_1_metalness_channel: Templates::OmniUber_Automotive::b,
84
+ layer_1_metalness: 1.f,
85
+ layer_1_specular_reflection_weight: 1.f,
86
+ layer_1_cavity_image: texture_2d(),
87
+ layer_1_cavity_channel: Templates::OmniUber_Automotive::r,
88
+ layer_1_roughness_image: texture_2d(),
89
+ layer_1_roughness_channel: Templates::OmniUber_Automotive::g,
90
+ layer_1_roughness_u: 1.f,
91
+ layer_1_roughness_range_position: float2(0.949999988f, 0.5f),
92
+ layer_1_normal_image: texture_2d(),
93
+ layer_1_normal_flip_green: true,
94
+ layer_1_normal_scale: 1.f,
95
+ enable_layer_2: false,
96
+ layer_2_order: Templates::OmniUber_Automotive::above,
97
+ layer_2_blend_source: Templates::OmniUber_Automotive::texture,
98
+ layer_2_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_2,
99
+ layer_2_blend_splatmap: texture_2d(),
100
+ layer_2_blend_splatmap_channel: Templates::OmniUber_Automotive::r,
101
+ layer_2_blend_direction: float3(0.f, 1.f, 0.f),
102
+ layer_2_blend_axis: Templates::OmniUber_Automotive::y,
103
+ layer_2_blend_object_space: true,
104
+ layer_2_blend_scale: 1.f,
105
+ layer_2_blend_offset: 0.f,
106
+ layer_2_blend_primvar_name: "",
107
+ layer_2_uv_set_detail: Templates::OmniUber_Automotive::uv_set_2,
108
+ layer_2_blend_detail_image: texture_2d(),
109
+ layer_2_blend_detail_image_channel: Templates::OmniUber_Automotive::r,
110
+ layer_2_blend_threshold: 0.330000013f,
111
+ layer_2_blend_factor_override: 0.f,
112
+ uv_set_layer_2: Templates::OmniUber_Automotive::uv_set_2,
113
+ layer_2_base_color_image: texture_2d(),
114
+ layer_2_diffuse_reflection_color: color(1.f, 1.f, 1.f),
115
+ layer_2_base_color_offset: 0.f,
116
+ layer_2_base_color_scale: 1.f,
117
+ layer_2_base_color_desaturation: 0.f,
118
+ layer_2_metalness_image: texture_2d(),
119
+ layer_2_metalness_channel: Templates::OmniUber_Automotive::b,
120
+ layer_2_metalness: 1.f,
121
+ layer_2_specular_reflection_weight: 1.f,
122
+ layer_2_cavity_image: texture_2d(),
123
+ layer_2_cavity_channel: Templates::OmniUber_Automotive::r,
124
+ layer_2_roughness_image: texture_2d(),
125
+ layer_2_roughness_channel: Templates::OmniUber_Automotive::g,
126
+ layer_2_roughness_u: 1.f,
127
+ layer_2_roughness_range_position: float2(1.f, 0.5f),
128
+ layer_2_normal_image: texture_2d(),
129
+ layer_2_normal_flip_green: true,
130
+ layer_2_normal_scale: 1.f,
131
+ enable_anisotropy: false,
132
+ uv_set_anisotropy: Templates::OmniUber_Automotive::uv_set_1,
133
+ anisotropic_roughness_u: 1.f,
134
+ anisotropic_roughness_v: 0.25f,
135
+ anisotropic_direction_image: texture_2d(),
136
+ anisotropic_direction_channel: Templates::OmniUber_Automotive::r,
137
+ anisotropic_direction: 0.f,
138
+ enable_detail_normal: false,
139
+ uv_set_detail_normal: Templates::OmniUber_Automotive::uv_set_1,
140
+ uv_set_detail_weight: Templates::OmniUber_Automotive::uv_set_1,
141
+ detail_normal_image: texture_2d(),
142
+ detail_normal_flip_green: true,
143
+ detail_normal_scale: 1.f,
144
+ detail_normal_weight_image: texture_2d(),
145
+ detail_normal_weight_channel: Templates::OmniUber_Automotive::r,
146
+ enable_emission: true,
147
+ uv_set_emission: Templates::OmniUber_Automotive::uv_set_1,
148
+ uv_set_emission_mask: Templates::OmniUber_Automotive::uv_set_1,
149
+ emission_image: texture_2d("./ov_reflectors_pattern_01_mask.png", ::tex::gamma_srgb, ""),
150
+ emission_mask_image: texture_2d(),
151
+ emission_mode: OmniSurface::OmniShared::emission_lx,
152
+ emission_intensity: 60000.f,
153
+ emission_color: color(1.f, 0.13861382f, 0.f),
154
+ emission_use_temperature: false,
155
+ emission_temperature: 6500.f,
156
+ enable_coat: false,
157
+ coat_color: color(1.f, 1.f, 1.f),
158
+ coat_mask_image: texture_2d(),
159
+ coat_mask_channel: Templates::OmniUber_Automotive::r,
160
+ coat_roughness_image: texture_2d(),
161
+ coat_roughness_channel: Templates::OmniUber_Automotive::r,
162
+ coat_roughness: 0.f,
163
+ coat_ior: 1.60000002f,
164
+ coat_anisotropy: 0.f,
165
+ coat_anisotropy_rotation: 0.f,
166
+ coat_affect_color: 0.f,
167
+ coat_affect_roughness: 0.f,
168
+ coat_normal_image: texture_2d(),
169
+ coat_normal_flip_green: true,
170
+ uv_set_coat_roughness_normal: Templates::OmniUber_Automotive::uv_set_1,
171
+ uv_set_coat_mask: Templates::OmniUber_Automotive::uv_set_1,
172
+ enable_flakes: false,
173
+ flake_color: color(1.f, 1.f, 1.f),
174
+ flake_size: 0.125f,
175
+ flakes_density: 0.25f,
176
+ flakes_spread: 0.150000006f,
177
+ flake_roughness: 0.0500000007f);
Material/material_0263/UI_Screen_01.mdl ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.8;
2
+
3
+ import ::state::normal;
4
+ import ::OmniSurface::OmniShared::emission_mode;
5
+ import ..::Templates::OmniUber_Automotive::*;
6
+ import ::tex::gamma_mode;
7
+
8
+ export material UI_Screen_01(*)
9
+ = Templates::OmniUber_Automotive::OmniUber_Automotive(
10
+ uvs_mode_01: Templates::OmniUber_Automotive::texture_coord_0,
11
+ uv_scale_01: float2(1.f),
12
+ uv_offset_01: float2(0.f),
13
+ uv_offset_time_01: float2(0.f),
14
+ uv_rotation_01: 0.f,
15
+ triplanar_blend_range_01: 0.5f,
16
+ uvs_mode_02: Templates::OmniUber_Automotive::triplanar,
17
+ uv_scale_02: float2(1.f),
18
+ uv_offset_02: float2(0.f),
19
+ uv_offset_time_02: float2(0.f),
20
+ uv_rotation_02: 0.f,
21
+ triplanar_blend_range_02: 0.5f,
22
+ uvs_mode_03: Templates::OmniUber_Automotive::triplanar,
23
+ uv_scale_03: float2(1.f),
24
+ uv_offset_03: float2(0.f),
25
+ uv_offset_time_03: float2(0.f),
26
+ uv_rotation_03: 0.f,
27
+ triplanar_blend_range_03: 0.5f,
28
+ uvs_mode_04: Templates::OmniUber_Automotive::triplanar,
29
+ uv_scale_04: float2(1.f),
30
+ uv_offset_04: float2(0.f),
31
+ uv_offset_time_04: float2(0.f),
32
+ uv_rotation_04: 0.f,
33
+ triplanar_blend_range_04: 0.5f,
34
+ enable_opacity: false,
35
+ uv_set_opacity: Templates::OmniUber_Automotive::uv_set_1,
36
+ opacity_image: texture_2d(),
37
+ opacity_channel: Templates::OmniUber_Automotive::a,
38
+ geometry_opacity_threshold: 0.150000006f,
39
+ uv_set_layer_0: Templates::OmniUber_Automotive::uv_set_1,
40
+ base_color_image: texture_2d(),
41
+ diffuse_reflection_color: color(9.99999997e-07f, 9.99989993e-07f, 9.99989993e-07f),
42
+ base_color_scale: 1.f,
43
+ base_color_offset: 0.f,
44
+ base_color_desaturation: 0.f,
45
+ metalness_image: texture_2d(),
46
+ metalness_channel: Templates::OmniUber_Automotive::b,
47
+ metalness: 1.f,
48
+ specular_reflection_weight: 1.f,
49
+ specular_reflection_color: color(1.f, 1.f, 1.f),
50
+ cavity_image: texture_2d(),
51
+ cavity_channel: Templates::OmniUber_Automotive::r,
52
+ roughness_image: texture_2d("./dust1.png", ::tex::gamma_default, ""),
53
+ roughness_channel: Templates::OmniUber_Automotive::g,
54
+ roughness_u: 1.f,
55
+ roughness_range_position: float2(0.f, 0.0274999999f),
56
+ normal_image: texture_2d(),
57
+ normal_flip_green: true,
58
+ normal_scale: 1.f,
59
+ enable_layer_1: false,
60
+ layer_1_order: Templates::OmniUber_Automotive::above,
61
+ layer_1_blend_source: Templates::OmniUber_Automotive::texture,
62
+ layer_1_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_1,
63
+ layer_1_blend_splatmap: texture_2d(),
64
+ layer_1_blend_splatmap_channel: Templates::OmniUber_Automotive::r,
65
+ layer_1_blend_direction: float3(0.f, 1.f, 0.f),
66
+ layer_1_blend_axis: Templates::OmniUber_Automotive::y,
67
+ layer_1_blend_object_space: true,
68
+ layer_1_blend_scale: 1.f,
69
+ layer_1_blend_offset: 0.f,
70
+ layer_1_blend_primvar_name: "",
71
+ layer_1_uv_set_detail: Templates::OmniUber_Automotive::uv_set_1,
72
+ layer_1_blend_detail_image: texture_2d(),
73
+ layer_1_blend_detail_image_channel: Templates::OmniUber_Automotive::r,
74
+ layer_1_blend_threshold: 0.330000013f,
75
+ layer_1_blend_factor_override: 0.f,
76
+ uv_set_layer_1: Templates::OmniUber_Automotive::uv_set_1,
77
+ layer_1_base_color_image: texture_2d(),
78
+ layer_1_diffuse_reflection_color: color(1.f, 1.f, 1.f),
79
+ layer_1_base_color_offset: 0.f,
80
+ layer_1_base_color_scale: 1.f,
81
+ layer_1_base_color_desaturation: 0.f,
82
+ layer_1_metalness_image: texture_2d(),
83
+ layer_1_metalness_channel: Templates::OmniUber_Automotive::b,
84
+ layer_1_metalness: 1.f,
85
+ layer_1_specular_reflection_weight: 1.f,
86
+ layer_1_cavity_image: texture_2d(),
87
+ layer_1_cavity_channel: Templates::OmniUber_Automotive::r,
88
+ layer_1_roughness_image: texture_2d(),
89
+ layer_1_roughness_channel: Templates::OmniUber_Automotive::g,
90
+ layer_1_roughness_u: 1.f,
91
+ layer_1_roughness_range_position: float2(1.f, 0.5f),
92
+ layer_1_normal_image: texture_2d(),
93
+ layer_1_normal_flip_green: true,
94
+ layer_1_normal_scale: 1.f,
95
+ enable_layer_2: false,
96
+ layer_2_order: Templates::OmniUber_Automotive::above,
97
+ layer_2_blend_source: Templates::OmniUber_Automotive::texture,
98
+ layer_2_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_2,
99
+ layer_2_blend_splatmap: texture_2d(),
100
+ layer_2_blend_splatmap_channel: Templates::OmniUber_Automotive::r,
101
+ layer_2_blend_direction: float3(0.f, 1.f, 0.f),
102
+ layer_2_blend_axis: Templates::OmniUber_Automotive::y,
103
+ layer_2_blend_object_space: true,
104
+ layer_2_blend_scale: 1.f,
105
+ layer_2_blend_offset: 0.f,
106
+ layer_2_blend_primvar_name: "",
107
+ layer_2_uv_set_detail: Templates::OmniUber_Automotive::uv_set_2,
108
+ layer_2_blend_detail_image: texture_2d(),
109
+ layer_2_blend_detail_image_channel: Templates::OmniUber_Automotive::r,
110
+ layer_2_blend_threshold: 0.330000013f,
111
+ layer_2_blend_factor_override: 0.f,
112
+ uv_set_layer_2: Templates::OmniUber_Automotive::uv_set_1,
113
+ layer_2_base_color_image: texture_2d(),
114
+ layer_2_diffuse_reflection_color: color(1.f, 1.f, 1.f),
115
+ layer_2_base_color_offset: 0.f,
116
+ layer_2_base_color_scale: 1.f,
117
+ layer_2_base_color_desaturation: 0.f,
118
+ layer_2_metalness_image: texture_2d(),
119
+ layer_2_metalness_channel: Templates::OmniUber_Automotive::b,
120
+ layer_2_metalness: 1.f,
121
+ layer_2_specular_reflection_weight: 1.f,
122
+ layer_2_cavity_image: texture_2d(),
123
+ layer_2_cavity_channel: Templates::OmniUber_Automotive::r,
124
+ layer_2_roughness_image: texture_2d(),
125
+ layer_2_roughness_channel: Templates::OmniUber_Automotive::g,
126
+ layer_2_roughness_u: 1.f,
127
+ layer_2_roughness_range_position: float2(1.f, 0.5f),
128
+ layer_2_normal_image: texture_2d(),
129
+ layer_2_normal_flip_green: true,
130
+ layer_2_normal_scale: 1.f,
131
+ enable_anisotropy: false,
132
+ uv_set_anisotropy: Templates::OmniUber_Automotive::uv_set_1,
133
+ anisotropic_roughness_u: 1.f,
134
+ anisotropic_roughness_v: 0.25f,
135
+ anisotropic_direction_image: texture_2d(),
136
+ anisotropic_direction_channel: Templates::OmniUber_Automotive::r,
137
+ anisotropic_direction: 0.f,
138
+ enable_detail_normal: false,
139
+ uv_set_detail_normal: Templates::OmniUber_Automotive::uv_set_1,
140
+ uv_set_detail_weight: Templates::OmniUber_Automotive::uv_set_1,
141
+ detail_normal_image: texture_2d(),
142
+ detail_normal_flip_green: true,
143
+ detail_normal_scale: 1.f,
144
+ detail_normal_weight_image: texture_2d(),
145
+ detail_normal_weight_channel: Templates::OmniUber_Automotive::r,
146
+ enable_emission: true,
147
+ uv_set_emission: Templates::OmniUber_Automotive::uv_set_1,
148
+ uv_set_emission_mask: Templates::OmniUber_Automotive::uv_set_1,
149
+ emission_image: texture_2d("./screen.png", ::tex::gamma_default, ""),
150
+ emission_mask_image: texture_2d(),
151
+ emission_mode: OmniSurface::OmniShared::emission_lx,
152
+ emission_intensity: 600.f,
153
+ emission_color: color(1.f, 1.f, 1.f),
154
+ emission_use_temperature: false,
155
+ emission_temperature: 6500.f,
156
+ enable_coat: false,
157
+ coat_color: color(1.f, 1.f, 1.f),
158
+ coat_mask_image: texture_2d(),
159
+ coat_mask_channel: Templates::OmniUber_Automotive::r,
160
+ coat_roughness_image: texture_2d(),
161
+ coat_roughness_channel: Templates::OmniUber_Automotive::r,
162
+ coat_roughness: 0.f,
163
+ coat_ior: 1.60000002f,
164
+ coat_anisotropy: 0.f,
165
+ coat_anisotropy_rotation: 0.f,
166
+ coat_affect_color: 0.f,
167
+ coat_affect_roughness: 0.f,
168
+ coat_normal_image: texture_2d(),
169
+ coat_normal_flip_green: true,
170
+ uv_set_coat_roughness_normal: Templates::OmniUber_Automotive::uv_set_1,
171
+ uv_set_coat_mask: Templates::OmniUber_Automotive::uv_set_1,
172
+ enable_flakes: false,
173
+ flake_color: color(1.f, 1.f, 1.f),
174
+ flake_size: 0.125f,
175
+ flakes_density: 0.25f,
176
+ flakes_spread: 0.150000006f,
177
+ flake_roughness: 0.0500000007f);
Material/material_0271/Tire_Supercar_01.mdl ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.8;
2
+
3
+ import ::state::normal;
4
+ import ::OmniSurface::OmniShared::emission_mode;
5
+ import ..::Templates::OmniUber_Automotive::*;
6
+ import ::tex::gamma_mode;
7
+
8
+ export material Tire_Supercar_01(*)
9
+ = Templates::OmniUber_Automotive::OmniUber_Automotive(
10
+ uvs_mode_01: Templates::OmniUber_Automotive::texture_coord_0,
11
+ uv_scale_01: float2(1.f),
12
+ uv_offset_01: float2(0.f),
13
+ uv_offset_time_01: float2(0.f),
14
+ uv_rotation_01: 0.f,
15
+ triplanar_blend_range_01: 0.5f,
16
+ uvs_mode_02: Templates::OmniUber_Automotive::triplanar,
17
+ uv_scale_02: float2(1.f),
18
+ uv_offset_02: float2(0.f),
19
+ uv_offset_time_02: float2(0.f),
20
+ uv_rotation_02: 0.f,
21
+ triplanar_blend_range_02: 0.5f,
22
+ uvs_mode_03: Templates::OmniUber_Automotive::triplanar,
23
+ uv_scale_03: float2(1.f),
24
+ uv_offset_03: float2(0.f),
25
+ uv_offset_time_03: float2(0.f),
26
+ uv_rotation_03: 0.f,
27
+ triplanar_blend_range_03: 0.5f,
28
+ uvs_mode_04: Templates::OmniUber_Automotive::triplanar,
29
+ uv_scale_04: float2(1.f),
30
+ uv_offset_04: float2(0.f),
31
+ uv_offset_time_04: float2(0.f),
32
+ uv_rotation_04: 0.f,
33
+ triplanar_blend_range_04: 0.5f,
34
+ enable_opacity: false,
35
+ uv_set_opacity: Templates::OmniUber_Automotive::uv_set_1,
36
+ opacity_image: texture_2d(),
37
+ opacity_channel: Templates::OmniUber_Automotive::a,
38
+ geometry_opacity_threshold: 0.150000006f,
39
+ uv_set_layer_0: Templates::OmniUber_Automotive::uv_set_1,
40
+ base_color_image: texture_2d("./ov_tire_rubber_trim_sedan_01_basecolor.png", ::tex::gamma_srgb, ""),
41
+ diffuse_reflection_color: color(0.999996424f, 1.f, 0.999989986f),
42
+ base_color_scale: 1.f,
43
+ base_color_offset: 0.f,
44
+ base_color_desaturation: 0.f,
45
+ metalness_image: texture_2d("./ov_tire_rubber_trim_sedan_01_orm.png", ::tex::gamma_linear, ""),
46
+ metalness_channel: Templates::OmniUber_Automotive::b,
47
+ metalness: 0.f,
48
+ specular_reflection_weight: 1.f,
49
+ specular_reflection_color: color(1.f, 1.f, 1.f),
50
+ cavity_image: texture_2d("./ov_tire_rubber_trim_sedan_01_orm.png", ::tex::gamma_linear, ""),
51
+ cavity_channel: Templates::OmniUber_Automotive::r,
52
+ roughness_image: texture_2d("./ov_tire_rubber_trim_sedan_01_orm.png", ::tex::gamma_default, ""),
53
+ roughness_channel: Templates::OmniUber_Automotive::g,
54
+ roughness_u: 1.f,
55
+ roughness_range_position: float2(0.75f, 0.550000012f),
56
+ normal_image: texture_2d("./ov_tire_rubber_trim_sedan_01_normal.png", ::tex::gamma_linear, ""),
57
+ normal_flip_green: true,
58
+ normal_scale: 1.f,
59
+ enable_layer_1: false,
60
+ layer_1_order: Templates::OmniUber_Automotive::above,
61
+ layer_1_blend_source: Templates::OmniUber_Automotive::texture,
62
+ layer_1_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_1,
63
+ layer_1_blend_splatmap: texture_2d(),
64
+ layer_1_blend_splatmap_channel: Templates::OmniUber_Automotive::r,
65
+ layer_1_blend_direction: float3(0.f, 1.f, 0.f),
66
+ layer_1_blend_axis: Templates::OmniUber_Automotive::y,
67
+ layer_1_blend_object_space: true,
68
+ layer_1_blend_scale: 1.f,
69
+ layer_1_blend_offset: 0.f,
70
+ layer_1_blend_primvar_name: "",
71
+ layer_1_uv_set_detail: Templates::OmniUber_Automotive::uv_set_1,
72
+ layer_1_blend_detail_image: texture_2d(),
73
+ layer_1_blend_detail_image_channel: Templates::OmniUber_Automotive::r,
74
+ layer_1_blend_threshold: 0.330000013f,
75
+ layer_1_blend_factor_override: 0.f,
76
+ uv_set_layer_1: Templates::OmniUber_Automotive::uv_set_1,
77
+ layer_1_base_color_image: texture_2d(),
78
+ layer_1_diffuse_reflection_color: color(1.f, 1.f, 1.f),
79
+ layer_1_base_color_offset: 0.f,
80
+ layer_1_base_color_scale: 1.f,
81
+ layer_1_base_color_desaturation: 0.f,
82
+ layer_1_metalness_image: texture_2d(),
83
+ layer_1_metalness_channel: Templates::OmniUber_Automotive::b,
84
+ layer_1_metalness: 1.f,
85
+ layer_1_specular_reflection_weight: 1.f,
86
+ layer_1_cavity_image: texture_2d(),
87
+ layer_1_cavity_channel: Templates::OmniUber_Automotive::r,
88
+ layer_1_roughness_image: texture_2d(),
89
+ layer_1_roughness_channel: Templates::OmniUber_Automotive::g,
90
+ layer_1_roughness_u: 1.f,
91
+ layer_1_roughness_range_position: float2(0.949999988f, 0.5f),
92
+ layer_1_normal_image: texture_2d(),
93
+ layer_1_normal_flip_green: true,
94
+ layer_1_normal_scale: 1.f,
95
+ enable_layer_2: false,
96
+ layer_2_order: Templates::OmniUber_Automotive::above,
97
+ layer_2_blend_source: Templates::OmniUber_Automotive::texture,
98
+ layer_2_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_2,
99
+ layer_2_blend_splatmap: texture_2d(),
100
+ layer_2_blend_splatmap_channel: Templates::OmniUber_Automotive::r,
101
+ layer_2_blend_direction: float3(0.f, 1.f, 0.f),
102
+ layer_2_blend_axis: Templates::OmniUber_Automotive::y,
103
+ layer_2_blend_object_space: true,
104
+ layer_2_blend_scale: 1.f,
105
+ layer_2_blend_offset: 0.f,
106
+ layer_2_blend_primvar_name: "",
107
+ layer_2_uv_set_detail: Templates::OmniUber_Automotive::uv_set_2,
108
+ layer_2_blend_detail_image: texture_2d(),
109
+ layer_2_blend_detail_image_channel: Templates::OmniUber_Automotive::r,
110
+ layer_2_blend_threshold: 0.330000013f,
111
+ layer_2_blend_factor_override: 0.f,
112
+ uv_set_layer_2: Templates::OmniUber_Automotive::uv_set_2,
113
+ layer_2_base_color_image: texture_2d(),
114
+ layer_2_diffuse_reflection_color: color(1.f, 1.f, 1.f),
115
+ layer_2_base_color_offset: 0.f,
116
+ layer_2_base_color_scale: 1.f,
117
+ layer_2_base_color_desaturation: 0.f,
118
+ layer_2_metalness_image: texture_2d(),
119
+ layer_2_metalness_channel: Templates::OmniUber_Automotive::b,
120
+ layer_2_metalness: 1.f,
121
+ layer_2_specular_reflection_weight: 1.f,
122
+ layer_2_cavity_image: texture_2d(),
123
+ layer_2_cavity_channel: Templates::OmniUber_Automotive::r,
124
+ layer_2_roughness_image: texture_2d(),
125
+ layer_2_roughness_channel: Templates::OmniUber_Automotive::g,
126
+ layer_2_roughness_u: 1.f,
127
+ layer_2_roughness_range_position: float2(1.f, 0.5f),
128
+ layer_2_normal_image: texture_2d(),
129
+ layer_2_normal_flip_green: true,
130
+ layer_2_normal_scale: 1.f,
131
+ enable_anisotropy: false,
132
+ uv_set_anisotropy: Templates::OmniUber_Automotive::uv_set_1,
133
+ anisotropic_roughness_u: 1.f,
134
+ anisotropic_roughness_v: 0.25f,
135
+ anisotropic_direction_image: texture_2d(),
136
+ anisotropic_direction_channel: Templates::OmniUber_Automotive::r,
137
+ anisotropic_direction: 0.f,
138
+ enable_detail_normal: true,
139
+ uv_set_detail_normal: Templates::OmniUber_Automotive::uv_set_2,
140
+ uv_set_detail_weight: Templates::OmniUber_Automotive::uv_set_1,
141
+ detail_normal_image: texture_2d("./ov_clouds_01_normal.png", ::tex::gamma_linear, ""),
142
+ detail_normal_flip_green: true,
143
+ detail_normal_scale: 0.5f,
144
+ detail_normal_weight_image: texture_2d(),
145
+ detail_normal_weight_channel: Templates::OmniUber_Automotive::r,
146
+ enable_emission: false,
147
+ uv_set_emission: Templates::OmniUber_Automotive::uv_set_1,
148
+ uv_set_emission_mask: Templates::OmniUber_Automotive::uv_set_1,
149
+ emission_image: texture_2d(),
150
+ emission_mask_image: texture_2d(),
151
+ emission_mode: OmniSurface::OmniShared::emission_lx,
152
+ emission_intensity: 1.f,
153
+ emission_color: color(1.f, 1.f, 1.f),
154
+ emission_use_temperature: false,
155
+ emission_temperature: 6500.f,
156
+ enable_coat: false,
157
+ coat_color: color(1.f, 1.f, 1.f),
158
+ coat_mask_image: texture_2d(),
159
+ coat_mask_channel: Templates::OmniUber_Automotive::r,
160
+ coat_roughness_image: texture_2d(),
161
+ coat_roughness_channel: Templates::OmniUber_Automotive::r,
162
+ coat_roughness: 0.f,
163
+ coat_ior: 1.60000002f,
164
+ coat_anisotropy: 0.f,
165
+ coat_anisotropy_rotation: 0.f,
166
+ coat_affect_color: 0.f,
167
+ coat_affect_roughness: 0.f,
168
+ coat_normal_image: texture_2d(),
169
+ coat_normal_flip_green: true,
170
+ uv_set_coat_roughness_normal: Templates::OmniUber_Automotive::uv_set_1,
171
+ uv_set_coat_mask: Templates::OmniUber_Automotive::uv_set_1,
172
+ enable_flakes: false,
173
+ flake_color: color(1.f, 1.f, 1.f),
174
+ flake_size: 0.125f,
175
+ flakes_density: 0.25f,
176
+ flakes_spread: 0.150000006f,
177
+ flake_roughness: 0.0500000007f);
Material/material_0281/Wood_Grain_Raw_03.mdl ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.8;
2
+
3
+ import ::state::normal;
4
+ import ::OmniSurface::OmniShared::emission_mode;
5
+ import ..::Templates::OmniUber_Automotive::*;
6
+ import ::tex::gamma_mode;
7
+
8
+ export material Wood_Grain_Raw_03(*)
9
+ = Templates::OmniUber_Automotive::OmniUber_Automotive(
10
+ uvs_mode_01: Templates::OmniUber_Automotive::triplanar,
11
+ uv_scale_01: float2(2.5f),
12
+ uv_offset_01: float2(0.f),
13
+ uv_offset_time_01: float2(0.f),
14
+ uv_rotation_01: 0.f,
15
+ triplanar_blend_range_01: 0.f,
16
+ uvs_mode_02: Templates::OmniUber_Automotive::triplanar,
17
+ uv_scale_02: float2(0.0500000007f),
18
+ uv_offset_02: float2(0.f),
19
+ uv_offset_time_02: float2(0.f),
20
+ uv_rotation_02: 0.f,
21
+ triplanar_blend_range_02: 0.5f,
22
+ uvs_mode_03: Templates::OmniUber_Automotive::triplanar,
23
+ uv_scale_03: float2(1.f),
24
+ uv_offset_03: float2(0.f),
25
+ uv_offset_time_03: float2(0.f),
26
+ uv_rotation_03: 0.f,
27
+ triplanar_blend_range_03: 0.5f,
28
+ uvs_mode_04: Templates::OmniUber_Automotive::triplanar,
29
+ uv_scale_04: float2(1.f),
30
+ uv_offset_04: float2(0.f),
31
+ uv_offset_time_04: float2(0.f),
32
+ uv_rotation_04: 0.f,
33
+ triplanar_blend_range_04: 0.5f,
34
+ enable_opacity: false,
35
+ uv_set_opacity: Templates::OmniUber_Automotive::uv_set_1,
36
+ opacity_image: texture_2d(),
37
+ opacity_channel: Templates::OmniUber_Automotive::a,
38
+ geometry_opacity_threshold: 0.150000006f,
39
+ uv_set_layer_0: Templates::OmniUber_Automotive::uv_set_1,
40
+ base_color_image: texture_2d("./ov_wood_grain_c_01_basecolor.png", ::tex::gamma_default, ""),
41
+ diffuse_reflection_color: color(1.f, 0.999989986f, 0.999989986f),
42
+ base_color_scale: 1.44999993f,
43
+ base_color_offset: 0.f,
44
+ base_color_desaturation: 0.f,
45
+ metalness_image: texture_2d("./ov_wood_grain_c_01_orm.png", ::tex::gamma_linear, ""),
46
+ metalness_channel: Templates::OmniUber_Automotive::b,
47
+ metalness: 0.f,
48
+ specular_reflection_weight: 1.f,
49
+ specular_reflection_color: color(1.f, 1.f, 1.f),
50
+ cavity_image: texture_2d("./ov_wood_grain_c_01_orm.png", ::tex::gamma_linear, ""),
51
+ cavity_channel: Templates::OmniUber_Automotive::r,
52
+ roughness_image: texture_2d("./ov_wood_grain_c_01_orm.png", ::tex::gamma_default, ""),
53
+ roughness_channel: Templates::OmniUber_Automotive::g,
54
+ roughness_u: 1.f,
55
+ roughness_range_position: float2(0.850000024f, 0.649999976f),
56
+ normal_image: texture_2d("./ov_wood_grain_c_01_normal.png", ::tex::gamma_linear, ""),
57
+ normal_flip_green: true,
58
+ normal_scale: 1.f,
59
+ enable_layer_1: false,
60
+ layer_1_order: Templates::OmniUber_Automotive::above,
61
+ layer_1_blend_source: Templates::OmniUber_Automotive::texture,
62
+ layer_1_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_1,
63
+ layer_1_blend_splatmap: texture_2d(),
64
+ layer_1_blend_splatmap_channel: Templates::OmniUber_Automotive::r,
65
+ layer_1_blend_direction: float3(0.f, 1.f, 0.f),
66
+ layer_1_blend_axis: Templates::OmniUber_Automotive::y,
67
+ layer_1_blend_object_space: true,
68
+ layer_1_blend_scale: 1.f,
69
+ layer_1_blend_offset: 0.f,
70
+ layer_1_blend_primvar_name: "",
71
+ layer_1_uv_set_detail: Templates::OmniUber_Automotive::uv_set_1,
72
+ layer_1_blend_detail_image: texture_2d(),
73
+ layer_1_blend_detail_image_channel: Templates::OmniUber_Automotive::r,
74
+ layer_1_blend_threshold: 0.330000013f,
75
+ layer_1_blend_factor_override: 0.f,
76
+ uv_set_layer_1: Templates::OmniUber_Automotive::uv_set_1,
77
+ layer_1_base_color_image: texture_2d(),
78
+ layer_1_diffuse_reflection_color: color(1.f, 1.f, 1.f),
79
+ layer_1_base_color_offset: 0.f,
80
+ layer_1_base_color_scale: 1.f,
81
+ layer_1_base_color_desaturation: 0.f,
82
+ layer_1_metalness_image: texture_2d(),
83
+ layer_1_metalness_channel: Templates::OmniUber_Automotive::b,
84
+ layer_1_metalness: 1.f,
85
+ layer_1_specular_reflection_weight: 1.f,
86
+ layer_1_cavity_image: texture_2d(),
87
+ layer_1_cavity_channel: Templates::OmniUber_Automotive::r,
88
+ layer_1_roughness_image: texture_2d(),
89
+ layer_1_roughness_channel: Templates::OmniUber_Automotive::g,
90
+ layer_1_roughness_u: 1.f,
91
+ layer_1_roughness_range_position: float2(0.949999988f, 0.5f),
92
+ layer_1_normal_image: texture_2d(),
93
+ layer_1_normal_flip_green: true,
94
+ layer_1_normal_scale: 1.f,
95
+ enable_layer_2: false,
96
+ layer_2_order: Templates::OmniUber_Automotive::above,
97
+ layer_2_blend_source: Templates::OmniUber_Automotive::texture,
98
+ layer_2_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_2,
99
+ layer_2_blend_splatmap: texture_2d(),
100
+ layer_2_blend_splatmap_channel: Templates::OmniUber_Automotive::r,
101
+ layer_2_blend_direction: float3(0.f, 1.f, 0.f),
102
+ layer_2_blend_axis: Templates::OmniUber_Automotive::y,
103
+ layer_2_blend_object_space: true,
104
+ layer_2_blend_scale: 1.f,
105
+ layer_2_blend_offset: 0.f,
106
+ layer_2_blend_primvar_name: "",
107
+ layer_2_uv_set_detail: Templates::OmniUber_Automotive::uv_set_2,
108
+ layer_2_blend_detail_image: texture_2d(),
109
+ layer_2_blend_detail_image_channel: Templates::OmniUber_Automotive::r,
110
+ layer_2_blend_threshold: 0.330000013f,
111
+ layer_2_blend_factor_override: 0.f,
112
+ uv_set_layer_2: Templates::OmniUber_Automotive::uv_set_2,
113
+ layer_2_base_color_image: texture_2d(),
114
+ layer_2_diffuse_reflection_color: color(1.f, 1.f, 1.f),
115
+ layer_2_base_color_offset: 0.f,
116
+ layer_2_base_color_scale: 1.f,
117
+ layer_2_base_color_desaturation: 0.f,
118
+ layer_2_metalness_image: texture_2d(),
119
+ layer_2_metalness_channel: Templates::OmniUber_Automotive::b,
120
+ layer_2_metalness: 1.f,
121
+ layer_2_specular_reflection_weight: 1.f,
122
+ layer_2_cavity_image: texture_2d(),
123
+ layer_2_cavity_channel: Templates::OmniUber_Automotive::r,
124
+ layer_2_roughness_image: texture_2d(),
125
+ layer_2_roughness_channel: Templates::OmniUber_Automotive::g,
126
+ layer_2_roughness_u: 1.f,
127
+ layer_2_roughness_range_position: float2(1.f, 0.5f),
128
+ layer_2_normal_image: texture_2d(),
129
+ layer_2_normal_flip_green: true,
130
+ layer_2_normal_scale: 1.f,
131
+ enable_anisotropy: false,
132
+ uv_set_anisotropy: Templates::OmniUber_Automotive::uv_set_1,
133
+ anisotropic_roughness_u: 1.f,
134
+ anisotropic_roughness_v: 0.25f,
135
+ anisotropic_direction_image: texture_2d(),
136
+ anisotropic_direction_channel: Templates::OmniUber_Automotive::r,
137
+ anisotropic_direction: 0.f,
138
+ enable_detail_normal: true,
139
+ uv_set_detail_normal: Templates::OmniUber_Automotive::uv_set_2,
140
+ uv_set_detail_weight: Templates::OmniUber_Automotive::uv_set_1,
141
+ detail_normal_image: texture_2d("./ov_clouds_01_normal.png", ::tex::gamma_linear, ""),
142
+ detail_normal_flip_green: true,
143
+ detail_normal_scale: 0.5f,
144
+ detail_normal_weight_image: texture_2d(),
145
+ detail_normal_weight_channel: Templates::OmniUber_Automotive::r,
146
+ enable_emission: false,
147
+ uv_set_emission: Templates::OmniUber_Automotive::uv_set_1,
148
+ uv_set_emission_mask: Templates::OmniUber_Automotive::uv_set_1,
149
+ emission_image: texture_2d(),
150
+ emission_mask_image: texture_2d(),
151
+ emission_mode: OmniSurface::OmniShared::emission_lx,
152
+ emission_intensity: 1.f,
153
+ emission_color: color(1.f, 1.f, 1.f),
154
+ emission_use_temperature: false,
155
+ emission_temperature: 6500.f,
156
+ enable_coat: false,
157
+ coat_color: color(1.f, 1.f, 1.f),
158
+ coat_mask_image: texture_2d(),
159
+ coat_mask_channel: Templates::OmniUber_Automotive::r,
160
+ coat_roughness_image: texture_2d(),
161
+ coat_roughness_channel: Templates::OmniUber_Automotive::r,
162
+ coat_roughness: 0.f,
163
+ coat_ior: 1.60000002f,
164
+ coat_anisotropy: 0.f,
165
+ coat_anisotropy_rotation: 0.f,
166
+ coat_affect_color: 0.f,
167
+ coat_affect_roughness: 0.f,
168
+ coat_normal_image: texture_2d(),
169
+ coat_normal_flip_green: true,
170
+ uv_set_coat_roughness_normal: Templates::OmniUber_Automotive::uv_set_1,
171
+ uv_set_coat_mask: Templates::OmniUber_Automotive::uv_set_1,
172
+ enable_flakes: false,
173
+ flake_color: color(1.f, 1.f, 1.f),
174
+ flake_size: 0.125f,
175
+ flakes_density: 0.25f,
176
+ flakes_spread: 0.150000006f,
177
+ flake_roughness: 0.0500000007f);
Material/material_0299/Ceramic_Tiles_Glazed_Square_Brick.mdl ADDED
The diff for this file is too large to render. See raw diff
 
Material/material_0310/Concrete_Rough.mdl ADDED
@@ -0,0 +1,457 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2024 NVIDIA Corporation. All rights reserved. *
3
+ ******************************************************************************
4
+
5
+ Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge,
6
+ to any person obtaining a copy of the sample definition code that uses our
7
+ Material Definition Language (the "MDL Materials"), to reproduce and distribute
8
+ the MDL Materials, including without limitation the rights to use, copy, merge,
9
+ publish, distribute, and sell modified and unmodified copies of the MDL
10
+ Materials, and to permit persons to whom the MDL Materials is furnished to do
11
+ so, in all cases solely for use with NVIDIA's Material Definition Language,
12
+ subject to the following further conditions:
13
+
14
+ 1. The above copyright notices, this list of conditions, and the disclaimer
15
+ that follows shall be retained in all copies of one or more of the MDL
16
+ Materials, including in any software with which the MDL Materials are bundled,
17
+ redistributed, and/or sold, and included either as stand-alone text files,
18
+ human-readable headers or in the appropriate machine-readable metadata fields
19
+ within text or binary files as long as those fields can be easily viewed by the
20
+ user, as applicable.
21
+ 2. The name of NVIDIA shall not be used to promote, endorse or advertise any
22
+ Modified Version without specific prior written permission, except a) to comply
23
+ with the notice requirements otherwise contained herein; or b) to acknowledge
24
+ the contribution(s) of NVIDIA.
25
+
26
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
27
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
28
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
29
+ TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR
30
+ ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL,
31
+ INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF
32
+ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE
33
+ THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.
34
+ */
35
+
36
+ mdl 1.5;
37
+
38
+ import ::anno::*;
39
+ import ::base::*;
40
+ import ::df::*;
41
+ import ::math::*;
42
+ import ::state::*;
43
+ import ::tex::*;
44
+ import ::nvidia::core_definitions::blend_colors;
45
+ import ::nvidia::core_definitions::dimension;
46
+
47
+ const string COPYRIGHT =
48
+ " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
49
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
50
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
51
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
52
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
53
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
54
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
55
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
56
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
57
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
58
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
59
+
60
+
61
+
62
+ float remap_xy_to_0_1(float input, float x, float y)
63
+ {
64
+ return (input - x)/(y - x);
65
+ }
66
+
67
+ float histogram_scan_big(float input, float width, float position)
68
+ {
69
+ return ::math::clamp(
70
+ remap_xy_to_0_1(input,
71
+ ::math::lerp(-width, 1.0, position),
72
+ ::math::lerp(0.0, 1.0 + width, position)),
73
+ 0.0,
74
+ 1.0);
75
+ }
76
+
77
+ float histogram_scan_small(float input, float width, float position)
78
+ {
79
+ return ::math::clamp(
80
+ remap_xy_to_0_1(input,
81
+ ::math::lerp(0.0, 1.0 - width, position),
82
+ ::math::lerp(width, 1.0 , position)),
83
+ 0.0,
84
+ 1.0);
85
+ }
86
+
87
+ ::base::texture_coordinate_info vmat_transform(
88
+ uniform float2 translation = float2(0.0, 0.0),
89
+ uniform float rotation = 0.0,
90
+ uniform float2 scaling = float2(1.0, 1.0),
91
+ uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw,
92
+ uniform int uv_space = 0
93
+ )
94
+ {
95
+ float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f;
96
+
97
+ float4x4 scale =
98
+ float4x4(1.0 /scaling.x, 0. , 0. , 0.,
99
+ 0. , 1.0 /scaling.y , 0. , 0.,
100
+ 0. , 0. , 1.0, 0.,
101
+ translation.x , translation.y , 0.0, 1.);
102
+
103
+ float s = ::math::sin(rotation_rad);
104
+ float c = ::math::cos(rotation_rad);
105
+ float4x4 rotate =
106
+ float4x4( c , -s , 0.0 , 0.0,
107
+ s , c , 0.0 , 0.0,
108
+ 0.0, 0.0 , 1.0 , 0.0,
109
+ 0. , 0.0 , 0.0 , 1.);
110
+
111
+ return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space));
112
+ }
113
+
114
+
115
+ float histogram_range(float input, float range, float position)
116
+ {
117
+ float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0);
118
+ float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0);
119
+ return ::math::lerp(low, high, input);
120
+ }
121
+
122
+
123
+
124
+ float uint2float(int x)
125
+ {
126
+ return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0);
127
+ }
128
+
129
+ int lowbias32(int x)
130
+ {
131
+ x ^= x >>> 16;
132
+ x *= 0x7feb352d;
133
+ x ^= x >>> 15;
134
+ x *= 0x846ca68b;
135
+ x ^= x >>> 16;
136
+ return x;
137
+ }
138
+
139
+ float2 rnd22(int2 p) {
140
+ float2 ret_val = float2(
141
+ uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f,
142
+ uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f
143
+ );
144
+ return ret_val;
145
+ }
146
+
147
+ float3 srgb2rgb(float3 val)
148
+ {
149
+ return ::math::pow(::math::max(val, float3(0.0f)), 2.2);
150
+ }
151
+
152
+ float2x2 invert_2x2(float2x2 M)
153
+ {
154
+ float det = M[0][0]*M[1][1] - M[0][1]*M[1][0];
155
+ //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/
156
+ return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]);
157
+ }
158
+
159
+ float3 nonrepeat_lookup(
160
+ uniform texture_2d texture = texture_2d(),
161
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
162
+ float texture_scale = 1.0,
163
+ float3 average_color = float3(0.5),
164
+ float patch_size = 8.0
165
+ )
166
+ {
167
+
168
+ float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale;
169
+ float Z = patch_size; // patch scale inside example texture
170
+ float CON = 1.0f;
171
+
172
+ float3 O = float3(0.f);
173
+ float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f);
174
+ float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space
175
+
176
+ float2 U = uv_in;
177
+ float2 V = M * uv_in; //pre-tilted hexa coordinates
178
+ int2 I = int2(::math::floor(V)); // hexa-tile id
179
+
180
+ // The mean color needs to be determined in Photoshop then to make the
181
+ // average color work out, take the float value and calculate the apropriate
182
+ // mean value as (value^(1/2.2))
183
+
184
+ float3 m = average_color;
185
+
186
+ float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W;
187
+ F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates
188
+
189
+ if( F[2] > 0.f )
190
+
191
+ O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON))
192
+ + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON))
193
+ + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON));
194
+ else
195
+ O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON))
196
+ + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON))
197
+ + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON));
198
+ O = m + O/::math::length(W);
199
+ O = ::math::clamp( (O), 0.0, 1.0);
200
+
201
+ return float3(O);
202
+ }
203
+
204
+ color endless_texture(
205
+ uniform texture_2d texture = texture_2d(),
206
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
207
+ float texture_scale = 10.0,
208
+ float3 average_color = float3(0.5, 0.5, 1.0),
209
+ float patch_size = 8.0,
210
+ bool gamma_correct_lookup = true
211
+ )
212
+ {
213
+ return gamma_correct_lookup ? color(srgb2rgb(
214
+ nonrepeat_lookup (
215
+ texture: texture,
216
+ uvw: uvw,
217
+ texture_scale: texture_scale,
218
+ average_color: average_color,
219
+ patch_size: patch_size
220
+ ))
221
+ ) : color(nonrepeat_lookup (
222
+ texture: texture,
223
+ uvw: uvw,
224
+ texture_scale: texture_scale,
225
+ average_color: average_color,
226
+ patch_size: patch_size
227
+ ));
228
+ }
229
+
230
+ float3 endless_normal(
231
+ uniform texture_2d texture = texture_2d(),
232
+ float factor = 1.0,
233
+ bool flip_tangent_u = false,
234
+ bool flip_tangent_v = false,
235
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
236
+ float texture_scale = 1.0,
237
+ float3 average_color = float3(0.5, 0.5, 1.0),
238
+ float patch_size = 8.0
239
+ )
240
+ {
241
+ float3 transformed_tangent_u = flip_tangent_u ? uvw.tangent_u : - uvw.tangent_u;
242
+ float3 transformed_tangent_v = flip_tangent_v ? uvw.tangent_v : - uvw.tangent_v;
243
+
244
+ if (flip_tangent_u)
245
+ transformed_tangent_u=-transformed_tangent_u;
246
+ if (flip_tangent_v)
247
+ transformed_tangent_v=-transformed_tangent_v;
248
+
249
+ // normalized Lookup
250
+ float3 tangent_space_normal =
251
+ (nonrepeat_lookup (
252
+ texture: texture,
253
+ uvw: uvw,
254
+ texture_scale: texture_scale,
255
+ average_color: average_color,
256
+ patch_size: patch_size
257
+ ) - 0.5) * (2.0 * factor);
258
+
259
+ return ::math::normalize(uvw.tangent_u * tangent_space_normal.x +
260
+ uvw.tangent_v * tangent_space_normal.y +
261
+ ::state::normal()*1.0);
262
+ }
263
+
264
+ float3 normalmap_normal(
265
+ uniform texture_2d texture,
266
+ float factor = 1.0,
267
+ ::base::texture_coordinate_info uvw = ::base::texture_coordinate_info()
268
+ )
269
+ {
270
+ float3 lookup = (::tex::lookup_float3(texture, float2(uvw.position.x, uvw.position.y)) - float3(0.5)) * (factor * 2.0);
271
+ return ::math::normalize(uvw.tangent_u * lookup.x + uvw.tangent_v * lookup.y + ::state::normal() * (lookup.z + (1.0 - factor)));
272
+ }
273
+
274
+
275
+ export material Concrete_Rough(
276
+ uniform bool infinite_tiling = true [[
277
+ ::anno::description("Enables infinite tiling feature which removes repeating texture patterns. Note that depending on the material this feature changes the appearance of the material slightly."),
278
+ ::anno::display_name("Infinite Tiling"),
279
+ ::anno::in_group("Appearance")
280
+ ]],
281
+ float diffuse_brightness = 1.f [[
282
+ ::anno::description("Adjusts the lightness of the material."),
283
+ ::anno::display_name("Diffuse Brightness"),
284
+ ::anno::hard_range(0.f, 1.f),
285
+ ::anno::in_group("Appearance")
286
+ ]],
287
+ float roughness = 0.f [[
288
+ ::anno::description("Higher values lead to blurrier reflections."),
289
+ ::anno::display_name("Roughness"),
290
+ ::anno::hard_range(0.f, 1.f),
291
+ ::anno::in_group("Appearance")
292
+ ]],
293
+ float reflectivity = 1.f [[
294
+ ::anno::description("Higher values make the surface more reflective."),
295
+ ::anno::display_name("Reflectivity"),
296
+ ::anno::hard_range(0.f, 1.f),
297
+ ::anno::in_group("Appearance")
298
+ ]],
299
+ float moss_growth = 0.f [[
300
+ ::anno::description("Grows a layer of moss on top of the material."),
301
+ ::anno::display_name("Moss Growth"),
302
+ ::anno::hard_range(0.f, 1.f),
303
+ ::anno::in_group("Appearance")
304
+ ]],
305
+ uniform float bump_strength = 1.f [[
306
+ ::anno::description("Determines the degree of bumpiness."),
307
+ ::anno::display_name("Bump Strength"),
308
+ ::anno::hard_range(0.f, 2.f),
309
+ ::anno::soft_range(0.f, 1.f),
310
+ ::anno::in_group("Appearance")
311
+ ]],
312
+ float dirt = 0.f [[
313
+ ::anno::description("The strength of the dirtlayer."),
314
+ ::anno::display_name("Dirt Strength"),
315
+ ::anno::hard_range(0.f, 1.f),
316
+ ::anno::in_group("Appearance", "Dirt")
317
+ ]],
318
+ color dirt_color = color(0.f, 0.f, 0.f) [[
319
+ ::anno::description("Adjust the color of the dirt layer."),
320
+ ::anno::display_name("Dirt Color"),
321
+ ::anno::in_group("Appearance", "Dirt")
322
+ ]],
323
+ uniform float2 texture_translate = 0.f [[
324
+ ::anno::description("Controls the position of the texture."),
325
+ ::anno::display_name("Texture Translate"),
326
+ ::anno::in_group("Transform")
327
+ ]],
328
+ uniform float texture_rotate = 0.f [[
329
+ ::anno::description("Rotation of the texture in degrees."),
330
+ ::anno::display_name("Texture Rotate"),
331
+ ::anno::in_group("Transform")
332
+ ]],
333
+ uniform float2 texture_scale = 1.f [[
334
+ ::anno::description("Larger numbers increase the size."),
335
+ ::anno::display_name("Texture Scale"),
336
+ ::nvidia::core_definitions::dimension(float2(1.0, 1.0)),
337
+ ::anno::in_group("Transform")
338
+ ]],
339
+ uniform int uv_space_index = 0 [[
340
+ ::anno::description("Uses selected UV space for material."),
341
+ ::anno::display_name("UV Space Index"),
342
+ ::anno::in_group("Advanced")
343
+ ]]
344
+ )
345
+ [[
346
+ ::anno::description("A rough concrete material with a dirt and moss layer."),
347
+ ::anno::in_group("Concrete"),
348
+ ::anno::display_name("Concrete Rough"),
349
+ ::anno::copyright_notice(COPYRIGHT),
350
+ ::anno::thumbnail("./.thumbs/Concrete_Rough.Concrete_Rough.png"),
351
+ ::anno::key_words(string[]("floor", "wall", "concrete", "construction", "exterior", "cement", "unfinished", "rough", "worn", "gray")),
352
+ ::anno::author("NVIDIA vMaterials"),
353
+ ::anno::contributor("Ruediger Raab"),
354
+ ::anno::contributor("Maik Rohland")
355
+ ]]
356
+ =
357
+ let {
358
+ bool tmp0 = false;
359
+ material_surface tmp1(::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, ::math::pow(histogram_scan_small(float3(infinite_tiling ? endless_texture(texture_2d("./concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./concrete_rough_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], ::math::lerp(0.0340000018f, 1.f, reflectivity), 1.f), 2.20000005f), ::df::microfacet_ggx_smith_bsdf(::math::lerp(::math::lerp(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./concrete_rough_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.635890067f, ::math::lerp(0.465000033f, 0.852000058f, roughness)), ::math::lerp(0.709000051f, histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./concrete_rough_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.635890067f, ::math::lerp(0.465000033f, 0.852000058f, roughness)), histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./concrete_rough_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.417000026f, 0.747000039f)), dirt), float3(::base::file_texture(texture_2d("./moss_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.478000015f, ::base::texture_coordinate_uvw, 0), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./concrete_rough_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.334000021f, ::math::lerp(1.f, 0.584000051f, moss_growth))) * ::math::lerp(::math::lerp(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./concrete_rough_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.635890067f, ::math::lerp(0.465000033f, 0.852000058f, roughness)), ::math::lerp(0.709000051f, histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./concrete_rough_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.635890067f, ::math::lerp(0.465000033f, 0.852000058f, roughness)), histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./concrete_rough_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.417000026f, 0.747000039f)), dirt), float3(::base::file_texture(texture_2d("./moss_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.478000015f, ::base::texture_coordinate_uvw, 0), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./concrete_rough_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.334000021f, ::math::lerp(1.f, 0.584000051f, moss_growth))), ::math::lerp(::math::lerp(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./concrete_rough_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.635890067f, ::math::lerp(0.465000033f, 0.852000058f, roughness)), ::math::lerp(0.709000051f, histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./concrete_rough_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.635890067f, ::math::lerp(0.465000033f, 0.852000058f, roughness)), histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./concrete_rough_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.417000026f, 0.747000039f)), dirt), float3(::base::file_texture(texture_2d("./moss_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.478000015f, ::base::texture_coordinate_uvw, 0), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./concrete_rough_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.334000021f, ::math::lerp(1.f, 0.584000051f, moss_growth))) * ::math::lerp(::math::lerp(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./concrete_rough_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.635890067f, ::math::lerp(0.465000033f, 0.852000058f, roughness)), ::math::lerp(0.709000051f, histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./concrete_rough_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.635890067f, ::math::lerp(0.465000033f, 0.852000058f, roughness)), histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./concrete_rough_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.417000026f, 0.747000039f)), dirt), float3(::base::file_texture(texture_2d("./moss_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.478000015f, ::base::texture_coordinate_uvw, 0), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./concrete_rough_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.334000021f, ::math::lerp(1.f, 0.584000051f, moss_growth))), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(infinite_tiling ? endless_texture(texture_2d("./concrete_rough_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.705882013f, 0.705882013f, 0.678430974f), 2.02700019f, true) : ::base::file_texture(texture_2d("./concrete_rough_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, color(0.f, 0.f, 0.f), ::base::color_layer_multiply, ::math::lerp(0.356000006f, 0.f, diffuse_brightness)).tint, nvidia::core_definitions::blend_colors(dirt_color, color(1.f, 1.f, 1.f), ::base::color_layer_blend, ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./concrete_rough_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 2.20000005f)).tint, ::base::color_layer_multiply, dirt * 0.699999988f).tint, ::base::file_texture(texture_2d("./moss_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.478000015f, ::base::texture_coordinate_uvw, 0), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, ::base::color_layer_multiply, histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./concrete_rough_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.334000021f, ::math::lerp(1.f, 0.584000051f, moss_growth))).tint, 0.f), bsdf(), ::state::normal()), ::state::normal()), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
360
+ material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
361
+ color tmp3 = color(1.f, 1.f, 1.f);
362
+ material_volume tmp4 = material_volume(scattering: vdf(), absorption_coefficient: color(0.f, 0.f, 0.f), scattering_coefficient: color(0.f, 0.f, 0.f));
363
+ material_geometry tmp5(float3(0.f), 1.f, ::math::normalize(::math::lerp(infinite_tiling ? endless_normal(texture_2d("./concrete_rough_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.5f, 0.5f, 1.f), 2.02700019f) : ::base::tangent_space_normal_texture(texture_2d("./concrete_rough_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f), normalmap_normal(texture_2d("./moss_norm.jpg", ::tex::gamma_linear), 2.f, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.478000015f, ::base::texture_coordinate_uvw, 0)), histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./concrete_rough_ORM.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.2670002f, float3(0.647059023f, 0.721569002f, 0.464740992f), 2.02700019f, false) : ::base::file_texture(texture_2d("./concrete_rough_ORM.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.334000021f, ::math::lerp(1.f, 0.584000051f, moss_growth)))));
364
+ hair_bsdf tmp6 = hair_bsdf();
365
+ } in
366
+ material(
367
+ thin_walled: tmp0,
368
+ surface: tmp1,
369
+ backface: tmp2,
370
+ ior: tmp3,
371
+ volume: tmp4,
372
+ geometry: tmp5,
373
+ hair: tmp6);
374
+
375
+
376
+ export material Concrete_Rough_Dirty(*)
377
+ [[
378
+ ::anno::description("A rough concrete material with a dirt and moss layer."),
379
+ ::anno::in_group("Concrete"),
380
+ ::anno::display_name("Concrete Rough Dirty"),
381
+ ::anno::copyright_notice(COPYRIGHT),
382
+ ::anno::thumbnail("./.thumbs/Concrete_Rough.Concrete_Rough_Dirty.png"),
383
+ ::anno::key_words(string[]("floor", "wall", "concrete", "construction", "exterior", "cement", "unfinished", "rough", "worn", "dirty", "gray")),
384
+ ::anno::author("NVIDIA vMaterials"),
385
+ ::anno::contributor("Ruediger Raab"),
386
+ ::anno::contributor("Maik Rohland")
387
+ ]]
388
+ = Concrete_Rough(
389
+ infinite_tiling: true,
390
+ diffuse_brightness: 1.0f,
391
+ roughness: 0.5f,
392
+ reflectivity: 1.0f,
393
+ moss_growth: 0.0f,
394
+ bump_strength: 1.0f,
395
+ dirt: 1.0f,
396
+ dirt_color: color(0.0f),
397
+ texture_translate: 0.0f,
398
+ texture_rotate: 0.0f,
399
+ texture_scale: 1.0f,
400
+ uv_space_index: 0
401
+ );
402
+
403
+
404
+ export material Concrete_Rough_Mossy(*)
405
+ [[
406
+ ::anno::description("A rough concrete material with a dirt and moss layer."),
407
+ ::anno::in_group("Concrete"),
408
+ ::anno::display_name("Concrete Rough Mossy"),
409
+ ::anno::copyright_notice(COPYRIGHT),
410
+ ::anno::thumbnail("./.thumbs/Concrete_Rough.Concrete_Rough_Mossy.png"),
411
+ ::anno::key_words(string[]("floor", "wall", "concrete", "construction", "exterior", "cement", "unfinished", "rough", "worn", "dirty", "decayed", "gray")),
412
+ ::anno::author("NVIDIA vMaterials"),
413
+ ::anno::contributor("Ruediger Raab"),
414
+ ::anno::contributor("Maik Rohland")
415
+ ]]
416
+ = Concrete_Rough(
417
+ infinite_tiling: true,
418
+ diffuse_brightness: 1.0f,
419
+ roughness: 0.5f,
420
+ reflectivity: 1.0f,
421
+ moss_growth: 0.5f,
422
+ bump_strength: 1.0f,
423
+ dirt: 0.0f,
424
+ dirt_color: color(0.0f),
425
+ texture_translate: 0.0f,
426
+ texture_rotate: 0.0f,
427
+ texture_scale: 1.0f,
428
+ uv_space_index: 0
429
+ );
430
+
431
+
432
+ export material Concrete_Rough_Heavy_Decay(*)
433
+ [[
434
+ ::anno::description("A rough concrete material with a dirt and moss layer."),
435
+ ::anno::in_group("Concrete"),
436
+ ::anno::display_name("Concrete Rough Heavy Decay"),
437
+ ::anno::copyright_notice(COPYRIGHT),
438
+ ::anno::thumbnail("./.thumbs/Concrete_Rough.Concrete_Rough_Heavy_Decay.png"),
439
+ ::anno::key_words(string[]("floor", "wall", "concrete", "construction", "exterior", "cement", "unfinished", "rough", "worn", "dirty", "decayed", "gray")),
440
+ ::anno::author("NVIDIA vMaterials"),
441
+ ::anno::contributor("Ruediger Raab"),
442
+ ::anno::contributor("Maik Rohland")
443
+ ]]
444
+ = Concrete_Rough(
445
+ infinite_tiling: true,
446
+ diffuse_brightness: 1.0f,
447
+ roughness: 0.75f,
448
+ reflectivity: 1.0f,
449
+ moss_growth: 0.80f,
450
+ bump_strength: 1.0f,
451
+ dirt: 0.0f,
452
+ dirt_color: color(0.0f),
453
+ texture_translate: 0.0f,
454
+ texture_rotate: 0.0f,
455
+ texture_scale: 1.0f,
456
+ uv_space_index: 0
457
+ );
Material/material_0311/Concrete_Wall_Aged.mdl ADDED
@@ -0,0 +1,436 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2024 NVIDIA Corporation. All rights reserved. *
3
+ ******************************************************************************
4
+
5
+ Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge,
6
+ to any person obtaining a copy of the sample definition code that uses our
7
+ Material Definition Language (the "MDL Materials"), to reproduce and distribute
8
+ the MDL Materials, including without limitation the rights to use, copy, merge,
9
+ publish, distribute, and sell modified and unmodified copies of the MDL
10
+ Materials, and to permit persons to whom the MDL Materials is furnished to do
11
+ so, in all cases solely for use with NVIDIA’s Material Definition Language,
12
+ subject to the following further conditions:
13
+
14
+ 1. The above copyright notices, this list of conditions, and the disclaimer
15
+ that follows shall be retained in all copies of one or more of the MDL
16
+ Materials, including in any software with which the MDL Materials are bundled,
17
+ redistributed, and/or sold, and included either as stand-alone text files,
18
+ human-readable headers or in the appropriate machine-readable metadata fields
19
+ within text or binary files as long as those fields can be easily viewed by the
20
+ user, as applicable.
21
+ 2. The name of NVIDIA shall not be used to promote, endorse or advertise any
22
+ Modified Version without specific prior written permission, except a) to comply
23
+ with the notice requirements otherwise contained herein; or b) to acknowledge
24
+ the contribution(s) of NVIDIA.
25
+
26
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
27
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
28
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
29
+ TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR
30
+ ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL,
31
+ INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF
32
+ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE
33
+ THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.
34
+ */
35
+
36
+ mdl 1.5;
37
+
38
+ import ::anno::*;
39
+ import ::base::*;
40
+ import ::df::*;
41
+ import ::math::*;
42
+ import ::state::*;
43
+ import ::tex::*;
44
+ import ::nvidia::core_definitions::blend_colors;
45
+ import ::nvidia::core_definitions::dimension;
46
+
47
+
48
+ const string COPYRIGHT =
49
+ " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
50
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
51
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
52
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
53
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
54
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
55
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
56
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
57
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
58
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
59
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
60
+
61
+
62
+
63
+ ::base::texture_coordinate_info transform_coordinate_2(
64
+ float4x4 transform
65
+ [[ ::anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix.") ]],
66
+ ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info()
67
+ [[ ::anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection.") ]]
68
+ ) [[
69
+ ::anno::description("Transform a texture coordinate by a matrix.") ,
70
+ ::anno::noinline()
71
+ ]]
72
+ {
73
+ // Version 2
74
+ float4 r_position = transform * float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1);
75
+ //Try aproximating it for the case that the rotation is only aroud z and assuming the texture layout is nice and z is ~constant.
76
+ //just pretend there is no other rotation happening
77
+ //get rid of scaling and translation. Then extract fields where sin and cos would be in a simple 2d transform around z.
78
+ float4 u = transform[0];
79
+ float3 ru = ::math::normalize(float3(u.x,u.y,u.z));
80
+ float cos = ru.x;
81
+ float sin = -ru.y;
82
+ //TODO: at least also handle sign of z?
83
+ //TODO: handle tangent becoming 0
84
+
85
+ return ::base::texture_coordinate_info(
86
+ float3(r_position.x,r_position.y,r_position.z),
87
+ ::math::normalize(cos * coordinate.tangent_u - sin * coordinate.tangent_v),
88
+ ::math::normalize(cos * coordinate.tangent_v + sin * coordinate.tangent_u));
89
+ }
90
+
91
+ ::base::texture_coordinate_info vmat_transform(
92
+ float2 translation = float2(0.0, 0.0),
93
+ float rotation = 0.0, // rotation in degrees
94
+ float2 scaling = float2(1.0, 1.0),
95
+ uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw,
96
+ uniform int uv_space = 0
97
+ )
98
+ {
99
+ float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f;
100
+ float4x4 scale =
101
+ float4x4(1.0 /scaling.x, 0. , 0. , 0.,
102
+ 0. , 1.0 /scaling.y , 0. , 0.,
103
+ 0. , 0. , 1.0, 0.,
104
+ translation.x , translation.y , 0.0, 1.);
105
+
106
+ float s = ::math::sin(rotation_rad);
107
+ float c = ::math::cos(rotation_rad);
108
+ float4x4 rotate =
109
+ float4x4( c , -s , 0.0 , 0.0,
110
+ s , c , 0.0 , 0.0,
111
+ 0.0, 0.0 , 1.0 , 0.0,
112
+ 0. , 0.0 , 0.0 , 1.);
113
+
114
+ return transform_coordinate_2(scale*rotate, ::base::coordinate_source(system, uv_space));
115
+ }
116
+
117
+
118
+ float histogram_range(float input, float range, float position)
119
+ {
120
+ float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0);
121
+ float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0);
122
+ return ::math::lerp(low, high, input);
123
+ }
124
+
125
+
126
+
127
+ float uint2float(int x)
128
+ {
129
+ return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0);
130
+ }
131
+
132
+ int lowbias32(int x)
133
+ {
134
+ x ^= x >>> 16;
135
+ x *= 0x7feb352d;
136
+ x ^= x >>> 15;
137
+ x *= 0x846ca68b;
138
+ x ^= x >>> 16;
139
+ return x;
140
+ }
141
+
142
+ float2 rnd22(int2 p) {
143
+ float2 ret_val = float2(
144
+ uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f,
145
+ uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f
146
+ );
147
+ return ret_val;
148
+ }
149
+
150
+ float3 srgb2rgb(float3 val)
151
+ {
152
+ return ::math::pow(::math::max(val, float3(0.0f)), 2.2);
153
+ }
154
+
155
+ float2x2 invert_2x2(float2x2 M)
156
+ {
157
+ float det = M[0][0]*M[1][1] - M[0][1]*M[1][0];
158
+ //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/
159
+ return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]);
160
+ }
161
+
162
+ float3 nonrepeat_lookup(
163
+ uniform texture_2d texture = texture_2d(),
164
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
165
+ float texture_scale = 1.0,
166
+ float3 average_color = float3(0.5),
167
+ float patch_size = 8.0
168
+ )
169
+ {
170
+
171
+ float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale;
172
+ float Z = patch_size; // patch scale inside example texture
173
+ float CON = 1.0f;
174
+
175
+ float3 O = float3(0.f);
176
+ float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f);
177
+ float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space
178
+
179
+ float2 U = uv_in;
180
+ float2 V = M * uv_in; //pre-tilted hexa coordinates
181
+ int2 I = int2(::math::floor(V)); // hexa-tile id
182
+
183
+ // The mean color needs to be determined in Photoshop then to make the
184
+ // average color work out, take the float value and calculate the apropriate
185
+ // mean value as (value^(1/2.2))
186
+
187
+ float3 m = average_color;
188
+
189
+ float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W;
190
+ F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates
191
+
192
+ if( F[2] > 0.f )
193
+
194
+ O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON))
195
+ + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON))
196
+ + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON));
197
+ else
198
+ O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON))
199
+ + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON))
200
+ + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON));
201
+ O = m + O/::math::length(W);
202
+ O = ::math::clamp( (O), 0.0, 1.0);
203
+
204
+ return float3(O);
205
+ }
206
+
207
+ color endless_texture(
208
+ uniform texture_2d texture = texture_2d(),
209
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
210
+ float texture_scale = 10.0,
211
+ float3 average_color = float3(0.5, 0.5, 1.0),
212
+ float patch_size = 8.0,
213
+ bool gamma_correct_lookup = true
214
+ )
215
+ {
216
+ return gamma_correct_lookup ? color(srgb2rgb(
217
+ nonrepeat_lookup (
218
+ texture: texture,
219
+ uvw: uvw,
220
+ texture_scale: texture_scale,
221
+ average_color: average_color,
222
+ patch_size: patch_size
223
+ ))
224
+ ) : color(nonrepeat_lookup (
225
+ texture: texture,
226
+ uvw: uvw,
227
+ texture_scale: texture_scale,
228
+ average_color: average_color,
229
+ patch_size: patch_size
230
+ ));
231
+ }
232
+
233
+ float3 endless_normal(
234
+ uniform texture_2d texture = texture_2d(),
235
+ float factor = 1.0,
236
+ bool flip_tangent_u = false,
237
+ bool flip_tangent_v = false,
238
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
239
+ float texture_scale = 1.0,
240
+ float3 average_color = float3(0.5, 0.5, 1.0),
241
+ float patch_size = 8.0
242
+ )
243
+ {
244
+ float3 transformed_tangent_u = flip_tangent_u ? uvw.tangent_u : - uvw.tangent_u;
245
+ float3 transformed_tangent_v = flip_tangent_v ? uvw.tangent_v : - uvw.tangent_v;
246
+
247
+ if (flip_tangent_u)
248
+ transformed_tangent_u=-transformed_tangent_u;
249
+ if (flip_tangent_v)
250
+ transformed_tangent_v=-transformed_tangent_v;
251
+
252
+ // normalized Lookup
253
+ float3 tangent_space_normal =
254
+ (nonrepeat_lookup (
255
+ texture: texture,
256
+ uvw: uvw,
257
+ texture_scale: texture_scale,
258
+ average_color: average_color,
259
+ patch_size: patch_size
260
+ ) - 0.5) * (2.0 * factor);
261
+
262
+ return ::math::normalize(uvw.tangent_u * tangent_space_normal.x +
263
+ uvw.tangent_v * tangent_space_normal.y +
264
+ ::state::normal()*1.0);
265
+ }
266
+
267
+ export material Concrete_Wall_Aged(
268
+ uniform bool infinite_tiling = false [[
269
+ ::anno::description("Enables infinite tiling feature which removes repeating texture patterns. Note that depending on the material this feature changes the appearance of the material slightly."),
270
+ ::anno::display_name("Infinite Tiling"),
271
+ ::anno::in_group("Appearance")
272
+ ]],
273
+ float diffuse_brightness = 0.8f [[
274
+ ::anno::description("Adjusts the lightness of the material."),
275
+ ::anno::display_name("Diffuse Brightness"),
276
+ ::anno::in_group("Appearance"),
277
+ ::anno::hard_range(0.f, 1.f)
278
+ ]],
279
+ float roughness = 0.45f [[
280
+ ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."),
281
+ ::anno::display_name("Roughness"),
282
+ ::anno::in_group("Appearance"),
283
+ ::anno::hard_range(0.f, 1.f)
284
+ ]],
285
+ uniform float bump_strength = 1.f [[
286
+ ::anno::description("Specifies the strength of the bump."),
287
+ ::anno::display_name("Bump Strength"),
288
+ ::anno::in_group("Appearance"),
289
+ ::anno::hard_range(0.f, 3.f),
290
+ ::anno::soft_range(0.f, 1.f)
291
+ ]],
292
+ float grunge_weight = 0.0f [[
293
+ ::anno::description("Adjusts the shininess of the grunge reflection. Vallues less than 0.5 make it shinier, value greater than 0.5 make it rougher. Set to 0.5 for neutral setting."),
294
+ ::anno::display_name("Grunge Amount"),
295
+ ::anno::in_group("Appearance", "Grunge"),
296
+ ::anno::hard_range(0.f, 1.f)
297
+ ]],
298
+ float grunge_roughness = 0.65f [[
299
+ ::anno::description("Specifies the roughnes."),
300
+ ::anno::display_name("Grunge Roughness"),
301
+ ::anno::in_group("Appearance", "Grunge"),
302
+ ::anno::hard_range(0.f, 1.f)
303
+ ]],
304
+ color grunge_tint = color(0.0546f, 0.0478f, 0.0446f) [[
305
+ ::anno::description("Tints the grunge layered upon the concrete."),
306
+ ::anno::display_name("Grunge Tint"),
307
+ ::anno::in_group("Appearance", "Grunge")
308
+ ]],
309
+ float2 texture_translate = 0.f [[
310
+ ::anno::description("Controls the position of the texture."),
311
+ ::anno::display_name("Texture Translate"),
312
+ ::anno::in_group("Transform")
313
+ ]],
314
+ float texture_rotate = 0.f [[
315
+ ::anno::description("Rotates angle of the texture in degrees."),
316
+ ::anno::display_name("Texture Rotate"),
317
+ ::anno::in_group("Transform"),
318
+ ::anno::soft_range(0.f, 360.f)
319
+ ]],
320
+ float2 texture_scale = 1.f [[
321
+ ::anno::description("Larger numbers increase the size."),
322
+ ::anno::display_name("Texture Scale"),
323
+ ::nvidia::core_definitions::dimension(float2(1.0, 1.0)),
324
+ ::anno::in_group("Transform")
325
+ ]],
326
+ uniform bool roundcorners_enable = false [[
327
+ ::anno::description("Enables the round corner effect. Comes at a slight performance cost as additional raytracing calls are required to evaluate the round corner effect."),
328
+ ::anno::display_name("Enable Round Corners"),
329
+ ::anno::in_group("Round Corners")
330
+ ]],
331
+ uniform float roundcorners_radius_mm = 1.5f [[
332
+ ::anno::description("Radius of the rounded corners in millimeters."),
333
+ ::anno::display_name("Round Corner Radius (mm)"),
334
+ ::anno::in_group("Round Corners"),
335
+ ::anno::soft_range(0.f, 10.f)
336
+ ]],
337
+ uniform bool roundcorners_across_materials = false [[
338
+ ::anno::description("Applies the round corner effect across different materials when enabled."),
339
+ ::anno::display_name("Across Materials"),
340
+ ::anno::in_group("Round Corners")
341
+ ]],
342
+ uniform int uv_space_index = 0 [[
343
+ ::anno::description("Uses selected UV space for material."),
344
+ ::anno::display_name("UV Space Index"),
345
+ ::anno::in_group("Advanced")
346
+ ]]
347
+ )
348
+ [[
349
+ ::anno::description("An old concrete wall."),
350
+ ::anno::in_group("Concrete"),
351
+ ::anno::display_name("Concrete Wall Aged"),
352
+ ::anno::copyright_notice(COPYRIGHT),
353
+ ::anno::thumbnail("./.thumbs/Concrete_Wall_Aged.Concrete_Wall_Aged.png"),
354
+ ::anno::key_words(string[]("concrete", "infinite tiling", "wall", "outdoor", "old", "construction", "aged", "paint", "worn", "scratched", "gray")),
355
+ ::anno::author("NVIDIA vMaterials"),
356
+ ::anno::contributor("Ruediger Raab"),
357
+ ::anno::contributor("Maik Rohland")
358
+ ]]
359
+ =
360
+ let {
361
+ bool tmp0 = false;
362
+ material_surface tmp1(::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, float3(infinite_tiling ? endless_texture(texture_2d("./concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 5.44000006f, float3(0.352941006f, 0.870588005f, 0.0549019985f), 5.44000006f, false) : ::base::file_texture(texture_2d("./concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], ::df::microfacet_ggx_smith_bsdf((histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 5.44000006f, float3(0.352941006f, 0.870588005f, 0.0549019985f), 5.44000006f, false) : ::base::file_texture(texture_2d("./concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, roughness * 0.25f + 0.600000024f) + grunge_weight * (grunge_roughness * 0.600000024f + -0.300000012f) * float3(infinite_tiling ? endless_texture(texture_2d("./concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 5.44000006f, float3(0.352941006f, 0.870588005f, 0.0549019985f), 5.44000006f, false) : ::base::file_texture(texture_2d("./concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2]) * (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 5.44000006f, float3(0.352941006f, 0.870588005f, 0.0549019985f), 5.44000006f, false) : ::base::file_texture(texture_2d("./concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, roughness * 0.25f + 0.600000024f) + grunge_weight * (grunge_roughness * 0.600000024f + -0.300000012f) * float3(infinite_tiling ? endless_texture(texture_2d("./concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 5.44000006f, float3(0.352941006f, 0.870588005f, 0.0549019985f), 5.44000006f, false) : ::base::file_texture(texture_2d("./concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2]), (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 5.44000006f, float3(0.352941006f, 0.870588005f, 0.0549019985f), 5.44000006f, false) : ::base::file_texture(texture_2d("./concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, roughness * 0.25f + 0.600000024f) + grunge_weight * (grunge_roughness * 0.600000024f + -0.300000012f) * float3(infinite_tiling ? endless_texture(texture_2d("./concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 5.44000006f, float3(0.352941006f, 0.870588005f, 0.0549019985f), 5.44000006f, false) : ::base::file_texture(texture_2d("./concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2]) * (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 5.44000006f, float3(0.352941006f, 0.870588005f, 0.0549019985f), 5.44000006f, false) : ::base::file_texture(texture_2d("./concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, roughness * 0.25f + 0.600000024f) + grunge_weight * (grunge_roughness * 0.600000024f + -0.300000012f) * float3(infinite_tiling ? endless_texture(texture_2d("./concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 5.44000006f, float3(0.352941006f, 0.870588005f, 0.0549019985f), 5.44000006f, false) : ::base::file_texture(texture_2d("./concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2]), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(infinite_tiling ? endless_texture(texture_2d("./concrete_wall_aged_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 5.44000006f, float3(0.576470971f, 0.560783982f, 0.517647028f), 5.44000006f, true) : ::base::file_texture(texture_2d("./concrete_wall_aged_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, grunge_tint, ::base::color_layer_multiply, float3(infinite_tiling ? endless_texture(texture_2d("./concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 5.44000006f, float3(0.352941006f, 0.870588005f, 0.0549019985f), 5.44000006f, false) : ::base::file_texture(texture_2d("./concrete_wall_aged_R_rough_G_ao_B_grunge.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2] * grunge_weight).tint, color(0.f, 0.f, 0.f), ::base::color_layer_multiply, diffuse_brightness * -0.300000012f + 0.300000012f).tint, 0.f, ""), bsdf(), infinite_tiling ? endless_normal(texture_2d("./concrete_wall_aged_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 5.44000006f, float3(0.5f, 0.5f, 1.f), 5.44000006f) : ::base::tangent_space_normal_texture(texture_2d("./concrete_wall_aged_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), infinite_tiling ? endless_normal(texture_2d("./concrete_wall_aged_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 5.44000006f, float3(0.5f, 0.5f, 1.f), 5.44000006f) : ::base::tangent_space_normal_texture(texture_2d("./concrete_wall_aged_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
363
+ material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
364
+ color tmp3 = color(1.f, 1.f, 1.f);
365
+ material_volume tmp4 = material_volume(scattering: vdf(), absorption_coefficient: color(0.f, 0.f, 0.f), scattering_coefficient: color(0.f, 0.f, 0.f));
366
+ material_geometry tmp5(float3(0.f), 1.f, roundcorners_enable ? ::state::rounded_corner_normal(roundcorners_radius_mm * 0.00100000005f, roundcorners_across_materials, 1.f) : ::state::normal());
367
+ hair_bsdf tmp6 = hair_bsdf();
368
+ } in
369
+ material(
370
+ thin_walled: tmp0,
371
+ surface: tmp1,
372
+ backface: tmp2,
373
+ ior: tmp3,
374
+ volume: tmp4,
375
+ geometry: tmp5,
376
+ hair: tmp6);
377
+
378
+
379
+ export material Concrete_Wall_Aged_Slight_Grunge(*)
380
+ [[
381
+ ::anno::description("An old concrete wall."),
382
+ ::anno::in_group("Concrete"),
383
+ ::anno::display_name("Concrete Wall Aged - Slight Grunge"),
384
+ ::anno::copyright_notice(COPYRIGHT),
385
+ ::anno::thumbnail("./.thumbs/Concrete_Wall_Aged.Concrete_Wall_Aged_Slight_Grunge.png"),
386
+ ::anno::key_words(string[]("concrete", "infinite tiling", "wall", "outdoor", "old", "construction", "aged", "paint", "worn", "scratched", "gray")),
387
+ ::anno::author("NVIDIA vMaterials"),
388
+ ::anno::contributor("Ruediger Raab"),
389
+ ::anno::contributor("Maik Rohland")
390
+ ]] = Concrete_Wall_Aged
391
+ (
392
+ infinite_tiling: false,
393
+ diffuse_brightness: 0.7f,
394
+ roughness: 0.33f,
395
+ bump_strength: 1.0f,
396
+ grunge_weight: 0.74f,
397
+ grunge_tint: color(0.0528f, 0.0399f, 0.0342f),
398
+ grunge_roughness: 0.81f,
399
+ texture_translate: 0.0f,
400
+ texture_rotate: 0.0f,
401
+ texture_scale: 1.0f,
402
+ roundcorners_enable: false,
403
+ roundcorners_radius_mm: 2.0f,
404
+ roundcorners_across_materials: false,
405
+ uv_space_index: 0
406
+ );
407
+
408
+
409
+ export material Concrete_Wall_Aged_Rough_Black_Grunge(*)
410
+ [[
411
+ ::anno::description("An old concrete wall."),
412
+ ::anno::in_group("Concrete"),
413
+ ::anno::display_name("Concrete Wall Aged - Black Grunge"),
414
+ ::anno::copyright_notice(COPYRIGHT),
415
+ ::anno::thumbnail("./.thumbs/Concrete_Wall_Aged.Concrete_Wall_Aged_Slight_Grunge.png"),
416
+ ::anno::key_words(string[]("concrete", "infinite tiling", "wall", "outdoor", "old", "construction", "aged", "paint", "worn", "grunge", "dirt", "dirty", "scratched", "gray")),
417
+ ::anno::author("NVIDIA vMaterials"),
418
+ ::anno::contributor("Ruediger Raab"),
419
+ ::anno::contributor("Maik Rohland")
420
+ ]] = Concrete_Wall_Aged
421
+ (
422
+ infinite_tiling: false,
423
+ diffuse_brightness: 0.7f,
424
+ roughness: 0.67f,
425
+ bump_strength: 1.0f,
426
+ grunge_weight: 1.0f,
427
+ grunge_tint: color(0.009696f, 0.005522f, 0.000992f),
428
+ grunge_roughness: 0.19f,
429
+ texture_translate: 0.0f,
430
+ texture_rotate: 0.0f,
431
+ texture_scale: 1.0f,
432
+ roundcorners_enable: false,
433
+ roundcorners_radius_mm: 2.0f,
434
+ roundcorners_across_materials: false,
435
+ uv_space_index: 0
436
+ );
Material/material_0349/Wood_Tiles_Walnut_Multicolor.mdl ADDED
@@ -0,0 +1,1588 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2024 NVIDIA Corporation. All rights reserved.
3
+ ******************************************************************************
4
+
5
+ Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge,
6
+ to any person obtaining a copy of the sample definition code that uses our
7
+ Material Definition Language (the "MDL Materials"), to reproduce and distribute
8
+ the MDL Materials, including without limitation the rights to use, copy, merge,
9
+ publish, distribute, and sell modified and unmodified copies of the MDL
10
+ Materials, and to permit persons to whom the MDL Materials is furnished to do
11
+ so, in all cases solely for use with NVIDIA's Material Definition Language,
12
+ subject to the following further conditions:
13
+
14
+ 1. The above copyright notices, this list of conditions, and the disclaimer
15
+ that follows shall be retained in all copies of one or more of the MDL
16
+ Materials, including in any software with which the MDL Materials are bundled,
17
+ redistributed, and/or sold, and included either as stand-alone text files,
18
+ human-readable headers or in the appropriate machine-readable metadata fields
19
+ within text or binary files as long as those fields can be easily viewed by the
20
+ user, as applicable.
21
+ 2. The name of NVIDIA shall not be used to promote, endorse or advertise any
22
+ Modified Version without specific prior written permission, except a) to comply
23
+ with the notice requirements otherwise contained herein; or b) to acknowledge
24
+ the contribution(s) of NVIDIA.
25
+
26
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
27
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
28
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
29
+ TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR
30
+ ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL,
31
+ INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF
32
+ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE
33
+ THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.
34
+ */
35
+
36
+
37
+ mdl 1.5;
38
+
39
+ import ::anno::*;
40
+ import ::base::*;
41
+ import ::df::*;
42
+ import ::math::*;
43
+ import ::state::*;
44
+ import ::tex::*;
45
+ import ::nvidia::core_definitions::blend_colors;
46
+ import ::nvidia::core_definitions::dimension;
47
+
48
+
49
+ const string COPYRIGHT =
50
+ " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
51
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
52
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
53
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
54
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
55
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
56
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
57
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
58
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
59
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
60
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
61
+
62
+ const string DESCRIPTION = "A wooden tile material with adjustments to produce a rich variety of wooden floor styles ranging from new to worn.";
63
+
64
+ annotation preview_scale( float f);
65
+
66
+ struct vm_coordinates{
67
+ float2 uv;
68
+ float rotation;
69
+ int uv_space_index;
70
+ float4 carry;
71
+ };
72
+
73
+ enum vm_mono_select
74
+ [[
75
+ anno::description("Modes for the creation of a gray-scale value from a color."),
76
+ anno::hidden()
77
+ ]]
78
+ {
79
+ mono_r = 0,
80
+ mono_g = 1,
81
+ mono_b = 2,
82
+ mono_a = 3,
83
+ mono_average = 4
84
+ };
85
+
86
+ vm_coordinates vm_coord
87
+ (
88
+ float2 translation = float2(0.0f, 0.0) [[
89
+ ::anno::display_name("Translation"),
90
+ ::anno::description("Translates the coordinates.")
91
+ ]],
92
+ float rotation = 0.0f [[
93
+ ::anno::display_name("Rotation"),
94
+ ::anno::description("Rotates the coordinates in degrees.")
95
+ ]],
96
+ float2 scaling = float2(1.0f, 1.0f) [[
97
+ ::anno::display_name("Scaling"),
98
+ ::anno::description("Scales the coordinates.")
99
+ ]],
100
+ uniform int uv_space = 0 [[
101
+ ::anno::display_name("UV Space"),
102
+ ::anno::description("Chose the UV space.")
103
+ ]]
104
+ )
105
+ [[
106
+ ::anno::display_name("vm Transform"),
107
+ ::anno::description("Generates coordinates to be used in vm_lookup functions.")
108
+ ]]
109
+ {
110
+ vm_coordinates uv;
111
+ ::base::texture_coordinate_info info = ::base::coordinate_source( ::base::texture_coordinate_uvw, uv_space);
112
+ uv.rotation = (rotation * 3.1415926535897932384626433832f) / 180.f;
113
+ uv.uv = float2(info.position.x, info.position.y);
114
+ float sine = ::math::sin(uv.rotation);
115
+ float cosine = ::math::cos(uv.rotation);
116
+ float2x2 rot = float2x2(cosine, -sine, sine, cosine);
117
+ uv.uv = rot * uv.uv;
118
+ uv.uv /= scaling;
119
+ uv.uv += translation;
120
+ // Translation before or after rotation?
121
+ return uv;
122
+ }
123
+
124
+ vm_coordinates vm_coord_post_scale(
125
+ vm_coordinates uv = vm_coord(),
126
+ float2 scale = 1.0f
127
+ )
128
+ {
129
+ uv.uv /= scale;
130
+ return uv;
131
+ }
132
+
133
+ ::base::texture_return vm_tex_lookup(
134
+ uniform texture_2d tex,
135
+ vm_coordinates uv = vm_coord(),
136
+ uniform vm_mono_select mono_source = mono_a,
137
+ float4 scale = float4(1.0f))
138
+ {
139
+ float mono;
140
+ float4 lookup = ::tex::lookup_float4(tex, uv.uv, ::tex::wrap_repeat, ::tex::wrap_repeat) * scale;
141
+ switch( mono_source ) {
142
+ case mono_r: mono = lookup.x;
143
+ break;
144
+ case mono_g: mono = lookup.y;
145
+ break;
146
+ case mono_b: mono = lookup.z;
147
+ break;
148
+ case mono_a: mono = lookup.w;
149
+ break;
150
+ case mono_average: mono = ::math::average(float3(lookup.x, lookup.y, lookup.z));
151
+ break;
152
+ }
153
+ return ::base::texture_return(color(lookup.x, lookup.y, lookup.z), mono);
154
+ }
155
+
156
+ float3 vm_tex_normal_lookup(
157
+ uniform texture_2d tex,
158
+ vm_coordinates uv = vm_coord(),
159
+ float strength = 1.0f
160
+ )
161
+ {
162
+ float rot = uv.rotation;
163
+ // Lookup and convert normal texture to -1 ... 1 range
164
+ float3 norm = (::tex::lookup_float3(tex, uv.uv, ::tex::wrap_repeat, ::tex::wrap_repeat) - float3(.5f)) * 2.0f;
165
+ norm = ::math::normalize(norm * float3(strength, strength, 1.0));
166
+ // if any rotation happened prior to the lookup, compensate for it
167
+ norm = float3(::math::cos(rot) * norm.x - ::math::sin(rot) * norm.y,
168
+ ::math::sin(rot) * norm.x + ::math::cos(rot) * norm.y,
169
+ norm.z);
170
+ return norm.x * ::state::texture_tangent_u(uv.uv_space_index) +
171
+ norm.y * ::state::texture_tangent_v(uv.uv_space_index) +
172
+ norm.z * ::state::normal();
173
+ }
174
+
175
+
176
+ // ----------------------------------------------------------------------------------------------------------------------
177
+
178
+
179
+ float histogram_range(float input, float range = 1.0f, float position = 0.5f)
180
+ {
181
+ float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0);
182
+ float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0);
183
+ return ::math::lerp(low, high, input);
184
+ }
185
+
186
+ float remap_xy_to_0_1(float input, float x, float y)
187
+ {
188
+ return (input - x)/(y - x);
189
+ }
190
+
191
+ float histogram_scan_big(float input, float width, float position)
192
+ {
193
+ return ::math::clamp(
194
+ remap_xy_to_0_1(input,
195
+ ::math::lerp(-width, 1.0, position),
196
+ ::math::lerp(0.0, 1.0 + width, position)),
197
+ 0.0,
198
+ 1.0);
199
+ }
200
+
201
+ // ********** Randomization functions -I- **********
202
+
203
+ int random(int seed = 0, int modulus = 65536, int multiplier = 1664525, int increment = 1013904223)
204
+ {
205
+ return (multiplier * seed + increment) % modulus;
206
+ }
207
+
208
+
209
+ // Returns the normal n in tangent space, given n is in internal space.
210
+ float3 transform_internal_to_tangent(float3 n)
211
+ [[
212
+ ::anno::hidden()
213
+ ]]
214
+ {
215
+ return
216
+ n.x* float3(::state::texture_tangent_u(0).x,::state::texture_tangent_v(0).x,::state::normal().x)+
217
+ n.y* float3(::state::texture_tangent_u(0).y,::state::texture_tangent_v(0).y,::state::normal().y)+
218
+ n.z* float3(::state::texture_tangent_u(0).z,::state::texture_tangent_v(0).z,::state::normal().z);
219
+ }
220
+
221
+ // Returns the normal n in internal space, given n is in tangent space.
222
+ float3 transform_tangent_to_internal(float3 n)
223
+ [[
224
+ ::anno::hidden()
225
+ ]]
226
+ {
227
+ return ::state::texture_tangent_u(0) * n.x +
228
+ ::state::texture_tangent_v(0) * n.y +
229
+ ::state::normal() * n.z ;
230
+ }
231
+
232
+
233
+
234
+ // Returns a normal by adding a detail normal to a global normal.
235
+ // If detail blending of two normal maps gives visual artifacts, check if texture_2d are loaded
236
+ // correctly with ::tex::gamma_linear
237
+ float3 add_detail_normal(float3 nd = ::state::normal(), float3 n = ::state::normal())
238
+ {
239
+ // http://blog.selfshadow.com/publications/blending-in-detail/
240
+ float3 n_t = transform_internal_to_tangent(n);
241
+ float3 nd_t = transform_internal_to_tangent(nd);
242
+
243
+ n_t=n_t + float3(0.,0.,1.);
244
+ nd_t = nd_t * float3(-1.,-1.,1.);
245
+
246
+ n = n_t*::math::dot(n_t, nd_t)/n_t.z - nd_t;
247
+ return ::math::normalize(transform_tangent_to_internal(n));
248
+ }
249
+
250
+
251
+ // For the rotated tangent I just used the code for the rotation of the tangent vector
252
+ // asselmbled from the former 'vmat_transform' and 'transform_coordinate_2' functions
253
+ float3 rotated_tangent(
254
+ float rotation = 0,
255
+ uniform int uv_space = 0
256
+ )
257
+ {
258
+ float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f;
259
+ float sin = ::math::sin(rotation_rad);
260
+ float cos = ::math::cos(rotation_rad);
261
+
262
+ ::base::texture_coordinate_info coord = ::base::coordinate_source(::base::texture_coordinate_uvw, uv_space);
263
+
264
+ return ::math::normalize(cos * coord.tangent_u - sin * coord.tangent_v);
265
+ }
266
+
267
+
268
+ // Returns 4 random IDs for a given pattern
269
+ float4 rand_tile_id(
270
+ vm_coordinates uv,
271
+ ::base::texture_return id_offset_map, // map containing the ID in r channel
272
+ //and the cell offset in g channel.
273
+ int seed = 0
274
+ )
275
+ [[
276
+ ::anno::noinline()
277
+ ]]
278
+ {
279
+ float4 ret_val;
280
+ int offset_x, offset_y;
281
+
282
+
283
+ float3 id_offset_map_2 = float3(id_offset_map.tint);
284
+ float offset_id = id_offset_map_2.y;
285
+ int rand_id = int(id_offset_map_2.x * 254.f); // the more logical value of 255 causes sometimes rendering artifacts
286
+ // with the random number generator. Setting it to 254 apparently fixes it
287
+
288
+ // Offset of overlapping tiles stored in G-channel
289
+ // [0 - 0.25[ : ( 0/ 0) Grayscale value: 0.1
290
+ // [0.25 - 0.5 [ : (-1/ 0) Grayscale value: 0.37
291
+ // [0.5 - 0.75[ : (-1/-1) Grayscale value: 0.62
292
+ // [0.75 - 1.0 [ : ( 0/-1) Grayscale value: 0.87
293
+
294
+ offset_x = offset_id < 0.25f ? 0 : (offset_id < .75f) ? 1 : 0;
295
+ offset_y = offset_id < 0.5 ? 0 : 1;
296
+
297
+ int2 cell_id = int2(int(::math::floor(uv.uv.x) - offset_x), int(::math::floor(uv.uv.y) - offset_y));
298
+
299
+ /* Using Linear congruential generator for pseudorandom numbers which is good enough */
300
+ int rand_val_0 = random(seed);
301
+ int rand_val_1 = random(rand_val_0 + rand_id + random(cell_id.x + random(cell_id.y)));
302
+ int rand_val_2 = random(rand_val_1);
303
+ int rand_val_3 = random(rand_val_2);
304
+ int rand_val_4 = random(rand_val_3);
305
+
306
+ ret_val = float4(rand_val_1, rand_val_2, rand_val_3, rand_val_4);
307
+
308
+ return float4(ret_val/65535.0f);
309
+ }
310
+
311
+
312
+ // ******************************************************************************************************
313
+ // Variation of the wood material which features another texture thats masks a secondary color
314
+ // Also the map includes a mask that prevents random color variations
315
+ export material Wood_Tiles_Walnut_Multicolor(
316
+ int seed = 0 [[
317
+ ::anno::display_name("Randomization Seed"),
318
+ ::anno::description("Different seed values while causes different patterns of randomization on the tiles."),
319
+ ::anno::in_group("Randomization")
320
+ ]],
321
+ color wood_color = color(0.4f, 1.0f, 0.0f) [[
322
+ ::anno::display_name("Color Tint"),
323
+ ::anno::description("Applies an overlay color to tint the wood. A grayscale value of 0.5 has no effect, "
324
+ "brighter values brighten it while darker colors will have a darkening effect."),
325
+ ::anno::in_group("Appearance")
326
+ ]],
327
+ color wood_secondary_color = color(0.2f, 1.0f, 0.0f) [[
328
+ ::anno::description("Choose the secondary overlay color to tint the wood. A grayscale value of 0.5 has no effect, "
329
+ "brighter values brighten it while darker colors will have a darkening effect."),
330
+ ::anno::display_name("Secondary Color Tint"),
331
+ ::anno::in_group("Appearance")
332
+ ]],
333
+ float age_dirt = 0.4f [[
334
+ ::anno::display_name("Age Dirt"),
335
+ ::anno::description("Adds dark dirt spots on top of the surface to create the appearance of a somewhat aged surface."),
336
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
337
+ ::anno::enable_if("coating_reflectivity > 0.0f"),
338
+ ::anno::hard_range(0.f, 1.f)
339
+ ]],
340
+ uniform float wood_bump_strength = 0.3f // Determines the degree of bumpiness"),
341
+ [[
342
+ ::anno::display_name("Wood Bump Strength"),
343
+ ::anno::description("Adjusts the strength of the wood bump map."),
344
+ ::anno::in_group("Appearance"),
345
+ ::anno::hard_range(0.f, 2.f)
346
+ ]],
347
+ float floor_brightness = 0.8f [[
348
+ ::anno::description("Adjusts the general brightness of the wood."),
349
+ ::anno::display_name("Wood Brightness"),
350
+ ::anno::in_group("Appearance", "Tiles"),
351
+ ::anno::hard_range(0.f, 1.f)
352
+ ]],
353
+ float wood_brightness_variation = 0.5f [[
354
+ ::anno::display_name("Wood Brightness Variation"),
355
+ ::anno::description("Randomly darkens the tiles of the floor."),
356
+ ::anno::in_group("Appearance", "Tiles"),
357
+ ::anno::hard_range(0.f, 1.f)
358
+ ]],
359
+ float wood_random_rotation = 0.015f [[
360
+ ::anno::display_name("Wood Random Rotation"),
361
+ ::anno::description("Adds a random rotation around the main wood tile alignment direction."),
362
+ ::anno::in_group("Appearance", "Tiles"),
363
+ ::anno::hard_range(0.f, 1.f)
364
+ ]],
365
+
366
+ float2 wood_scale = 1.0f [[
367
+ ::anno::description("Sets the size of the wood relative to the tiles pattern. Larger numbers increase the size of the wood texture within the tiles."),
368
+ ::anno::display_name("Wood Scale"),
369
+ ::anno::in_group("Appearance", "Tiles"),
370
+ ::anno::soft_range(0.0f, 2.0f)
371
+ ]],
372
+
373
+ uniform float tiles_bump_strength = 0.3f [[
374
+ ::anno::description("Determines the degree of bumpiness of the tiles texture (grooves and bent tiles)."),
375
+ ::anno::display_name("Tiles Bump Strength"),
376
+ ::anno::in_group("Appearance", "Tiles"),
377
+ ::anno::hard_range(0.f, 1.f)
378
+ ]],
379
+ float tiles_random_slope_orientation = 0.15f [[
380
+ ::anno::display_name("Tiles Random Slope Orientation"),
381
+ ::anno::description("Makes tiles individual tiles to appear tilted in random directions. Good for old floors and to take away too perfect appearing tiled floors."),
382
+ ::anno::in_group("Appearance", "Tiles"),
383
+ ::anno::hard_range(0.f, 1.f)
384
+ ]],
385
+ float gaps_brightness = 0.3f [[
386
+ ::anno::display_name("Grout Brightness"),
387
+ ::anno::description("Adjusts the brightness and roughness of the gaps between the tiles."),
388
+ ::anno::in_group("Appearance", "Tiles"),
389
+ ::anno::hard_range(0.f, 1.f)
390
+ ]],
391
+ float tiles_base_roughness = 0.14f [[
392
+ ::anno::description("Adjusts the roughness of the coating. Higher value leading to blurrier and softer reflections."),
393
+ ::anno::display_name("Coating Roughness"),
394
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
395
+ ::anno::enable_if("coating_reflectivity > 0.0f"),
396
+ ::anno::hard_range(0.f, 1.f)
397
+ ]],
398
+ float base_roughness_range = 0.6f [[
399
+ ::anno::description("Applies roughness variation to the coating, introducing signs of wear such as footprints and smudges."),
400
+ ::anno::display_name("Coating Roughness Variation"),
401
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
402
+ ::anno::enable_if("coating_reflectivity > 0.0f"),
403
+ ::anno::hard_range(0.f, 1.f)
404
+ ]],
405
+ uniform float tiles_orange_peel_bump_factor = 0.1f [[
406
+ ::anno::display_name("Coating Unevenness"),
407
+ ::anno::description("Applies an unevenness to the clear coat layer akin to orange peel."),
408
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
409
+ ::anno::enable_if("coating_reflectivity > 0.0f"),
410
+ ::anno::hard_range(0.f, 1.f)
411
+ ]],
412
+ float coating_reflectivity = 1.f [[
413
+ ::anno::display_name("Coating Reflectivity"),
414
+ ::anno::description("The overall reflectivity of the clearcoat layer. Note that other parameters will show no effect when the clearcoat reflectivity is 0."),
415
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
416
+ ::anno::hard_range(0.f, 1.f)
417
+ ]],
418
+
419
+ float dirt_and_spots_amount = 0.15f [[
420
+ ::anno::description("Adds random dirt and spots on top of the surface which adds variation to the clearcoat roughness."),
421
+ ::anno::display_name("Dirt and Spots"),
422
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
423
+ ::anno::enable_if("coating_reflectivity > 0.0f"),
424
+ ::anno::hard_range(0.f, 1.f)
425
+ ]],
426
+ float edgewear_roughness_amount = 0.2f [[
427
+ ::anno::description("Adds edgewear around the tile borders which results in a more worn and rough look of the clearcoat."),
428
+ ::anno::display_name("Edgewear Roughness Amount"),
429
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
430
+ ::anno::enable_if("coating_reflectivity > 0.0f"),
431
+ ::anno::hard_range(0.f, 1.f)
432
+ ]],
433
+
434
+ //-----------------------------------------------
435
+
436
+ float2 texture_translate = 0.f [[
437
+ ::anno::display_name("Texture Translate"),
438
+ ::anno::description("Controls the position of the texture."),
439
+ ::anno::in_group("Transform")
440
+ ]],
441
+ float texture_rotate = 0.f [[
442
+ ::anno::display_name("Texture Rotate"),
443
+ ::anno::description("Rotates angle of the texture in degrees."),
444
+ ::anno::in_group("Transform")
445
+ ]],
446
+ float2 texture_scale = 1.0f [[
447
+ ::anno::display_name("Texture Scale"),
448
+ ::anno::description("Larger numbers increase the size."),
449
+ ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)),
450
+ ::anno::in_group("Transform")
451
+ ]],
452
+ uniform int uv_space_index = 0 [[
453
+ ::anno::display_name("UV Space Index"),
454
+ ::anno::description("Uses selected UV space for material."),
455
+ ::anno::in_group("Transform")
456
+ ]],
457
+ uniform bool round_corners = false [[
458
+ ::anno::display_name("Round Corners"),
459
+ ::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."),
460
+ ::anno::in_group("Round Corners")
461
+ ]],
462
+ uniform float roundcorner_radius_mm = 1.5f [[
463
+ ::anno::display_name("Radius (mm)"),
464
+ ::anno::description("Radius of the rounded corners in millimeters."),
465
+ ::anno::in_group("Round Corners"),
466
+ ::anno::soft_range(0.f, 10.f)
467
+ ]],
468
+ uniform bool across_materials = false [[
469
+ ::anno::display_name("Across Materials"),
470
+ ::anno::description("Applies the round corner effect across different materials when enabled."),
471
+ ::anno::in_group("Round Corners")
472
+ ]],
473
+
474
+ // WOOD Highlights (Not accessible to regular users)
475
+ uniform bool preview_wood_highlights = false
476
+ [[
477
+ ::anno::display_name("Preview Wood Specular"),
478
+ ::anno::description("Enables previewing of the wood specular highlights for tweaking."),
479
+ ::anno::in_group("Advanced", "Wood Highlight")
480
+ ]], // just previews the highlights of the wood material
481
+ float isotropic_roughness = 0.352f // The average roughness value of the isotropic highlight. When roughness variation is applied, the variation will go above and below those values.")
482
+ [[
483
+ ::anno::display_name("Isotropic Roughness"),
484
+ ::anno::description("Sets the roughness of the isotropic component of the wood reflection."),
485
+ ::anno::hard_range(0.f, 1.f),
486
+ ::anno::in_group("Advanced", "Wood Highlight")
487
+ ]],
488
+ float isotropic_roughness_range = 0.566f // Adjusts the range of variation being applied to the isotropic highlight, a value of zero has no effect at all whereas 1 produces the most variation")
489
+ [[
490
+ ::anno::display_name("Isotropic Roughness Range"),
491
+ ::anno::description("Sets the degree roughness variation around the isotropic highlight."),
492
+ ::anno::hard_range(0.f, 1.f),
493
+ ::anno::in_group("Advanced", "Wood Highlight")
494
+ ]],
495
+ float isotropic_specular_brightness = 1.0f // Sets how strong the isotropic specular highlight appears
496
+ [[
497
+ ::anno::display_name("Isotropic Highlight Brightness"),
498
+ ::anno::description("Sets the brightness of the isotropic wood highlight."),
499
+ ::anno::hard_range(0.f, 1.f),
500
+ ::anno::in_group("Advanced", "Wood Highlight")
501
+ ]],
502
+ float wood_specular_level = 1.f // Adjusts the specular level (PBR Style)
503
+ [[
504
+ ::anno::display_name("Wood Specular Level"),
505
+ ::anno::description("Adjusts the falloff of the wood highlights."),
506
+ ::anno::hard_range(0.f, 1.f),
507
+ ::anno::in_group("Advanced", "Wood Highlight")
508
+ ]],
509
+ float aniso_attenuation = 0.491f //Attenuates the the anisotropic highlight using a texture. Use the preview for exclusively previewing the wood hightligghts for properly adjusting this term"
510
+ [[
511
+ ::anno::display_name("Anisotropic Attenuation"),
512
+ ::anno::description("Breaks up the reflection of the anisotropic highlight."),
513
+ ::anno::hard_range(0.f, 1.f),
514
+ ::anno::in_group("Advanced", "Wood Highlight")
515
+ ]],
516
+ float aniso_bsdf_width = 0.508f //Controls the width of the anisotropic highlight"
517
+ [[
518
+ ::anno::display_name("Anisotropic Width"),
519
+ ::anno::description("Adjusts the width of the anisotropic wood highlight."),
520
+ ::anno::hard_range(0.f, 1.f),
521
+ ::anno::in_group("Advanced", "Wood Highlight")
522
+ ]],
523
+ float aniso_bsdf_height = 0.657f //Controls the height of the anisotropic highlight"
524
+ [[
525
+ ::anno::display_name("Anisotropic Height"),
526
+ ::anno::description("Adjusts the height of the anisotropic highlight."),
527
+ ::anno::hard_range(0.f, 1.f),
528
+ ::anno::in_group("Advanced", "Wood Highlight")
529
+ ]],
530
+ float anisotropic_isotropic_balance = 0.320f // Balances the Anisotropic vs. the isotropic wood highlight"
531
+ [[
532
+ ::anno::display_name("Anisotropic - Isotropic Balance"),
533
+ ::anno::description("Blends between the contribution of isotropic and anisotropic highlight."),
534
+ ::anno::hard_range(0.f, 1.f),
535
+ ::anno::in_group("Advanced", "Wood Highlight")
536
+ ]],
537
+
538
+ // ------------------ TEXTURES (Not accessible to regular users) ------------------
539
+ // Diffuse
540
+ uniform texture_2d tex_srgb_wood_color = texture_2d("./wood_walnut_diff.jpg", ::tex::gamma_srgb)
541
+ [[
542
+ ::anno::display_name("Diffuse Wood Texture"),
543
+ ::anno::description("The diffuse wood texture used to cover the tiles (srgb)."),
544
+ ::anno::in_group("Advanced", "Textures")
545
+ ]],
546
+ // Anisotropic Roughness AKA "Rough Detail"
547
+ uniform texture_2d tex_lin_wood_rough_detail = texture_2d("./wood_walnut_rough_detail.jpg", ::tex::gamma_linear)
548
+ [[
549
+ ::anno::display_name("Anisotropic Variation Texture"),
550
+ ::anno::description("Texture to add variation to the anisotropic reflections of the wood (linear space)."),
551
+ ::anno::in_group("Advanced", "Textures")
552
+ ]],
553
+ // Isotropic Roughness AKA "Rough Grain"
554
+ uniform texture_2d tex_lin_wood_rough_grain = texture_2d("./wood_walnut_rough_grain.jpg", ::tex::gamma_linear)
555
+ [[
556
+ ::anno::display_name("Isotropic Variation Texture"),
557
+ ::anno::description("Texture to add variation to the isotropic reflections of the wood (linear space)."),
558
+ ::anno::in_group("Advanced", "Textures")
559
+ ]],
560
+ // Wood detail Normal - Grain & Structure
561
+ uniform texture_2d tex_lin_wood_detail_norm = texture_2d("./wood_walnut_norm.jpg", ::tex::gamma_linear)
562
+ [[
563
+ ::anno::display_name("Wood Normal Texture"),
564
+ ::anno::description("Tangent Space Normal texture for defining the bumpiness of the wood."),
565
+ ::anno::in_group("Advanced", "Textures")
566
+ ]],
567
+ // Tiles ID, Offset & Rotation
568
+ uniform texture_2d tex_lin_tiles_id_offset_rotation = texture_2d("./melbury_R_id_G_offset_B_rotation.png", ::tex::gamma_linear)
569
+ [[
570
+ ::anno::display_name("Tiles ID - Offset - Rotation Texture"),
571
+ ::anno::description("Texture that holds information about the wood tiles needed to create the wood tiles effect. R - Tiles ID, G - Tiles offset, B - Tiles Rotation (linear space)."),
572
+ ::anno::in_group("Advanced", "Textures")
573
+ ]],
574
+ // Edgewear, Gaps(AO), Gaps Roughnesss
575
+ uniform texture_2d tex_lin_tiles_edgewear_gaps_gapsrough= texture_2d("./melbury_R_edgewear_G_gaps_B_gaps_rough.jpg", ::tex::gamma_linear)
576
+ [[
577
+ ::anno::display_name("Edgewear - Gaps - Gap Rough"),
578
+ ::anno::description("Texture that holds maps for the edgewear roughness, the tile gaps and the gaps roughness (linear space)."),
579
+ ::anno::in_group("Advanced", "Textures")
580
+ ]],
581
+ // Tiles Normal (Grout and Bend)
582
+ uniform texture_2d tex_lin_tiles_normal = texture_2d("./melbury_norm.jpg", ::tex::gamma_linear)
583
+ [[
584
+ ::anno::display_name("Tiles Normal Texture"),
585
+ ::anno::description("Texture that holds the normal map for the tiles (linear space)."),
586
+ ::anno::in_group("Advanced", "Textures")
587
+ ]],
588
+ // Secondary color (grayscale) mask, randomization mask
589
+ uniform texture_2d tex_lin_tiles_R_2nd_col_G_randmask = texture_2d("./melbury_R_2ndcol_G_randmask.png", ::tex::gamma_linear)
590
+ [[
591
+ ::anno::display_name("2nd Color - Random Mask"),
592
+ ::anno::description("Texture that holds maps for blending with the secondary color and a color randomization mask that specifies in which area brightness randomization should occur (linear space)."),
593
+ ::anno::in_group("Advanced", "Textures")
594
+ ]],
595
+ // Tiles Roughness, Dents and Spots
596
+ uniform texture_2d tex_lin_tiles_rough_dents_spots = texture_2d("./tiles_wood_R_rough_G_dents_B_spots.jpg", ::tex::gamma_linear)
597
+ [[
598
+ ::anno::display_name("Tiles Rough - Dents - Spots"),
599
+ ::anno::description("Texture that contains maps for the tiles roughness, dents and spots which is a roughness effect applied to the wood coating layer (linear space)."),
600
+ ::anno::in_group("Advanced", "Textures")
601
+ ]],
602
+ // Tiles orange Peel
603
+ uniform texture_2d tex_lin_tiles_orange_peel = texture_2d("./tiles_wood_orangepeel_norm.jpg", ::tex::gamma_linear)
604
+ [[
605
+ ::anno::display_name("Tiles Orange Peel"),
606
+ ::anno::description("Tangent Space Normal texture for the orange peel which is applied to the coating of the tiles."),
607
+ ::anno::in_group("Advanced", "Textures")
608
+ ]]
609
+
610
+ )
611
+ [[
612
+ ::anno::author("NVIDIA vMaterials"),
613
+ ::anno::display_name("Wood Tiles Walnut - Multicolor Master"),
614
+ ::anno::description("Master template material. This material should be hidden."
615
+ "If you see this material, the integration is not hiding it correctly."),
616
+ // reflective, varnished, bumped, matte, natural, stained, exterior, new, aged, decayed, abstract, modern, classic
617
+ ::anno::key_words(string[]("wood", "walnut", "master", "tiles", "tiled", "pattern", "decorative", "multimaterial", "multicolor", "organic", "natural", "coated", "infinite tiling", "architecture", "interior")),
618
+ ::anno::thumbnail("./.thumbs/Wood_Tiles_Walnut_Multicolor.Wood_Tiles_Walnut_Multicolor.png"),
619
+ ::anno::copyright_notice(COPYRIGHT),
620
+ ::anno::hidden()
621
+ ]]
622
+ =
623
+ let {
624
+ /*
625
+ texture_2d tex_srgb_wood_color = texture_2d("./wood_walnut_diff.jpg", ::tex::gamma_srgb); // Diffuse
626
+ texture_2d tex_lin_wood_rough_detail = texture_2d("./wood_walnut_rough_detail.jpg", ::tex::gamma_linear); // Anisotropic Roughness AKA "Rough Detail"
627
+ texture_2d tex_lin_wood_rough_grain = texture_2d("./wood_walnut_rough_grain.jpg", ::tex::gamma_linear); // Isotropic Roughness AKA "Rough Grain"
628
+ texture_2d tex_lin_wood_detail_norm = texture_2d("./wood_walnut_norm.jpg", ::tex::gamma_linear); // Wood detail Normal - Grain & Structure
629
+ texture_2d tex_lin_tiles_id_offset_rotation = texture_2d("./brickbond_R_id_G_offs_B_rotation.png", ::tex::gamma_linear); // Tiles ID, Offset & Rotation
630
+ texture_2d tex_lin_tiles_edgewear_gaps_gapsrough= texture_2d("./brickbond_R_edgewear_G_gaps_B_gaps_rough.jpg", ::tex::gamma_linear); // Edgewear, Gaps(AO), Gaps Roughnesss
631
+ texture_2d tex_lin_tiles_normal = texture_2d("./brickbond_norm.png", ::tex::gamma_linear); // Tiles Normal (Grout and Bend)
632
+ texture_2d tex_lin_tiles_rough_dents_spots = texture_2d("./tiles_wood_R_rough_G_dents_B_spots.jpg", ::tex::gamma_linear); // Tiles Roughness, Dents and Spots
633
+ texture_2d tex_lin_tiles_orange_peel = texture_2d("./tiles_wood_orangepeel_norm.jpg", ::tex::gamma_linear); // Tiles orange Peel
634
+ */
635
+ /*
636
+ // Wood Highlight tweaks
637
+ bool preview_wood_highlights = false; // just previews the highlights of the wood material
638
+ float wood_specular_level = 1.f; // Adjusts the specular level (PBR Style)
639
+ float isotropic_specular_brightness = 1.0f; // Sets how strong the isotropic specular highlight appears
640
+ float aniso_attenuation = 0.5f; //Attenuates the the anisotropic highlight using a texture. Use the preview for exclusively previewing the wood hightligghts for properly adjusting this term"
641
+ float anisotropic_isotropic_balance = 0.467f; // Balances the Anisotropic vs. the isotropic wood highlight"
642
+ float isotropic_roughness_range = 0.66f; // Adjusts the range of variation being applied to the isotropic highlight, a value of zero has no effect at all whereas 1 produces the most variation")
643
+ float isotropic_roughness = 0.34f; // The average roughness value of the isotropic highlight. When roughness variation is applied, the variation will go above and below those values."),
644
+
645
+ float aniso_bsdf_width = 0.36f; //Controls the width of the anisotropic highlight"
646
+ float aniso_bsdf_height = 0.50f; //Controls the height of the anisotropic highlight"),
647
+ */
648
+ float wood_scale_variation = 0.1f;
649
+
650
+ // Prepare the UV coordinates for regular texture lookups
651
+ vm_coordinates base_uv = vm_coord(
652
+ translation:texture_translate,
653
+ rotation: texture_rotate,
654
+ scaling: texture_scale,
655
+ uv_space: uv_space_index
656
+ );
657
+
658
+ // Random tile transform
659
+ // R: tile_id
660
+ // G: tile_offset
661
+ // B: tile_rotation
662
+ // A: secondary color blend weight
663
+
664
+ ::base::texture_return rand_id_offset_lookup = vm_tex_lookup(
665
+ tex: tex_lin_tiles_id_offset_rotation,
666
+ uv: base_uv,
667
+ mono_source: mono_a
668
+ );
669
+
670
+ float3 R_2nd_col_G_randmask = ::tex::lookup_float3(tex_lin_tiles_R_2nd_col_G_randmask, base_uv.uv, ::tex::wrap_repeat, ::tex::wrap_repeat) ;
671
+
672
+
673
+
674
+ float4 rand_vals = rand_tile_id(
675
+ uv: base_uv,
676
+ id_offset_map: rand_id_offset_lookup,
677
+ seed: seed
678
+ );
679
+
680
+ float2 rand_translation = float2(rand_vals.x, rand_vals.y);
681
+ float rand_rotation = texture_rotate + (float3(rand_id_offset_lookup.tint).z + (rand_vals.z - 0.5) * wood_random_rotation) * 360;
682
+ float2 rand_scale = float2(wood_scale/(1.0 - wood_scale_variation * 0.5 * rand_vals.x)) * texture_scale;
683
+
684
+ // *** TILE UV *** - The randomized UV lookup for the tiles
685
+
686
+
687
+ vm_coordinates tile_uv = vm_coord(
688
+ translation:rand_translation,
689
+ rotation: rand_rotation,
690
+ scaling: rand_scale,
691
+ uv_space: uv_space_index
692
+ );
693
+
694
+
695
+ // Tiling Lookups and compositing
696
+ // R: Edgewear
697
+ // G: Gaps
698
+ // B: Gaps Damage Roughness
699
+ float3 egdewear_gaps_gapsrough_lookup = float3( vm_tex_lookup(
700
+ tex: tex_lin_tiles_edgewear_gaps_gapsrough,
701
+ uv: base_uv,
702
+ mono_source: mono_a
703
+ ).tint);
704
+
705
+ // R: Coat Base Roughness (Footsteps, Grain, Wipe)
706
+ // G: Dents (Dirt/Ao)
707
+ // B: Spots (Liquid-alike)
708
+ float3 rough_dents_spots_lookup = float3( vm_tex_lookup(
709
+ tex: tex_lin_tiles_rough_dents_spots,
710
+ uv: base_uv,
711
+ mono_source: mono_a
712
+ ).tint);
713
+
714
+ float dirt_and_spots_amount_remap = dirt_and_spots_amount * 0.5;
715
+
716
+ float coat_roughness = egdewear_gaps_gapsrough_lookup.x * edgewear_roughness_amount + // edgewear
717
+ egdewear_gaps_gapsrough_lookup.z * dirt_and_spots_amount_remap + // Gaps Damage
718
+ histogram_range(rough_dents_spots_lookup.x, base_roughness_range, tiles_base_roughness) + // base roughness
719
+ rough_dents_spots_lookup.z * dirt_and_spots_amount + // Spots (rough)
720
+ (1.0 - rough_dents_spots_lookup.y) * dirt_and_spots_amount; // Dents
721
+
722
+ float coat_roughness_squared = coat_roughness*coat_roughness; // roughness squared
723
+
724
+ bsdf coating_bsdf = ::df::microfacet_ggx_smith_bsdf(
725
+ roughness_u: coat_roughness_squared,
726
+ roughness_v: coat_roughness_squared,
727
+ tint: color(1.0f),
728
+ mode: ::df::scatter_reflect
729
+ );
730
+
731
+ // ******** NORMALS ********
732
+
733
+ // Tiles normal
734
+ float3 tiles_normal = vm_tex_normal_lookup(
735
+ tex: tex_lin_tiles_normal,
736
+ strength: tiles_bump_strength,
737
+ uv: base_uv
738
+ );
739
+
740
+ float3 wood_detail_normal = vm_tex_normal_lookup(
741
+ tex: tex_lin_wood_detail_norm,
742
+ strength: wood_bump_strength,
743
+ uv: tile_uv
744
+ );
745
+
746
+ float3 orange_peel_normal = vm_tex_normal_lookup(
747
+ tex: tex_lin_tiles_orange_peel,
748
+ strength: tiles_orange_peel_bump_factor * 0.1f,
749
+ uv: base_uv
750
+ );
751
+
752
+ // Randomized Tiles normals - This needs to be probably rotated with the normal of the uv-tiles
753
+ float slope_amount = 0.07 * tiles_random_slope_orientation;
754
+ float3 slope = ::math::normalize(
755
+ ::state::texture_tangent_u(uv_space_index) * (rand_vals.y - 0.5) * slope_amount +
756
+ ::state::texture_tangent_v(uv_space_index) * (rand_vals.z - 0.5) * slope_amount +
757
+ ::state::normal() * ((1.0f - slope_amount) + 1.0f)
758
+ );
759
+
760
+ float3 tiles_slope_normal = add_detail_normal(
761
+ n: slope,
762
+ nd: tiles_normal
763
+ );
764
+
765
+ float3 tiles_slope_detail_normal = add_detail_normal(
766
+ n: tiles_slope_normal,
767
+ nd: wood_detail_normal
768
+ );
769
+
770
+ float3 normal_final = add_detail_normal(
771
+ n: tiles_slope_detail_normal,
772
+ nd: orange_peel_normal
773
+ );
774
+
775
+ // ******** Anisotropic Highlight ********
776
+ // Lookup for anisotropic brightness variation
777
+ vm_coordinates aniso_brightnessvar_lookup_uv = vm_coord_post_scale(
778
+ uv: base_uv,
779
+ scale: texture_scale * 0.6
780
+ );
781
+
782
+ ::base::texture_return aniso_brightnessvar_lookup = vm_tex_lookup(
783
+ tex: tex_lin_wood_rough_detail,
784
+ uv: aniso_brightnessvar_lookup_uv,
785
+ mono_source: mono_average
786
+ );
787
+
788
+ float aniso_brightnessvar = histogram_scan_big(
789
+ input: aniso_brightnessvar_lookup.mono,
790
+ width: 0.911,
791
+ position: aniso_attenuation
792
+ );
793
+
794
+ ::base::texture_return aniso_mod_lookup = vm_tex_lookup(
795
+ tex: tex_lin_wood_rough_detail,
796
+ uv: tile_uv,
797
+ mono_source: mono_average
798
+ );
799
+
800
+ float aniso_detail_u = histogram_range(aniso_mod_lookup.mono, 1.0, aniso_bsdf_width);
801
+ float aniso_detail_v = histogram_range(aniso_mod_lookup.mono, 1.0, aniso_bsdf_height);
802
+
803
+ bsdf wood_highlight_aniso = ::df::weighted_layer(
804
+ layer: ::df::microfacet_ggx_smith_bsdf(
805
+ roughness_u: aniso_detail_u * aniso_detail_u,
806
+ roughness_v: aniso_detail_v * aniso_detail_v,
807
+ tint: color(aniso_brightnessvar),
808
+ tangent_u: rotated_tangent(texture_rotate, uv_space_index),
809
+ mode: ::df::scatter_reflect
810
+ ),
811
+ weight: 1.0f,
812
+ normal: tiles_slope_normal
813
+ );
814
+
815
+ // ******** Isotropic Highlight ********
816
+ ::base::texture_return iso_mod_lookup = vm_tex_lookup(
817
+ tex: tex_lin_wood_rough_grain,
818
+ uv: tile_uv,
819
+ mono_source: mono_average
820
+ );
821
+
822
+ float iso_mod = histogram_range(
823
+ input: iso_mod_lookup.mono,
824
+ range: isotropic_roughness_range,
825
+ position: isotropic_roughness
826
+ );
827
+
828
+ float iso_mod_squared = iso_mod * iso_mod;
829
+
830
+ bsdf wood_highlight_isotropic = ::df::microfacet_ggx_smith_bsdf(
831
+ roughness_u: iso_mod_squared,
832
+ roughness_v: iso_mod_squared,
833
+ tint: color(isotropic_specular_brightness),
834
+ mode: ::df::scatter_reflect
835
+ );
836
+
837
+ // ******** Comping Anisotropic and Isotropic Highlight ********
838
+
839
+ bsdf wood_highlight_isotropic_bumped = ::df::weighted_layer(
840
+ layer: wood_highlight_isotropic,
841
+ base: wood_highlight_aniso,
842
+ weight: anisotropic_isotropic_balance,
843
+ normal: tiles_slope_detail_normal
844
+ );
845
+
846
+
847
+ // ******** Diffuse Comping ********
848
+
849
+ // Linear interpolation magic to keep brightness appear the same across different values for
850
+ // 'floor_brightness' and 'wood_brightness_variation'
851
+
852
+ float floor_brightness_fix = ::math::lerp(
853
+ ::math::lerp(0.0f, 0.3f, floor_brightness),
854
+ ::math::lerp(0.42f, 1.0f, floor_brightness),
855
+ wood_brightness_variation);
856
+
857
+ float floor_brightness_remap = floor_brightness_fix * 0.7f + 0.3f; // remapping from 0.3 to 0.7
858
+
859
+
860
+ float4 diffuse_attenuation = float4(::math::lerp(
861
+ a: gaps_brightness,
862
+ b: floor_brightness_remap,
863
+ l: egdewear_gaps_gapsrough_lookup.y));
864
+
865
+
866
+ ::base::texture_return diffuse_lookup = vm_tex_lookup(
867
+ tex: tex_srgb_wood_color,
868
+ uv: tile_uv,
869
+ mono_source: mono_a,
870
+ scale: diffuse_attenuation
871
+ );
872
+
873
+ // Randomly varies brightness from 0.73 - 1.0 which is a simplification from the two nested lerp calls used in a previous version
874
+ float rand_tile_brightness = 1.0f - 0.27 * wood_brightness_variation + 0.27 * wood_brightness_variation * rand_vals.z * R_2nd_col_G_randmask.y;
875
+ // float rand_tile_brightness = R_2nd_col_G_randmask.x;
876
+
877
+ // adding the darkening of the dents texture channel
878
+ float rand_tile_brightness_dents = rand_tile_brightness * ::math::lerp(1.0f, rough_dents_spots_lookup.y, age_dirt);
879
+
880
+
881
+ ::base::texture_return tiles_rand_brightness = ::nvidia::core_definitions::blend_colors(
882
+ color_1: diffuse_lookup.tint,
883
+ color_2: color(::math::pow( a: rand_tile_brightness_dents, b: 2.2)), // do gamma compensation
884
+ mode: ::base::color_layer_multiply,
885
+ weight: 1.0f
886
+ );
887
+
888
+ // blend wood color and wood secondary color based on maps
889
+ ::base::texture_return wood_2_colored = ::nvidia::core_definitions::blend_colors(
890
+ color_1: wood_color,
891
+ color_2: wood_secondary_color,
892
+ mode: ::base::color_layer_blend,
893
+ weight: R_2nd_col_G_randmask.x
894
+ );
895
+
896
+ ::base::texture_return tiles_rand_brightness_tint = ::nvidia::core_definitions::blend_colors(
897
+ color_1: tiles_rand_brightness.tint,
898
+ color_2: wood_2_colored.tint,
899
+ mode: ::base::color_layer_overlay,
900
+ weight: .95f
901
+ );
902
+
903
+ bsdf diffuse = ::df::weighted_layer(
904
+ layer: ::df::diffuse_reflection_bsdf(
905
+ tint: tiles_rand_brightness_tint.tint
906
+ ),
907
+ normal: tiles_slope_detail_normal,
908
+ weight: 1.0
909
+ );
910
+
911
+ // Diffuse + Highlights BSDF
912
+
913
+ bsdf diffuse_and_highlights_bsdf = ::df::custom_curve_layer(
914
+ normal_reflectivity: wood_specular_level * 0.08,
915
+ grazing_reflectivity: 1.0f,
916
+ weight: aniso_brightnessvar ,
917
+ layer: wood_highlight_isotropic_bumped,
918
+ base: diffuse
919
+ );
920
+
921
+ // DEBUG
922
+ bsdf debug_diffuse_and_highlights_bsdf = ::df::custom_curve_layer(
923
+ normal_reflectivity: wood_specular_level * 0.08,
924
+ grazing_reflectivity: 1.0f,
925
+ weight: aniso_brightnessvar ,
926
+ layer: wood_highlight_isotropic_bumped
927
+ );
928
+
929
+ // Coating Layer
930
+ // separate controls for the reflectivity of the gaps and the general reflectivity of the coat
931
+ // Note that "gaps_brightness" also controls the diffuse texture (saving an additional parameter here)
932
+ float coating_weight = ::math::lerp(
933
+ a: gaps_brightness,
934
+ b: coating_reflectivity,
935
+ l: egdewear_gaps_gapsrough_lookup.y
936
+ );
937
+
938
+ // apply the coating layer
939
+ bsdf coated_wood_tiles_bsdf = ::df::custom_curve_layer(
940
+ normal_reflectivity: 0.03, //may as well be made adjustable (0.08 * specular_level)
941
+ grazing_reflectivity: 1.0f,
942
+ layer: coating_bsdf,
943
+ weight: coating_weight,
944
+ base: diffuse_and_highlights_bsdf,
945
+ normal: normal_final
946
+ );
947
+
948
+
949
+ // ******** Round Corners ********
950
+ float3 round_normal = round_corners ?
951
+ ::state::rounded_corner_normal(
952
+ radius: roundcorner_radius_mm * 0.001, // is in mm
953
+ across_materials: across_materials
954
+ ) : ::state::normal();
955
+
956
+ } in material(
957
+ surface: material_surface(
958
+ scattering: preview_wood_highlights ? debug_diffuse_and_highlights_bsdf : coated_wood_tiles_bsdf
959
+ ),
960
+ geometry: material_geometry(
961
+ normal: round_normal
962
+ )
963
+ );
964
+
965
+
966
+ // ******************************************************************************************************
967
+ // 01
968
+
969
+ export material Wood_Tiles_Walnut_Melbury(
970
+ int seed = 0 [[
971
+ ::anno::display_name("Randomization Seed"),
972
+ ::anno::description("Different seed values while causes different patterns of randomization on the tiles."),
973
+ ::anno::in_group("Randomization")
974
+ ]],
975
+ color wood_color = color(0.4f, 1.0f, 0.0f) [[
976
+ ::anno::display_name("Color Tint"),
977
+ ::anno::description("Applies an overlay color to tint the wood. A grayscale value of 0.5 has no effect, "
978
+ "brighter values brighten it while darker colors will have a darkening effect."),
979
+ ::anno::in_group("Appearance")
980
+ ]],
981
+ color wood_secondary_color = color(0.2f, 1.0f, 0.0f) [[
982
+ ::anno::display_name("Secondary Color Tint"),
983
+ ::anno::description("Choose the secondary overlay color to tint the wood. A grayscale value of 0.5 has no effect, "
984
+ "brighter values brighten it while darker colors will have a darkening effect."),
985
+ ::anno::in_group("Appearance")
986
+ ]],
987
+ uniform float wood_bump_strength = 0.3f // Determines the degree of bumpiness"),
988
+ [[
989
+ ::anno::display_name("Wood Bump Strength"),
990
+ ::anno::description("Adjusts the strength of the wood bump map."),
991
+ ::anno::in_group("Appearance"),
992
+ ::anno::hard_range(0.f, 2.f)
993
+ ]],
994
+ float floor_brightness = 1.0f [[
995
+ ::anno::display_name("Wood Brightness"),
996
+ ::anno::description("Adjusts the general brightness of the wood."),
997
+ ::anno::in_group("Appearance", "Tiles"),
998
+ ::anno::hard_range(0.f, 1.f)
999
+ ]],
1000
+ float wood_brightness_variation = 0.5f [[
1001
+ ::anno::display_name("Wood Brightness Variation"),
1002
+ ::anno::description("Adds a random brightness variation to the wooden tiles."),
1003
+ ::anno::in_group("Appearance", "Tiles"),
1004
+ ::anno::hard_range(0.f, 1.f)
1005
+ ]],
1006
+ float2 wood_scale = 1.5f [[
1007
+ ::anno::description("Sets the size of the wood relative to the tiles pattern. Larger numbers increase the size of the wood texture within the tiles."),
1008
+ ::anno::display_name("Wood Scale"),
1009
+ ::anno::in_group("Appearance", "Tiles"),
1010
+ ::anno::soft_range(0.f, 2.f)
1011
+ ]],
1012
+ uniform float tiles_bump_strength = 0.4f [[
1013
+ ::anno::description("Determines the degree of bumpiness of the tiles texture (grooves and bent tiles)."),
1014
+ ::anno::display_name("Tiles Bump Strength"),
1015
+ ::anno::in_group("Appearance", "Tiles"),
1016
+ ::anno::hard_range(0.f, 1.f)
1017
+ ]],
1018
+ float tiles_random_slope_orientation = 0.05f [[
1019
+ ::anno::display_name("Tiles Random Slope Orientation"),
1020
+ ::anno::description("Makes tiles individual tiles to appear tilted in random directions. Good for old floors and to take away too perfect appearing tiled floors."),
1021
+ ::anno::in_group("Appearance", "Tiles"),
1022
+ ::anno::hard_range(0.f, 1.f)
1023
+ ]],
1024
+ float gaps_brightness = 0.3f [[
1025
+ ::anno::display_name("Grout Brightness"),
1026
+ ::anno::description("Adjusts the brightness and roughness of the gaps between the tiles."),
1027
+ ::anno::in_group("Appearance", "Tiles"),
1028
+ ::anno::hard_range(0.f, 1.f)
1029
+ ]],
1030
+ float tiles_base_roughness = 0.14f [[
1031
+ ::anno::description("Adjusts the roughness of the coating. Higher value leading to blurrier and softer reflections."),
1032
+ ::anno::display_name("Coating Roughness"),
1033
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
1034
+ ::anno::enable_if("coating_reflectivity > 0.0f"),
1035
+ ::anno::hard_range(0.f, 1.f)
1036
+ ]],
1037
+ float base_roughness_range = 0.6f [[
1038
+ ::anno::description("Applies roughness variation to the coating, introducing signs of wear such as footprints and smudges."),
1039
+ ::anno::display_name("Coating Roughness Variation"),
1040
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
1041
+ ::anno::enable_if("coating_reflectivity > 0.0f"),
1042
+ ::anno::hard_range(0.f, 1.f)
1043
+ ]],
1044
+ uniform float tiles_orange_peel_bump_factor = 0.0f [[
1045
+ ::anno::display_name("Coating Unevenness"),
1046
+ ::anno::description("Applies an unevenness to the clear coat layer akin to orange peel."),
1047
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
1048
+ ::anno::enable_if("coating_reflectivity > 0.0f"),
1049
+ ::anno::hard_range(0.f, 1.f)
1050
+ ]],
1051
+ float coating_reflectivity = 1.f [[
1052
+ ::anno::display_name("Coating Reflectivity"),
1053
+ ::anno::description("The overall reflectivity of the clearcoat layer. Note that other parameters will show no effect when the clearcoat reflectivity is 0."),
1054
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
1055
+ ::anno::hard_range(0.f, 1.f)
1056
+ ]],
1057
+ float dirt_and_spots_amount = 0.15f [[
1058
+ ::anno::description("Adds random dirt and spots on top of the surface which adds variation to the clearcoat roughness."),
1059
+ ::anno::display_name("Dirt and Spots"),
1060
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
1061
+ ::anno::enable_if("coating_reflectivity > 0.0f"),
1062
+ ::anno::hard_range(0.f, 1.f)
1063
+ ]],
1064
+ float edgewear_roughness_amount = 0.2f [[
1065
+ ::anno::description("Adds edgewear around the tile borders which results in a more worn and rough look of the clearcoat."),
1066
+ ::anno::display_name("Edgewear Roughness Amount"),
1067
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
1068
+ ::anno::enable_if("coating_reflectivity > 0.0f"),
1069
+ ::anno::hard_range(0.f, 1.f)
1070
+ ]],
1071
+
1072
+ //-----------------------------------------------
1073
+
1074
+ float2 texture_translate = 0.f [[
1075
+ ::anno::display_name("Texture Translate"),
1076
+ ::anno::description("Controls the position of the texture."),
1077
+ ::anno::in_group("Transform")
1078
+ ]],
1079
+ float texture_rotate = 0.f [[
1080
+ ::anno::display_name("Texture Rotate"),
1081
+ ::anno::description("Rotates angle of the texture in degrees."),
1082
+ ::anno::in_group("Transform")
1083
+ ]],
1084
+ float2 texture_scale = 1.0f [[
1085
+ ::anno::display_name("Texture Scale"),
1086
+ ::anno::description("Larger numbers increase the size."),
1087
+ ::nvidia::core_definitions::dimension(float2(.5f, .5f)),
1088
+ ::anno::in_group("Transform")
1089
+ ]],
1090
+ uniform int uv_space_index = 0 [[
1091
+ ::anno::display_name("UV Space Index"),
1092
+ ::anno::description("Uses selected UV space for material."),
1093
+ ::anno::in_group("Transform")
1094
+ ]],
1095
+ uniform bool round_corners = false [[
1096
+ ::anno::display_name("Round Corners"),
1097
+ ::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."),
1098
+ ::anno::in_group("Round Corners")
1099
+ ]],
1100
+ uniform float roundcorner_radius_mm = 1.5f [[
1101
+ ::anno::display_name("Radius (mm)"),
1102
+ ::anno::description("Radius of the rounded corners in millimeters."),
1103
+ ::anno::in_group("Round Corners"),
1104
+ ::anno::soft_range(0.f, 10.f)
1105
+ ]],
1106
+ uniform bool across_materials = false [[
1107
+ ::anno::display_name("Across Materials"),
1108
+ ::anno::description("Applies the round corner effect across different materials when enabled."),
1109
+ ::anno::in_group("Round Corners")
1110
+ ]]
1111
+ )
1112
+ [[
1113
+ ::anno::author("NVIDIA vMaterials"),
1114
+ ::anno::display_name("Wood Tiles Walnut - Multicolor Melbury"),
1115
+ ::anno::description(DESCRIPTION),
1116
+ // reflective, varnished, bumped, matte, natural, stained, exterior, new, aged, decayed, abstract, modern, classic
1117
+ ::anno::key_words(string[]("wood", "walnut", "tiles", "tiled", "pattern", "decorative", "multimaterial", "multicolor", "organic", "natural", "coated", "infinite tiling", "melbury", "architecture", "interior")),
1118
+ ::anno::thumbnail("./.thumbs/Wood_Tiles_Walnut_Multicolor.Wood_Tiles_Walnut_Melbury.png"),
1119
+ ::anno::copyright_notice(COPYRIGHT)
1120
+ //::anno::hidden()
1121
+ ]]
1122
+ = Wood_Tiles_Walnut_Multicolor(
1123
+ seed: seed,
1124
+ wood_color: wood_color,
1125
+ wood_secondary_color: wood_secondary_color,
1126
+ wood_bump_strength: wood_bump_strength,
1127
+ floor_brightness: floor_brightness,
1128
+ wood_brightness_variation: wood_brightness_variation,
1129
+ wood_random_rotation: 0.006f,
1130
+ wood_scale: wood_scale,
1131
+
1132
+ tiles_bump_strength: tiles_bump_strength,
1133
+ tiles_random_slope_orientation: tiles_random_slope_orientation,
1134
+ gaps_brightness: gaps_brightness,
1135
+ tiles_orange_peel_bump_factor: tiles_orange_peel_bump_factor,
1136
+ coating_reflectivity: coating_reflectivity,
1137
+ tiles_base_roughness: tiles_base_roughness,
1138
+ base_roughness_range: base_roughness_range,
1139
+ dirt_and_spots_amount: dirt_and_spots_amount,
1140
+ edgewear_roughness_amount: edgewear_roughness_amount,
1141
+
1142
+ texture_translate: texture_translate,
1143
+ texture_rotate: texture_rotate,
1144
+ texture_scale: texture_scale,
1145
+ uv_space_index: uv_space_index,
1146
+
1147
+ round_corners: round_corners,
1148
+ roundcorner_radius_mm: roundcorner_radius_mm,
1149
+ across_materials: across_materials,
1150
+
1151
+ preview_wood_highlights: false,
1152
+ isotropic_roughness: 0.352f,
1153
+ isotropic_roughness_range: 0.566f,
1154
+ isotropic_specular_brightness: 1.0f,
1155
+ wood_specular_level: 1.0f,
1156
+ aniso_attenuation: 0.491f,
1157
+ aniso_bsdf_width: 0.508f,
1158
+ aniso_bsdf_height: 0.657f,
1159
+ anisotropic_isotropic_balance: 0.320f,
1160
+
1161
+ tex_srgb_wood_color: texture_2d("./wood_walnut_diff.jpg", ::tex::gamma_srgb),
1162
+ tex_lin_wood_rough_detail: texture_2d("./wood_walnut_rough_detail.jpg", ::tex::gamma_linear),
1163
+ tex_lin_wood_rough_grain: texture_2d("./wood_walnut_rough_grain.jpg", ::tex::gamma_linear),
1164
+ tex_lin_wood_detail_norm: texture_2d("./wood_walnut_norm.jpg", ::tex::gamma_linear),
1165
+ tex_lin_tiles_id_offset_rotation: texture_2d("./melbury_R_id_G_offset_B_rotation.png", ::tex::gamma_linear),
1166
+ tex_lin_tiles_edgewear_gaps_gapsrough: texture_2d("./melbury_R_edgewear_G_gaps_B_gaps_rough.jpg", ::tex::gamma_linear),
1167
+ tex_lin_tiles_normal: texture_2d("./melbury_norm.jpg", ::tex::gamma_linear),
1168
+ tex_lin_tiles_R_2nd_col_G_randmask: texture_2d("./melbury_R_2ndcol_G_randmask.png", ::tex::gamma_linear),
1169
+ tex_lin_tiles_rough_dents_spots: texture_2d("./tiles_wood_R_rough_G_dents_B_spots.jpg", ::tex::gamma_linear),
1170
+ tex_lin_tiles_orange_peel: texture_2d("./tiles_wood_orangepeel_norm.jpg", ::tex::gamma_linear)
1171
+ );
1172
+
1173
+
1174
+
1175
+ // 02
1176
+
1177
+ export material Wood_Tiles_Walnut_Large_Star(
1178
+ int seed = 0 [[
1179
+ ::anno::display_name("Randomization Seed"),
1180
+ ::anno::description("Different seed values while causes different patterns of randomization on the tiles."),
1181
+ ::anno::in_group("Randomization")
1182
+ ]],
1183
+ color wood_color = color(0.4f, 1.0f, 0.0f) [[
1184
+ ::anno::display_name("Color Tint"),
1185
+ ::anno::description("Applies an overlay color to tint the wood. A grayscale value of 0.5 has no effect, "
1186
+ "brighter values brighten it while darker colors will have a darkening effect."),
1187
+ ::anno::in_group("Appearance")
1188
+ ]],
1189
+ color wood_secondary_color = color(0.2f, 1.0f, 0.0f) [[
1190
+ ::anno::display_name("Secondary Color Tint"),
1191
+ ::anno::description("Choose the secondary overlay color to tint the wood. A grayscale value of 0.5 has no effect, "
1192
+ "brighter values brighten it while darker colors will have a darkening effect."),
1193
+ ::anno::in_group("Appearance")
1194
+ ]],
1195
+ uniform float wood_bump_strength = 0.3f // Determines the degree of bumpiness"),
1196
+ [[
1197
+ ::anno::display_name("Wood Bump Strength"),
1198
+ ::anno::description("Adjusts the strength of the wood bump map."),
1199
+ ::anno::in_group("Appearance"),
1200
+ ::anno::hard_range(0.f, 2.f)
1201
+ ]],
1202
+ float floor_brightness = 0.8f [[
1203
+ ::anno::display_name("Wood Brightness"),
1204
+ ::anno::description("Adjusts the general brightness of the wood."),
1205
+ ::anno::in_group("Appearance", "Tiles"),
1206
+ ::anno::hard_range(0.f, 1.f)
1207
+ ]],
1208
+ float wood_brightness_variation = .4f [[
1209
+ ::anno::display_name("Wood Brightness Variation"),
1210
+ ::anno::description("Adds a random brightness variation to the wooden tiles."),
1211
+ ::anno::in_group("Appearance", "Tiles"),
1212
+ ::anno::hard_range(0.f, 1.f)
1213
+ ]],
1214
+ float2 wood_scale = 1.6f [[
1215
+ ::anno::description("Sets the size of the wood relative to the tiles pattern. Larger numbers increase the size of the wood texture within the tiles."),
1216
+ ::anno::display_name("Wood Scale"),
1217
+ ::anno::in_group("Appearance", "Tiles"),
1218
+ ::anno::soft_range(0.0f, 2.0f)
1219
+ ]],
1220
+ uniform float tiles_bump_strength = 0.3f [[
1221
+ ::anno::description("Determines the degree of bumpiness of the tiles texture (grooves and bent tiles)."),
1222
+ ::anno::display_name("Tiles Bump Strength"),
1223
+ ::anno::in_group("Appearance", "Tiles"),
1224
+ ::anno::hard_range(0.f, 1.f)
1225
+ ]],
1226
+ float tiles_random_slope_orientation = 0.4f [[
1227
+ ::anno::display_name("Tiles Random Slope Orientation"),
1228
+ ::anno::description("Makes tiles individual tiles to appear tilted in random directions. Good for old floors and to take away too perfect appearing tiled floors."),
1229
+ ::anno::in_group("Appearance", "Tiles"),
1230
+ ::anno::hard_range(0.f, 1.f)
1231
+ ]],
1232
+ float gaps_brightness = 0.0f [[
1233
+ ::anno::display_name("Grout Brightness"),
1234
+ ::anno::description("Adjusts the brightness and roughness of the gaps between the tiles."),
1235
+ ::anno::in_group("Appearance", "Tiles"),
1236
+ ::anno::hard_range(0.f, 1.f)
1237
+ ]],
1238
+ float tiles_base_roughness = 0.14f [[
1239
+ ::anno::description("Adjusts the roughness of the coating. Higher value leading to blurrier and softer reflections."),
1240
+ ::anno::display_name("Coating Roughness"),
1241
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
1242
+ ::anno::enable_if("coating_reflectivity > 0.0f"),
1243
+ ::anno::hard_range(0.f, 1.f)
1244
+ ]],
1245
+ float base_roughness_range = 1.0f [[
1246
+ ::anno::description("Applies roughness variation to the coating, introducing signs of wear such as footprints and smudges."),
1247
+ ::anno::display_name("Coating Roughness Variation"),
1248
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
1249
+ ::anno::enable_if("coating_reflectivity > 0.0f"),
1250
+ ::anno::hard_range(0.f, 1.f)
1251
+ ]],
1252
+ uniform float tiles_orange_peel_bump_factor = 0.3f [[
1253
+ ::anno::display_name("Coating Unevenness"),
1254
+ ::anno::description("Applies an unevenness to the clear coat layer akin to orange peel."),
1255
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
1256
+ ::anno::enable_if("coating_reflectivity > 0.0f"),
1257
+ ::anno::hard_range(0.f, 1.f)
1258
+ ]],
1259
+ float coating_reflectivity = 1.f [[
1260
+ ::anno::display_name("Coating Reflectivity"),
1261
+ ::anno::description("The overall reflectivity of the clearcoat layer. Note that other parameters will show no effect when the clearcoat reflectivity is 0."),
1262
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
1263
+ ::anno::hard_range(0.f, 1.f)
1264
+ ]],
1265
+ float dirt_and_spots_amount = 0.15f [[
1266
+ ::anno::description("Adds random dirt and spots on top of the surface which adds variation to the clearcoat roughness."),
1267
+ ::anno::display_name("Dirt and Spots"),
1268
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
1269
+ ::anno::enable_if("coating_reflectivity > 0.0f"),
1270
+ ::anno::hard_range(0.f, 1.f)
1271
+ ]],
1272
+ float edgewear_roughness_amount = 0.2f [[
1273
+ ::anno::description("Adds edgewear around the tile borders which results in a more worn and rough look of the clearcoat."),
1274
+ ::anno::display_name("Edgewear Roughness Amount"),
1275
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
1276
+ ::anno::enable_if("coating_reflectivity > 0.0f"),
1277
+ ::anno::hard_range(0.f, 1.f)
1278
+ ]],
1279
+
1280
+ //-----------------------------------------------
1281
+
1282
+ float2 texture_translate = 0.f [[
1283
+ ::anno::display_name("Texture Translate"),
1284
+ ::anno::description("Controls the position of the texture."),
1285
+ ::anno::in_group("Transform")
1286
+ ]],
1287
+ float texture_rotate = 0.f [[
1288
+ ::anno::display_name("Texture Rotate"),
1289
+ ::anno::description("Rotates angle of the texture in degrees."),
1290
+ ::anno::in_group("Transform")
1291
+ ]],
1292
+ float2 texture_scale = 1.0f [[
1293
+ ::anno::display_name("Texture Scale"),
1294
+ ::anno::description("Larger numbers increase the size."),
1295
+ ::nvidia::core_definitions::dimension(float2(0.3333f, 0.3333f)),
1296
+ ::anno::in_group("Transform")
1297
+ ]],
1298
+ uniform int uv_space_index = 0 [[
1299
+ ::anno::display_name("UV Space Index"),
1300
+ ::anno::description("Uses selected UV space for material."),
1301
+ ::anno::in_group("Transform")
1302
+ ]],
1303
+ uniform bool round_corners = false [[
1304
+ ::anno::display_name("Round Corners"),
1305
+ ::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."),
1306
+ ::anno::in_group("Round Corners")
1307
+ ]],
1308
+ uniform float roundcorner_radius_mm = 1.5f [[
1309
+ ::anno::display_name("Radius (mm)"),
1310
+ ::anno::description("Radius of the rounded corners in millimeters."),
1311
+ ::anno::in_group("Round Corners"),
1312
+ ::anno::soft_range(0.f, 10.f)
1313
+ ]],
1314
+ uniform bool across_materials = false [[
1315
+ ::anno::display_name("Across Materials"),
1316
+ ::anno::description("Applies the round corner effect across different materials when enabled."),
1317
+ ::anno::in_group("Round Corners")
1318
+ ]]
1319
+ )
1320
+ [[
1321
+ ::anno::author("NVIDIA vMaterials"),
1322
+ ::anno::display_name("Wood Tiles Walnut - Multicolor Large Star"),
1323
+ ::anno::description(DESCRIPTION),
1324
+ // reflective, varnished, bumped, matte, natural, stained, exterior, new, aged, decayed, abstract, modern, classic
1325
+ ::anno::key_words(string[]("wood", "walnut", "tiles", "tiled", "pattern", "decorative", "multimaterial", "multicolor", "organic", "natural", "coated", "infinite tiling", "star", "architecture", "interior")),
1326
+ ::anno::thumbnail("./.thumbs/Wood_Tiles_Walnut_Multicolor.Wood_Tiles_Walnut_Large_Star.png"),
1327
+ ::anno::copyright_notice(COPYRIGHT)
1328
+ //::anno::hidden()
1329
+ ]]
1330
+ = Wood_Tiles_Walnut_Multicolor(
1331
+ seed: seed,
1332
+ wood_color: wood_color,
1333
+ wood_secondary_color: wood_secondary_color,
1334
+ wood_bump_strength: wood_bump_strength,
1335
+ floor_brightness: floor_brightness,
1336
+ wood_brightness_variation: wood_brightness_variation,
1337
+ wood_random_rotation: 0.005f,
1338
+ wood_scale: wood_scale,
1339
+
1340
+ tiles_bump_strength: tiles_bump_strength,
1341
+ tiles_random_slope_orientation: tiles_random_slope_orientation,
1342
+ gaps_brightness: gaps_brightness,
1343
+ tiles_orange_peel_bump_factor: tiles_orange_peel_bump_factor,
1344
+ coating_reflectivity: coating_reflectivity,
1345
+ tiles_base_roughness: tiles_base_roughness,
1346
+ base_roughness_range: base_roughness_range,
1347
+ dirt_and_spots_amount: dirt_and_spots_amount,
1348
+ edgewear_roughness_amount: edgewear_roughness_amount,
1349
+
1350
+ texture_translate: texture_translate,
1351
+ texture_rotate: texture_rotate,
1352
+ texture_scale: texture_scale,
1353
+ uv_space_index: uv_space_index,
1354
+
1355
+ round_corners: round_corners,
1356
+ roundcorner_radius_mm: roundcorner_radius_mm,
1357
+ across_materials: across_materials,
1358
+
1359
+ preview_wood_highlights: false,
1360
+ isotropic_roughness: 0.352f,
1361
+ isotropic_roughness_range: 0.566f,
1362
+ isotropic_specular_brightness: 1.0f,
1363
+ wood_specular_level: 1.0f,
1364
+ aniso_attenuation: 0.491f,
1365
+ aniso_bsdf_width: 0.508f,
1366
+ aniso_bsdf_height: 0.657f,
1367
+ anisotropic_isotropic_balance: 0.320f,
1368
+
1369
+ tex_srgb_wood_color: texture_2d("./wood_walnut_diff.jpg", ::tex::gamma_srgb),
1370
+ tex_lin_wood_rough_detail: texture_2d("./wood_walnut_rough_detail.jpg", ::tex::gamma_linear),
1371
+ tex_lin_wood_rough_grain: texture_2d("./wood_walnut_rough_grain.jpg", ::tex::gamma_linear),
1372
+ tex_lin_wood_detail_norm: texture_2d("./wood_walnut_norm.jpg", ::tex::gamma_linear),
1373
+ tex_lin_tiles_id_offset_rotation: texture_2d("./star_large_R_id_G_offset_B_rotation.png", ::tex::gamma_linear),
1374
+ tex_lin_tiles_edgewear_gaps_gapsrough: texture_2d("./star_large_R_edgewear_G_gaps_B_gaps_rough.jpg", ::tex::gamma_linear),
1375
+ tex_lin_tiles_normal: texture_2d("./star_large_norm.jpg", ::tex::gamma_linear),
1376
+ tex_lin_tiles_R_2nd_col_G_randmask: texture_2d("./star_large_R_2ndcol_G_randmask.png", ::tex::gamma_linear),
1377
+ tex_lin_tiles_rough_dents_spots: texture_2d("./tiles_wood_R_rough_G_dents_B_spots.jpg", ::tex::gamma_linear),
1378
+ tex_lin_tiles_orange_peel: texture_2d("./tiles_wood_orangepeel_norm.jpg", ::tex::gamma_linear)
1379
+ );
1380
+
1381
+
1382
+
1383
+ // 03
1384
+
1385
+ export material Wood_Tiles_Walnut_Stars(
1386
+ int seed = 0 [[
1387
+ ::anno::display_name("Randomization Seed"),
1388
+ ::anno::description("Different seed values while causes different patterns of randomization on the tiles."),
1389
+ ::anno::in_group("Randomization")
1390
+ ]],
1391
+ color wood_color = color(0.4f, 1.0f, 0.0f) [[
1392
+ ::anno::display_name("Color Tint"),
1393
+ ::anno::description("Applies an overlay color to tint the wood. A grayscale value of 0.5 has no effect, "
1394
+ "brighter values brighten it while darker colors will have a darkening effect."),
1395
+ ::anno::in_group("Appearance")
1396
+ ]],
1397
+ color wood_secondary_color = color(0.2f, 1.0f, 0.0f) [[
1398
+ ::anno::display_name("Secondary Color Tint"),
1399
+ ::anno::description("Choose the secondary overlay color to tint the wood. A grayscale value of 0.5 has no effect, "
1400
+ "brighter values brighten it while darker colors will have a darkening effect."),
1401
+ ::anno::in_group("Appearance")
1402
+ ]],
1403
+ uniform float wood_bump_strength = 0.3f // Determines the degree of bumpiness"),
1404
+ [[
1405
+ ::anno::display_name("Wood Bump Strength"),
1406
+ ::anno::description("Adjusts the strength of the wood bump map."),
1407
+ ::anno::in_group("Appearance"),
1408
+ ::anno::hard_range(0.f, 2.f)
1409
+ ]],
1410
+ float floor_brightness = 0.8f [[
1411
+ ::anno::display_name("Wood Brightness"),
1412
+ ::anno::description("Adjusts the general brightness of the wood."),
1413
+ ::anno::in_group("Appearance", "Tiles"),
1414
+ ::anno::hard_range(0.f, 1.f)
1415
+ ]],
1416
+ float wood_brightness_variation = .35f [[
1417
+ ::anno::display_name("Wood Brightness Variation"),
1418
+ ::anno::description("Adds a random brightness variation to the wooden tiles."),
1419
+ ::anno::in_group("Appearance", "Tiles"),
1420
+ ::anno::hard_range(0.f, 1.f)
1421
+ ]],
1422
+ float2 wood_scale = 1.4f [[
1423
+ ::anno::description("Sets the size of the wood relative to the tiles pattern. Larger numbers increase the size of the wood texture within the tiles."),
1424
+ ::anno::display_name("Wood Scale"),
1425
+ ::anno::in_group("Appearance", "Tiles"),
1426
+ ::anno::soft_range(0.0f, 2.0f)
1427
+ ]],
1428
+ uniform float tiles_bump_strength = 0.3f [[
1429
+ ::anno::description("Determines the degree of bumpiness of the tiles texture (grooves and bent tiles)."),
1430
+ ::anno::display_name("Tiles Bump Strength"),
1431
+ ::anno::in_group("Appearance", "Tiles"),
1432
+ ::anno::hard_range(0.f, 1.f)
1433
+ ]],
1434
+ float tiles_random_slope_orientation = 0.4f [[
1435
+ ::anno::display_name("Tiles Random Slope Orientation"),
1436
+ ::anno::description("Makes tiles individual tiles to appear tilted in random directions. Good for old floors and to take away too perfect appearing tiled floors."),
1437
+ ::anno::in_group("Appearance", "Tiles"),
1438
+ ::anno::hard_range(0.f, 1.f)
1439
+ ]],
1440
+ float gaps_brightness = 0.0f [[
1441
+ ::anno::display_name("Grout Brightness"),
1442
+ ::anno::description("Adjusts the brightness and roughness of the gaps between the tiles."),
1443
+ ::anno::in_group("Appearance", "Tiles"),
1444
+ ::anno::hard_range(0.f, 1.f)
1445
+ ]],
1446
+ float tiles_base_roughness = 0.14f [[
1447
+ ::anno::description("Adjusts the roughness of the coating. Higher value leading to blurrier and softer reflections."),
1448
+ ::anno::display_name("Coating Roughness"),
1449
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
1450
+ ::anno::enable_if("coating_reflectivity > 0.0f"),
1451
+ ::anno::hard_range(0.f, 1.f)
1452
+ ]],
1453
+ float base_roughness_range = 1.0f [[
1454
+ ::anno::description("Applies roughness variation to the coating, introducing signs of wear such as footprints and smudges."),
1455
+ ::anno::display_name("Coating Roughness Variation"),
1456
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
1457
+ ::anno::enable_if("coating_reflectivity > 0.0f"),
1458
+ ::anno::hard_range(0.f, 1.f)
1459
+ ]],
1460
+ uniform float tiles_orange_peel_bump_factor = 0.3f [[
1461
+ ::anno::display_name("Coating Unevenness"),
1462
+ ::anno::description("Applies an unevenness to the clear coat layer akin to orange peel."),
1463
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
1464
+ ::anno::enable_if("coating_reflectivity > 0.0f"),
1465
+ ::anno::hard_range(0.f, 1.f)
1466
+ ]],
1467
+ float coating_reflectivity = 1.f [[
1468
+ ::anno::display_name("Coating Reflectivity"),
1469
+ ::anno::description("The overall reflectivity of the clearcoat layer. Note that other parameters will show no effect when the clearcoat reflectivity is 0."),
1470
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
1471
+ ::anno::hard_range(0.f, 1.f)
1472
+ ]],
1473
+ float dirt_and_spots_amount = 0.15f [[
1474
+ ::anno::description("Adds random dirt and spots on top of the surface which adds variation to the clearcoat roughness."),
1475
+ ::anno::display_name("Dirt and Spots"),
1476
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
1477
+ ::anno::enable_if("coating_reflectivity > 0.0f"),
1478
+ ::anno::hard_range(0.f, 1.f)
1479
+ ]],
1480
+ float edgewear_roughness_amount = 0.2f [[
1481
+ ::anno::description("Adds edgewear around the tile borders which results in a more worn and rough look of the clearcoat."),
1482
+ ::anno::display_name("Edgewear Roughness Amount"),
1483
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
1484
+ ::anno::enable_if("coating_reflectivity > 0.0f"),
1485
+ ::anno::hard_range(0.f, 1.f)
1486
+ ]],
1487
+
1488
+ //-----------------------------------------------
1489
+
1490
+ float2 texture_translate = 0.f [[
1491
+ ::anno::display_name("Texture Translate"),
1492
+ ::anno::description("Controls the position of the texture."),
1493
+ ::anno::in_group("Transform")
1494
+ ]],
1495
+ float texture_rotate = 0.f [[
1496
+ ::anno::display_name("Texture Rotate"),
1497
+ ::anno::description("Rotates angle of the texture in degrees."),
1498
+ ::anno::in_group("Transform")
1499
+ ]],
1500
+ float2 texture_scale = 1.0f [[
1501
+ ::anno::display_name("Texture Scale"),
1502
+ ::anno::description("Larger numbers increase the size."),
1503
+ ::nvidia::core_definitions::dimension(float2(0.5f, 0.5f)),
1504
+ ::preview_scale(0.33f),
1505
+ ::anno::in_group("Transform")
1506
+ ]],
1507
+ uniform int uv_space_index = 0 [[
1508
+ ::anno::display_name("UV Space Index"),
1509
+ ::anno::description("Uses selected UV space for material."),
1510
+ ::anno::in_group("Transform")
1511
+ ]],
1512
+ uniform bool round_corners = false [[
1513
+ ::anno::display_name("Round Corners"),
1514
+ ::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."),
1515
+ ::anno::in_group("Round Corners")
1516
+ ]],
1517
+ uniform float roundcorner_radius_mm = 1.5f [[
1518
+ ::anno::display_name("Radius (mm)"),
1519
+ ::anno::description("Radius of the rounded corners in millimeters."),
1520
+ ::anno::in_group("Round Corners"),
1521
+ ::anno::soft_range(0.f, 10.f)
1522
+ ]],
1523
+ uniform bool across_materials = false [[
1524
+ ::anno::display_name("Across Materials"),
1525
+ ::anno::description("Applies the round corner effect across different materials when enabled."),
1526
+ ::anno::in_group("Round Corners")
1527
+ ]]
1528
+ )
1529
+ [[
1530
+ ::anno::author("NVIDIA vMaterials"),
1531
+ ::anno::display_name("Wood Tiles Walnut - Multicolor Stars"),
1532
+ ::anno::description(DESCRIPTION),
1533
+ // reflective, varnished, bumped, matte, natural, stained, exterior, new, aged, decayed, abstract, modern, classic
1534
+ ::anno::key_words(string[]("wood", "walnut", "tiles", "tiled", "pattern", "decorative", "multimaterial", "multicolor", "organic", "natural", "coated", "infinite tiling", "star", "stars", "architecture", "interior")),
1535
+ ::anno::thumbnail("./.thumbs/Wood_Tiles_Walnut_Multicolor.Wood_Tiles_Walnut_Stars.png"),
1536
+ ::anno::copyright_notice(COPYRIGHT)
1537
+ //::anno::hidden()
1538
+ ]]
1539
+ = Wood_Tiles_Walnut_Multicolor(
1540
+ seed: seed,
1541
+ wood_color: wood_color,
1542
+ wood_secondary_color: wood_secondary_color,
1543
+ wood_bump_strength: wood_bump_strength,
1544
+ floor_brightness: floor_brightness,
1545
+ wood_brightness_variation: wood_brightness_variation,
1546
+ wood_random_rotation: 0.00f,
1547
+ wood_scale: wood_scale,
1548
+
1549
+ tiles_bump_strength: tiles_bump_strength,
1550
+ tiles_random_slope_orientation: tiles_random_slope_orientation,
1551
+ gaps_brightness: gaps_brightness,
1552
+ tiles_orange_peel_bump_factor: tiles_orange_peel_bump_factor,
1553
+ coating_reflectivity: coating_reflectivity,
1554
+ tiles_base_roughness: tiles_base_roughness,
1555
+ base_roughness_range: base_roughness_range,
1556
+ dirt_and_spots_amount: dirt_and_spots_amount,
1557
+ edgewear_roughness_amount: edgewear_roughness_amount,
1558
+
1559
+ texture_translate: texture_translate,
1560
+ texture_rotate: texture_rotate,
1561
+ texture_scale: texture_scale,
1562
+ uv_space_index: uv_space_index,
1563
+
1564
+ round_corners: round_corners,
1565
+ roundcorner_radius_mm: roundcorner_radius_mm,
1566
+ across_materials: across_materials,
1567
+
1568
+ preview_wood_highlights: false,
1569
+ isotropic_roughness: 0.352f,
1570
+ isotropic_roughness_range: 0.566f,
1571
+ isotropic_specular_brightness: 1.0f,
1572
+ wood_specular_level: 1.0f,
1573
+ aniso_attenuation: 0.491f,
1574
+ aniso_bsdf_width: 0.508f,
1575
+ aniso_bsdf_height: 0.657f,
1576
+ anisotropic_isotropic_balance: 0.320f,
1577
+
1578
+ tex_srgb_wood_color: texture_2d("./wood_walnut_diff.jpg", ::tex::gamma_srgb),
1579
+ tex_lin_wood_rough_detail: texture_2d("./wood_walnut_rough_detail.jpg", ::tex::gamma_linear),
1580
+ tex_lin_wood_rough_grain: texture_2d("./wood_walnut_rough_grain.jpg", ::tex::gamma_linear),
1581
+ tex_lin_wood_detail_norm: texture_2d("./wood_walnut_norm.jpg", ::tex::gamma_linear),
1582
+ tex_lin_tiles_id_offset_rotation: texture_2d("./stars_R_id_G_offset_B_rotation.png", ::tex::gamma_linear),
1583
+ tex_lin_tiles_edgewear_gaps_gapsrough: texture_2d("./stars_R_edgewear_G_gaps_B_gaps_rough.jpg", ::tex::gamma_linear),
1584
+ tex_lin_tiles_normal: texture_2d("./stars_norm.jpg", ::tex::gamma_linear),
1585
+ tex_lin_tiles_R_2nd_col_G_randmask: texture_2d("./stars_R_2ndcol_G_randmask.png", ::tex::gamma_linear),
1586
+ tex_lin_tiles_rough_dents_spots: texture_2d("./tiles_wood_R_rough_G_dents_B_spots.jpg", ::tex::gamma_linear),
1587
+ tex_lin_tiles_orange_peel: texture_2d("./tiles_wood_orangepeel_norm.jpg", ::tex::gamma_linear)
1588
+ );
Material/material_0362/Small_Cobblestone.mdl ADDED
@@ -0,0 +1,335 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2024 NVIDIA Corporation. All rights reserved. *
3
+ ******************************************************************************
4
+
5
+ Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge,
6
+ to any person obtaining a copy of the sample definition code that uses our
7
+ Material Definition Language (the "MDL Materials"), to reproduce and distribute
8
+ the MDL Materials, including without limitation the rights to use, copy, merge,
9
+ publish, distribute, and sell modified and unmodified copies of the MDL
10
+ Materials, and to permit persons to whom the MDL Materials is furnished to do
11
+ so, in all cases solely for use with NVIDIA’s Material Definition Language,
12
+ subject to the following further conditions:
13
+
14
+ 1. The above copyright notices, this list of conditions, and the disclaimer
15
+ that follows shall be retained in all copies of one or more of the MDL
16
+ Materials, including in any software with which the MDL Materials are bundled,
17
+ redistributed, and/or sold, and included either as stand-alone text files,
18
+ human-readable headers or in the appropriate machine-readable metadata fields
19
+ within text or binary files as long as those fields can be easily viewed by the
20
+ user, as applicable.
21
+ 2. The name of NVIDIA shall not be used to promote, endorse or advertise any
22
+ Modified Version without specific prior written permission, except a) to comply
23
+ with the notice requirements otherwise contained herein; or b) to acknowledge
24
+ the contribution(s) of NVIDIA.
25
+
26
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
27
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
28
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
29
+ TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR
30
+ ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL,
31
+ INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF
32
+ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE
33
+ THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.
34
+ */
35
+
36
+
37
+ mdl 1.5;
38
+
39
+ import ::anno::*;
40
+ import ::base::*;
41
+ import ::df::*;
42
+ import ::math::*;
43
+ import ::state::*;
44
+ import ::tex::*;
45
+ import ::nvidia::core_definitions::blend_colors;
46
+ import ::nvidia::core_definitions::dimension;
47
+
48
+
49
+ const string COPYRIGHT =
50
+ " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
51
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
52
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
53
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
54
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
55
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
56
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
57
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
58
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
59
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
60
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
61
+
62
+ const string DESCRIPTION = "A ground stone material";
63
+
64
+
65
+
66
+
67
+ float histogram_range(float input, float range = 1.0f, float position = 0.5f)
68
+ {
69
+ float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0);
70
+ float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0);
71
+ return ::math::lerp(low, high, input);
72
+ }
73
+
74
+ float remap_xy_to_0_1(float input, float x, float y)
75
+ {
76
+ return (input - x)/(y - x);
77
+ }
78
+
79
+ float histogram_scan_big(float input, float width, float position)
80
+ {
81
+ return ::math::clamp(
82
+ remap_xy_to_0_1(input,
83
+ ::math::lerp(-width, 1.0, position),
84
+ ::math::lerp(0.0, 1.0 + width, position)),
85
+ 0.0,
86
+ 1.0);
87
+ }
88
+
89
+ ::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
+
110
+ return ::base::texture_coordinate_info(
111
+ float3(r_position.x,r_position.y,r_position.z),
112
+ ::math::normalize(cos * coordinate.tangent_u - sin * coordinate.tangent_v),
113
+ ::math::normalize(cos * coordinate.tangent_v + sin * coordinate.tangent_u));
114
+ }
115
+
116
+ float3 normalmap_normal(
117
+ uniform texture_2d texture,
118
+ float factor = 1.0,
119
+ ::base::texture_coordinate_info uvw = ::base::texture_coordinate_info()
120
+ )
121
+ {
122
+ float3 lookup = (::tex::lookup_float3(texture, float2(uvw.position.x, uvw.position.y)) - float3(0.5)) * (factor * 2.0);
123
+ return ::math::normalize(uvw.tangent_u * lookup.x + uvw.tangent_v * lookup.y + ::state::normal() * (lookup.z + (1.0 - factor)));
124
+ }
125
+
126
+ ::base::texture_coordinate_info vmat_transform(
127
+ float2 translation = float2(0.0, 0.0),
128
+ float rotation = 0.0, // rotation in degrees
129
+ float2 scaling = float2(1.0, 1.0),
130
+ uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw,
131
+ uniform int uv_space = 0
132
+ )
133
+ {
134
+ float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f;
135
+ float4x4 scale =
136
+ float4x4(1.0 /scaling.x, 0. , 0. , 0.,
137
+ 0. , 1.0 /scaling.y , 0. , 0.,
138
+ 0. , 0. , 1.0, 0.,
139
+ translation.x , translation.y , 0.0, 1.);
140
+
141
+ float s = ::math::sin(rotation_rad);
142
+ float c = ::math::cos(rotation_rad);
143
+ float4x4 rotate =
144
+ float4x4( c , -s , 0.0 , 0.0,
145
+ s , c , 0.0 , 0.0,
146
+ 0.0, 0.0 , 1.0 , 0.0,
147
+ 0. , 0.0 , 0.0 , 1.);
148
+
149
+ return transform_coordinate_2(scale*rotate, ::base::coordinate_source(system, uv_space));
150
+ }
151
+
152
+
153
+ export material Small_Cobblestone(
154
+ float brightness = .65f [[
155
+ ::anno::description("Adjusts the general brightness of the material."),
156
+ ::anno::display_name("Brightness"),
157
+ ::anno::in_group("Appearance"),
158
+ ::anno::hard_range(0.f, 1.f),
159
+ ::anno::ui_order(0)
160
+ ]],
161
+ float bricks_roughness = .8f [[
162
+ ::anno::description("Adjusts the roughness of the paving blocks."),
163
+ ::anno::display_name("Paving Blocks Roughness"),
164
+ ::anno::in_group("Appearance"),
165
+ ::anno::hard_range(0.f, 1.f),
166
+ ::anno::ui_order(1)
167
+ ]],
168
+ float water_height = 0.f [[
169
+ ::anno::description("Raise the level of water surrounding the bricks."),
170
+ ::anno::display_name("Water Level"),
171
+ ::anno::in_group("Appearance", "Water"),
172
+ ::anno::hard_range(0.f, 1.f),
173
+ ::anno::ui_order(2)
174
+ ]],
175
+ float water_transition_softness = 0.f [[
176
+ ::anno::description("Adjusts the softness of the transition from dry material to water. A softer transition will show areas, where the material gets moist first before being submerged in water."),
177
+ ::anno::display_name("Water Transition Softness"),
178
+ ::anno::in_group("Appearance", "Water"),
179
+ ::anno::hard_range(0.f, 1.f),
180
+ ::anno::ui_order(3)
181
+ ]],
182
+ float bump_strength = 1.f [[
183
+ ::anno::description("Specifies the strength of the bump, lowering this value males the surface appear flat."),
184
+ ::anno::display_name("Bump Strength"),
185
+ ::anno::in_group("Appearance"),
186
+ ::anno::hard_range(0.f, 1.f),
187
+ ::anno::ui_order(4)
188
+ ]],
189
+ float2 texture_translate = 0.f [[
190
+ ::anno::description("Controls the position of the texture."),
191
+ ::anno::display_name("Translate"),
192
+ ::anno::in_group("Transform"),
193
+ ::anno::ui_order(5)
194
+ ]],
195
+ float texture_rotate = 0.f [[
196
+ ::anno::description("Rotates angle of the texture in degrees."),
197
+ ::anno::display_name("Rotate"),
198
+ ::anno::in_group("Transform"),
199
+ ::anno::soft_range(0.f, 360.f),
200
+ ::anno::ui_order(6)
201
+ ]],
202
+ float2 texture_scale = 1.f [[
203
+ ::anno::description("Larger numbers increase the size."),
204
+ ::anno::display_name("Scale"),
205
+ ::anno::in_group("Transform"),
206
+ ::nvidia::core_definitions::dimension(float2(.3f, .3f)),
207
+ ::anno::ui_order(7)
208
+ ]],
209
+ uniform int uv_space_index_1 = 0 [[
210
+ ::anno::description("Use selected UV space for material."),
211
+ ::anno::display_name("UV Space Index"),
212
+ ::anno::in_group("Advanced"),
213
+ ::anno::ui_order(8)
214
+ ]])
215
+ [[
216
+ ::anno::description(DESCRIPTION),
217
+ ::anno::display_name("Small Cobblestone"),
218
+ ::anno::copyright_notice(COPYRIGHT),
219
+ ::anno::key_words(string[]("dielectric", "stone", "nature", "weathered", "water", "exterior", "rough", "urban", "city", "bright", "shiny", "paving", "level", "cobblestone", "small", "rock", "yellow", "brown", "grey")),
220
+ ::anno::thumbnail("./.thumbs/Small_Cobblestone.Small_Cobblestone.png"),
221
+ ::anno::author("Nvidia vMaterials"),
222
+ ::anno::contributor("Maik Rohland"),
223
+ ::anno::contributor("Ruediger Raab")
224
+ ]]
225
+ =
226
+ let {
227
+ bool tmp0 = false;
228
+ material_surface tmp1(::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, ::math::lerp(1.f, histogram_scan_big(::math::pow(float3(::base::file_texture(texture_2d("./cobblestone_tiny_multi.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_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 3.30900025f), 0.971000075f, 0.506000042f), ::math::smoothstep(::math::lerp(0.359999985f, 1.f, water_height) * 0.98999995f - (water_transition_softness * 0.859999955f + 0.00999999978f), ::math::lerp(0.359999985f, 1.f, water_height) * 0.98999995f + (water_transition_softness * 0.859999955f + 0.00999999978f), float3(::base::file_texture(texture_2d("./cobblestone_tiny_multi.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_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2])), ::df::microfacet_ggx_vcavities_bsdf(::math::lerp(0.f, ::math::lerp(histogram_range(float3(::base::file_texture(texture_2d("./cobblestone_tiny_multi.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_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, 0.855000019f), histogram_range(float3(::base::file_texture(texture_2d("./cobblestone_tiny_multi.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_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.408000022f, bricks_roughness * 0.519999981f + 0.479999989f), ::base::file_texture(texture_2d("./cobblestone_tiny_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono), ::math::smoothstep(::math::lerp(0.359999985f, 1.f, water_height) * 0.98999995f - (water_transition_softness * 0.859999955f + 0.00999999978f), ::math::lerp(0.359999985f, 1.f, water_height) * 0.98999995f + (water_transition_softness * 0.859999955f + 0.00999999978f), float3(::base::file_texture(texture_2d("./cobblestone_tiny_multi.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_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2])) * ::math::lerp(0.f, ::math::lerp(histogram_range(float3(::base::file_texture(texture_2d("./cobblestone_tiny_multi.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_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, 0.855000019f), histogram_range(float3(::base::file_texture(texture_2d("./cobblestone_tiny_multi.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_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.408000022f, bricks_roughness * 0.519999981f + 0.479999989f), ::base::file_texture(texture_2d("./cobblestone_tiny_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono), ::math::smoothstep(::math::lerp(0.359999985f, 1.f, water_height) * 0.98999995f - (water_transition_softness * 0.859999955f + 0.00999999978f), ::math::lerp(0.359999985f, 1.f, water_height) * 0.98999995f + (water_transition_softness * 0.859999955f + 0.00999999978f), float3(::base::file_texture(texture_2d("./cobblestone_tiny_multi.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_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2])), ::math::lerp(0.f, ::math::lerp(histogram_range(float3(::base::file_texture(texture_2d("./cobblestone_tiny_multi.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_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, 0.855000019f), histogram_range(float3(::base::file_texture(texture_2d("./cobblestone_tiny_multi.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_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.408000022f, bricks_roughness * 0.519999981f + 0.479999989f), ::base::file_texture(texture_2d("./cobblestone_tiny_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono), ::math::smoothstep(::math::lerp(0.359999985f, 1.f, water_height) * 0.98999995f - (water_transition_softness * 0.859999955f + 0.00999999978f), ::math::lerp(0.359999985f, 1.f, water_height) * 0.98999995f + (water_transition_softness * 0.859999955f + 0.00999999978f), float3(::base::file_texture(texture_2d("./cobblestone_tiny_multi.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_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2])) * ::math::lerp(0.f, ::math::lerp(histogram_range(float3(::base::file_texture(texture_2d("./cobblestone_tiny_multi.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_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, 0.855000019f), histogram_range(float3(::base::file_texture(texture_2d("./cobblestone_tiny_multi.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_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.408000022f, bricks_roughness * 0.519999981f + 0.479999989f), ::base::file_texture(texture_2d("./cobblestone_tiny_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono), ::math::smoothstep(::math::lerp(0.359999985f, 1.f, water_height) * 0.98999995f - (water_transition_softness * 0.859999955f + 0.00999999978f), ::math::lerp(0.359999985f, 1.f, water_height) * 0.98999995f + (water_transition_softness * 0.859999955f + 0.00999999978f), float3(::base::file_texture(texture_2d("./cobblestone_tiny_multi.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_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2])), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(::base::file_texture(texture_2d("./cobblestone_tiny_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), ::math::lerp(color(0.507079005f, 0.507079005f, 0.507079005f), color(1.f, 1.f, 1.f), ::math::smoothstep(::math::lerp(0.359999985f, 1.f, water_height) * 0.98999995f - (water_transition_softness * 0.859999955f + 0.00999999978f), ::math::lerp(0.359999985f, 1.f, water_height) * 0.98999995f + (water_transition_softness * 0.859999955f + 0.00999999978f), float3(::base::file_texture(texture_2d("./cobblestone_tiny_multi.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_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2])), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, color(0.f, 0.f, 0.f), ::base::color_layer_multiply, ::math::lerp(0.620000005f, -0.239999995f, brightness)).tint, color(0.284646988f, 0.245784f, 0.231759995f), ::base::color_layer_screen, ::math::smoothstep(::math::lerp(0.359999985f, 1.f, water_height) * 0.98999995f - (water_transition_softness * 0.859999955f + 0.00999999978f), ::math::lerp(0.359999985f, 1.f, water_height) * 0.98999995f + (water_transition_softness * 0.859999955f + 0.00999999978f), float3(::base::file_texture(texture_2d("./cobblestone_tiny_multi.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_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2]) * (1.f - ::base::file_texture(texture_2d("./cobblestone_tiny_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono) * 0.f).tint, 0.f), ::state::normal()), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
229
+ material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
230
+ color tmp3 = color(1.f, 1.f, 1.f);
231
+ material_geometry tmp5(float3(0.f), 1.f, normalmap_normal(texture_2d("./cobblestone_tiny_norm.jpg", ::tex::gamma_linear), ::math::lerp(0.f, bump_strength * 2.f, ::math::smoothstep(::math::lerp(0.359999985f, 1.f, water_height) * 0.98999995f - (water_transition_softness * 0.859999955f + 0.00999999978f), ::math::lerp(0.359999985f, 1.f, water_height) * 0.98999995f + (water_transition_softness * 0.859999955f + 0.00999999978f), float3(::base::file_texture(texture_2d("./cobblestone_tiny_multi.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_1), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2])), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index_1)));
232
+ } in
233
+ material(
234
+ thin_walled: tmp0,
235
+ surface: tmp1,
236
+ backface: tmp2,
237
+ ior: tmp3,
238
+ geometry: tmp5);
239
+
240
+
241
+ export material Small_Cobblestone_Bright(*)
242
+ [[
243
+ ::anno::display_name("Small Cobblestone Bright"),
244
+ ::anno::description(DESCRIPTION),
245
+ ::anno::copyright_notice(COPYRIGHT),
246
+ ::anno::key_words(string[]("dielectric", "stone", "nature", "weathered", "water", "exterior", "rough", "urban", "city", "bright", "shiny", "paving", "level" , "cobblestone", "small", "rock", "yellow", "brown", "grey")),
247
+ ::anno::thumbnail("./.thumbs/Small_Cobblestone.Small_Cobblestone_Bright.png"),
248
+ ::anno::author("NVIDIA vMaterials"),
249
+ ::anno::contributor("Maik Rohland"),
250
+ ::anno::contributor("Ruediger Raab")
251
+ ]]
252
+ = Small_Cobblestone
253
+ (
254
+ brightness: 1.f,
255
+ bricks_roughness: .2f,
256
+ water_height: 0.f,
257
+ water_transition_softness: 0.f,
258
+ bump_strength: 1.f,
259
+ texture_translate: 0.0f,
260
+ texture_rotate: 0.f,
261
+ texture_scale: 1.0f,
262
+ uv_space_index_1: 0
263
+ );
264
+
265
+ export material Small_Cobblestone_Wet_Grouts(*)
266
+ [[
267
+ ::anno::display_name("Small Cobblestone Wet Grouts"),
268
+ ::anno::description(DESCRIPTION),
269
+ ::anno::copyright_notice(COPYRIGHT),
270
+ ::anno::key_words(string[]("dielectric", "stone", "nature", "weathered", "water", "exterior", "rough", "urban", "city", "bright", "shiny", "paving", "level", "wet", "grouts", "cobblestone", "small", "rock", "yellow", "brown", "grey")),
271
+ ::anno::thumbnail("./.thumbs/Small_Cobblestone.Small_Cobblestone_Wet_Grouts.png"),
272
+ ::anno::author("NVIDIA vMaterials"),
273
+ ::anno::contributor("Maik Rohland"),
274
+ ::anno::contributor("Ruediger Raab")
275
+ ]]
276
+ = Small_Cobblestone
277
+ (
278
+ brightness: 1.f,
279
+ bricks_roughness: .2f,
280
+ water_height: .35f,
281
+ water_transition_softness: 0.f,
282
+ bump_strength: 1.f,
283
+ texture_translate: 0.0f,
284
+ texture_rotate: 0.f,
285
+ texture_scale: 1.0f,
286
+ uv_space_index_1: 0
287
+ );
288
+
289
+ export material Small_Cobblestone_Flooded_Grouts(*)
290
+ [[
291
+ ::anno::display_name("Small Cobblestones Flooded Grouts"),
292
+ ::anno::description(DESCRIPTION),
293
+ ::anno::copyright_notice(COPYRIGHT),
294
+ ::anno::key_words(string[]("dielectric", "stone", "nature", "weathered", "water", "exterior", "rough", "urban", "city", "bright", "shiny", "paving", "level", "wet", "grouts", "cobblestone", "flooded", "small", "rock", "yellow", "brown", "grey")),
295
+ ::anno::thumbnail("./.thumbs/Small_Cobblestone.Small_Cobblestone_Flooded_Grouts.png"),
296
+ ::anno::author("NVIDIA vMaterials"),
297
+ ::anno::contributor("Maik Rohland"),
298
+ ::anno::contributor("Ruediger Raab")
299
+ ]]
300
+ = Small_Cobblestone
301
+ (
302
+ brightness: 1.f,
303
+ bricks_roughness: .2f,
304
+ water_height: .75f,
305
+ water_transition_softness: 0.2f,
306
+ bump_strength: 1.f,
307
+ texture_translate: 0.0f,
308
+ texture_rotate: 0.f,
309
+ texture_scale: 1.0f,
310
+ uv_space_index_1: 0
311
+ );
312
+
313
+ export material Small_Cobblestone_Water_Flooded(*)
314
+ [[
315
+ ::anno::display_name("Small Cobblestone Water Flooded"),
316
+ ::anno::description(DESCRIPTION),
317
+ ::anno::copyright_notice(COPYRIGHT),
318
+ ::anno::key_words(string[]("dielectric", "stone", "nature", "weathered", "water", "exterior", "rough", "urban", "city", "bright", "shiny", "paving", "level", "wet", "grouts", "cobblestone", "flooded", "water", "small", "rock", "yellow", "brown", "grey")),
319
+ ::anno::thumbnail("./.thumbs/Small_Cobblestone.Small_Cobblestone_Water_Flooded.png"),
320
+ ::anno::author("NVIDIA vMaterials"),
321
+ ::anno::contributor("Maik Rohland"),
322
+ ::anno::contributor("Ruediger Raab")
323
+ ]]
324
+ = Small_Cobblestone
325
+ (
326
+ brightness: 1.f,
327
+ bricks_roughness: 0.f,
328
+ water_height: 1.f,
329
+ water_transition_softness: 0.3f,
330
+ bump_strength: 1.f,
331
+ texture_translate: 0.0f,
332
+ texture_rotate: 0.f,
333
+ texture_scale: 1.0f,
334
+ uv_space_index_1: 0
335
+ );
Material/material_0370/Pull_Up_Leather.mdl ADDED
@@ -0,0 +1,1727 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2024 NVIDIA Corporation. All rights reserved. *
3
+ ******************************************************************************
4
+
5
+ Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge,
6
+ to any person obtaining a copy of the sample definition code that uses our
7
+ Material Definition Language (the "MDL Materials"), to reproduce and distribute
8
+ the MDL Materials, including without limitation the rights to use, copy, merge,
9
+ publish, distribute, and sell modified and unmodified copies of the MDL
10
+ Materials, and to permit persons to whom the MDL Materials is furnished to do
11
+ so, in all cases solely for use with NVIDIA's Material Definition Language,
12
+ subject to the following further conditions:
13
+
14
+ 1. The above copyright notices, this list of conditions, and the disclaimer
15
+ that follows shall be retained in all copies of one or more of the MDL
16
+ Materials, including in any software with which the MDL Materials are bundled,
17
+ redistributed, and/or sold, and included either as stand-alone text files,
18
+ human-readable headers or in the appropriate machine-readable metadata fields
19
+ within text or binary files as long as those fields can be easily viewed by the
20
+ user, as applicable.
21
+ 2. The name of NVIDIA shall not be used to promote, endorse or advertise any
22
+ Modified Version without specific prior written permission, except a) to comply
23
+ with the notice requirements otherwise contained herein; or b) to acknowledge
24
+ the contribution(s) of NVIDIA.
25
+
26
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
27
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
28
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
29
+ TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR
30
+ ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL,
31
+ INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF
32
+ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE
33
+ THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.
34
+ */
35
+
36
+
37
+ mdl 1.5;
38
+
39
+ import ::anno::*;
40
+ import ::base::*;
41
+ import ::df::*;
42
+ import ::math::*;
43
+ import ::state::*;
44
+ import ::tex::*;
45
+ import ::nvidia::core_definitions::blend_colors;
46
+ import ::nvidia::core_definitions::dimension;
47
+
48
+
49
+ const string COPYRIGHT =
50
+ " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
51
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
52
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
53
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
54
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
55
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
56
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
57
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
58
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
59
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
60
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
61
+
62
+ const string DESCRIPTION = "A pull up leather material";
63
+ const string DESCRIPTION_PUNCHED = "A pull up leather material with punched holes. Various shapes for the punching such as circles, lines, rectangles and squares can be chosen.";
64
+
65
+ annotation preview_scale( float f);
66
+
67
+
68
+ // returns the min-max coordinates of a 2x2 atlas tile
69
+ float4 tile_select_2x2(uniform int select = 0)
70
+ {
71
+ switch(select)
72
+ {
73
+ case 2: return float4(0.0f, 0.5f, 0.0f, 0.5f);
74
+ case 3: return float4(0.5f, 1.0f, 0.0f, 0.5f);
75
+ case 0: return float4(0.0f, 0.5f, 0.5f, 1.0f);
76
+ case 1: return float4(0.5f, 1.0f, 0.5f, 1.0f);
77
+
78
+ default: return float4(0.0f, 0.5f, 0.0f, 0.5f);
79
+ }
80
+ }
81
+
82
+
83
+ export struct vm_coordinates
84
+ [[
85
+ ::anno::hidden()
86
+ ]]
87
+ {
88
+ float2 uv;
89
+ float rotation;
90
+ int uv_space_index;
91
+ float4 carry;
92
+ };
93
+
94
+ enum vm_mono_select
95
+ [[
96
+ anno::description("Modes for the creation of a gray-scale value from a color."),
97
+ anno::hidden()
98
+ ]]
99
+ {
100
+ mono_r = 0,
101
+ mono_g = 1,
102
+ mono_b = 2,
103
+ mono_a = 3,
104
+ mono_average = 4
105
+ };
106
+
107
+ vm_coordinates vm_coord
108
+ (
109
+ float2 translation = float2(0.0f, 0.0) [[
110
+ ::anno::display_name("Translation"),
111
+ ::anno::description("Translates the coordinates.")
112
+ ]],
113
+ float rotation = 0.0f [[
114
+ ::anno::display_name("Rotation"),
115
+ ::anno::description("Rotates the coordinates in degrees.")
116
+ ]],
117
+ float2 scaling = float2(1.0f, 1.0f) [[
118
+ ::anno::display_name("Scaling"),
119
+ ::anno::description("Scales the coordinates.")
120
+ ]],
121
+ uniform int uv_space = 0 [[
122
+ ::anno::display_name("UV Space"),
123
+ ::anno::description("Choose the UV space.")
124
+ ]]
125
+ )
126
+ [[
127
+ ::anno::display_name("vm Transform"),
128
+ ::anno::description("Generates coordinates to be used in vm_lookup functions.")
129
+ ]]
130
+ {
131
+ vm_coordinates uv;
132
+ ::base::texture_coordinate_info info = ::base::coordinate_source( ::base::texture_coordinate_uvw, uv_space);
133
+ uv.rotation = (rotation * 3.1415926535897932384626433832f) / 180.f;
134
+ uv.uv = float2(info.position.x, info.position.y);
135
+ float sine = ::math::sin(uv.rotation);
136
+ float cosine = ::math::cos(uv.rotation);
137
+ float2x2 rot = float2x2(cosine, -sine, sine, cosine);
138
+ uv.uv = rot * uv.uv;
139
+ uv.uv /= scaling;
140
+ uv.uv += translation;
141
+ return uv;
142
+ }
143
+
144
+
145
+ vm_coordinates vm_coord_hex(
146
+ vm_coordinates uv,
147
+ float scale = 1.0f,
148
+ float rotation = 45.0f
149
+
150
+ //,float2 rot_center=0.5f
151
+ )
152
+ {
153
+ vm_coordinates uv_return;
154
+ float2 uv_ = float2(uv.uv.x, uv.uv.y);
155
+ float rot_rad = (rotation * 3.1415926535897932384626433832f) / 180.f;
156
+
157
+ float sine = ::math::sin(rot_rad);
158
+ float cosine = ::math::cos(rot_rad);
159
+ float2x2 rot = float2x2(cosine, -sine, sine, cosine);
160
+
161
+ // same as from function get_hex above
162
+ float2 s = float2(1.0f, 1.7320508f);
163
+ float2 n = uv_ - float2(0.5f, 1.0f);
164
+ float4 c = ::math::floor(float4(uv_.x, uv_.y, n.x, n.y)/float4(s.x, s.y, s.x, s.y)) + 0.5f;
165
+ float2 h_1 = uv_ - float2(c.x, c.y) * s;
166
+ float2 h_2 = uv_ - (float2(c.z, c.w) + 0.5f) * s;
167
+ float4 uv_id = ::math::dot(h_1, h_1) < ::math::dot(h_2, h_2) ? float4(h_1.x, h_1.y, c.x, c.y) : float4(h_2.x, h_2.y, c.z, c.w);
168
+
169
+ float2 id_xy = float2(uv_id.x, uv_id.y);
170
+
171
+ //uv_return.uv = float2(id_xy.x*scale+.5f, id_xy.y*scale+.5f);
172
+ uv_return.uv = rot*float2(id_xy.x*scale, id_xy.y*scale);
173
+ uv_return.uv += 0.5f;
174
+
175
+
176
+ // unless we introduce random cell rotations where we need to compensate for this in the rotation
177
+ // we can just plain copy the rotation value
178
+ uv_return.rotation = uv.rotation + rot_rad;
179
+ return uv_return;
180
+ }
181
+
182
+ // Offsets a set of uv coordinates in either row (u) or column (v) direction
183
+ vm_coordinates vm_coord_rowcol_offset(
184
+ vm_coordinates uv,
185
+ float offset,
186
+ bool horizontal_offset = true
187
+ )
188
+ {
189
+ int index = horizontal_offset ? 0 : 1;
190
+ uv.uv[index] += ::math::floor(uv.uv[index ^ 1]) * offset;
191
+ return uv;
192
+ }
193
+
194
+ vm_coordinates vm_coord_grid(
195
+ vm_coordinates uv,
196
+ float scale = 1.0f,
197
+ float rotation = 45.0f
198
+ )
199
+ {
200
+ float rot_rad = (rotation * 3.1415926535897932384626433832f) / 180.f;
201
+ float sine = ::math::sin(rot_rad);
202
+ float cosine = ::math::cos(rot_rad);
203
+ float2x2 rot = float2x2(cosine, -sine, sine, cosine);
204
+
205
+ float2x2 scal = float2x2(scale, 0., 0., scale);
206
+ uv.uv = ::math::frac(uv.uv);
207
+ uv.uv -= 0.5f;
208
+ uv.uv = rot*(scal * uv.uv);
209
+ uv.uv = uv.uv + 0.5f;
210
+ uv.rotation += rot_rad;
211
+ return uv;
212
+ }
213
+
214
+ ::base::texture_return vm_tex_lookup(
215
+ uniform texture_2d tex,
216
+ vm_coordinates uv = vm_coord(),
217
+ uniform vm_mono_select mono_source = mono_a,
218
+ float4 scale = float4(1.0f),
219
+
220
+ uniform ::tex::wrap_mode wrap_u = ::tex::wrap_repeat,
221
+ uniform ::tex::wrap_mode wrap_v = ::tex::wrap_repeat,
222
+ uniform float2 crop_u = float2(0.0, 1.0),
223
+ uniform float2 crop_v = float2(0.0, 1.0)
224
+ )
225
+ {
226
+ float mono;
227
+ float4 lookup = ::tex::lookup_float4(tex, uv.uv, wrap_u, wrap_v, crop_u, crop_v) * scale;
228
+ switch( mono_source ) {
229
+ case mono_r: mono = lookup.x;
230
+ break;
231
+ case mono_g: mono = lookup.y;
232
+ break;
233
+ case mono_b: mono = lookup.z;
234
+ break;
235
+ case mono_a: mono = lookup.w;
236
+ break;
237
+ case mono_average: mono = ::math::average(float3(lookup.x, lookup.y, lookup.z));
238
+ break;
239
+ }
240
+ return ::base::texture_return(color(lookup.x, lookup.y, lookup.z), mono);
241
+ }
242
+
243
+ // *** SET CUTOUT ENUM NAMES ***
244
+ export enum cutout_pattern
245
+ [[
246
+ ::anno::description("Cutout Pattern"),
247
+ ::anno::hidden()
248
+ ]]
249
+ {
250
+ pattern_circle = 0
251
+ [[ ::anno::display_name("Circle")]],
252
+ pattern_hexagon = 1
253
+ [[ ::anno::display_name("Square")]],
254
+ pattern_line = 2
255
+ [[ ::anno::display_name("Line") ]],
256
+
257
+ pattern_square = 3
258
+ [[ ::anno::display_name("Rectangle")]]
259
+ };
260
+
261
+ float3 srgb2rgb(float3 val)
262
+ {
263
+ return ::math::pow(::math::max(val, float3(0.0f)), 2.2);
264
+ }
265
+
266
+ float3 rgb2srgb(float3 val) [[ ::anno::unused() ]] {
267
+ return ::math::pow( ::math::max(val, float3(0.f)), float3(1./2.2) );
268
+
269
+ }
270
+ int lowbias32(int x)
271
+ {
272
+ x ^= x >>> 16;
273
+ x *= 0x7feb352d;
274
+ x ^= x >>> 15;
275
+ x *= 0x846ca68b;
276
+ x ^= x >>> 16;
277
+ return x;
278
+ }
279
+
280
+ float uint2float(int x)
281
+ {
282
+ return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0);
283
+ }
284
+
285
+ float2 rnd22(int2 p) {
286
+ float2 ret_val = float2(
287
+ uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f,
288
+ uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f
289
+ );
290
+ return ret_val;
291
+ }
292
+
293
+ float2x2 invert_2x2(float2x2 M)
294
+ {
295
+ float det = M[0][0]*M[1][1] - M[0][1]*M[1][0];
296
+ //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/
297
+ return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]);
298
+ }
299
+
300
+ float3 nonrepeat_lookup(
301
+ uniform texture_2d texture = texture_2d(),
302
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
303
+ float texture_scale = 1.0,
304
+ float3 average_color = float3(0.5),
305
+ float patch_size = 8.0
306
+ )
307
+ {
308
+
309
+ float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale;
310
+ float Z = patch_size; // patch scale inside example texture
311
+ float CON = 1.0f;
312
+
313
+ float3 O = float3(0.f);
314
+ float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f);
315
+ float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space
316
+
317
+ float2 U = uv_in;
318
+ float2 V = M * uv_in; //pre-tilted hexa coordinates
319
+ int2 I = int2(::math::floor(V)); // hexa-tile id
320
+
321
+ // The mean color needs to be determined in Photoshop then to make the
322
+ // average color work out, take the float value and calculate the apropriate
323
+ // mean value as (value^(1/2.2))
324
+
325
+ float3 m = average_color;
326
+
327
+ float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W;
328
+ F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates
329
+
330
+ if( F[2] > 0.f )
331
+
332
+ O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON))
333
+ + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON))
334
+ + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON));
335
+ else
336
+ O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON))
337
+ + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON))
338
+ + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON));
339
+ O = m + O/::math::length(W);
340
+ O = ::math::clamp( (O), 0.0, 1.0);
341
+
342
+ return float3(O);
343
+ }
344
+
345
+ float3 endless_normal(
346
+ uniform texture_2d texture = texture_2d(),
347
+ float factor = 1.0,
348
+ bool flip_tangent_u = false,
349
+ bool flip_tangent_v = false,
350
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
351
+ float texture_scale = 1.0,
352
+ float3 average_color = float3(0.5, 0.5, 1.0),
353
+ float patch_size = 8.0
354
+ //bool srgb2rgb = false,
355
+ //bool rgb2srgb = false
356
+ )
357
+ {
358
+ float3 transformed_tangent_u = flip_tangent_u ? uvw.tangent_u : - uvw.tangent_u;
359
+ float3 transformed_tangent_v = flip_tangent_v ? uvw.tangent_v : - uvw.tangent_v;
360
+
361
+ if (flip_tangent_u)
362
+ transformed_tangent_u=-transformed_tangent_u;
363
+ if (flip_tangent_v)
364
+ transformed_tangent_v=-transformed_tangent_v;
365
+
366
+ // normalized Lookup
367
+ float3 tangent_space_normal =
368
+ (nonrepeat_lookup (
369
+ texture: texture,
370
+ uvw: uvw,
371
+ texture_scale: texture_scale,
372
+ average_color: average_color,
373
+ patch_size: patch_size
374
+ ) - 0.5) * (2.0 * factor);
375
+
376
+
377
+ return ::math::normalize(uvw.tangent_u * tangent_space_normal.x +
378
+ uvw.tangent_v * tangent_space_normal.y +
379
+ ::state::normal()*1.0);
380
+ //return ::state::normal();
381
+ }
382
+
383
+ color endless_texture(
384
+ uniform texture_2d texture = texture_2d(),
385
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
386
+ float texture_scale = 10.0,
387
+ float3 average_color = float3(0.5, 0.5, 1.0),
388
+ float patch_size = 8.0,
389
+ bool gamma_correct_lookup = true
390
+ )
391
+
392
+
393
+ {
394
+ return gamma_correct_lookup ? color(srgb2rgb(
395
+ nonrepeat_lookup (
396
+ texture: texture,
397
+ uvw: uvw,
398
+ texture_scale: texture_scale,
399
+ average_color: average_color,
400
+ patch_size: patch_size
401
+ ))
402
+ ) : color(nonrepeat_lookup (
403
+ texture: texture,
404
+ uvw: uvw,
405
+ texture_scale: texture_scale,
406
+ average_color: average_color,
407
+ patch_size: patch_size
408
+ ));
409
+ }
410
+
411
+
412
+ float histogram_range(float input, float range = 1.0f, float position = 0.5f)
413
+ {
414
+ float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0);
415
+ float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0);
416
+ return ::math::lerp(low, high, input);
417
+ }
418
+
419
+ float remap_xy_to_0_1(float input, float x, float y)
420
+ {
421
+ return (input - x)/(y - x);
422
+ }
423
+
424
+ float histogram_scan_big(float input, float width, float position)
425
+ {
426
+ return ::math::clamp(
427
+ remap_xy_to_0_1(input,
428
+ ::math::lerp(-width, 1.0, position),
429
+ ::math::lerp(0.0, 1.0 + width, position)),
430
+ 0.0,
431
+ 1.0);
432
+ }
433
+
434
+
435
+
436
+ float3 normalmap_normal(
437
+ uniform texture_2d texture,
438
+ float factor = 1.0,
439
+ ::base::texture_coordinate_info uvw = ::base::texture_coordinate_info()
440
+ )
441
+ {
442
+ float3 lookup = (::tex::lookup_float3(texture, float2(uvw.position.x, uvw.position.y)) - float3(0.5)) * (factor * 2.0);
443
+ return ::math::normalize(uvw.tangent_u * lookup.x + uvw.tangent_v * lookup.y + ::state::normal() * (lookup.z + (1.0 - factor)));
444
+ }
445
+
446
+ ::base::texture_coordinate_info transform_coordinate_2(
447
+ float4x4 transform
448
+ [[ ::anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix.") ]],
449
+ ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info()
450
+ [[ ::anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection.") ]]
451
+ ) [[
452
+ ::anno::description("Transform a texture coordinate by a matrix.") ,
453
+ ::anno::noinline()
454
+ ]]
455
+ {
456
+ // Version 2
457
+ float4 r_position = transform * float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1);
458
+ //Try aproximating it for the case that the rotation is only aroud z and assuming the texture layout is nice and z is ~constant.
459
+ //just pretend there is no other rotation happening
460
+ //get rid of scaling and translation. Then extract fields where sin and cos would be in a simple 2d transform around z.
461
+ float4 u = transform[0];
462
+ float3 ru = ::math::normalize(float3(u.x,u.y,u.z));
463
+ float cos = ru.x;
464
+ float sin = -ru.y;
465
+
466
+ return ::base::texture_coordinate_info(
467
+ float3(r_position.x,r_position.y,r_position.z),
468
+ ::math::normalize(cos * coordinate.tangent_u - sin * coordinate.tangent_v),
469
+ ::math::normalize(cos * coordinate.tangent_v + sin * coordinate.tangent_u));
470
+ }
471
+
472
+
473
+ ::base::texture_coordinate_info vmat_transform(
474
+ float2 translation = float2(0.0, 0.0),
475
+ float rotation = 0.0, // rotation in degrees
476
+ float2 scaling = float2(1.0, 1.0),
477
+ uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw,
478
+ uniform int uv_space = 0
479
+ )
480
+ {
481
+ float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f;
482
+ float4x4 scale =
483
+ float4x4(1.0 /scaling.x, 0. , 0. , 0.,
484
+ 0. , 1.0 /scaling.y , 0. , 0.,
485
+ 0. , 0. , 1.0, 0.,
486
+ translation.x , translation.y , 0.0, 1.);
487
+
488
+ float s = ::math::sin(rotation_rad);
489
+ float c = ::math::cos(rotation_rad);
490
+ float4x4 rotate =
491
+ float4x4( c , -s , 0.0 , 0.0,
492
+ s , c , 0.0 , 0.0,
493
+ 0.0, 0.0 , 1.0 , 0.0,
494
+ 0. , 0.0 , 0.0 , 1.);
495
+
496
+ return transform_coordinate_2(scale*rotate, ::base::coordinate_source(system, uv_space));
497
+ }
498
+
499
+
500
+ export material Pull_Up_Leather(
501
+ uniform bool infinite_tiling = true [[
502
+ ::anno::description("Enables infinite tiling feature which removes repeating texture patterns. Note that depending on the material this feature changes the appearance of the material slightly."),
503
+ ::anno::display_name("Infinite Tiling"),
504
+ ::anno::in_group("Appearance")
505
+ ]],
506
+ float bump_strength = 0.7f [[
507
+ ::anno::description("Specifies the strength of the bump."),
508
+ ::anno::display_name("Bump Strength"),
509
+ ::anno::in_group("Appearance"),
510
+ ::anno::hard_range(0.f, 1.f)
511
+ ]],
512
+ color color_front = color(0.101f, 0.0658f, 0.0189f) [[
513
+ ::anno::description("Choose the color of the front side."),
514
+ ::anno::display_name("Color"),
515
+ ::anno::in_group("Appearance", "Front")
516
+ ]],
517
+ float diffuse_brightness_front = 0.400000006f [[
518
+ ::anno::description("Adjusts the lightness of the material."),
519
+ ::anno::display_name("Brightness Front"),
520
+ ::anno::in_group("Appearance", "Front"),
521
+ ::anno::hard_range(0.f, 1.f)
522
+ ]],
523
+ float reflection_roughness_front = 0.347000003f [[
524
+ ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."),
525
+ ::anno::display_name("Roughness Front"),
526
+ ::anno::in_group("Appearance", "Front"),
527
+ ::anno::hard_range(0.f, 1.f)
528
+ ]],
529
+ float imperfection_dust = 0.7f [[
530
+ ::anno::description("Adds specular variation to the roughness."),
531
+ ::anno::display_name("Imperfection Dust"),
532
+ ::anno::in_group("Appearance", "Front", "Imperfections"),
533
+ ::anno::hard_range(0.f, 1.f)
534
+ ]],
535
+ float imperfection_grunge = 0.3f [[
536
+ ::anno::description("Adds specular variation to the roughness."),
537
+ ::anno::display_name("Imperfection Grunge"),
538
+ ::anno::in_group("Appearance", "Front", "Imperfections"),
539
+ ::anno::hard_range(0.f, 1.f)
540
+ ]],
541
+ float imperfection_smudges = 0.5f [[
542
+ ::anno::description("Adds specular variation to the roughness."),
543
+ ::anno::display_name("Imperfection Smudges"),
544
+ ::anno::in_group("Appearance", "Front", "Imperfections"),
545
+ ::anno::hard_range(0.f, 1.f)
546
+ ]],
547
+ color color_back = color(0.106f, 0.0619f, 0.0127f) [[
548
+ ::anno::description("Choose the color of the back side."),
549
+ ::anno::display_name("Color Back"),
550
+ ::anno::in_group("Appearance", "Back")
551
+ ]],
552
+ float diffuse_brightness_back = 0.25f [[
553
+ ::anno::description("Adjusts the lightness of the material."),
554
+ ::anno::display_name("Brightness Back"),
555
+ ::anno::in_group("Appearance", "Back"),
556
+ ::anno::hard_range(0.f, 1.f)
557
+ ]],
558
+ float reflection_roughness_back = 0.25f [[
559
+ ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."),
560
+ ::anno::display_name("Roughness Back"),
561
+ ::anno::in_group("Appearance", "Back"),
562
+ ::anno::hard_range(0.f, 1.f)
563
+ ]],
564
+ uniform bool dirt_back_on_off = false [[
565
+ ::anno::description("Switch on and off the dirt layer on the backside."),
566
+ ::anno::display_name("Dirt Back"),
567
+ ::anno::in_group("Appearance", "Dirt")
568
+ ]],
569
+ color dirt_color = color(0.023f, 0.023f, 0.023f) [[
570
+ ::anno::description("Choose the color of the dirt layer."),
571
+ ::anno::display_name("Color"),
572
+ ::anno::in_group("Appearance", "Dirt")
573
+ ]],
574
+ float dirt_softness = 0.7f [[
575
+ ::anno::description("Adjust the transition between dirt and leather. From hard to soft."),
576
+ ::anno::display_name("Dirt Softness"),
577
+ ::anno::in_group("Appearance", "Dirt"),
578
+ ::anno::hard_range(0.f, 1.f)
579
+ ]],
580
+ float dirt_amount = 0.3f [[
581
+ ::anno::description("Adjust the intensity through position."),
582
+ ::anno::display_name("Dirt Amount"),
583
+ ::anno::in_group("Appearance", "Dirt"),
584
+ ::anno::hard_range(0.f, 1.f)
585
+ ]],
586
+ float2 texture_translate = 0.f [[
587
+ ::anno::description("Controls the position of the texture."),
588
+ ::anno::display_name("Translate"),
589
+ ::anno::in_group("Transform")
590
+ ]],
591
+ float texture_rotate = 0.f [[
592
+ ::anno::description("Rotates angle of the texture in degrees."),
593
+ ::anno::display_name("Rotate"),
594
+ ::anno::in_group("Transform")
595
+ ]],
596
+ float2 texture_scale = 1.0f [[
597
+ ::anno::description("Larger numbers increase the size."),
598
+ ::anno::display_name("Scale"),
599
+ ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)),
600
+ ::preview_scale(3.5f),
601
+ ::anno::in_group("Transform")
602
+ ]],
603
+ uniform bool round_corners = false [[
604
+ ::anno::description("Enables the round corner effect. Comes at a slight performance cost as additional raytracing calls are required to evaluate the round corner effect."),
605
+ ::anno::display_name("Round Corners"),
606
+ ::anno::in_group("Round Corners")
607
+ ]],
608
+ uniform float radius = 1.5f [[
609
+ ::anno::description("Radius of the rounded corners."),
610
+ ::anno::display_name("Radius mm"),
611
+ ::anno::in_group("Round Corners"),
612
+ ::anno::soft_range(0.f, 10.f)
613
+ ]],
614
+ uniform bool across_materials = true [[
615
+ ::anno::description("Applies the round corner effect across different materials when enabled."),
616
+ ::anno::display_name("Across Materials"),
617
+ ::anno::in_group("Round Corners")
618
+ ]],
619
+ uniform int uv_space_index = 0 [[
620
+ ::anno::description("Use selected UV space for material."),
621
+ ::anno::display_name("UV Space Index"),
622
+ ::anno::in_group("Advanced")
623
+ ]])
624
+ [[
625
+ ::anno::description(DESCRIPTION),
626
+ ::anno::display_name("Pull Up Leather - Dark Brown"),
627
+ ::anno::copyright_notice(COPYRIGHT),
628
+ ::anno::key_words(string[]("pull", "up", "leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "brown", "warm", "dark")),
629
+ ::anno::author("Nvidia vMaterials"),
630
+ ::anno::contributor("Maik Rohland"),
631
+ ::anno::contributor("Ruediger Raab"),
632
+ ::anno::thumbnail("./.thumbs/Pull_Up_Leather.Pull_Up_Leather.png")
633
+ ]]
634
+ =
635
+ let {
636
+ float2 texture_scale_rescaled = texture_scale / 8.0f;
637
+ bool tmp0 = true;
638
+ texture_2d rough_dirt_height_tex = texture_2d("./pullUp_leather_Front_multi_rough_dirt_height.jpg", ::tex::gamma_linear);
639
+ texture_2d dust_grunge_leather_tex = texture_2d("./multi_R_dust_G_grunge_B_leather.jpg", ::tex::gamma_linear);
640
+ texture_2d front_diff_lin_tex = texture_2d("./pullUp_leather_front_diff.jpg", ::tex::gamma_linear);
641
+ texture_2d front_diff_srgb_tex = texture_2d("./pullUp_leather_front_diff.jpg", ::tex::gamma_srgb);
642
+ texture_2d rough_height_tex = texture_2d("./pullUp_leather_back_multi_rough_pullUp_height.jpg", ::tex::gamma_linear);
643
+ texture_2d front_norm_tex = texture_2d("./pullUp_leather_front_norm.jpg", ::tex::gamma_linear);
644
+ texture_2d back_diff_lin_tex = texture_2d("./pullUp_leather_back_diff.jpg", ::tex::gamma_linear);
645
+ texture_2d back_diff_srgb_tex = texture_2d("./pullUp_leather_back_diff.jpg", ::tex::gamma_srgb);
646
+ texture_2d back_norm_tex = texture_2d("./pullUp_leather_back_norm.jpg", ::tex::gamma_linear);
647
+
648
+ material_surface tmp1(::df::weighted_layer(::math::pow(::math::lerp(0.f, 1.f, ::math::smoothstep(::math::lerp(1.f, 0.f, dirt_amount) - dirt_softness, ::math::lerp(1.f, 0.f, dirt_amount) + dirt_softness, float3(infinite_tiling ? endless_texture(rough_dirt_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.737999976f, 0.523999989f, 0.674000025f), 6.f, false) : ::base::file_texture(rough_dirt_height_tex, 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_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1])), 2.43300009f), ::df::diffuse_reflection_bsdf(dirt_color, 0.800000012f), ::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, histogram_scan_big(float3(infinite_tiling ? endless_texture(rough_dirt_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.737999976f, 0.523999989f, 0.674000025f), 6.f, false) : ::base::file_texture(rough_dirt_height_tex, 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_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.5f, 0.261000007f), ::df::microfacet_ggx_smith_bsdf(((float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, 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_rescaled, ::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.5f)[0] * imperfection_dust + histogram_range(float3(infinite_tiling ? endless_texture(rough_dirt_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.737999976f, 0.523999989f, 0.674000025f), 6.f, false) : ::base::file_texture(rough_dirt_height_tex, 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_rescaled, ::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.701000035f, ::math::lerp(0.25f, 0.75f, reflection_roughness_front)) + (float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, 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_rescaled, ::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.5f)[1] * imperfection_grunge + (float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, 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_rescaled, ::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.5f)[2] * imperfection_smudges) * ((float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, 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_rescaled, ::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.5f)[0] * imperfection_dust + histogram_range(float3(infinite_tiling ? endless_texture(rough_dirt_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.737999976f, 0.523999989f, 0.674000025f), 6.f, false) : ::base::file_texture(rough_dirt_height_tex, 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_rescaled, ::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.701000035f, ::math::lerp(0.25f, 0.75f, reflection_roughness_front)) + (float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, 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_rescaled, ::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.5f)[1] * imperfection_grunge + (float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, 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_rescaled, ::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.5f)[2] * imperfection_smudges), ((float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, 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_rescaled, ::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.5f)[0] * imperfection_dust + histogram_range(float3(infinite_tiling ? endless_texture(rough_dirt_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.737999976f, 0.523999989f, 0.674000025f), 6.f, false) : ::base::file_texture(rough_dirt_height_tex, 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_rescaled, ::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.701000035f, ::math::lerp(0.25f, 0.75f, reflection_roughness_front)) + (float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, 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_rescaled, ::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.5f)[1] * imperfection_grunge + (float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, 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_rescaled, ::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.5f)[2] * imperfection_smudges) * ((float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, 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_rescaled, ::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.5f)[0] * imperfection_dust + histogram_range(float3(infinite_tiling ? endless_texture(rough_dirt_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.737999976f, 0.523999989f, 0.674000025f), 6.f, false) : ::base::file_texture(rough_dirt_height_tex, 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_rescaled, ::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.701000035f, ::math::lerp(0.25f, 0.75f, reflection_roughness_front)) + (float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, 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_rescaled, ::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.5f)[1] * imperfection_grunge + (float3(infinite_tiling ? endless_texture(dust_grunge_leather_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(dust_grunge_leather_tex, 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_rescaled, ::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.5f)[2] * imperfection_smudges), 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(color_front, (infinite_tiling ? endless_texture(front_diff_lin_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.368000001f), 6.f, true) : ::base::file_texture(front_diff_srgb_tex, 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_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) * color(::math::lerp(0.f, 3.f, diffuse_brightness_front)), ::base::color_layer_overlay, histogram_range(float3(infinite_tiling ? endless_texture(rough_dirt_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.737999976f, 0.523999989f, 0.674000025f), 6.f, false) : ::base::file_texture(rough_dirt_height_tex, 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_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.796000063f, 0.784000039f)).tint, color(float3(infinite_tiling ? endless_texture(rough_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.776000023f, 0.5f, 0.824000001f), 6.f, false) : ::base::file_texture(rough_height_tex, 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_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), ::base::color_layer_spotlight, 0.5f).tint, 0.f), bsdf(), infinite_tiling ? endless_normal(front_norm_tex, ::math::lerp(0.f, 2.5f, bump_strength), false, false, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.505999982f, 0.513999999f, 0.99000001f), 6.f) : normalmap_normal(front_norm_tex, ::math::lerp(0.f, 2.5f, bump_strength), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index))), infinite_tiling ? endless_normal(front_norm_tex, ::math::lerp(0.f, 2.5f, bump_strength), false, false, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.505999982f, 0.513999999f, 0.99000001f), 6.f) : normalmap_normal(front_norm_tex, ::math::lerp(0.f, 2.5f, bump_strength), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index))), ::state::normal()), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
649
+ material_surface tmp2(dirt_back_on_off ? ::df::weighted_layer(::math::pow(::math::lerp(0.f, 1.f, ::math::smoothstep(::math::lerp(1.f, 0.f, dirt_amount) - dirt_softness, ::math::lerp(1.f, 0.f, dirt_amount) + dirt_softness, float3(infinite_tiling ? endless_texture(rough_dirt_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.737999976f, 0.523999989f, 0.674000025f), 6.f, false) : ::base::file_texture(rough_dirt_height_tex, 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_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1])), 2.43300009f), ::df::diffuse_reflection_bsdf(dirt_color, 0.800000012f), ::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, histogram_scan_big(float3(infinite_tiling ? endless_texture(rough_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.776000023f, 0.5f, 0.824000001f), 6.f, false) : ::base::file_texture(rough_height_tex, 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_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.421000034f, 0.625f), ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(infinite_tiling ? endless_texture(rough_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.776000023f, 0.5f, 0.824000001f), 6.f, false) : ::base::file_texture(rough_height_tex, 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_rescaled, ::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.337000012f, 0.559000015f, reflection_roughness_back)) * histogram_range(float3(infinite_tiling ? endless_texture(rough_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.776000023f, 0.5f, 0.824000001f), 6.f, false) : ::base::file_texture(rough_height_tex, 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_rescaled, ::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.337000012f, 0.559000015f, reflection_roughness_back)), histogram_range(float3(infinite_tiling ? endless_texture(rough_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.776000023f, 0.5f, 0.824000001f), 6.f, false) : ::base::file_texture(rough_height_tex, 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_rescaled, ::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.337000012f, 0.559000015f, reflection_roughness_back)) * histogram_range(float3(infinite_tiling ? endless_texture(rough_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.776000023f, 0.5f, 0.824000001f), 6.f, false) : ::base::file_texture(rough_height_tex, 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_rescaled, ::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.337000012f, 0.559000015f, reflection_roughness_back)), 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(color_back, (infinite_tiling ? endless_texture(back_diff_lin_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.307000011f), 6.f, true) : ::base::file_texture(back_diff_srgb_tex, 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_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) * color(::math::lerp(0.f, 2.f, diffuse_brightness_back)), ::base::color_layer_overlay, histogram_range(float3(infinite_tiling ? endless_texture(rough_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.776000023f, 0.5f, 0.824000001f), 6.f, false) : ::base::file_texture(rough_height_tex, 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_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 1.f, 0.754000008f)).tint, 0.f), bsdf(), infinite_tiling ? endless_normal(back_norm_tex, 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.512000024f, 0.513000011f, 0.994000018f), 6.f) : normalmap_normal(back_norm_tex, ::math::lerp(0.f, 2.5f, bump_strength), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index))), infinite_tiling ? endless_normal(back_norm_tex, 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.512000024f, 0.513000011f, 0.994000018f), 6.f) : normalmap_normal(back_norm_tex, ::math::lerp(0.f, 2.5f, bump_strength), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index))), ::state::normal()) : ::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, histogram_scan_big(float3(infinite_tiling ? endless_texture(rough_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.776000023f, 0.5f, 0.824000001f), 6.f, false) : ::base::file_texture(rough_height_tex, 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_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.421000034f, 0.625f), ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(infinite_tiling ? endless_texture(rough_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.776000023f, 0.5f, 0.824000001f), 6.f, false) : ::base::file_texture(rough_height_tex, 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_rescaled, ::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.337000012f, 0.559000015f, reflection_roughness_back)) * histogram_range(float3(infinite_tiling ? endless_texture(rough_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.776000023f, 0.5f, 0.824000001f), 6.f, false) : ::base::file_texture(rough_height_tex, 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_rescaled, ::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.337000012f, 0.559000015f, reflection_roughness_back)), histogram_range(float3(infinite_tiling ? endless_texture(rough_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.776000023f, 0.5f, 0.824000001f), 6.f, false) : ::base::file_texture(rough_height_tex, 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_rescaled, ::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.337000012f, 0.559000015f, reflection_roughness_back)) * histogram_range(float3(infinite_tiling ? endless_texture(rough_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.776000023f, 0.5f, 0.824000001f), 6.f, false) : ::base::file_texture(rough_height_tex, 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_rescaled, ::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.337000012f, 0.559000015f, reflection_roughness_back)), 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(color_back, (infinite_tiling ? endless_texture(back_diff_lin_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.307000011f), 6.f, true) : ::base::file_texture(back_diff_lin_tex, 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_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) * color(::math::lerp(0.f, 2.f, diffuse_brightness_back)), ::base::color_layer_overlay, histogram_range(float3(infinite_tiling ? endless_texture(rough_height_tex, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.776000023f, 0.5f, 0.824000001f), 6.f, false) : ::base::file_texture(rough_height_tex, 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_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 1.f, 0.754000008f)).tint, 0.f), bsdf(), infinite_tiling ? endless_normal(back_norm_tex, 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.512000024f, 0.513000011f, 0.994000018f), 6.f) : normalmap_normal(back_norm_tex, ::math::lerp(0.f, 2.5f, bump_strength), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index))), infinite_tiling ? endless_normal(back_norm_tex, 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 6.f, float3(0.512000024f, 0.513000011f, 0.994000018f), 6.f) : normalmap_normal(back_norm_tex, ::math::lerp(0.f, 2.5f, bump_strength), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index))), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
650
+ color tmp3 = color(1.f, 1.f, 1.f);
651
+ material_geometry tmp5(float3(0.f), 1.f, round_corners ? ::state::rounded_corner_normal(radius * 0.00100000005f, across_materials, 1.f) : ::state::normal());
652
+
653
+ } in
654
+ material(
655
+ thin_walled: tmp0,
656
+ surface: tmp1,
657
+ backface: tmp2,
658
+ ior: tmp3,
659
+ geometry: tmp5);
660
+
661
+ export material Pull_Up_Leather_Black(*)
662
+ [[
663
+ ::anno::description(DESCRIPTION),
664
+ ::anno::display_name("Pull Up Leather - Black"),
665
+ ::anno::copyright_notice(COPYRIGHT),
666
+ ::anno::key_words(string[]("leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "black", "dark", "neutral")),
667
+ ::anno::contributor("Maik Rohland"),
668
+ ::anno::contributor("Ruediger Raab"),
669
+ ::anno::author("NVIDIA vMaterials"),
670
+ ::anno::thumbnail("./.thumbs/Pull_Up_Leather.Pull_Up_Leather_Black.png")
671
+ ]]
672
+ = Pull_Up_Leather
673
+ (
674
+ infinite_tiling: true,
675
+ bump_strength: 0.7f,
676
+ color_front: color(0.021f, 0.021f, 0.021f),
677
+ diffuse_brightness_front: 0.3f,
678
+ reflection_roughness_front: 0.25f,
679
+ imperfection_dust: 0.455f,
680
+ imperfection_grunge: 0.062f,
681
+ imperfection_smudges: 0.406f,
682
+ color_back: color(0.0494f, 0.0494f, 0.0494f),
683
+ diffuse_brightness_back: 0.1f,
684
+ reflection_roughness_back: 0.8f,
685
+ dirt_back_on_off: true,
686
+ dirt_color: color(0.067725f, 0.067725f, 0.067725f),
687
+ dirt_softness: 0.8f,
688
+ dirt_amount: 0.3f,
689
+ texture_translate: 0.0f,
690
+ texture_rotate: 0.0f,
691
+ texture_scale: 1.0f,
692
+ round_corners: false,
693
+ radius: 1.5f,
694
+ across_materials: true,
695
+ uv_space_index: 0
696
+ );
697
+
698
+ export material Pull_Up_Leather_Violet(*)
699
+ [[
700
+ ::anno::description(DESCRIPTION),
701
+ ::anno::display_name("Pull Up Leather - Violet"),
702
+ ::anno::copyright_notice(COPYRIGHT),
703
+ ::anno::key_words(string[]("leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "violet", "cool", "cold", "dark")),
704
+ ::anno::contributor("Maik Rohland"),
705
+ ::anno::contributor("Ruediger Raab"),
706
+ ::anno::author("NVIDIA vMaterials"),
707
+ ::anno::thumbnail("./.thumbs/Pull_Up_Leather.Pull_Up_Leather_Violet.png")
708
+ ]]
709
+ = Pull_Up_Leather
710
+ (
711
+ infinite_tiling: true,
712
+ bump_strength: 0.7f,
713
+ color_front: color(0.0781f, 0.021f, 0.0461f),
714
+ diffuse_brightness_front: 0.3f,
715
+ reflection_roughness_front: 0.25f,
716
+ imperfection_dust: 0.455f,
717
+ imperfection_grunge: 0.062f,
718
+ imperfection_smudges: 0.406f,
719
+ color_back: color(0.223f,0.080f,0.069f),
720
+ diffuse_brightness_back: 0.1f,
721
+ reflection_roughness_back: 0.8f,
722
+ dirt_back_on_off: true,
723
+ dirt_color: color(0.034f, 0.055f, 0.082f),
724
+ dirt_softness: 0.8f,
725
+ dirt_amount: 0.3f,
726
+ texture_translate: 0.0f,
727
+ texture_rotate: 0.0f,
728
+ texture_scale: 1.0f,
729
+ round_corners: false,
730
+ radius: 1.5f,
731
+ across_materials: true,
732
+ uv_space_index: 0
733
+ );
734
+
735
+
736
+ export material Pull_Up_Leather_Blue(*)
737
+ [[
738
+ ::anno::description(DESCRIPTION),
739
+ ::anno::display_name("Pull Up Leather - Blue"),
740
+ ::anno::copyright_notice(COPYRIGHT),
741
+ ::anno::key_words(string[]("leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "blue", "dark", "cold", "cool")),
742
+ ::anno::contributor("Maik Rohland"),
743
+ ::anno::contributor("Ruediger Raab"),
744
+ ::anno::author("NVIDIA vMaterials"),
745
+ ::anno::thumbnail("./.thumbs/Pull_Up_Leather.Pull_Up_Leather_Blue.png")
746
+ ]]
747
+ = Pull_Up_Leather
748
+ (
749
+ infinite_tiling: true,
750
+ bump_strength: 0.7f,
751
+ color_front: color(0.017936f, 0.075926f ,0.119264f),
752
+ diffuse_brightness_front: 0.3f,
753
+ reflection_roughness_front: 0.3f,
754
+ imperfection_dust: 0.719f,
755
+ imperfection_grunge: 0.228f,
756
+ imperfection_smudges: 0.587f,
757
+ color_back: color(0.044553f,0.096266f,0.151058f),
758
+ diffuse_brightness_back: 0.125f,
759
+ reflection_roughness_back: 0.8f,
760
+ dirt_back_on_off: true,
761
+ dirt_color: color(0.013473f, 0.023104f, 0.035614f),
762
+ dirt_softness: 0.816f,
763
+ dirt_amount: 0.3f,
764
+ texture_translate: 0.0f,
765
+ texture_rotate: 0.0f,
766
+ texture_scale: 1.0f,
767
+ round_corners: false,
768
+ radius: 1.5f,
769
+ across_materials: true,
770
+ uv_space_index: 0
771
+ );
772
+
773
+ export material Pull_Up_Leather_Yellow(*)
774
+ [[
775
+ ::anno::description(DESCRIPTION),
776
+ ::anno::display_name("Pull Up Leather - Yellow"),
777
+ ::anno::copyright_notice(COPYRIGHT),
778
+ ::anno::key_words(string[]("leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "yellow", "mustard", "saturated", "warm")),
779
+ ::anno::contributor("Maik Rohland"),
780
+ ::anno::contributor("Ruediger Raab"),
781
+ ::anno::author("NVIDIA vMaterials"),
782
+ ::anno::thumbnail("./.thumbs/Pull_Up_Leather.Pull_Up_Leather_Yellow.png")
783
+ ]]
784
+ = Pull_Up_Leather
785
+ (
786
+ infinite_tiling: true,
787
+ bump_strength: 0.7f,
788
+ color_front: color(0.812241f, 0.638779f ,0.035614f),
789
+ diffuse_brightness_front: 0.1f,
790
+ reflection_roughness_front: 0.22,
791
+ imperfection_dust: 0.719f,
792
+ imperfection_grunge: 0.228f,
793
+ imperfection_smudges: 0.587f,
794
+ color_back: color(0.729919f,0.592438f,0.147998f),
795
+ diffuse_brightness_back: 0.125f,
796
+ reflection_roughness_back: 0.56f,
797
+ dirt_back_on_off: true,
798
+ dirt_color: color(0.680020f, 0.353741f, 0.039947f),
799
+ dirt_softness: 0.987f,
800
+ dirt_amount: 0.8f,
801
+ texture_translate: 0.0f,
802
+ texture_rotate: 0.0f,
803
+ texture_scale: 1.0f,
804
+ round_corners: false,
805
+ radius: 1.5f,
806
+ across_materials: true,
807
+ uv_space_index: 0
808
+ );
809
+
810
+ export material Pull_Up_Leather_Light_Brown(*)
811
+ [[
812
+ ::anno::description(DESCRIPTION),
813
+ ::anno::display_name("Pull Up Leather - Light Brown"),
814
+ ::anno::copyright_notice(COPYRIGHT),
815
+ ::anno::key_words(string[]("leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "warm", "light", "brown")),
816
+ ::anno::contributor("Maik Rohland"),
817
+ ::anno::contributor("Ruediger Raab"),
818
+ ::anno::author("NVIDIA vMaterials"),
819
+ ::anno::thumbnail("./.thumbs/Pull_Up_Leather.Pull_Up_Leather_Light_Brown.png")
820
+ ]]
821
+ = Pull_Up_Leather
822
+ (
823
+ infinite_tiling: true,
824
+ bump_strength: 0.7f,
825
+ color_front: color(0.541798f, 0.254916f ,0.011126f),
826
+ diffuse_brightness_front: 0.2f,
827
+ reflection_roughness_front: 0.22,
828
+ imperfection_dust: 0.719f,
829
+ imperfection_grunge: 0.228f,
830
+ imperfection_smudges: 0.587f,
831
+ color_back: color(0.302125f,0.147998f,0.024223f),
832
+ diffuse_brightness_back: 0.527f,
833
+ reflection_roughness_back: 0.7f,
834
+ dirt_back_on_off: true,
835
+ dirt_color: color(0.680020f, 0.353741f, 0.039947f),
836
+ dirt_softness: 0.987f,
837
+ dirt_amount: 0.125f,
838
+ texture_translate: 0.0f,
839
+ texture_rotate: 0.0f,
840
+ texture_scale: 1.0f,
841
+ round_corners: false,
842
+ radius: 1.5f,
843
+ across_materials: true,
844
+ uv_space_index: 0
845
+ );
846
+
847
+ export material Pull_Up_Leather_Dark_Brown(*)
848
+ [[
849
+ ::anno::description(DESCRIPTION),
850
+ ::anno::display_name("Pull Up Leather - Dark Brown"),
851
+ ::anno::copyright_notice(COPYRIGHT),
852
+ ::anno::key_words(string[]("leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "warm", "dark", "brown")),
853
+ ::anno::contributor("Maik Rohland"),
854
+ ::anno::contributor("Ruediger Raab"),
855
+ ::anno::author("NVIDIA vMaterials"),
856
+ ::anno::thumbnail("./.thumbs/Pull_Up_Leather.Pull_Up_Leather_Dark_Brown.png")
857
+ ]]
858
+ = Pull_Up_Leather
859
+ (
860
+ infinite_tiling: true,
861
+ bump_strength: 0.7f,
862
+ color_front: color(0.101f, 0.0461f, 0.0127f),
863
+ diffuse_brightness_front: 0.2f,
864
+ reflection_roughness_front: 0.22,
865
+ imperfection_dust: 0.719f,
866
+ imperfection_grunge: 0.228f,
867
+ imperfection_smudges: 0.587f,
868
+ color_back: color(0.128f, 0.0963f, 0.0546f),
869
+ diffuse_brightness_back: 0.2f,
870
+ reflection_roughness_back: 0.66f,
871
+ dirt_back_on_off: true,
872
+ dirt_color: color(0.108711f, 0.058187f, 0.017936f),
873
+ dirt_softness: 0.816f,
874
+ dirt_amount: 0.2f,
875
+ texture_translate: 0.0f,
876
+ texture_rotate: 0.0f,
877
+ texture_scale: 1.0f,
878
+ round_corners: false,
879
+ radius: 1.5f,
880
+ across_materials: true,
881
+ uv_space_index: 0
882
+ );
883
+
884
+ export material Pull_Up_Leather_Cognac(*)
885
+ [[
886
+ ::anno::description(DESCRIPTION),
887
+ ::anno::display_name("Pull Up Leather - Cognac"),
888
+ ::anno::copyright_notice(COPYRIGHT),
889
+ ::anno::key_words(string[]("leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "dark", "cognac", "brown", "warm")),
890
+ ::anno::contributor("Maik Rohland"),
891
+ ::anno::contributor("Ruediger Raab"),
892
+ ::anno::author("NVIDIA vMaterials"),
893
+ ::anno::thumbnail("./.thumbs/Pull_Up_Leather.Pull_Up_Leather_Cognac.png")
894
+ ]]
895
+ = Pull_Up_Leather
896
+ (
897
+ infinite_tiling: true,
898
+ bump_strength: 0.7f,
899
+ color_front: color(0.212f, 0.037f, 0.0199f),
900
+ diffuse_brightness_front: 0.2f,
901
+ reflection_roughness_front: 0.2,
902
+ imperfection_dust: 0.7f,
903
+ imperfection_grunge: 0.2f,
904
+ imperfection_smudges: 0.6f,
905
+ color_back: color(0.267f, 0.0939f, 0.0546f),
906
+ diffuse_brightness_back: 0.2f,
907
+ reflection_roughness_back: 0.7f,
908
+ dirt_back_on_off: true,
909
+ dirt_color: color(0.023104f, 0.023104f, 0.023104f),
910
+ dirt_softness: 0.8f,
911
+ dirt_amount: 0.25f,
912
+ texture_translate: 0.0f,
913
+ texture_rotate: 0.0f,
914
+ texture_scale: 1.0f,
915
+ round_corners: false,
916
+ radius: 1.5f,
917
+ across_materials: true,
918
+ uv_space_index: 0
919
+ );
920
+
921
+ export material Pull_Up_Leather_Red_Oak(*)
922
+ [[
923
+ ::anno::description(DESCRIPTION),
924
+ ::anno::display_name("Pull Up Leather - Red Oak"),
925
+ ::anno::copyright_notice(COPYRIGHT),
926
+ ::anno::key_words(string[]("leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "red", "warm")),
927
+ ::anno::contributor("Maik Rohland"),
928
+ ::anno::contributor("Ruediger Raab"),
929
+ ::anno::author("NVIDIA vMaterials"),
930
+ ::anno::thumbnail("./.thumbs/Pull_Up_Leather.Pull_Up_Leather_Red_Oak.png")
931
+ ]]
932
+ = Pull_Up_Leather
933
+ (
934
+ infinite_tiling: true,
935
+ bump_strength: 0.7f,
936
+ color_front: color(0.339223f, 0.071761f ,0.005522f),
937
+ diffuse_brightness_front: 0.2f,
938
+ reflection_roughness_front: 0.2,
939
+ imperfection_dust: 0.7f,
940
+ imperfection_grunge: 0.2f,
941
+ imperfection_smudges: 0.6f,
942
+ color_back: color(0.297653f,0.193972f,0.124741f),
943
+ diffuse_brightness_back: 0.7f,
944
+ reflection_roughness_back: 0.7f,
945
+ dirt_back_on_off: true,
946
+ dirt_color: color(0.481952f, 0.056374f, 0.012664f),
947
+ dirt_softness: 0.8f,
948
+ dirt_amount: 0.317f,
949
+ texture_translate: 0.0f,
950
+ texture_rotate: 0.0f,
951
+ texture_scale: 1.0f,
952
+ round_corners: false,
953
+ radius: 1.5f,
954
+ across_materials: true,
955
+ uv_space_index: 0
956
+ );
957
+
958
+ export material Pull_Up_Leather_Red_Wine(*)
959
+ [[
960
+ ::anno::description(DESCRIPTION),
961
+ ::anno::display_name("Pull Up Leather - Red Wine"),
962
+ ::anno::copyright_notice(COPYRIGHT),
963
+ ::anno::key_words(string[]("leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "red", "wine", "warm")),
964
+ ::anno::contributor("Maik Rohland"),
965
+ ::anno::contributor("Ruediger Raab"),
966
+ ::anno::author("NVIDIA vMaterials"),
967
+ ::anno::thumbnail("./.thumbs/Pull_Up_Leather.Pull_Up_Leather_Red_Wine.png")
968
+ ]]
969
+ = Pull_Up_Leather
970
+ (
971
+ infinite_tiling: true,
972
+ bump_strength: 0.7f,
973
+ color_front: color(0.167f, 0.0199f, 0.0135f),
974
+ diffuse_brightness_front: 0.125f,
975
+ reflection_roughness_front: 0.2,
976
+ imperfection_dust: 0.7f,
977
+ imperfection_grunge: 0.2f,
978
+ imperfection_smudges: 0.6f,
979
+ color_back: color(0.373615f,0.049433f,0.023104f),
980
+ diffuse_brightness_back: 0.2f,
981
+ reflection_roughness_back: 0.7f,
982
+ dirt_back_on_off: true,
983
+ dirt_color: color(0.275833f, 0.028991f, 0.016068f),
984
+ dirt_softness: 1.0f,
985
+ dirt_amount: 0.3f,
986
+ texture_translate: 0.0f,
987
+ texture_rotate: 0.0f,
988
+ texture_scale: 1.0f,
989
+ round_corners: false,
990
+ radius: 1.5f,
991
+ across_materials: true,
992
+ uv_space_index: 0
993
+ );
994
+
995
+
996
+ // ----------------- Punched Leather -----------------
997
+ export material Pull_Up_Leather_Punched(
998
+
999
+ // Leather parameters
1000
+ uniform bool infinite_tiling = true [[
1001
+ ::anno::description("Enables infinite tiling feature which removes repeating texture patterns. Note that depending on the material this feature changes the appearance of the material slightly."),
1002
+ ::anno::display_name("Infinite Tiling"),
1003
+ ::anno::in_group("Appearance")
1004
+ ]],
1005
+ float bump_strength = 0.7f [[
1006
+ ::anno::description("Specifies the strength of the bump."),
1007
+ ::anno::display_name("Bump Strength"),
1008
+ ::anno::in_group("Appearance"),
1009
+ ::anno::hard_range(0.f, 1.f)
1010
+ ]],
1011
+ color color_front = color(0.069727f, 0.046149f, 0.013473f) [[
1012
+ ::anno::description("Choose the color of the front side."),
1013
+ ::anno::display_name("Color"),
1014
+ ::anno::in_group("Appearance", "Front")
1015
+ ]],
1016
+ float diffuse_brightness_front = 0.40f [[
1017
+ ::anno::description("Adjusts the lightness of the material."),
1018
+ ::anno::display_name("Brightness Front"),
1019
+ ::anno::in_group("Appearance", "Front"),
1020
+ ::anno::hard_range(0.f, 1.f)
1021
+ ]],
1022
+ float reflection_roughness_front = 0.347f [[
1023
+ ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."),
1024
+ ::anno::display_name("Roughness Front"),
1025
+ ::anno::in_group("Appearance", "Front"),
1026
+ ::anno::hard_range(0.f, 1.f)
1027
+ ]],
1028
+ float imperfection_dust = 0.7f [[
1029
+ ::anno::description("Adds specular variation to the roughness."),
1030
+ ::anno::display_name("Imperfection Dust"),
1031
+ ::anno::in_group("Appearance", "Front", "Imperfections"),
1032
+ ::anno::hard_range(0.f, 1.f)
1033
+ ]],
1034
+ float imperfection_grunge = 0.3f [[
1035
+ ::anno::description("Adds specular variation to the roughness."),
1036
+ ::anno::display_name("Imperfection Grunge"),
1037
+ ::anno::in_group("Appearance", "Front", "Imperfections"),
1038
+ ::anno::hard_range(0.f, 1.f)
1039
+ ]],
1040
+ float imperfection_smudges = 0.5f [[
1041
+ ::anno::description("Adds specular variation to the roughness."),
1042
+ ::anno::display_name("Imperfection Smudges"),
1043
+ ::anno::in_group("Appearance", "Front", "Imperfections"),
1044
+ ::anno::hard_range(0.f, 1.f)
1045
+ ]],
1046
+ color color_back = color(0.072f, 0.043f, 0.009f) [[
1047
+ ::anno::description("Choose the color of the back side."),
1048
+ ::anno::display_name("Color Back"),
1049
+ ::anno::in_group("Appearance", "Back")
1050
+ ]],
1051
+ float diffuse_brightness_back = 0.25f [[
1052
+ ::anno::description("Adjusts the lightness of the material."),
1053
+ ::anno::display_name("Brightness Back"),
1054
+ ::anno::in_group("Appearance", "Back"),
1055
+ ::anno::hard_range(0.f, 1.f)
1056
+ ]],
1057
+ float reflection_roughness_back = 0.25f [[
1058
+ ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."),
1059
+ ::anno::display_name("Roughness Back"),
1060
+ ::anno::in_group("Appearance", "Back"),
1061
+ ::anno::hard_range(0.f, 1.f)
1062
+ ]],
1063
+ uniform bool dirt_back_on_off = false [[
1064
+ ::anno::description("Switch on and off the dirt layer on the backside."),
1065
+ ::anno::display_name("Dirt Back"),
1066
+ ::anno::in_group("Appearance", "Dirt")
1067
+ ]],
1068
+ color dirt_color = color(0.023f, 0.023f, 0.023f) [[
1069
+ ::anno::description("Choose the color of the dirt layer."),
1070
+ ::anno::display_name("Color"),
1071
+ ::anno::in_group("Appearance", "Dirt")
1072
+ ]],
1073
+ float dirt_softness = 0.7f [[
1074
+ ::anno::description("Adjust the transition between dirt and leather. From hard to soft."),
1075
+ ::anno::display_name("Dirt Softness"),
1076
+ ::anno::in_group("Appearance", "Dirt"),
1077
+ ::anno::hard_range(0.f, 1.f)
1078
+ ]],
1079
+ float dirt_amount = 0.3f [[
1080
+ ::anno::description("Adjust the intensity through position."),
1081
+ ::anno::display_name("Dirt Amount"),
1082
+ ::anno::in_group("Appearance", "Dirt"),
1083
+ ::anno::hard_range(0.f, 1.f)
1084
+ ]],
1085
+ float2 texture_translate = 0.f [[
1086
+ ::anno::description("Controls the position of the texture."),
1087
+ ::anno::display_name("Texture Translate"),
1088
+ ::anno::in_group("Transform")
1089
+ ]],
1090
+ float texture_rotate = 0.f [[
1091
+ ::anno::description("Rotates angle of the texture in degrees."),
1092
+ ::anno::display_name("Texture Rotate"),
1093
+ ::anno::in_group("Transform"),
1094
+ ::anno::soft_range(0.f, 360.f)
1095
+ ]],
1096
+ float2 texture_scale = 1.f [[
1097
+ ::anno::description("Larger numbers increase the size."),
1098
+ ::anno::display_name("Texture Scale"),
1099
+ ::anno::in_group("Transform"),
1100
+ ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)),
1101
+ ::preview_scale(3.5f),
1102
+ ::anno::ui_order(7)
1103
+ ]],
1104
+ uniform int uv_space_index = 0 [[
1105
+ ::anno::description("Uses selected UV space for material."),
1106
+ ::anno::display_name("UV Space Index"),
1107
+ ::anno::in_group("Transform")
1108
+ ]],
1109
+ // Punching parameters
1110
+ uniform cutout_pattern shape_select = pattern_circle //select atlas tile here
1111
+ [[
1112
+ ::anno::description("Select a cutout shape."),
1113
+ ::anno::display_name("Cutout Shape"),
1114
+ ::anno::in_group("Appearance", "Cutout"),
1115
+ ::anno::ui_order(9)
1116
+ ]],
1117
+ float punching_grid_size = 1.0f
1118
+ [[
1119
+ ::anno::description("Scales the size of the punching grid."),
1120
+ ::anno::display_name("Punching Grid Size"),
1121
+ ::anno::in_group("Appearance", "Cutout")
1122
+ ]],
1123
+ float cutout_rotation = 45.0f
1124
+ [[
1125
+ ::anno::description("Rotates the cutout shape."),
1126
+ ::anno::display_name("Cutout Rotation"),
1127
+ ::anno::hard_range(0.f, 360.0f),
1128
+ ::anno::soft_range(0.f, 360.0f),
1129
+ ::anno::in_group("Appearance", "Cutout")
1130
+ ]],
1131
+ float cutout_size = .4f
1132
+ [[
1133
+ ::anno::description("Scales the size of the cutout pattern independently from the base material."),
1134
+ ::anno::display_name("Cutout Size"),
1135
+ ::anno::hard_range(0.f, 1.2f),
1136
+ ::anno::soft_range(0.f, 1.0f),
1137
+ ::anno::in_group("Appearance", "Cutout")
1138
+ ]],
1139
+ float cutout_roundness = .5f
1140
+ [[
1141
+ ::anno::description("At low values it makes the cutouts sharper. Higher values give the shapes a more rounded look."),
1142
+ ::anno::display_name("Cutout Roundness"),
1143
+ ::anno::hard_range(0.f, 1.f),
1144
+ ::anno::in_group("Appearance", "Cutout")
1145
+ ]],
1146
+ float cutout_bump_strength = 1.0f
1147
+ [[
1148
+ ::anno::description("Sets the strength of the bevelled normal around the cutout."),
1149
+ ::anno::display_name("Cutout Bevel Strength"),
1150
+ ::anno::soft_range(0.0f, 1.0f),
1151
+ ::anno::hard_range(0.0f, 2.0f),
1152
+ ::anno::in_group("Appearance", "Cutout")
1153
+ ]],
1154
+ // Grid Layout parameters
1155
+ bool hexagonal_grid = true
1156
+ [[
1157
+ ::anno::description("When enabled, the punching will occur on a hexagonal grid, otherwise a square grid."),
1158
+ ::anno::display_name("Enable Hexagonal Grid"),
1159
+ ::anno::in_group("Appearance", "Cutout")
1160
+ ]],
1161
+ float square_grid_offset = 0.0f
1162
+ [[
1163
+ ::anno::description("Offsets each row of the grid by a certain amount. Applies only when hexagonal grid is disabled."),
1164
+ ::anno::display_name("Square Grid Offset"),
1165
+ ::anno::in_group("Appearance", "Cutout"),
1166
+ ::anno::enable_if("hexagonal_grid==false")
1167
+ ]],
1168
+ uniform bool round_corners = false [[
1169
+ ::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."),
1170
+ ::anno::display_name("Enable Round Corners"),
1171
+ ::anno::in_group("Round Corners")
1172
+ ]],
1173
+ uniform float radius = 1.5f [[
1174
+ ::anno::description("Radius of the rounded corners in millimeters."),
1175
+ ::anno::display_name("Round Corner Radius"),
1176
+ ::anno::in_group("Round Corners"),
1177
+ ::anno::enable_if("round_corners==true")
1178
+ ]],
1179
+ uniform bool across_materials = false [[
1180
+ ::anno::description("Applies the round corner effect across different materials when enabled."),
1181
+ ::anno::display_name("Across Materials"),
1182
+ ::anno::in_group("Round Corners"),
1183
+ ::anno::enable_if("round_corners==true")
1184
+ ]]
1185
+ )
1186
+ [[
1187
+ ::anno::description(DESCRIPTION_PUNCHED),
1188
+ ::anno::display_name("Pull Up Leather - Dark Brown Punched"),
1189
+ ::anno::copyright_notice(COPYRIGHT),
1190
+ ::anno::key_words(string[]("dielectric", "automotive", "punched", "design", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "black", "dark", "neutral")),
1191
+ ::anno::thumbnail("./.thumbs/Pull_Up_Leather.Pull_Up_Leather_Punched.png"),
1192
+ ::anno::author("Nvidia vMaterials"),
1193
+ ::anno::contributor("Maik Rohland"),
1194
+ ::anno::contributor("Ruediger Raab")
1195
+ ]] = let
1196
+ {
1197
+ bool horizontal_offset = true;
1198
+ float cutout_bevel_width = 0.7f;
1199
+ float cutout_bump_strength_2 = cutout_bump_strength * 5.0f;
1200
+
1201
+ material base_mat = Pull_Up_Leather(
1202
+ infinite_tiling: infinite_tiling,
1203
+ bump_strength: bump_strength,
1204
+ color_front: color_front,
1205
+ diffuse_brightness_front: diffuse_brightness_front,
1206
+ reflection_roughness_front: reflection_roughness_front,
1207
+ imperfection_dust: imperfection_dust,
1208
+ imperfection_grunge: imperfection_grunge,
1209
+ imperfection_smudges: imperfection_smudges,
1210
+ color_back: color_back,
1211
+ diffuse_brightness_back: diffuse_brightness_back,
1212
+ reflection_roughness_back: reflection_roughness_back,
1213
+ dirt_back_on_off: dirt_back_on_off,
1214
+ dirt_color: dirt_color,
1215
+ dirt_softness: dirt_softness,
1216
+ dirt_amount: dirt_amount,
1217
+ texture_translate: texture_translate,
1218
+ texture_rotate: texture_rotate,
1219
+ texture_scale: texture_scale,
1220
+ uv_space_index: uv_space_index,
1221
+ round_corners: round_corners,
1222
+ radius: radius,
1223
+ across_materials: across_materials
1224
+ );
1225
+
1226
+ // remap range of slider to avoid artifacts in the bevelling
1227
+ float2 punching_scale = texture_scale * 0.01f * float2(punching_grid_size);
1228
+ float cutout_roundness_ = cutout_roundness*0.6f+0.4f;
1229
+ float cutout_size_lin = (1.0f/cutout_size);
1230
+ texture_2d punching_cutout = texture_2d("./leather_punch_atlas_01.png", ::tex::gamma_linear);
1231
+
1232
+ vm_coordinates uv = vm_coord(
1233
+ translation: texture_translate,
1234
+ rotation: texture_rotate,
1235
+ scaling: punching_scale,
1236
+ uv_space: uv_space_index
1237
+ );
1238
+
1239
+ vm_coordinates punching_uv = hexagonal_grid ? vm_coord_hex(
1240
+ uv: uv,
1241
+ scale: cutout_roundness_ * cutout_size_lin,
1242
+ rotation: cutout_rotation
1243
+ ) : vm_coord_grid(
1244
+ uv: vm_coord_rowcol_offset(
1245
+ uv: uv,
1246
+ offset: square_grid_offset,
1247
+ horizontal_offset: horizontal_offset
1248
+ ),
1249
+ scale: cutout_roundness_ * cutout_size_lin,
1250
+ rotation: cutout_rotation
1251
+ );
1252
+ // select the correct subtile from the atlas
1253
+ float4 crop = tile_select_2x2(shape_select);
1254
+
1255
+ ::base::texture_return lookup = vm_tex_lookup(
1256
+ tex: punching_cutout,
1257
+ uv: punching_uv,
1258
+ mono_source: mono_a,
1259
+ scale: float4(1.0f),
1260
+ crop_u: float2(crop.x, crop.y),
1261
+ crop_v: float2(crop.z, crop.w),
1262
+ wrap_u: ::tex::wrap_clamp,
1263
+ wrap_v: ::tex::wrap_clamp
1264
+ );
1265
+
1266
+ float low = (1.0 - cutout_roundness_);
1267
+ float high = (cutout_size_lin * (cutout_bevel_width * 0.2f) * cutout_roundness_) + (1.0 - cutout_roundness_);
1268
+ // remap x...y to (clamped) 0...1
1269
+ float x = ::math::clamp((lookup.mono - low)/(high - low), 0.0, 1.0);
1270
+ // spherical falloff
1271
+ float falloff=::math::sqrt(1.0-x*x);
1272
+ // masking falloff as the center of the cutout is flat
1273
+ float masked_falloff=falloff<=0.0?1.0:falloff;
1274
+
1275
+ // where base material is still there, use the value of the base material
1276
+ float cutout= ::math::min(falloff<=0.0?0.0:1.0, base_mat.geometry.cutout_opacity);
1277
+
1278
+ // bring in -.5 ... +.5 range and lerp between lookup and flat normal
1279
+ float3 remap_norm = ::math::lerp(float3(lookup.tint), float3(0.5, 0.5, 1.0), masked_falloff) - float3(0.5);
1280
+ float3 t_norm = ::math::normalize(remap_norm * float3(cutout_bump_strength_2, cutout_bump_strength_2, 1.0));
1281
+
1282
+ float3 rotfix_norm = float3(::math::cos(punching_uv.rotation) * t_norm.x - ::math::sin(punching_uv.rotation) * t_norm.y,
1283
+ ::math::sin(punching_uv.rotation) * t_norm.x + ::math::cos(punching_uv.rotation) * t_norm.y,
1284
+ t_norm.z);
1285
+
1286
+ float3 normal = ::state::texture_tangent_u(punching_uv.uv_space_index) * rotfix_norm.x +
1287
+ ::state::texture_tangent_v(punching_uv.uv_space_index) * rotfix_norm.y +
1288
+ ::state::normal() * rotfix_norm.z;
1289
+
1290
+ float3 final_normal = ::base::blend_normals(
1291
+ base_normal: normal,
1292
+ base_normal_weight: 1.0f,
1293
+ detail_normal: base_mat.geometry.normal,
1294
+ detail_normal_weight: 1.0f
1295
+ );
1296
+
1297
+ } in material(
1298
+ surface: material_surface(
1299
+ scattering: base_mat.surface.scattering
1300
+ ),
1301
+ backface: material_surface(
1302
+ scattering: base_mat.backface.scattering
1303
+ ),
1304
+ volume: base_mat.volume,
1305
+ ior: base_mat.ior,
1306
+ thin_walled: true,
1307
+ geometry: material_geometry(
1308
+ displacement: base_mat.geometry.displacement,
1309
+ normal: final_normal,
1310
+ cutout_opacity: cutout
1311
+ )
1312
+ );
1313
+
1314
+
1315
+ export material Pull_Up_Leather_Black_Punched(*)
1316
+ [[
1317
+ ::anno::description(DESCRIPTION_PUNCHED),
1318
+ ::anno::display_name("Pull Up Leather - Black Punched"),
1319
+ ::anno::copyright_notice(COPYRIGHT),
1320
+ ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "black", "dark", "neutral")),
1321
+ ::anno::contributor("Maik Rohland"),
1322
+ ::anno::contributor("Ruediger Raab"),
1323
+ ::anno::author("NVIDIA vMaterials"),
1324
+ ::anno::thumbnail("./.thumbs/Pull_Up_Leather.Pull_Up_Leather_Black_Punched.png")
1325
+ ]]
1326
+ = Pull_Up_Leather_Punched
1327
+ (
1328
+ infinite_tiling: true,
1329
+ bump_strength: 0.7f,
1330
+ color_front: color(0.021f, 0.021f, 0.021f),
1331
+ diffuse_brightness_front: 0.3f,
1332
+ reflection_roughness_front: 0.25f,
1333
+ imperfection_dust: 0.455f,
1334
+ imperfection_grunge: 0.062f,
1335
+ imperfection_smudges: 0.406f,
1336
+ color_back: color(0.0494f, 0.0494f, 0.0494f),
1337
+ diffuse_brightness_back: 0.1f,
1338
+ reflection_roughness_back: 0.8f,
1339
+ dirt_back_on_off: true,
1340
+ dirt_color: color(0.067725f, 0.067725f, 0.067725f),
1341
+ dirt_softness: 0.8f,
1342
+ dirt_amount: 0.3f,
1343
+ texture_translate: 0.0f,
1344
+ texture_rotate: 0.0f,
1345
+ texture_scale: 1.0f,
1346
+ uv_space_index: 0,
1347
+
1348
+ shape_select: pattern_circle,
1349
+ punching_grid_size: 0.7f,
1350
+ cutout_size: 0.4f,
1351
+ cutout_roundness: 0.8f,
1352
+ cutout_bump_strength: 2.0f,
1353
+ hexagonal_grid: true,
1354
+ square_grid_offset: 0.0f,
1355
+
1356
+ round_corners: false,
1357
+ radius: 1.5f,
1358
+ across_materials: true
1359
+ );
1360
+
1361
+ export material Pull_Up_Leather_Violet_Punched(*)
1362
+ [[
1363
+ ::anno::description(DESCRIPTION_PUNCHED),
1364
+ ::anno::display_name("Pull Up Leather - Violet Punched"),
1365
+ ::anno::copyright_notice(COPYRIGHT),
1366
+ ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "violet", "cool", "cold", "dark")),
1367
+ ::anno::contributor("Maik Rohland"),
1368
+ ::anno::contributor("Ruediger Raab"),
1369
+ ::anno::author("NVIDIA vMaterials"),
1370
+ ::anno::thumbnail("./.thumbs/Pull_Up_Leather.Pull_Up_Leather_Violet_Punched.png")
1371
+ ]]
1372
+ = Pull_Up_Leather_Punched
1373
+ (
1374
+ infinite_tiling: true,
1375
+ bump_strength: 0.7f,
1376
+ color_front: color(0.0781f, 0.021f, 0.0461f),
1377
+ diffuse_brightness_front: 0.3f,
1378
+ reflection_roughness_front: 0.25f,
1379
+ imperfection_dust: 0.455f,
1380
+ imperfection_grunge: 0.062f,
1381
+ imperfection_smudges: 0.406f,
1382
+ color_back: color(0.223f,0.080f,0.069f),
1383
+ diffuse_brightness_back: 0.1f,
1384
+ reflection_roughness_back: 0.8f,
1385
+ dirt_back_on_off: true,
1386
+ dirt_color: color(0.034f, 0.055f, 0.082f),
1387
+ dirt_softness: 0.8f,
1388
+ dirt_amount: 0.3f,
1389
+ texture_translate: 0.0f,
1390
+ texture_rotate: 0.0f,
1391
+ texture_scale: 1.0f,
1392
+ uv_space_index: 0,
1393
+
1394
+ shape_select: pattern_circle,
1395
+ punching_grid_size: 0.7f,
1396
+ cutout_size: 0.4f,
1397
+ cutout_roundness: 0.8f,
1398
+ cutout_bump_strength: 2.0f,
1399
+ hexagonal_grid: true,
1400
+ square_grid_offset: 0.0f,
1401
+
1402
+ round_corners: false,
1403
+ radius: 1.5f,
1404
+ across_materials: true
1405
+ );
1406
+
1407
+ export material Pull_Up_Leather_Blue_Punched(*)
1408
+ [[
1409
+ ::anno::description(DESCRIPTION_PUNCHED),
1410
+ ::anno::display_name("Pull Up Leather - Blue Punched"),
1411
+ ::anno::copyright_notice(COPYRIGHT),
1412
+ ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "cold", "blue", "dark", "cold", "cool")),
1413
+ ::anno::contributor("Maik Rohland"),
1414
+ ::anno::contributor("Ruediger Raab"),
1415
+ ::anno::author("NVIDIA vMaterials"),
1416
+ ::anno::thumbnail("./.thumbs/Pull_Up_Leather.Pull_Up_Leather_Blue_Punched.png")
1417
+ ]]
1418
+ = Pull_Up_Leather_Punched
1419
+ (
1420
+ infinite_tiling: true,
1421
+ bump_strength: 0.7f,
1422
+ color_front: color(0.017936f, 0.075926f ,0.119264f),
1423
+ diffuse_brightness_front: 0.3f,
1424
+ reflection_roughness_front: 0.3f,
1425
+ imperfection_dust: 0.719f,
1426
+ imperfection_grunge: 0.228f,
1427
+ imperfection_smudges: 0.587f,
1428
+ color_back: color(0.044553f,0.096266f,0.151058f),
1429
+ diffuse_brightness_back: 0.125f,
1430
+ reflection_roughness_back: 0.8f,
1431
+ dirt_back_on_off: true,
1432
+ dirt_color: color(0.013473f, 0.023104f, 0.035614f),
1433
+ dirt_softness: 0.816f,
1434
+ dirt_amount: 0.3f,
1435
+ texture_translate: 0.0f,
1436
+ texture_rotate: 0.0f,
1437
+ texture_scale: 1.0f,
1438
+ uv_space_index: 0,
1439
+
1440
+ shape_select: pattern_circle,
1441
+ punching_grid_size: 0.7f,
1442
+ cutout_size: 0.4f,
1443
+ cutout_roundness: 0.8f,
1444
+ cutout_bump_strength: 2.0f,
1445
+ hexagonal_grid: true,
1446
+ square_grid_offset: 0.0f,
1447
+
1448
+ round_corners: false,
1449
+ radius: 1.5f,
1450
+ across_materials: true
1451
+ );
1452
+
1453
+ export material Pull_Up_Leather_Yellow_Punched(*)
1454
+ [[
1455
+ ::anno::description(DESCRIPTION_PUNCHED),
1456
+ ::anno::display_name("Pull Up Leather - Yellow Punched"),
1457
+ ::anno::copyright_notice(COPYRIGHT),
1458
+ ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "warm", "yellow", "mustard", "saturated")),
1459
+ ::anno::contributor("Maik Rohland"),
1460
+ ::anno::contributor("Ruediger Raab"),
1461
+ ::anno::author("NVIDIA vMaterials"),
1462
+ ::anno::thumbnail("./.thumbs/Pull_Up_Leather.Pull_Up_Leather_Yellow_Punched.png")
1463
+ ]]
1464
+ = Pull_Up_Leather_Punched
1465
+ (
1466
+ infinite_tiling: true,
1467
+ bump_strength: 0.7f,
1468
+ color_front: color(0.812241f, 0.638779f ,0.035614f),
1469
+ diffuse_brightness_front: 0.1f,
1470
+ reflection_roughness_front: 0.22,
1471
+ imperfection_dust: 0.719f,
1472
+ imperfection_grunge: 0.228f,
1473
+ imperfection_smudges: 0.587f,
1474
+ color_back: color(0.729919f,0.592438f,0.147998f),
1475
+ diffuse_brightness_back: 0.125f,
1476
+ reflection_roughness_back: 0.56f,
1477
+ dirt_back_on_off: true,
1478
+ dirt_color: color(0.680020f, 0.353741f, 0.039947f),
1479
+ dirt_softness: 0.987f,
1480
+ dirt_amount: 0.8f,
1481
+ texture_translate: 0.0f,
1482
+ texture_rotate: 0.0f,
1483
+ texture_scale: 1.0f,
1484
+ uv_space_index: 0,
1485
+
1486
+ shape_select: pattern_circle,
1487
+ punching_grid_size: 0.7f,
1488
+ cutout_size: 0.4f,
1489
+ cutout_roundness: 0.8f,
1490
+ cutout_bump_strength: 2.0f,
1491
+ hexagonal_grid: true,
1492
+ square_grid_offset: 0.0f,
1493
+
1494
+ round_corners: false,
1495
+ radius: 1.5f,
1496
+ across_materials: true
1497
+ );
1498
+
1499
+ export material Pull_Up_Leather_Light_Brown_Punched(*)
1500
+ [[
1501
+ ::anno::description(DESCRIPTION_PUNCHED),
1502
+ ::anno::display_name("Pull Up Leather - Light Brown Punched"),
1503
+ ::anno::copyright_notice(COPYRIGHT),
1504
+ ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "warm", "light", "brown")),
1505
+ ::anno::contributor("Maik Rohland"),
1506
+ ::anno::contributor("Ruediger Raab"),
1507
+ ::anno::author("NVIDIA vMaterials"),
1508
+ ::anno::thumbnail("./.thumbs/Pull_Up_Leather.Pull_Up_Leather_Light_Brown_Punched.png")
1509
+ ]]
1510
+ = Pull_Up_Leather_Punched
1511
+ (
1512
+ infinite_tiling: true,
1513
+ bump_strength: 0.7f,
1514
+ color_front: color(0.541798f, 0.254916f ,0.011126f),
1515
+ diffuse_brightness_front: 0.2f,
1516
+ reflection_roughness_front: 0.22,
1517
+ imperfection_dust: 0.719f,
1518
+ imperfection_grunge: 0.228f,
1519
+ imperfection_smudges: 0.587f,
1520
+ color_back: color(0.302125f,0.147998f,0.024223f),
1521
+ diffuse_brightness_back: 0.527f,
1522
+ reflection_roughness_back: 0.7f,
1523
+ dirt_back_on_off: true,
1524
+ dirt_color: color(0.680020f, 0.353741f, 0.039947f),
1525
+ dirt_softness: 0.987f,
1526
+ dirt_amount: 0.125f,
1527
+ texture_translate: 0.0f,
1528
+ texture_rotate: 0.0f,
1529
+ texture_scale: 1.0f,
1530
+ uv_space_index: 0,
1531
+
1532
+ shape_select: pattern_circle,
1533
+ punching_grid_size: 0.7f,
1534
+ cutout_size: 0.4f,
1535
+ cutout_roundness: 0.8f,
1536
+ cutout_bump_strength: 2.0f,
1537
+ hexagonal_grid: true,
1538
+ square_grid_offset: 0.0f,
1539
+
1540
+ round_corners: false,
1541
+ radius: 1.5f,
1542
+ across_materials: true
1543
+ );
1544
+
1545
+ export material Pull_Up_Leather_Dark_Brown_Punched(*)
1546
+ [[
1547
+ ::anno::description(DESCRIPTION_PUNCHED),
1548
+ ::anno::display_name("Pull Up Leather - Dark Brown Punched"),
1549
+ ::anno::copyright_notice(COPYRIGHT),
1550
+ ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "warm", "dark", "brown")),
1551
+ ::anno::contributor("Maik Rohland"),
1552
+ ::anno::contributor("Ruediger Raab"),
1553
+ ::anno::author("NVIDIA vMaterials"),
1554
+ ::anno::thumbnail("./.thumbs/Pull_Up_Leather.Pull_Up_Leather_Dark_Brown_Punched.png")
1555
+ ]]
1556
+ = Pull_Up_Leather_Punched
1557
+ (
1558
+ infinite_tiling: true,
1559
+ bump_strength: 0.7f,
1560
+ color_front: color(0.101f, 0.0461f, 0.0127f),
1561
+ diffuse_brightness_front: 0.2f,
1562
+ reflection_roughness_front: 0.22,
1563
+ imperfection_dust: 0.719f,
1564
+ imperfection_grunge: 0.228f,
1565
+ imperfection_smudges: 0.587f,
1566
+ color_back: color(0.128f, 0.0963f, 0.0546f),
1567
+ diffuse_brightness_back: 0.2f,
1568
+ reflection_roughness_back: 0.66f,
1569
+ dirt_back_on_off: true,
1570
+ dirt_color: color(0.108711f, 0.058187f, 0.017936f),
1571
+ dirt_softness: 0.816f,
1572
+ dirt_amount: 0.2f,
1573
+ texture_translate: 0.0f,
1574
+ texture_rotate: 0.0f,
1575
+ texture_scale: 1.0f,
1576
+ uv_space_index: 0,
1577
+
1578
+ shape_select: pattern_circle,
1579
+ punching_grid_size: 0.7f,
1580
+ cutout_size: 0.4f,
1581
+ cutout_roundness: 0.8f,
1582
+ cutout_bump_strength: 2.0f,
1583
+ hexagonal_grid: true,
1584
+ square_grid_offset: 0.0f,
1585
+
1586
+ round_corners: false,
1587
+ radius: 1.5f,
1588
+ across_materials: true
1589
+ );
1590
+
1591
+ export material Pull_Up_Leather_Cognac_Punched(*)
1592
+ [[
1593
+ ::anno::description(DESCRIPTION_PUNCHED),
1594
+ ::anno::display_name("Pull Up Leather - Cognac Punched"),
1595
+ ::anno::copyright_notice(COPYRIGHT),
1596
+ ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "warm", "dark", "cognac", "brown")),
1597
+ ::anno::contributor("Maik Rohland"),
1598
+ ::anno::contributor("Ruediger Raab"),
1599
+ ::anno::author("NVIDIA vMaterials"),
1600
+ ::anno::thumbnail("./.thumbs/Pull_Up_Leather.Pull_Up_Leather_Cognac_Punched.png")
1601
+ ]]
1602
+ = Pull_Up_Leather_Punched
1603
+ (
1604
+ infinite_tiling: true,
1605
+ bump_strength: 0.7f,
1606
+ color_front: color(0.212f, 0.037f, 0.0199f),
1607
+ diffuse_brightness_front: 0.2f,
1608
+ reflection_roughness_front: 0.2,
1609
+ imperfection_dust: 0.7f,
1610
+ imperfection_grunge: 0.2f,
1611
+ imperfection_smudges: 0.6f,
1612
+ color_back: color(0.267f, 0.0939f, 0.0546f),
1613
+ diffuse_brightness_back: 0.2f,
1614
+ reflection_roughness_back: 0.7f,
1615
+ dirt_back_on_off: true,
1616
+ dirt_color: color(0.023104f, 0.023104f, 0.023104f),
1617
+ dirt_softness: 0.8f,
1618
+ dirt_amount: 0.25f,
1619
+ texture_translate: 0.0f,
1620
+ texture_rotate: 0.0f,
1621
+ texture_scale: 1.0f,
1622
+ uv_space_index: 0,
1623
+
1624
+ shape_select: pattern_circle,
1625
+ punching_grid_size: 0.7f,
1626
+ cutout_size: 0.4f,
1627
+ cutout_roundness: 0.8f,
1628
+ cutout_bump_strength: 2.0f,
1629
+ hexagonal_grid: true,
1630
+ square_grid_offset: 0.0f,
1631
+
1632
+ round_corners: false,
1633
+ radius: 1.5f,
1634
+ across_materials: true
1635
+ );
1636
+
1637
+ export material Pull_Up_Leather_Red_Oak_Punched(*)
1638
+ [[
1639
+ ::anno::description(DESCRIPTION_PUNCHED),
1640
+ ::anno::display_name("Pull Up Leather - Red Oak Punched"),
1641
+ ::anno::copyright_notice(COPYRIGHT),
1642
+ ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "red", "warm")),
1643
+ ::anno::contributor("Maik Rohland"),
1644
+ ::anno::contributor("Ruediger Raab"),
1645
+ ::anno::author("NVIDIA vMaterials"),
1646
+ ::anno::thumbnail("./.thumbs/Pull_Up_Leather.Pull_Up_Leather_Red_Oak_Punched.png")
1647
+ ]]
1648
+ = Pull_Up_Leather_Punched
1649
+ (
1650
+ infinite_tiling: true,
1651
+ bump_strength: 0.7f,
1652
+ color_front: color(0.339223f, 0.071761f ,0.005522f),
1653
+ diffuse_brightness_front: 0.2f,
1654
+ reflection_roughness_front: 0.2,
1655
+ imperfection_dust: 0.7f,
1656
+ imperfection_grunge: 0.2f,
1657
+ imperfection_smudges: 0.6f,
1658
+ color_back: color(0.297653f,0.193972f,0.124741f),
1659
+ diffuse_brightness_back: 0.7f,
1660
+ reflection_roughness_back: 0.7f,
1661
+ dirt_back_on_off: true,
1662
+ dirt_color: color(0.481952f, 0.056374f, 0.012664f),
1663
+ dirt_softness: 0.8f,
1664
+ dirt_amount: 0.317f,
1665
+ texture_translate: 0.0f,
1666
+ texture_rotate: 0.0f,
1667
+ texture_scale: 1.0f,
1668
+ uv_space_index: 0,
1669
+
1670
+ shape_select: pattern_circle,
1671
+ punching_grid_size: 0.7f,
1672
+ cutout_size: 0.4f,
1673
+ cutout_roundness: 0.8f,
1674
+ cutout_bump_strength: 2.0f,
1675
+ hexagonal_grid: true,
1676
+ square_grid_offset: 0.0f,
1677
+
1678
+ round_corners: false,
1679
+ radius: 1.5f,
1680
+ across_materials: true
1681
+ );
1682
+
1683
+ export material Pull_Up_Leather_Red_Wine_Punched(*)
1684
+ [[
1685
+ ::anno::description(DESCRIPTION_PUNCHED),
1686
+ ::anno::display_name("Pull Up Leather - Red Wine Punched"),
1687
+ ::anno::copyright_notice(COPYRIGHT),
1688
+ ::anno::key_words(string[]("leather", "punched", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "red", "wine", "warm")),
1689
+ ::anno::contributor("Maik Rohland"),
1690
+ ::anno::contributor("Ruediger Raab"),
1691
+ ::anno::author("NVIDIA vMaterials"),
1692
+ ::anno::thumbnail("./.thumbs/Pull_Up_Leather.Pull_Up_Leather_Red_Wine_Punched.png")
1693
+ ]]
1694
+ = Pull_Up_Leather_Punched
1695
+ (
1696
+ infinite_tiling: true,
1697
+ bump_strength: 0.7f,
1698
+ color_front: color(0.167f, 0.0199f, 0.0135f),
1699
+ diffuse_brightness_front: 0.125f,
1700
+ reflection_roughness_front: 0.2,
1701
+ imperfection_dust: 0.7f,
1702
+ imperfection_grunge: 0.2f,
1703
+ imperfection_smudges: 0.6f,
1704
+ color_back: color(0.373615f,0.049433f,0.023104f),
1705
+ diffuse_brightness_back: 0.2f,
1706
+ reflection_roughness_back: 0.7f,
1707
+ dirt_back_on_off: true,
1708
+ dirt_color: color(0.275833f, 0.028991f, 0.016068f),
1709
+ dirt_softness: 1.0f,
1710
+ dirt_amount: 0.3f,
1711
+ texture_translate: 0.0f,
1712
+ texture_rotate: 0.0f,
1713
+ texture_scale: 1.0f,
1714
+ uv_space_index: 0,
1715
+
1716
+ shape_select: pattern_circle,
1717
+ punching_grid_size: 0.7f,
1718
+ cutout_size: 0.4f,
1719
+ cutout_roundness: 0.8f,
1720
+ cutout_bump_strength: 2.0f,
1721
+ hexagonal_grid: true,
1722
+ square_grid_offset: 0.0f,
1723
+
1724
+ round_corners: false,
1725
+ radius: 1.5f,
1726
+ across_materials: true
1727
+ );
Material/material_0380/Aluminum_Foil.mdl ADDED
@@ -0,0 +1,501 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 = "Metal foil material with additional controls for wrinkling the material";
62
+
63
+ float remap_xy_to_0_1(float input, float x, float y)
64
+ {
65
+ return (input - x)/(y - x);
66
+ }
67
+
68
+ float histogram_scan_big(float input, float width, float position)
69
+ {
70
+ return ::math::clamp(
71
+ remap_xy_to_0_1(input,
72
+ ::math::lerp(-width, 1.0, position),
73
+ ::math::lerp(0.0, 1.0 + width, position)),
74
+ 0.0,
75
+ 1.0);
76
+ }
77
+
78
+ ::base::texture_coordinate_info vmat_transform(
79
+ uniform float2 translation = float2(0.0, 0.0),
80
+ uniform float rotation = 0.0,
81
+ uniform float2 scaling = float2(1.0, 1.0),
82
+ uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw,
83
+ uniform int uv_space = 0
84
+ )
85
+ {
86
+ float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f;
87
+
88
+ float4x4 scale =
89
+ float4x4(1.0 /scaling.x, 0. , 0. , 0.,
90
+ 0. , 1.0 /scaling.y , 0. , 0.,
91
+ 0. , 0. , 1.0, 0.,
92
+ translation.x , translation.y , 0.0, 1.);
93
+
94
+ float s = ::math::sin(rotation_rad);
95
+ float c = ::math::cos(rotation_rad);
96
+ float4x4 rotate =
97
+ float4x4( c , -s , 0.0 , 0.0,
98
+ s , c , 0.0 , 0.0,
99
+ 0.0, 0.0 , 1.0 , 0.0,
100
+ 0. , 0.0 , 0.0 , 1.);
101
+
102
+ return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space));
103
+ }
104
+
105
+ float histogram_range(float input, float range, float position)
106
+ {
107
+ float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0);
108
+ float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0);
109
+ return ::math::lerp(low, high, input);
110
+ }
111
+
112
+ float uint2float(int x)
113
+ {
114
+ return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0);
115
+ }
116
+
117
+ int lowbias32(int x)
118
+ {
119
+ x ^= x >>> 16;
120
+ x *= 0x7feb352d;
121
+ x ^= x >>> 15;
122
+ x *= 0x846ca68b;
123
+ x ^= x >>> 16;
124
+ return x;
125
+ }
126
+
127
+ float2 rnd22(int2 p) {
128
+ float2 ret_val = float2(
129
+ uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f,
130
+ uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f
131
+ );
132
+ return ret_val;
133
+ }
134
+
135
+ float3 srgb2rgb(float3 val)
136
+ {
137
+ return ::math::pow(::math::max(val, float3(0.0f)), 2.2);
138
+ }
139
+
140
+ float2x2 invert_2x2(float2x2 M)
141
+ {
142
+ float det = M[0][0]*M[1][1] - M[0][1]*M[1][0];
143
+ //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/
144
+ return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]);
145
+ }
146
+
147
+ float3 nonrepeat_lookup(
148
+ uniform texture_2d texture = texture_2d(),
149
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
150
+ float texture_scale = 1.0,
151
+ float3 average_color = float3(0.5),
152
+ float patch_size = 8.0
153
+ )
154
+ {
155
+
156
+ float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale;
157
+ float Z = patch_size; // patch scale inside example texture
158
+ float CON = 1.0f;
159
+
160
+ float3 O = float3(0.f);
161
+ float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f);
162
+ float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space
163
+
164
+ float2 U = uv_in;
165
+ float2 V = M * uv_in; //pre-tilted hexa coordinates
166
+ int2 I = int2(::math::floor(V)); // hexa-tile id
167
+
168
+ // The mean color needs to be determined in Photoshop then to make the
169
+ // average color work out, take the float value and calculate the apropriate
170
+ // mean value as (value^(1/2.2))
171
+
172
+ float3 m = average_color;
173
+
174
+ float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W;
175
+ F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates
176
+
177
+ if( F[2] > 0.f )
178
+
179
+ O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON))
180
+ + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON))
181
+ + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON));
182
+ else
183
+ O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON))
184
+ + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON))
185
+ + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON));
186
+ O = m + O/::math::length(W);
187
+ O = ::math::clamp( (O), 0.0, 1.0);
188
+
189
+ return float3(O);
190
+ }
191
+
192
+ color endless_texture(
193
+ uniform texture_2d texture = texture_2d(),
194
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
195
+ float texture_scale = 10.0,
196
+ float3 average_color = float3(0.5, 0.5, 1.0),
197
+ float patch_size = 8.0,
198
+ bool gamma_correct_lookup = true
199
+ )
200
+ {
201
+ return gamma_correct_lookup ? color(srgb2rgb(
202
+ nonrepeat_lookup (
203
+ texture: texture,
204
+ uvw: uvw,
205
+ texture_scale: texture_scale,
206
+ average_color: average_color,
207
+ patch_size: patch_size
208
+ ))
209
+ ) : color(nonrepeat_lookup (
210
+ texture: texture,
211
+ uvw: uvw,
212
+ texture_scale: texture_scale,
213
+ average_color: average_color,
214
+ patch_size: patch_size
215
+ ));
216
+ }
217
+
218
+ float3 endless_normal(
219
+ uniform texture_2d texture = texture_2d(),
220
+ float factor = 1.0,
221
+ bool flip_tangent_u = false,
222
+ bool flip_tangent_v = false,
223
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
224
+ float texture_scale = 1.0,
225
+ float3 average_color = float3(0.5, 0.5, 1.0),
226
+ float patch_size = 8.0
227
+ )
228
+ {
229
+ float3 transformed_tangent_u = flip_tangent_u ? uvw.tangent_u : - uvw.tangent_u;
230
+ float3 transformed_tangent_v = flip_tangent_v ? uvw.tangent_v : - uvw.tangent_v;
231
+
232
+ if (flip_tangent_u)
233
+ transformed_tangent_u=-transformed_tangent_u;
234
+ if (flip_tangent_v)
235
+ transformed_tangent_v=-transformed_tangent_v;
236
+
237
+ // normalized Lookup
238
+ float3 tangent_space_normal =
239
+ (nonrepeat_lookup (
240
+ texture: texture,
241
+ uvw: uvw,
242
+ texture_scale: texture_scale,
243
+ average_color: average_color,
244
+ patch_size: patch_size
245
+ ) - 0.5) * (2.0 * factor);
246
+
247
+ return ::math::normalize(uvw.tangent_u * tangent_space_normal.x +
248
+ uvw.tangent_v * tangent_space_normal.y +
249
+ ::state::normal()*1.0);
250
+ }
251
+
252
+ export material Aluminum_Foil(
253
+ uniform bool infinite_tiling = true [[
254
+ ::anno::description("Enables infinite tiling feature which removes repeating texture patterns. Note that depending on the material this feature changes the appearance of the material slightly."),
255
+ ::anno::display_name("Infinite Tiling"),
256
+ ::anno::in_group("Infinite Tiing")
257
+ ]],
258
+ float brightness = 1.f [[
259
+ ::anno::description("Ajusts the total reflectivity of the metal."),
260
+ ::anno::display_name("Brightness"),
261
+ ::anno::hard_range(0.f, 1.f),
262
+ ::anno::in_group("Appearance")
263
+ ]],
264
+ float roughness = 0.15f [[
265
+ ::anno::display_name("Roughness"),
266
+ ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."),
267
+ ::anno::hard_range(0.f, 1.f),
268
+ ::anno::in_group("Appearance")
269
+ ]],
270
+ float roughness_variation = 0.564f [[
271
+ ::anno::description("Amount of variation applied to the roughness, higher numbers add more non uniform appearance to the reflectivity of the material."),
272
+ ::anno::display_name("Roughness Variation"),
273
+ ::anno::hard_range(0.f, 1.f),
274
+ ::anno::in_group("Appearance")
275
+ ]],
276
+ float smudges = 0.35f [[
277
+ ::anno::description("Adds blurrier reflections that show smudges on the surface."),
278
+ ::anno::display_name("Smudges"),
279
+ ::anno::hard_range(0.f, 1.f),
280
+ ::anno::in_group("Appearance")
281
+ ]],
282
+ uniform float bump_strength = 0.05f [[
283
+ ::anno::description("Specifies the strength of the bump."),
284
+ ::anno::display_name("Bump Strength"),
285
+ ::anno::hard_range(0.f, 1.f),
286
+ ::anno::in_group("Appearance")
287
+ ]],
288
+ uniform float2 texture_translate = 0.f [[
289
+ ::anno::description("Controls the position of the texture."),
290
+ ::anno::display_name("Texture Translate"),
291
+ ::anno::in_group("Transform")
292
+ ]],
293
+ uniform float texture_rotate = 0.0f [[
294
+ ::anno::description("Rotates angle of the texture in degrees."),
295
+ ::anno::display_name("Texture Rotate"),
296
+ ::anno::in_group("Transform")
297
+ ]],
298
+ uniform float2 texture_scale = 1.f [[
299
+ ::anno::description("Larger numbers increase the size."),
300
+ ::anno::display_name("Texture Scale"),
301
+ ::anno::in_group("Transform"),
302
+ ::nvidia::core_definitions::dimension(float2(.25f, .25f))
303
+ ]],
304
+ uniform int uv_space_index = 0 [[
305
+ ::anno::display_name("UV Space Index"),
306
+ ::anno::in_group("Transform")
307
+ ]],
308
+ uniform bool enable_round_corners = false [[
309
+ ::anno::description("Enables the round corner effect. Comes at a slight performance cost as additional raytracing calls are required to evaluate the round corner effect."),
310
+ ::anno::display_name("Enable Round Corners"),
311
+ ::anno::in_group("Round Corners")
312
+ ]],
313
+ uniform float radius = 0.002f [[
314
+ ::anno::description("Radius of the rounded corners."),
315
+ ::anno::display_name("Round Corner Radius"),
316
+ ::anno::in_group("Round Corners")
317
+ ]],
318
+ uniform bool across_materials = false [[
319
+ ::anno::display_name("Across Materials"),
320
+ ::anno::in_group("Round Corners")
321
+ ]]
322
+ )
323
+ [[
324
+ ::anno::author("NVIDIA vMaterials"),
325
+ ::anno::display_name("Aluminum Foil - Slightly Wrinkled"),
326
+ ::anno::description(DESCRIPTION),
327
+ ::anno::copyright_notice(COPYRIGHT),
328
+ ::anno::thumbnail("./.thumbs/Aluminum_Foil.Aluminum_Foil.png"),
329
+ ::anno::key_words(string[]("design", "metal", "aluminum", "aluminium", "foil", "smooth", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral"))
330
+ ]]
331
+ =
332
+ let {
333
+ color normal_reflectivity = color(0.911810895428f,0.914089043421f,0.920152876196f);
334
+ color grazing_reflectivity = color(0.99942f, 1.f, 1.f);
335
+
336
+ texture_2d rough_ao_tex = texture_2d("./foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear);
337
+ texture_2d smudge_splotch_tex = texture_2d("./foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear);
338
+ texture_2d norm_tex = texture_2d("./foil_crumpled_norm.jpg", ::tex::gamma_linear);
339
+
340
+ bool tmp0 = false;
341
+ material_surface tmp1(
342
+ ::df::weighted_layer(0.0299999993f, ::df::microfacet_ggx_smith_bsdf(0.300000012f, 0.300000012f, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::color_custom_curve_layer(normal_reflectivity, grazing_reflectivity, 5.f, color(::math::lerp(0.600000024f, 1.f, brightness) * histogram_scan_big(::math::pow(float3(infinite_tiling ? endless_texture(rough_ao_tex, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.328999996f, 0.513999999f, 0.764999986f), 8.f, false) : ::base::file_texture(rough_ao_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_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), 1.f, bump_strength * 0.400000006f)), ::df::microfacet_ggx_smith_bsdf((histogram_range(float3(infinite_tiling ? endless_texture(rough_ao_tex, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.328999996f, 0.513999999f, 0.764999986f), 8.f, false) : ::base::file_texture(rough_ao_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_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], roughness * 0.5f * roughness_variation, roughness * 0.5f) + roughness * 0.5f * roughness_variation * (float3(infinite_tiling ? endless_texture(rough_ao_tex, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.328999996f, 0.513999999f, 0.764999986f), 8.f, false) : ::base::file_texture(rough_ao_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1] - 0.5f) + (1.f - roughness) * smudges * float3(infinite_tiling ? endless_texture(smudge_splotch_tex, ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.0820000023f), 8.f, false) : ::base::file_texture(smudge_splotch_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] + roughness_variation * 0.200000003f * float3(infinite_tiling ? endless_texture(smudge_splotch_tex, ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.0820000023f), 8.f, false) : ::base::file_texture(smudge_splotch_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]) * (histogram_range(float3(infinite_tiling ? endless_texture(rough_ao_tex, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.328999996f, 0.513999999f, 0.764999986f), 8.f, false) : ::base::file_texture(rough_ao_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_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], roughness * 0.5f * roughness_variation, roughness * 0.5f) + roughness * 0.5f * roughness_variation * (float3(infinite_tiling ? endless_texture(rough_ao_tex, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.328999996f, 0.513999999f, 0.764999986f), 8.f, false) : ::base::file_texture(rough_ao_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1] - 0.5f) + (1.f - roughness) * smudges * float3(infinite_tiling ? endless_texture(smudge_splotch_tex, ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.0820000023f), 8.f, false) : ::base::file_texture(smudge_splotch_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] + roughness_variation * 0.200000003f * float3(infinite_tiling ? endless_texture(smudge_splotch_tex, ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.0820000023f), 8.f, false) : ::base::file_texture(smudge_splotch_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), (histogram_range(float3(infinite_tiling ? endless_texture(rough_ao_tex, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.328999996f, 0.513999999f, 0.764999986f), 8.f, false) : ::base::file_texture(rough_ao_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_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], roughness * 0.5f * roughness_variation, roughness * 0.5f) + roughness * 0.5f * roughness_variation * (float3(infinite_tiling ? endless_texture(rough_ao_tex, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.328999996f, 0.513999999f, 0.764999986f), 8.f, false) : ::base::file_texture(rough_ao_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1] - 0.5f) + (1.f - roughness) * smudges * float3(infinite_tiling ? endless_texture(smudge_splotch_tex, ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.0820000023f), 8.f, false) : ::base::file_texture(smudge_splotch_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] + roughness_variation * 0.200000003f * float3(infinite_tiling ? endless_texture(smudge_splotch_tex, ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.0820000023f), 8.f, false) : ::base::file_texture(smudge_splotch_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]) * (histogram_range(float3(infinite_tiling ? endless_texture(rough_ao_tex, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.328999996f, 0.513999999f, 0.764999986f), 8.f, false) : ::base::file_texture(rough_ao_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_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], roughness * 0.5f * roughness_variation, roughness * 0.5f) + roughness * 0.5f * roughness_variation * (float3(infinite_tiling ? endless_texture(rough_ao_tex, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.328999996f, 0.513999999f, 0.764999986f), 8.f, false) : ::base::file_texture(rough_ao_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1] - 0.5f) + (1.f - roughness) * smudges * float3(infinite_tiling ? endless_texture(smudge_splotch_tex, ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.0820000023f), 8.f, false) : ::base::file_texture(smudge_splotch_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] + roughness_variation * 0.200000003f * float3(infinite_tiling ? endless_texture(smudge_splotch_tex, ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.0820000023f), 8.f, false) : ::base::file_texture(smudge_splotch_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), bsdf(), infinite_tiling ? endless_normal(norm_tex, bump_strength * 1.5f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.5f, 0.5f, 1.f), 8.f) : ::base::tangent_space_normal_texture(norm_tex, bump_strength * 1.5f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), infinite_tiling ? endless_normal(norm_tex, bump_strength * 1.5f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.5f, 0.5f, 1.f), 8.f) : ::base::tangent_space_normal_texture(norm_tex, bump_strength * 1.5f, 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)),
343
+ material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
344
+ material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
345
+ color tmp3 = color(1.f, 1.f, 1.f);
346
+ 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));
347
+ material_geometry tmp5(
348
+ float3(0.f),
349
+ 1.f,
350
+ enable_round_corners ? ::state::rounded_corner_normal(radius, across_materials, 1.f) : ::state::normal());
351
+ } in
352
+ material(
353
+ thin_walled: tmp0,
354
+ surface: tmp1,
355
+ backface: tmp2,
356
+ ior: tmp3,
357
+ volume: tmp4,
358
+ geometry: tmp5);
359
+
360
+
361
+ export material Aluminum_Foil_Smudged_Foil(*)
362
+ [[
363
+ ::anno::author("NVIDIA vMaterials"),
364
+ ::anno::display_name("Aluminum Foil - Smudgy Foil"),
365
+ ::anno::description(DESCRIPTION),
366
+ ::anno::copyright_notice(COPYRIGHT),
367
+ ::anno::thumbnail("./.thumbs/Aluminum_Foil.Aluminum_Foil_Smudged_Foil.png"),
368
+ ::anno::key_words(string[]("design", "metal", "aluminum", "aluminium", "foil", "smooth", "unfinished", "decorative", "creative", "neutral"))
369
+ ]]
370
+ = Aluminum_Foil(
371
+ infinite_tiling: true,
372
+ roughness: 0.15f,
373
+ roughness_variation: 0.84f,
374
+ smudges: 0.35f,
375
+ bump_strength: 0.0f,
376
+ texture_translate: 0.0f,
377
+ texture_rotate: 0.0f,
378
+ texture_scale: 1.0f,
379
+ uv_space_index: 0,
380
+ enable_round_corners: false,
381
+ radius: 0.002f,
382
+ across_materials: false
383
+ );
384
+
385
+
386
+ export material Aluminum_Foil_Shiny_Wrinkled(*)
387
+ [[
388
+ ::anno::author("NVIDIA vMaterials"),
389
+ ::anno::display_name("Aluminum Foil - Shiny Wrinkled"),
390
+ ::anno::description(DESCRIPTION),
391
+ ::anno::copyright_notice(COPYRIGHT),
392
+ ::anno::thumbnail("./.thumbs/Aluminum_Foil.Aluminum_Foil_Shiny_Wrinkled.png"),
393
+ ::anno::key_words(string[]("design", "metal", "aluminum", "aluminium", "foil", "shiny", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral"))
394
+ ]]
395
+ = Aluminum_Foil(
396
+ infinite_tiling: true,
397
+ roughness: 0.25f,
398
+ roughness_variation: 0.25f,
399
+ smudges: 0.75f,
400
+ bump_strength: 0.25f,
401
+ texture_translate: 0.0f,
402
+ texture_rotate: 0.0f,
403
+ texture_scale: 1.0f,
404
+ uv_space_index: 0,
405
+ enable_round_corners: false,
406
+ radius: 0.002f,
407
+ across_materials: false
408
+ );
409
+
410
+
411
+
412
+
413
+ export material Aluminum_Foil_Matte_Wrinkled(*)
414
+ [[
415
+ ::anno::author("NVIDIA vMaterials"),
416
+ ::anno::display_name("Aluminum Foil - Matte Wrinkled"),
417
+ ::anno::description(DESCRIPTION),
418
+ ::anno::copyright_notice(COPYRIGHT),
419
+ ::anno::thumbnail("./.thumbs/Aluminum_Foil.Aluminum_Foil_Matte_Wrinkled.png"),
420
+ ::anno::key_words(string[]("design", "metal", "aluminum", "aluminium", "foil", "matte", "smooth", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral", "gray"))
421
+ ]]
422
+ = Aluminum_Foil(
423
+ infinite_tiling: true,
424
+ roughness: 0.65f,
425
+ roughness_variation: 1.0f,
426
+ smudges: 0.4f,
427
+ bump_strength: 0.15f,
428
+ texture_translate: 0.0f,
429
+ texture_rotate: 0.0f,
430
+ texture_scale: 1.0f,
431
+ uv_space_index: 0,
432
+ enable_round_corners: false,
433
+ radius: 0.002f,
434
+ across_materials: false
435
+ );
436
+
437
+
438
+
439
+ export material Aluminum_Foil_Heavy_Glossy_Wrinkles(*)
440
+ [[
441
+ ::anno::author("NVIDIA vMaterials"),
442
+ ::anno::display_name("Aluminum Foil - Heavy Glossy Wrinkles"),
443
+ ::anno::description(DESCRIPTION),
444
+ ::anno::copyright_notice(COPYRIGHT),
445
+ ::anno::thumbnail("./.thumbs/Aluminum_Foil.Aluminum_Foil_Heavy_Glossy_Wrinkles.png"),
446
+ ::anno::key_words(string[]("design", "metal", "aluminum", "aluminium", "foil", "smooth", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral"))
447
+ ]]
448
+ = Aluminum_Foil(
449
+ infinite_tiling: true,
450
+ roughness: 0.164f,
451
+ roughness_variation: 0.021f,
452
+ smudges: 0.143f,
453
+ bump_strength: 0.99f,
454
+ texture_translate: 0.0f,
455
+ texture_rotate: 0.0f,
456
+ texture_scale: 1.0f,
457
+ uv_space_index: 0,
458
+ enable_round_corners: false,
459
+ radius: 0.002f,
460
+ across_materials: false
461
+ );
462
+
463
+
464
+
465
+ export material Aluminum_Foil_Heavy_Matte_Wrinkled(*)
466
+ [[
467
+ ::anno::author("NVIDIA vMaterials"),
468
+ ::anno::display_name("Aluminum Foil - Heavy Matte Wrinkled"),
469
+ ::anno::description(DESCRIPTION),
470
+ ::anno::copyright_notice(COPYRIGHT),
471
+ ::anno::thumbnail("./.thumbs/Aluminum_Foil.Aluminum_Foil_Heavy_Matte_Wrinkled.png"),
472
+ ::anno::key_words(string[]("design", "metal", "aluminum", "aluminium", "foil", "matte", "bumped", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral", "gray"))
473
+ ]]
474
+ = Aluminum_Foil(
475
+ infinite_tiling: true,
476
+ roughness: 0.889f,
477
+ roughness_variation: 0.018f,
478
+ smudges: 0.246f,
479
+ bump_strength: 0.732f,
480
+ texture_translate: 0.0f,
481
+ texture_rotate: 0.0f,
482
+ texture_scale: 1.0f,
483
+ uv_space_index: 0,
484
+ enable_round_corners: false,
485
+ radius: 0.002f,
486
+ across_materials: false
487
+ );
488
+
489
+
490
+
491
+
492
+
493
+
494
+
495
+
496
+
497
+
498
+
499
+
500
+
501
+
Material/material_0384/Aluminum_Sheet.mdl ADDED
@@ -0,0 +1,1330 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2024 NVIDIA Corporation. All rights reserved.
3
+ ******************************************************************************
4
+
5
+ Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge,
6
+ to any person obtaining a copy of the sample definition code that uses our
7
+ Material Definition Language (the "MDL Materials"), to reproduce and distribute
8
+ the MDL Materials, including without limitation the rights to use, copy, merge,
9
+ publish, distribute, and sell modified and unmodified copies of the MDL
10
+ Materials, and to permit persons to whom the MDL Materials is furnished to do
11
+ so, in all cases solely for use with NVIDIA's Material Definition Language,
12
+ subject to the following further conditions:
13
+
14
+ 1. The above copyright notices, this list of conditions, and the disclaimer
15
+ that follows shall be retained in all copies of one or more of the MDL
16
+ Materials, including in any software with which the MDL Materials are bundled,
17
+ redistributed, and/or sold, and included either as stand-alone text files,
18
+ human-readable headers or in the appropriate machine-readable metadata fields
19
+ within text or binary files as long as those fields can be easily viewed by the
20
+ user, as applicable.
21
+ 2. The name of NVIDIA shall not be used to promote, endorse or advertise any
22
+ Modified Version without specific prior written permission, except a) to comply
23
+ with the notice requirements otherwise contained herein; or b) to acknowledge
24
+ the contribution(s) of NVIDIA.
25
+
26
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
27
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
28
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
29
+ TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR
30
+ ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL,
31
+ INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF
32
+ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE
33
+ THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.
34
+ */
35
+
36
+
37
+ mdl 1.5;
38
+
39
+ import ::anno::*;
40
+ import ::base::*;
41
+ import ::df::*;
42
+ import ::math::*;
43
+ import ::state::*;
44
+ import ::tex::*;
45
+ import ::nvidia::core_definitions::blend_colors;
46
+ import ::nvidia::core_definitions::dimension;
47
+
48
+ const string COPYRIGHT =
49
+ " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
50
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
51
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
52
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
53
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
54
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
55
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
56
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
57
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
58
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
59
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
60
+
61
+ const string DESCRIPTION = "A sheet metal material with adjustable imperfections";
62
+ const string DESCRIPTION_PUNCH = "Punched aluminum sheet metal material with adjustable imperfections and punchings.";
63
+
64
+
65
+ float4 tile_select(uniform int select = 0)
66
+ {
67
+ switch (select)
68
+ {
69
+ case 0: return float4(0.000, 0.333, 0.666, 1.000);
70
+ case 1: return float4(0.333, 0.666, 0.666, 1.000);
71
+ case 2: return float4(0.666, 1.000, 0.666, 1.000);
72
+
73
+ case 3: return float4(0.000, 0.333, 0.333, 0.666);
74
+ case 4: return float4(0.333, 0.666, 0.333, 0.666);
75
+ case 5: return float4(0.666, 1.000, 0.333, 0.666);
76
+
77
+ case 6: return float4(0.000, 0.333, 0.000, 0.333);
78
+ case 7: return float4(0.333, 0.666, 0.000, 0.333);
79
+ case 8: return float4(0.666, 1.000, 0.000, 0.333);
80
+
81
+ default: return float4(0.000, 0.333, 0.000, 0.333);
82
+ }
83
+ }
84
+
85
+ export struct vm_coordinates
86
+ [[
87
+ ::anno::hidden()
88
+ ]]
89
+ {
90
+ float2 uv;
91
+ float rotation;
92
+ int uv_space_index;
93
+ float4 carry;
94
+ };
95
+
96
+ enum vm_mono_select
97
+ [[
98
+ anno::description("Modes for the creation of a gray-scale value from a color"),
99
+ anno::hidden()
100
+ ]]
101
+ {
102
+ mono_r = 0,
103
+ mono_g = 1,
104
+ mono_b = 2,
105
+ mono_a = 3,
106
+ mono_average = 4
107
+ };
108
+
109
+ vm_coordinates vm_coord
110
+ (
111
+ float2 translation = float2(0.0f, 0.0) [[
112
+ ::anno::display_name("Translation"),
113
+ ::anno::description("Translates the coordinates.")
114
+ ]],
115
+ float rotation = 0.0f [[
116
+ ::anno::display_name("Rotation"),
117
+ ::anno::description("Rotates the coordinates in degrees.")
118
+ ]],
119
+ float2 scaling = float2(1.0f, 1.0f) [[
120
+ ::anno::display_name("Scaling"),
121
+ ::anno::description("Scales the coordinates.")
122
+ ]],
123
+ uniform int uv_space = 0 [[
124
+ ::anno::display_name("UV Space"),
125
+ ::anno::description("Chose the UV space.")
126
+ ]]
127
+ )
128
+ [[
129
+ ::anno::display_name("vm Transform"),
130
+ ::anno::description("Generates coordinates to be used in vm_lookup functions.")
131
+ ]]
132
+ {
133
+ vm_coordinates uv;
134
+ ::base::texture_coordinate_info info = ::base::coordinate_source( ::base::texture_coordinate_uvw, uv_space);
135
+ uv.rotation = (rotation * 3.1415926535897932384626433832f) / 180.f;
136
+ uv.uv = float2(info.position.x, info.position.y);
137
+ float sine = ::math::sin(uv.rotation);
138
+ float cosine = ::math::cos(uv.rotation);
139
+ float2x2 rot = float2x2(cosine, -sine, sine, cosine);
140
+ uv.uv = rot * uv.uv;
141
+ uv.uv /= scaling;
142
+ uv.uv += translation;
143
+ return uv;
144
+ }
145
+
146
+
147
+ vm_coordinates vm_coord_hex(
148
+ vm_coordinates uv,
149
+ float scale = 1.0f)
150
+ {
151
+ vm_coordinates uv_return;
152
+ float2 uv_ = float2(uv.uv.x, uv.uv.y);
153
+
154
+ // same as from function get_hex above
155
+ float2 s = float2(1.0f, 1.7320508f);
156
+ float2 n = uv_ - float2(0.5f, 1.0f);
157
+ float4 c = ::math::floor(float4(uv_.x, uv_.y, n.x, n.y)/float4(s.x, s.y, s.x, s.y)) + 0.5f;
158
+ float2 h_1 = uv_ - float2(c.x, c.y) * s;
159
+ float2 h_2 = uv_ - (float2(c.z, c.w) + 0.5f) * s;
160
+ float4 uv_id = ::math::dot(h_1, h_1) < ::math::dot(h_2, h_2) ? float4(h_1.x, h_1.y, c.x, c.y) : float4(h_2.x, h_2.y, c.z, c.w);
161
+
162
+ uv_return.uv = float2(uv_id.x*scale+0.5, uv_id.y*scale+0.5);
163
+ // unless we introduce random cell rotations where we need to compensate for this in the rotation
164
+ // we can just plain copy the rotation value
165
+ uv_return.rotation = uv.rotation;
166
+ return uv_return;
167
+ }
168
+
169
+ // Offsets a set of uv coordinates in either row (u) or column (v) direction
170
+ vm_coordinates vm_coord_rowcol_offset(
171
+ vm_coordinates uv,
172
+ float offset,
173
+ bool horizontal_offset = true
174
+ )
175
+ {
176
+ int index = horizontal_offset ? 0 : 1;
177
+ uv.uv[index] += ::math::floor(uv.uv[index ^ 1]) * offset;
178
+ return uv;
179
+ }
180
+
181
+ vm_coordinates vm_coord_grid(
182
+ vm_coordinates uv,
183
+ float scale = 1.0f
184
+ )
185
+ {
186
+ float2x2 scal = float2x2(scale, 0., 0., scale);
187
+ uv.uv = ::math::frac(uv.uv);
188
+ uv.uv -= 0.5f;
189
+ uv.uv = scal * uv.uv;
190
+ uv.uv = uv.uv + 0.5f;
191
+ return uv;
192
+ }
193
+
194
+ ::base::texture_return vm_tex_lookup(
195
+ uniform texture_2d tex,
196
+ vm_coordinates uv = vm_coord(),
197
+ uniform vm_mono_select mono_source = mono_a,
198
+ float4 scale = float4(1.0f),
199
+
200
+ uniform ::tex::wrap_mode wrap_u = ::tex::wrap_repeat,
201
+ uniform ::tex::wrap_mode wrap_v = ::tex::wrap_repeat,
202
+ uniform float2 crop_u = float2(0.0, 1.0),
203
+ uniform float2 crop_v = float2(0.0, 1.0)
204
+ )
205
+ {
206
+ float mono;
207
+ float4 lookup = ::tex::lookup_float4(tex, uv.uv, wrap_u, wrap_v, crop_u, crop_v) * scale;
208
+ switch( mono_source ) {
209
+ case mono_r: mono = lookup.x;
210
+ break;
211
+ case mono_g: mono = lookup.y;
212
+ break;
213
+ case mono_b: mono = lookup.z;
214
+ break;
215
+ case mono_a: mono = lookup.w;
216
+ break;
217
+ case mono_average: mono = ::math::average(float3(lookup.x, lookup.y, lookup.z));
218
+ break;
219
+ }
220
+ return ::base::texture_return(color(lookup.x, lookup.y, lookup.z), mono);
221
+ }
222
+
223
+ // *** SET CUTOUT ENUM NAMES ***
224
+ export enum cutout_pattern
225
+ [[
226
+ ::anno::description("Cutout Pattern."),
227
+ ::anno::hidden()
228
+ ]]
229
+ {
230
+ pattern_circle = 0
231
+ [[ ::anno::display_name("Circle")]],
232
+ pattern_hexagon = 1
233
+ [[ ::anno::display_name("Hexagon")]],
234
+ pattern_line = 2
235
+ [[ ::anno::display_name("Line") ]],
236
+
237
+ pattern_square = 3
238
+ [[ ::anno::display_name("Square")]],
239
+ pattern_rectangle = 4
240
+ [[ ::anno::display_name("Rectangle")]],
241
+ pattern_cross = 5
242
+ [[ ::anno::display_name("Cross")]],
243
+
244
+ pattern_rhombus = 6
245
+ [[ ::anno::display_name("Rhombus")]],
246
+ pattern_triangle = 7
247
+ [[ ::anno::display_name("Triangle")]],
248
+ pattern_star = 8
249
+ [[ ::anno::display_name("Star")]]
250
+ };
251
+
252
+ float remap_xy_to_0_1(float input, float x, float y)
253
+ {
254
+ return (input - x)/(y - x);
255
+ }
256
+
257
+ float histogram_scan_big(float input, float width, float position)
258
+ {
259
+ return ::math::clamp(
260
+ remap_xy_to_0_1(input,
261
+ ::math::lerp(-width, 1.0, position),
262
+ ::math::lerp(0.0, 1.0 + width, position)),
263
+ 0.0,
264
+ 1.0);
265
+ }
266
+
267
+
268
+ ::base::texture_coordinate_info vmat_transform(
269
+ uniform float2 translation = float2(0.0, 0.0),
270
+ uniform float rotation = 0.0,
271
+ uniform float2 scaling = float2(1.0, 1.0),
272
+ uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw,
273
+ uniform int uv_space = 0
274
+ )
275
+ {
276
+ float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f;
277
+
278
+ float4x4 scale =
279
+ float4x4(1.0 /scaling.x, 0. , 0. , 0.,
280
+ 0. , 1.0 /scaling.y , 0. , 0.,
281
+ 0. , 0. , 1.0, 0.,
282
+ translation.x , translation.y , 0.0, 1.);
283
+
284
+ float s = ::math::sin(rotation_rad);
285
+ float c = ::math::cos(rotation_rad);
286
+ float4x4 rotate =
287
+ float4x4( c , -s , 0.0 , 0.0,
288
+ s , c , 0.0 , 0.0,
289
+ 0.0, 0.0 , 1.0 , 0.0,
290
+ 0. , 0.0 , 0.0 , 1.);
291
+
292
+ return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space));
293
+ }
294
+
295
+ float uint2float(int x)
296
+ {
297
+ return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0);
298
+ }
299
+
300
+ int lowbias32(int x)
301
+ {
302
+ x ^= x >>> 16;
303
+ x *= 0x7feb352d;
304
+ x ^= x >>> 15;
305
+ x *= 0x846ca68b;
306
+ x ^= x >>> 16;
307
+ return x;
308
+ }
309
+
310
+ float2 rnd22(int2 p) {
311
+ float2 ret_val = float2(
312
+ uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f,
313
+ uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f
314
+ );
315
+ return ret_val;
316
+ }
317
+
318
+ float3 srgb2rgb(float3 val)
319
+ {
320
+ return ::math::pow(::math::max(val, float3(0.0f)), 2.2);
321
+ }
322
+
323
+ float2x2 invert_2x2(float2x2 M)
324
+ {
325
+ float det = M[0][0]*M[1][1] - M[0][1]*M[1][0];
326
+ //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/
327
+ return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]);
328
+ }
329
+
330
+ float3 nonrepeat_lookup(
331
+ uniform texture_2d texture = texture_2d(),
332
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
333
+ float texture_scale = 1.0,
334
+ float3 average_color = float3(0.5),
335
+ float patch_size = 8.0
336
+ )
337
+ {
338
+
339
+ float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale;
340
+ float Z = patch_size; // patch scale inside example texture
341
+ float CON = 1.0f;
342
+
343
+ float3 O = float3(0.f);
344
+ float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f);
345
+ float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space
346
+
347
+ float2 U = uv_in;
348
+ float2 V = M * uv_in; //pre-tilted hexa coordinates
349
+ int2 I = int2(::math::floor(V)); // hexa-tile id
350
+
351
+ // The mean color needs to be determined in Photoshop then to make the
352
+ // average color work out, take the float value and calculate the apropriate
353
+ // mean value as (value^(1/2.2))
354
+
355
+ float3 m = average_color;
356
+
357
+ float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W;
358
+ F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates
359
+
360
+ if( F[2] > 0.f )
361
+
362
+ O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON))
363
+ + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON))
364
+ + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON));
365
+ else
366
+ O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON))
367
+ + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON))
368
+ + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON));
369
+ O = m + O/::math::length(W);
370
+ O = ::math::clamp( (O), 0.0, 1.0);
371
+
372
+ return float3(O);
373
+ }
374
+
375
+ color endless_texture(
376
+ uniform texture_2d texture = texture_2d(),
377
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
378
+ float texture_scale = 10.0,
379
+ float3 average_color = float3(0.5, 0.5, 1.0),
380
+ float patch_size = 8.0,
381
+ bool gamma_correct_lookup = true
382
+ )
383
+ {
384
+ return gamma_correct_lookup ? color(srgb2rgb(
385
+ nonrepeat_lookup (
386
+ texture: texture,
387
+ uvw: uvw,
388
+ texture_scale: texture_scale,
389
+ average_color: average_color,
390
+ patch_size: patch_size
391
+ ))
392
+ ) : color(nonrepeat_lookup (
393
+ texture: texture,
394
+ uvw: uvw,
395
+ texture_scale: texture_scale,
396
+ average_color: average_color,
397
+ patch_size: patch_size
398
+ ));
399
+ }
400
+
401
+
402
+ export material Aluminum_Sheet(
403
+ uniform bool infinite_tiling = false [[
404
+ ::anno::description("Enables infinite tiling feature which removes repeating texture patterns. Note that depending on the material this feature changes the appearance of the material slightly."),
405
+ ::anno::display_name("Infinite Tiling"),
406
+ ::anno::in_group("Appearance", "Main")
407
+ ]],
408
+ float sheet_brightness = 0.5f [[
409
+ ::anno::display_name("Brightness"),
410
+ ::anno::description("Controls the brightness of the material."),
411
+ ::anno::in_group("Appearance", "Main"),
412
+ ::anno::hard_range(0.f, 1.f)
413
+ ]],
414
+ float roughness = 0.2f [[
415
+ ::anno::display_name("Roughness"),
416
+ ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."),
417
+ ::anno::in_group("Appearance", "Main"),
418
+ ::anno::hard_range(0.f, 1.f)
419
+ ]],
420
+ float streaks = 0.0f [[
421
+ ::anno::display_name("Streaks Weight"),
422
+ ::anno::description("Adds directional streaks that occur as part of the sheet manufacturing process."),
423
+ ::anno::in_group("Appearance", "Main"),
424
+ ::anno::hard_range(0.f, 1.f)
425
+ ]],
426
+ uniform float scratch_bump_factor = 0.0f [[
427
+ ::anno::description("Determines the degree of bumpiness."),
428
+ ::anno::display_name("Bump Factor Streaks"),
429
+ ::anno::in_group("Appearance", "Main"),
430
+ ::anno::hard_range(0.f, 1.f)
431
+ ]],
432
+ float imperfections_amount = 0.6f [[
433
+ ::anno::description("Balances between a perfectly smooth metal and a surface that has various imperfections."),
434
+ ::anno::display_name("Imperfections Amount"),
435
+ ::anno::in_group("Appearance", "Imperfections"),
436
+ ::anno::hard_range(0.f, 1.f)
437
+ ]],
438
+ uniform float impurities_weight_1 = 0.f [[
439
+ ::anno::display_name("Washed Imperfections Ratio"),
440
+ ::anno::in_group("Appearance", "Imperfections"),
441
+ ::anno::hard_range(0.f, 1.f)
442
+ ]],
443
+ uniform float impurities_weight_2 = 0.939f [[
444
+ ::anno::display_name("Noisy Imperfections Ratio"),
445
+ ::anno::in_group("Appearance", "Imperfections"),
446
+ ::anno::hard_range(0.f, 1.f)
447
+ ]],
448
+ uniform float impurities_weight_3 = 0.0 [[
449
+ ::anno::display_name("Splotchy Imperfection Ratio"),
450
+ ::anno::in_group("Appearance", "Imperfections"),
451
+ ::anno::hard_range(0.f, 1.f)
452
+ ]],
453
+ uniform bool enable_round_corners = false [[
454
+ ::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."),
455
+ ::anno::display_name("Enable Round Corners"),
456
+ ::anno::in_group("Round Corners")
457
+ ]],
458
+ uniform float roundcorner_radius = 0.01f [[
459
+ ::anno::description("Radius of the rounded corners."),
460
+ ::anno::display_name("Round Corner Radius"),
461
+ ::anno::in_group("Round Corners"),
462
+ ::anno::soft_range(0.f, 0.1f)
463
+ ]],
464
+ uniform bool across_materials = false [[
465
+ ::anno::display_name("Across Materials"),
466
+ ::anno::in_group("Round Corners")
467
+ ]],
468
+ uniform float2 texture_translate = 0.f [[
469
+ ::anno::description("Controls the position of the texture."),
470
+ ::anno::display_name("Texture Translate"),
471
+ ::anno::in_group("Transform")
472
+ ]],
473
+ uniform float texture_rotate = 0.f [[
474
+ ::anno::description("Rotates angle of the texture in degrees."),
475
+ ::anno::display_name("Texture Rotate"),
476
+ ::anno::in_group("Transform"),
477
+ ::anno::soft_range(0.f, 360.f)
478
+ ]],
479
+ uniform float2 texture_scale = 1.0f [[
480
+ ::anno::description("Larger numbers increase the size."),
481
+ ::anno::display_name("Texture Scale"),
482
+ ::nvidia::core_definitions::dimension(float2(0.75f, 0.75f)),
483
+ ::anno::in_group("Transform")
484
+ ]],
485
+ uniform int uv_space_index = 0 [[
486
+ ::anno::display_name("UV Space Index"),
487
+ ::anno::description("Uses selected UV space for material."),
488
+ ::anno::in_group("Transform")
489
+ ]]
490
+ )
491
+ [[
492
+ ::anno::author("NVIDIA vMaterials"),
493
+ ::anno::display_name("Aluminum Sheet - New Clean"),
494
+ ::anno::description(DESCRIPTION),
495
+ ::anno::copyright_notice(COPYRIGHT),
496
+ ::anno::thumbnail("./.thumbs/Aluminum_Sheet.Aluminum_Sheet.png"),
497
+ ::anno::key_words(string[]("metal", "sheet", "aluminum", "aluminium", "imperfections", "interior", "exterior", "automotive", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "neutral"))
498
+ ]]
499
+ =
500
+ let {
501
+ color normal_reflectivity = color(0.911810895428f,0.914089043421f,0.920152876196f);
502
+ color grazing_reflectivity = color(0.99942f, 1.f, 1.f);
503
+
504
+ bool tmp0 = false;
505
+ material_surface tmp1(
506
+ ::df::color_custom_curve_layer(normal_reflectivity, grazing_reflectivity, 5.f, color(::math::lerp(0.400000006f, 1.f, sheet_brightness) * ::math::lerp(1.f, ::math::pow(float3(::base::file_texture(texture_2d("./sheet_metal_R_rough_G_ao_B_streaks.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 2.20000005f), ::math::lerp(0.f, 0.300000012f, streaks))), ::df::weighted_layer(0.0700000003f, ::df::microfacet_ggx_smith_bsdf(0.150000006f, 0.150000006f, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf((::math::lerp(roughness * 0.5f, (impurities_weight_1 + impurities_weight_2 + impurities_weight_3 > 0.f ? impurities_weight_1 / (impurities_weight_1 + impurities_weight_2 + impurities_weight_3) : 0.333299994f) * roughness * float3(infinite_tiling ? endless_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.633000016f, 0.495000005f, 0.542999983f), 2.f, false) : ::base::file_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] + (impurities_weight_1 + impurities_weight_2 + impurities_weight_3 > 0.f ? impurities_weight_2 / (impurities_weight_1 + impurities_weight_2 + impurities_weight_3) : 0.333299994f) * roughness * float3(infinite_tiling ? endless_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.633000016f, 0.495000005f, 0.542999983f), 2.f, false) : ::base::file_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1] + (impurities_weight_1 + impurities_weight_2 + impurities_weight_3 > 0.f ? impurities_weight_3 / (impurities_weight_1 + impurities_weight_2 + impurities_weight_3) : 0.333299994f) * roughness * float3(infinite_tiling ? endless_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.633000016f, 0.495000005f, 0.542999983f), 2.f, false) : ::base::file_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], imperfections_amount) + (float3(::base::file_texture(texture_2d("./sheet_metal_R_rough_G_ao_B_streaks.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] - 0.5f) * (streaks * 0.5f * 0.5f)) * (::math::lerp(roughness * 0.5f, (impurities_weight_1 + impurities_weight_2 + impurities_weight_3 > 0.f ? impurities_weight_1 / (impurities_weight_1 + impurities_weight_2 + impurities_weight_3) : 0.333299994f) * roughness * float3(infinite_tiling ? endless_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.633000016f, 0.495000005f, 0.542999983f), 2.f, false) : ::base::file_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] + (impurities_weight_1 + impurities_weight_2 + impurities_weight_3 > 0.f ? impurities_weight_2 / (impurities_weight_1 + impurities_weight_2 + impurities_weight_3) : 0.333299994f) * roughness * float3(infinite_tiling ? endless_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.633000016f, 0.495000005f, 0.542999983f), 2.f, false) : ::base::file_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1] + (impurities_weight_1 + impurities_weight_2 + impurities_weight_3 > 0.f ? impurities_weight_3 / (impurities_weight_1 + impurities_weight_2 + impurities_weight_3) : 0.333299994f) * roughness * float3(infinite_tiling ? endless_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.633000016f, 0.495000005f, 0.542999983f), 2.f, false) : ::base::file_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], imperfections_amount) + (float3(::base::file_texture(texture_2d("./sheet_metal_R_rough_G_ao_B_streaks.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] - 0.5f) * (streaks * 0.5f * 0.5f)), (::math::lerp(roughness * 0.5f, (impurities_weight_1 + impurities_weight_2 + impurities_weight_3 > 0.f ? impurities_weight_1 / (impurities_weight_1 + impurities_weight_2 + impurities_weight_3) : 0.333299994f) * roughness * float3(infinite_tiling ? endless_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.633000016f, 0.495000005f, 0.542999983f), 2.f, false) : ::base::file_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] + (impurities_weight_1 + impurities_weight_2 + impurities_weight_3 > 0.f ? impurities_weight_2 / (impurities_weight_1 + impurities_weight_2 + impurities_weight_3) : 0.333299994f) * roughness * float3(infinite_tiling ? endless_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.633000016f, 0.495000005f, 0.542999983f), 2.f, false) : ::base::file_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1] + (impurities_weight_1 + impurities_weight_2 + impurities_weight_3 > 0.f ? impurities_weight_3 / (impurities_weight_1 + impurities_weight_2 + impurities_weight_3) : 0.333299994f) * roughness * float3(infinite_tiling ? endless_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.633000016f, 0.495000005f, 0.542999983f), 2.f, false) : ::base::file_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], imperfections_amount) + (float3(::base::file_texture(texture_2d("./sheet_metal_R_rough_G_ao_B_streaks.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] - 0.5f) * (streaks * 0.5f * 0.5f)) * (::math::lerp(roughness * 0.5f, (impurities_weight_1 + impurities_weight_2 + impurities_weight_3 > 0.f ? impurities_weight_1 / (impurities_weight_1 + impurities_weight_2 + impurities_weight_3) : 0.333299994f) * roughness * float3(infinite_tiling ? endless_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.633000016f, 0.495000005f, 0.542999983f), 2.f, false) : ::base::file_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] + (impurities_weight_1 + impurities_weight_2 + impurities_weight_3 > 0.f ? impurities_weight_2 / (impurities_weight_1 + impurities_weight_2 + impurities_weight_3) : 0.333299994f) * roughness * float3(infinite_tiling ? endless_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.633000016f, 0.495000005f, 0.542999983f), 2.f, false) : ::base::file_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1] + (impurities_weight_1 + impurities_weight_2 + impurities_weight_3 > 0.f ? impurities_weight_3 / (impurities_weight_1 + impurities_weight_2 + impurities_weight_3) : 0.333299994f) * roughness * float3(infinite_tiling ? endless_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.633000016f, 0.495000005f, 0.542999983f), 2.f, false) : ::base::file_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], imperfections_amount) + (float3(::base::file_texture(texture_2d("./sheet_metal_R_rough_G_ao_B_streaks.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] - 0.5f) * (streaks * 0.5f * 0.5f)), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::math::normalize(::math::lerp(::state::normal(), ::base::tangent_space_normal_texture(texture_2d("./sheet_metal_norm.jpg", ::tex::gamma_linear), scratch_bump_factor, false, false, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f), histogram_scan_big(float3(::base::file_texture(texture_2d("./sheet_metal_R_rough_G_ao_B_streaks.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.242000014f, 0.850000024f)))), bsdf(), ::math::normalize(::math::lerp(::state::normal(), ::base::tangent_space_normal_texture(texture_2d("./sheet_metal_norm.jpg", ::tex::gamma_linear), scratch_bump_factor, false, false, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f), histogram_scan_big(float3(::base::file_texture(texture_2d("./sheet_metal_R_rough_G_ao_B_streaks.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.242000014f, 0.850000024f)))),
507
+ material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
508
+ material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
509
+ color tmp3 = color(1.f, 1.f, 1.f);
510
+ 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));
511
+ material_geometry tmp5(
512
+ float3(0.f),
513
+ 1.f,
514
+ enable_round_corners ? ::state::rounded_corner_normal(roundcorner_radius, across_materials, 1.f) : ::state::normal());
515
+ } in
516
+ material(
517
+ thin_walled: tmp0,
518
+ surface: tmp1,
519
+ backface: tmp2,
520
+ ior: tmp3,
521
+ volume: tmp4,
522
+ geometry: tmp5);
523
+
524
+
525
+
526
+ export material Aluminum_Sheet_Punched(
527
+ // Cutout parameters
528
+
529
+ uniform cutout_pattern shape_select = pattern_circle //select atlas tile here
530
+ [[
531
+ ::anno::description("Select a cutout shape."),
532
+ ::anno::display_name("Cutout Shape"),
533
+ ::anno::in_group("Appearance", "Cutout"),
534
+ ::anno::ui_order(0)
535
+ ]],
536
+ float2 punching_grid_size = float2(.5f, .5f)
537
+ [[
538
+ ::anno::description("Scales the size of the punching grid."),
539
+ ::anno::display_name("Punching Grid Size"),
540
+ ::anno::in_group("Appearance", "Cutout"),
541
+ ::anno::ui_order(1)
542
+ ]],
543
+ float cutout_size = .92f
544
+ [[
545
+ ::anno::description("Scales the size of the cutout pattern independently from the base material."),
546
+ ::anno::display_name("Cutout Size"),
547
+ ::anno::hard_range(0.f, 1.2f),
548
+ ::anno::soft_range(0.f, 1.0f),
549
+ ::anno::in_group("Appearance", "Cutout"),
550
+ ::anno::ui_order(2)
551
+ ]],
552
+ float cutout_roundness = .4f
553
+ [[
554
+ ::anno::description("At low values it makes the cutouts sharper. Higher values give the shapes a more rounded look."),
555
+ ::anno::display_name("Cutout Roundness"),
556
+ ::anno::hard_range(0.f, 1.f),
557
+ ::anno::in_group("Appearance", "Cutout"),
558
+ ::anno::ui_order(3)
559
+ ]],
560
+ float cutout_bevel_width = 0.5f
561
+ [[
562
+ ::anno::description("Adjusts the width of the bevel transition."),
563
+ ::anno::display_name("Cutout Bevel Width"),
564
+ ::anno::hard_range(0.f, 1.f),
565
+ ::anno::in_group("Appearance", "Cutout"),
566
+ ::anno::ui_order(4)
567
+ ]],
568
+ float cutout_bump_strength = .8f
569
+ [[
570
+ ::anno::description("Sets the strength of the bevelled normal around the cutout."),
571
+ ::anno::display_name("Cutout Bevel Strength"),
572
+ ::anno::soft_range(0.0f, 1.0f),
573
+ ::anno::hard_range(0.0f, 2.0f),
574
+ ::anno::in_group("Appearance", "Cutout"),
575
+ ::anno::ui_order(5)
576
+ ]],
577
+ // Grid Layout parameters
578
+ bool hexagonal_grid = true
579
+ [[
580
+ ::anno::description("When enabled, the punching will occur on a hexagonal grid, otherwise a square grid."),
581
+ ::anno::display_name("Enable Hexagonal Grid"),
582
+ ::anno::in_group("Appearance", "Cutout Layout"),
583
+ ::anno::ui_order(6)
584
+ ]],
585
+ float square_grid_offset = 0.0f
586
+ [[
587
+ ::anno::description("Offsets each row of the grid by a certain amount."),
588
+ ::anno::display_name("Square Grid Offset"),
589
+ ::anno::in_group("Appearance", "Cutout Layout"),
590
+ ::anno::enable_if("hexagonal_grid==false"),
591
+ ::anno::ui_order(7)
592
+ ]],
593
+ bool horizontal_offset = true
594
+ [[
595
+ ::anno::description("Choose whether to offset either in row or column direction."),
596
+ ::anno::display_name("Horizontal Offset"),
597
+ ::anno::in_group("Appearance", "Cutout Layout"),
598
+ ::anno::enable_if("hexagonal_grid==false"),
599
+ ::anno::ui_order(8)
600
+ ]],
601
+
602
+
603
+
604
+ // Aluminum Sheet parameters
605
+ uniform bool infinite_tiling = false [[
606
+ ::anno::description("Enables infinite tiling feature which removes repeating texture patterns. Note that depending on the material this feature changes the appearance of the material slightly."),
607
+ ::anno::display_name("Infinite Tiling"),
608
+ ::anno::in_group("Appearance", "Main")
609
+ ]],
610
+ float sheet_brightness = 0.5f [[
611
+ ::anno::display_name("Brightness"),
612
+ ::anno::description("Controls the brightness of the material."),
613
+ ::anno::in_group("Appearance", "Main"),
614
+ ::anno::hard_range(0.f, 1.f)
615
+ ]],
616
+ float roughness = 0.2f [[
617
+ ::anno::display_name("Roughness"),
618
+ ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."),
619
+ ::anno::in_group("Appearance", "Main"),
620
+ ::anno::hard_range(0.f, 1.f)
621
+ ]],
622
+ float streaks = 0.0f [[
623
+ ::anno::display_name("Streaks Weight"),
624
+ ::anno::description("Adds directional streaks that occur as part of the sheet manufacturing process."),
625
+ ::anno::in_group("Appearance", "Main"),
626
+ ::anno::hard_range(0.f, 1.f)
627
+ ]],
628
+ uniform float scratch_bump_factor = 0.0f [[
629
+ ::anno::description("Determines the degree of bumpiness."),
630
+ ::anno::display_name("Bump Factor Streaks"),
631
+ ::anno::in_group("Appearance", "Main"),
632
+ ::anno::hard_range(0.f, 1.f)
633
+ ]],
634
+ float imperfections_amount = 0.6f [[
635
+ ::anno::description("Balances between a perfectly smooth metal and a surface that has various imperfections."),
636
+ ::anno::display_name("Imperfections Amount"),
637
+ ::anno::in_group("Appearance", "Imperfections"),
638
+ ::anno::hard_range(0.f, 1.f)
639
+ ]],
640
+ uniform float impurities_weight_1 = 0.f [[
641
+ ::anno::display_name("Washed Imperfections Ratio"),
642
+ ::anno::in_group("Appearance", "Imperfections"),
643
+ ::anno::hard_range(0.f, 1.f)
644
+ ]],
645
+ uniform float impurities_weight_2 = 0.939f [[
646
+ ::anno::display_name("Noisy Imperfections Ratio"),
647
+ ::anno::in_group("Appearance", "Imperfections"),
648
+ ::anno::hard_range(0.f, 1.f)
649
+ ]],
650
+ uniform float impurities_weight_3 = 0.0 [[
651
+ ::anno::display_name("Splotchy Imperfection Ratio"),
652
+ ::anno::in_group("Appearance", "Imperfections"),
653
+ ::anno::hard_range(0.f, 1.f)
654
+ ]],
655
+ uniform bool enable_round_corners = false [[
656
+ ::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."),
657
+ ::anno::display_name("Enable Round Corners"),
658
+ ::anno::in_group("Round Corners")
659
+ ]],
660
+ uniform float roundcorner_radius = 0.01f [[
661
+ ::anno::description("Radius of the rounded corners."),
662
+ ::anno::display_name("Round Corner Radius"),
663
+ ::anno::in_group("Round Corners"),
664
+ ::anno::soft_range(0.f, 0.1f)
665
+ ]],
666
+ uniform bool across_materials = false [[
667
+ ::anno::display_name("Across Materials"),
668
+ ::anno::in_group("Round Corners")
669
+ ]],
670
+ uniform float2 texture_translate = 0.f [[
671
+ ::anno::description("Controls the position of the texture."),
672
+ ::anno::display_name("Texture Translate"),
673
+ ::anno::in_group("Transform")
674
+ ]],
675
+ uniform float texture_rotate = 0.f [[
676
+ ::anno::description("Rotates angle of the texture in degrees."),
677
+ ::anno::display_name("Texture Rotate"),
678
+ ::anno::in_group("Transform"),
679
+ ::anno::soft_range(0.f, 360.f)
680
+ ]],
681
+ uniform float2 texture_scale = 1.0f [[
682
+ ::anno::description("Larger numbers increase the size."),
683
+ ::anno::display_name("Texture Scale"),
684
+ ::nvidia::core_definitions::dimension(float2(0.75f, 0.75f)),
685
+ ::anno::in_group("Transform")
686
+ ]],
687
+ uniform int uv_space_index = 0 [[
688
+ ::anno::display_name("UV Space Index"),
689
+ ::anno::description("Uses selected UV space for material."),
690
+ ::anno::in_group("Transform")
691
+ ]]
692
+ )
693
+ [[
694
+ ::anno::author("NVIDIA vMaterials"),
695
+ ::anno::contributor("Rüdiger Raab"),
696
+ ::anno::contributor("Maik Rohland"),
697
+ ::anno::display_name("Aluminum Sheet - Circular Punch"),
698
+ ::anno::description(DESCRIPTION),
699
+ ::anno::copyright_notice(COPYRIGHT),
700
+ ::anno::thumbnail("./.thumbs/Aluminum_Sheet.Aluminum_Sheet_Punched.png"),
701
+ ::anno::key_words(string[]("metal", "sheet", "aluminum", "aluminium", "imperfections", "interior", "exterior", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "circular", "gray"))
702
+ ]] = let
703
+ {
704
+ material base_mat = Aluminum_Sheet(
705
+ infinite_tiling: infinite_tiling,
706
+ sheet_brightness: sheet_brightness,
707
+ roughness: roughness,
708
+ streaks: streaks,
709
+ scratch_bump_factor: scratch_bump_factor,
710
+ imperfections_amount: imperfections_amount,
711
+ impurities_weight_1: impurities_weight_1,
712
+ impurities_weight_2: impurities_weight_2,
713
+ impurities_weight_3: impurities_weight_3,
714
+ texture_translate: texture_translate,
715
+ texture_rotate: texture_rotate,
716
+ texture_scale: texture_scale,
717
+ uv_space_index: uv_space_index,
718
+ enable_round_corners: enable_round_corners,
719
+ roundcorner_radius: roundcorner_radius,
720
+ across_materials: across_materials
721
+ );
722
+ texture_2d punching_cutout = texture_2d("./atlas_02_norm_dist.png", ::tex::gamma_linear);
723
+
724
+ // remap range of slider to avoid artifacts in the bevelling
725
+ float2 punching_scale = texture_scale * 0.01f * punching_grid_size;
726
+ float cutout_roundness_ = cutout_roundness*0.6f+0.4f;
727
+ float cutout_size_lin = (1.0f/cutout_size);
728
+ float cutout_bevel_width_ = 0.1 + cutout_bevel_width * 0.9f;
729
+
730
+ vm_coordinates uv = vm_coord(
731
+ translation: texture_translate,
732
+ rotation: texture_rotate,
733
+ scaling: punching_scale,
734
+ uv_space: uv_space_index
735
+ );
736
+
737
+ vm_coordinates punching_uv = hexagonal_grid ? vm_coord_hex(
738
+ uv: uv,
739
+ scale: cutout_roundness_ * cutout_size_lin
740
+ ) : vm_coord_grid(
741
+ uv: vm_coord_rowcol_offset(
742
+ uv: uv,
743
+ offset: square_grid_offset,
744
+ horizontal_offset: horizontal_offset
745
+ ),
746
+ scale: cutout_roundness_ * cutout_size_lin
747
+ );
748
+ // select the correct subtile from the atlas
749
+ float4 crop = tile_select(shape_select);
750
+
751
+ ::base::texture_return lookup = vm_tex_lookup(
752
+ tex: punching_cutout,
753
+ uv: punching_uv,
754
+ mono_source: mono_a,
755
+ scale: float4(1.0f),
756
+ crop_u: float2(crop.x, crop.y),
757
+ crop_v: float2(crop.z, crop.w),
758
+ wrap_u: ::tex::wrap_clamp,
759
+ wrap_v: ::tex::wrap_clamp
760
+ );
761
+
762
+ float low = (1.0 - cutout_roundness_);
763
+ float high = (cutout_size_lin * (cutout_bevel_width_ * 0.2f) * cutout_roundness_) + (1.0 - cutout_roundness_);
764
+ // remap x...y to (clamped) 0...1
765
+ float x = ::math::clamp((lookup.mono - low)/(high - low), 0.0, 1.0);
766
+ // spherical falloff
767
+ float falloff=::math::sqrt(1.0-x*x);
768
+ // masking falloff as the center of the cutout is flat
769
+ float masked_falloff=falloff<=0.0?1.0:falloff;
770
+
771
+ // where base material is still there, use the value of the base material
772
+ float cutout= ::math::min(falloff<=0.0?0.0:1.0, base_mat.geometry.cutout_opacity);
773
+
774
+ // bring in -.5 ... +.5 range and lerp between lookup and flat normal
775
+ float3 remap_norm = ::math::lerp(float3(lookup.tint), float3(0.5, 0.5, 1.0), masked_falloff) - float3(0.5);
776
+ float3 t_norm = ::math::normalize(remap_norm * float3(cutout_bump_strength, cutout_bump_strength, 1.0));
777
+
778
+ float3 rotfix_norm = float3(::math::cos(punching_uv.rotation) * t_norm.x - ::math::sin(punching_uv.rotation) * t_norm.y,
779
+ ::math::sin(punching_uv.rotation) * t_norm.x + ::math::cos(punching_uv.rotation) * t_norm.y,
780
+ t_norm.z);
781
+
782
+ float3 normal = ::state::texture_tangent_u(punching_uv.uv_space_index) * rotfix_norm.x +
783
+ ::state::texture_tangent_v(punching_uv.uv_space_index) * rotfix_norm.y +
784
+ ::state::normal() * rotfix_norm.z;
785
+
786
+ float3 final_normal = ::base::blend_normals(
787
+ base_normal: normal,
788
+ base_normal_weight: 1.0f,
789
+ detail_normal: base_mat.geometry.normal,
790
+ detail_normal_weight: 1.0f
791
+ );
792
+
793
+ } in material(
794
+ surface: material_surface(
795
+ scattering: base_mat.surface.scattering
796
+ ),
797
+ volume: base_mat.volume,
798
+ ior: base_mat.ior,
799
+ thin_walled: true,
800
+ geometry: material_geometry(
801
+ displacement: base_mat.geometry.displacement,
802
+ normal: final_normal,
803
+ cutout_opacity: cutout
804
+ )
805
+ );
806
+
807
+ // ------------------------ Aluminum Sheet Presets ------------------------
808
+ export material Aluminum_Sheet_Soft_Splotches(*)
809
+ [[
810
+ ::anno::author("NVIDIA vMaterials"),
811
+ ::anno::display_name("Aluminum Sheet - Soft Splotches"),
812
+ ::anno::description(DESCRIPTION),
813
+ ::anno::copyright_notice(COPYRIGHT),
814
+ ::anno::thumbnail("./.thumbs/Aluminum_Sheet.Aluminum_Sheet_Soft_Splotches.png"),
815
+ ::anno::key_words(string[]("metal", "sheet", "aluminum", "aluminium", "imperfections", "interior", "exterior", "automotive", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "neutral", "gray"))
816
+ ]]
817
+ = Aluminum_Sheet(
818
+ infinite_tiling: false,
819
+ sheet_brightness: 0.5f,
820
+ roughness: 0.3f,
821
+ streaks: 0.0f,
822
+ scratch_bump_factor: 0.0f,
823
+ imperfections_amount: 0.75f,
824
+ impurities_weight_1: 0.75f,
825
+ impurities_weight_2: 0.01f,
826
+ impurities_weight_3: 0.98f,
827
+ enable_round_corners: false,
828
+ roundcorner_radius: 0.01f,
829
+ across_materials: false,
830
+ texture_translate: 0.0f,
831
+ texture_rotate: 0.0f,
832
+ texture_scale: 1.0f,
833
+ uv_space_index: 0
834
+ );
835
+
836
+
837
+
838
+
839
+ export material Aluminum_Sheet_Matte_Imperfections(*)
840
+ [[
841
+ ::anno::author("NVIDIA vMaterials"),
842
+ ::anno::display_name("Aluminum Sheet - Matte Imperfections"),
843
+ ::anno::description(DESCRIPTION),
844
+ ::anno::copyright_notice(COPYRIGHT),
845
+ ::anno::thumbnail("./.thumbs/Aluminum_Sheet.Aluminum_Sheet_Matte_Imperfections.png"),
846
+ ::anno::key_words(string[]("metal", "sheet", "aluminum", "aluminium", "imperfections", "interior", "exterior", "automotive", "new", "matte", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "neutral"))
847
+ ]]= Aluminum_Sheet(
848
+ infinite_tiling: false,
849
+ sheet_brightness: 0.85f,
850
+ roughness: 0.75f,
851
+ streaks: 0.0f,
852
+ scratch_bump_factor: 0.0f,
853
+ imperfections_amount: 0.265f,
854
+ impurities_weight_1: 0.75f,
855
+ impurities_weight_2: 0.43f,
856
+ impurities_weight_3: 0.0f,
857
+ enable_round_corners: false,
858
+ roundcorner_radius: 0.01f,
859
+ across_materials: false,
860
+ texture_translate: 0.0f,
861
+ texture_rotate: 0.0f,
862
+ texture_scale: 1.0f,
863
+ uv_space_index: 0
864
+ );
865
+
866
+
867
+
868
+
869
+ export material Aluminum_Sheet_Glossy_Imperfections(*)
870
+ [[
871
+ ::anno::author("NVIDIA vMaterials"),
872
+ ::anno::display_name("Aluminum Sheet - Glossy Imperfections"),
873
+ ::anno::description(DESCRIPTION),
874
+ ::anno::copyright_notice(COPYRIGHT),
875
+ ::anno::thumbnail("./.thumbs/Aluminum_Sheet.Aluminum_Sheet_Glossy_Imperfections.png"),
876
+ ::anno::key_words(string[]("metal", "sheet", "aluminum", "aluminium", "imperfections", "interior", "exterior", "automotive", "new", "glossy", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "neutral"))
877
+ ]]
878
+ = Aluminum_Sheet(
879
+ infinite_tiling: false,
880
+ sheet_brightness: 0.85f,
881
+ roughness: 0.3f,
882
+ streaks: 0.1f,
883
+ scratch_bump_factor: 0.15f,
884
+ imperfections_amount: 0.1f,
885
+ impurities_weight_1: 0.75f,
886
+ impurities_weight_2: 0.89f,
887
+ impurities_weight_3: 0.86f,
888
+ enable_round_corners: false,
889
+ roundcorner_radius: 0.01f,
890
+ across_materials: false,
891
+ texture_translate: 0.0f,
892
+ texture_rotate: 0.0f,
893
+ texture_scale: 1.0f,
894
+ uv_space_index: 0
895
+ );
896
+
897
+
898
+
899
+
900
+ export material Aluminum_Sheet_Splotchy_Streaks(*)
901
+ [[
902
+ ::anno::author("NVIDIA vMaterials"),
903
+ ::anno::display_name("Aluminum Sheet - Splotchy Streaks"),
904
+ ::anno::description(DESCRIPTION),
905
+ ::anno::copyright_notice(COPYRIGHT),
906
+ ::anno::thumbnail("./.thumbs/Aluminum_Sheet.Aluminum_Sheet_Splotchy_Streaks.png"),
907
+ ::anno::key_words(string[]("metal", "sheet", "aluminum", "aluminium", "imperfections", "interior", "exterior", "automotive", "new", "glossy", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "neutral"))
908
+ ]]= Aluminum_Sheet(
909
+ infinite_tiling: false,
910
+ sheet_brightness: 0.85f,
911
+ roughness: 0.6f,
912
+ streaks: 0.1f,
913
+ scratch_bump_factor: 0.2f,
914
+ imperfections_amount: 0.26f,
915
+ impurities_weight_1: 1.0f,
916
+ impurities_weight_2: 0.76f,
917
+ impurities_weight_3: 0.13f,
918
+ enable_round_corners: false,
919
+ roundcorner_radius: 0.01f,
920
+ across_materials: false,
921
+ texture_translate: 0.0f,
922
+ texture_rotate: 0.0f,
923
+ texture_scale: 1.0f,
924
+ uv_space_index: 0
925
+ );
926
+
927
+ export material Aluminum_Sheet_Glossy_Streaks(*)
928
+ [[
929
+ ::anno::author("NVIDIA vMaterials"),
930
+ ::anno::display_name("Aluminum Sheet - Glossy Streaks"),
931
+ ::anno::description(DESCRIPTION),
932
+ ::anno::copyright_notice(COPYRIGHT),
933
+ ::anno::thumbnail("./.thumbs/Aluminum_Sheet.Aluminum_Sheet_Glossy_Streaks.png"),
934
+ ::anno::key_words(string[]("metal", "sheet", "aluminum", "aluminium", "imperfections", "interior", "exterior", "automotive", "new", "glossy", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "neutral"))
935
+ ]]
936
+ = Aluminum_Sheet(
937
+ infinite_tiling: false,
938
+ sheet_brightness: 0.65f,
939
+ roughness: 0.25f,
940
+ streaks: 0.8f,
941
+ scratch_bump_factor: 0.88f,
942
+ imperfections_amount: 0.86f,
943
+ impurities_weight_1: 1.0f,
944
+ impurities_weight_2: 0.75f,
945
+ impurities_weight_3: 0.125f,
946
+ enable_round_corners: false,
947
+ roundcorner_radius: 0.01f,
948
+ across_materials: false,
949
+ texture_translate: 0.0f,
950
+ texture_rotate: 0.0f,
951
+ texture_scale: 1.0f,
952
+ uv_space_index: 0
953
+ );
954
+
955
+
956
+ // ------------------------ Punched Aluminum Sheet Presets ------------------------
957
+
958
+ export material Aluminum_Sheet_Punched_Small_Circular(*)[[
959
+ ::anno::author("NVIDIA vMaterials"),
960
+ ::anno::contributor("Rüdiger Raab"),
961
+ ::anno::contributor("Maik Rohland"),
962
+ ::anno::display_name("Aluminum Sheet - Small Circular Punch"),
963
+ ::anno::description(DESCRIPTION_PUNCH),
964
+ ::anno::copyright_notice(COPYRIGHT),
965
+ ::anno::thumbnail("./.thumbs/Aluminum_Sheet.Aluminum_Sheet_Punched_Small_Circular.png"),
966
+ ::anno::key_words(string[]("metal", "sheet", "aluminum", "aluminium", "imperfections", "interior", "exterior", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "circular", "gray"))
967
+ ]] = Aluminum_Sheet_Punched(
968
+ // Punching parameters
969
+ shape_select: pattern_circle,
970
+ punching_grid_size: 1.0f,
971
+ cutout_size: 0.5f,
972
+ cutout_roundness: 0.4f,
973
+ cutout_bevel_width: 0.5f,
974
+ cutout_bump_strength: 0.8f,
975
+ hexagonal_grid: true,
976
+ square_grid_offset: 0.0f,
977
+ horizontal_offset: true,
978
+
979
+ // Material Parameters
980
+ infinite_tiling: false,
981
+ sheet_brightness: 0.85f,
982
+ roughness: 0.55f,
983
+ streaks: 0.0f,
984
+ scratch_bump_factor: 0.0f,
985
+ imperfections_amount: 0.33f,
986
+ impurities_weight_1: 0.75f,
987
+ impurities_weight_2: 0.43f,
988
+ impurities_weight_3: 1.0f,
989
+ enable_round_corners: false,
990
+ roundcorner_radius: 0.01f,
991
+ across_materials: false,
992
+ texture_translate: 0.0f,
993
+ texture_rotate: 0.0f,
994
+ texture_scale: 1.0f,
995
+ uv_space_index: 0
996
+ );
997
+
998
+
999
+ export material Aluminum_Sheet_Punched_Hexagonal(*)
1000
+ [[
1001
+ ::anno::author("NVIDIA vMaterials"),
1002
+ ::anno::contributor("Rüdiger Raab"),
1003
+ ::anno::contributor("Maik Rohland"),
1004
+ ::anno::display_name("Aluminum Sheet - Hexagonal Punch"),
1005
+ ::anno::description(DESCRIPTION_PUNCH),
1006
+ ::anno::copyright_notice(COPYRIGHT),
1007
+ ::anno::thumbnail("./.thumbs/Aluminum_Sheet.Aluminum_Sheet_Punched_Hexagonal.png"),
1008
+ ::anno::key_words(string[]("metal", "sheet", "aluminum", "aluminium", "imperfections", "interior", "exterior", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "hexagonal", "gray"))
1009
+ ]] = Aluminum_Sheet_Punched(
1010
+ // Punching parameters
1011
+ shape_select: pattern_hexagon,
1012
+ punching_grid_size: 1.5f,
1013
+ cutout_size: .95f,
1014
+ cutout_roundness: 0.4f,
1015
+ cutout_bevel_width: 0.5f,
1016
+ cutout_bump_strength: 1.5f,
1017
+ hexagonal_grid: true,
1018
+ square_grid_offset: 0.0f,
1019
+ horizontal_offset: true,
1020
+
1021
+ // Material Parameters
1022
+ infinite_tiling: false,
1023
+ sheet_brightness: 0.85f,
1024
+ roughness: 0.55f,
1025
+ streaks: 0.0f,
1026
+ scratch_bump_factor: 0.0f,
1027
+ imperfections_amount: 0.33f,
1028
+ impurities_weight_1: 0.75f,
1029
+ impurities_weight_2: 0.43f,
1030
+ impurities_weight_3: 1.0f,
1031
+ enable_round_corners: false,
1032
+ roundcorner_radius: 0.01f,
1033
+ across_materials: false,
1034
+ texture_translate: 0.0f,
1035
+ texture_rotate: 0.0f,
1036
+ texture_scale: 1.0f,
1037
+ uv_space_index: 0
1038
+ );
1039
+
1040
+
1041
+ export material Aluminum_Sheet_Punched_Hexagonal_Small(*)
1042
+ [[
1043
+ ::anno::author("NVIDIA vMaterials"),
1044
+ ::anno::contributor("Rüdiger Raab"),
1045
+ ::anno::contributor("Maik Rohland"),
1046
+ ::anno::display_name("Aluminum Sheet - Small Hexagonal Punch"),
1047
+ ::anno::description(DESCRIPTION_PUNCH),
1048
+ ::anno::copyright_notice(COPYRIGHT),
1049
+ ::anno::thumbnail("./.thumbs/Aluminum_Sheet.Aluminum_Sheet_Punched_Hexagonal_Small.png"),
1050
+ ::anno::key_words(string[]("metal", "sheet", "aluminum", "aluminium", "imperfections", "interior", "exterior", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "hexagonal", "gray"))
1051
+ ]] = Aluminum_Sheet_Punched(
1052
+ // Punching parameters
1053
+ shape_select: pattern_hexagon,
1054
+ punching_grid_size: float2(.75f),
1055
+ cutout_size: .58f,
1056
+ cutout_roundness: 0.4f,
1057
+ cutout_bevel_width: 0.3f,
1058
+ cutout_bump_strength: 1.5f,
1059
+ hexagonal_grid: true,
1060
+ square_grid_offset: 0.0f,
1061
+ horizontal_offset: true,
1062
+
1063
+ // Material Parameters
1064
+ infinite_tiling: false,
1065
+ sheet_brightness: 0.85f,
1066
+ roughness: 0.55f,
1067
+ streaks: 0.0f,
1068
+ scratch_bump_factor: 0.0f,
1069
+ imperfections_amount: 0.33f,
1070
+ impurities_weight_1: 0.75f,
1071
+ impurities_weight_2: 0.43f,
1072
+ impurities_weight_3: 1.0f,
1073
+ enable_round_corners: false,
1074
+ roundcorner_radius: 0.01f,
1075
+ across_materials: false,
1076
+ texture_translate: 0.0f,
1077
+ texture_rotate: 0.0f,
1078
+ texture_scale: 1.0f,
1079
+ uv_space_index: 0
1080
+ );
1081
+
1082
+
1083
+ export material Aluminum_Sheet_Punched_Square(*)
1084
+ [[
1085
+ ::anno::author("NVIDIA vMaterials"),
1086
+ ::anno::contributor("Rüdiger Raab"),
1087
+ ::anno::contributor("Maik Rohland"),
1088
+ ::anno::display_name("Aluminum Sheet - Square Punch"),
1089
+ ::anno::description(DESCRIPTION_PUNCH),
1090
+ ::anno::copyright_notice(COPYRIGHT),
1091
+ ::anno::thumbnail("./.thumbs/Aluminum_Sheet.Aluminum_Sheet_Punched_Square.png"),
1092
+ ::anno::key_words(string[]("metal", "sheet", "aluminum", "aluminium", "imperfections", "interior", "exterior", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "square", "gray"))
1093
+ ]] = Aluminum_Sheet_Punched(
1094
+ // Punching parameters
1095
+ shape_select: pattern_square,
1096
+ punching_grid_size: 1.2f,
1097
+ cutout_size: 0.56f,
1098
+ cutout_roundness: 0.1f,
1099
+ cutout_bevel_width: 0.5f,
1100
+ cutout_bump_strength: 1.5f,
1101
+ hexagonal_grid: false,
1102
+ square_grid_offset: 0.5f,
1103
+ horizontal_offset: true,
1104
+
1105
+ // Material Parameters
1106
+ infinite_tiling: false,
1107
+ sheet_brightness: 0.85f,
1108
+ roughness: 0.55f,
1109
+ streaks: 0.0f,
1110
+ scratch_bump_factor: 0.0f,
1111
+ imperfections_amount: 0.33f,
1112
+ impurities_weight_1: 0.75f,
1113
+ impurities_weight_2: 0.43f,
1114
+ impurities_weight_3: 1.0f,
1115
+ enable_round_corners: false,
1116
+ roundcorner_radius: 0.01f,
1117
+ across_materials: false,
1118
+ texture_translate: 0.0f,
1119
+ texture_rotate: 0.0f,
1120
+ texture_scale: 1.0f,
1121
+ uv_space_index: 0
1122
+ );
1123
+
1124
+
1125
+ export material Aluminum_Sheet_Punched_Line(*)
1126
+ [[
1127
+ ::anno::author("NVIDIA vMaterials"),
1128
+ ::anno::contributor("Rüdiger Raab"),
1129
+ ::anno::contributor("Maik Rohland"),
1130
+ ::anno::display_name("Aluminum Sheet - Line Punch"),
1131
+ ::anno::description(DESCRIPTION_PUNCH),
1132
+ ::anno::copyright_notice(COPYRIGHT),
1133
+ ::anno::thumbnail("./.thumbs/Aluminum_Sheet.Aluminum_Sheet_Punched_Line.png"),
1134
+ ::anno::key_words(string[]("metal", "sheet", "aluminum", "aluminium", "imperfections", "interior", "exterior", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "line", "gray"))
1135
+ ]] = Aluminum_Sheet_Punched(
1136
+ // Punching parameters
1137
+ shape_select: pattern_line,
1138
+ punching_grid_size: 1.3f,
1139
+ cutout_size: 0.59f,
1140
+ cutout_roundness: 0.4f,
1141
+ cutout_bevel_width: 0.3f,
1142
+ cutout_bump_strength: 1.5f,
1143
+ hexagonal_grid: false,
1144
+ square_grid_offset: 0.3333f,
1145
+ horizontal_offset: true,
1146
+
1147
+ // Material Parameters
1148
+ infinite_tiling: false,
1149
+ sheet_brightness: 0.85f,
1150
+ roughness: 0.55f,
1151
+ streaks: 0.0f,
1152
+ scratch_bump_factor: 0.0f,
1153
+ imperfections_amount: 0.33f,
1154
+ impurities_weight_1: 0.75f,
1155
+ impurities_weight_2: 0.43f,
1156
+ impurities_weight_3: 1.0f,
1157
+ enable_round_corners: false,
1158
+ roundcorner_radius: 0.01f,
1159
+ across_materials: false,
1160
+ texture_translate: 0.0f,
1161
+ texture_rotate: 0.0f,
1162
+ texture_scale: 1.0f,
1163
+ uv_space_index: 0
1164
+ );
1165
+
1166
+ export material Aluminum_Sheet_Punched_Cross(*)
1167
+ [[
1168
+ ::anno::author("NVIDIA vMaterials"),
1169
+ ::anno::contributor("Rüdiger Raab"),
1170
+ ::anno::contributor("Maik Rohland"),
1171
+ ::anno::display_name("Aluminum Sheet - Cross Punch"),
1172
+ ::anno::description(DESCRIPTION_PUNCH),
1173
+ ::anno::copyright_notice(COPYRIGHT),
1174
+ ::anno::thumbnail("./.thumbs/Aluminum_Sheet.Aluminum_Sheet_Punched_Cross.png"),
1175
+ ::anno::key_words(string[]("metal", "sheet", "aluminum", "aluminium", "imperfections", "interior", "exterior", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "cross", "gray"))
1176
+ ]] = Aluminum_Sheet_Punched(
1177
+ // Punching parameters
1178
+ shape_select: pattern_cross,
1179
+ punching_grid_size: 2.0f,
1180
+ cutout_size: 0.59f,
1181
+ cutout_roundness: 0.1f,
1182
+ cutout_bevel_width: 0.44f,
1183
+ cutout_bump_strength: 1.5f,
1184
+ hexagonal_grid: true,
1185
+ square_grid_offset: 0.0f,
1186
+ horizontal_offset: true,
1187
+
1188
+ // Material Parameters
1189
+ infinite_tiling: false,
1190
+ sheet_brightness: 0.85f,
1191
+ roughness: 0.55f,
1192
+ streaks: 0.0f,
1193
+ scratch_bump_factor: 0.0f,
1194
+ imperfections_amount: 0.33f,
1195
+ impurities_weight_1: 0.75f,
1196
+ impurities_weight_2: 0.43f,
1197
+ impurities_weight_3: 1.0f,
1198
+ enable_round_corners: false,
1199
+ roundcorner_radius: 0.01f,
1200
+ across_materials: false,
1201
+ texture_translate: 0.0f,
1202
+ texture_rotate: 0.0f,
1203
+ texture_scale: 1.0f,
1204
+ uv_space_index: 0
1205
+ );
1206
+
1207
+ export material Aluminum_Sheet_Punched_Rhombus(*)
1208
+ [[
1209
+ ::anno::author("NVIDIA vMaterials"),
1210
+ ::anno::contributor("Rüdiger Raab"),
1211
+ ::anno::contributor("Maik Rohland"),
1212
+ ::anno::display_name("Aluminum Sheet - Rhombus Punch"),
1213
+ ::anno::description(DESCRIPTION_PUNCH),
1214
+ ::anno::copyright_notice(COPYRIGHT),
1215
+ ::anno::thumbnail("./.thumbs/Aluminum_Sheet.Aluminum_Sheet_Punched_Rhombus.png"),
1216
+ ::anno::key_words(string[]("metal", "sheet", "aluminum", "aluminium", "imperfections", "interior", "exterior", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "rhombus", "gray"))
1217
+ ]] = Aluminum_Sheet_Punched(
1218
+ // Punching parameters
1219
+ shape_select: pattern_rhombus,
1220
+ punching_grid_size: 1.4f,
1221
+ cutout_size: 1.0f,
1222
+ cutout_roundness: 0.8f,
1223
+ cutout_bevel_width: 0.5f,
1224
+ cutout_bump_strength: 1.5f,
1225
+ hexagonal_grid: true,
1226
+ square_grid_offset: 0.0f,
1227
+ horizontal_offset: true,
1228
+
1229
+ // Material Parameters
1230
+ infinite_tiling: false,
1231
+ sheet_brightness: 0.85f,
1232
+ roughness: 0.55f,
1233
+ streaks: 0.0f,
1234
+ scratch_bump_factor: 0.0f,
1235
+ imperfections_amount: 0.33f,
1236
+ impurities_weight_1: 0.75f,
1237
+ impurities_weight_2: 0.43f,
1238
+ impurities_weight_3: 1.0f,
1239
+ enable_round_corners: false,
1240
+ roundcorner_radius: 0.01f,
1241
+ across_materials: false,
1242
+ texture_translate: 0.0f,
1243
+ texture_rotate: 0.0f,
1244
+ texture_scale: 1.0f,
1245
+ uv_space_index: 0
1246
+ );
1247
+
1248
+
1249
+ export material Aluminum_Sheet_Punched_Triangle(*)
1250
+ [[
1251
+ ::anno::author("NVIDIA vMaterials"),
1252
+ ::anno::contributor("Rüdiger Raab"),
1253
+ ::anno::contributor("Maik Rohland"),
1254
+ ::anno::display_name("Aluminum Sheet - Triangle Punch"),
1255
+ ::anno::description(DESCRIPTION_PUNCH),
1256
+ ::anno::copyright_notice(COPYRIGHT),
1257
+ ::anno::thumbnail("./.thumbs/Aluminum_Sheet.Aluminum_Sheet_Punched_Triangle.png"),
1258
+ ::anno::key_words(string[]("metal", "sheet", "aluminum", "aluminium", "imperfections", "interior", "exterior", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "triangle", "gray"))
1259
+ ]] = Aluminum_Sheet_Punched(
1260
+ // Punching parameters
1261
+ shape_select: pattern_triangle,
1262
+ punching_grid_size: 1.3f,
1263
+ cutout_size: 1.08f,
1264
+ cutout_roundness: 1.0f,
1265
+ cutout_bevel_width: 1.0f,
1266
+ cutout_bump_strength: 1.5f,
1267
+ hexagonal_grid: true,
1268
+ square_grid_offset: 0.0f,
1269
+ horizontal_offset: true,
1270
+
1271
+ // Material Parameters
1272
+ infinite_tiling: false,
1273
+ sheet_brightness: 0.85f,
1274
+ roughness: 0.55f,
1275
+ streaks: 0.0f,
1276
+ scratch_bump_factor: 0.0f,
1277
+ imperfections_amount: 0.33f,
1278
+ impurities_weight_1: 0.75f,
1279
+ impurities_weight_2: 0.43f,
1280
+ impurities_weight_3: 1.0f,
1281
+ enable_round_corners: false,
1282
+ roundcorner_radius: 0.01f,
1283
+ across_materials: false,
1284
+ texture_translate: 0.0f,
1285
+ texture_rotate: 0.0f,
1286
+ texture_scale: 1.0f,
1287
+ uv_space_index: 0
1288
+ );
1289
+
1290
+
1291
+ export material Aluminum_Sheet_Punched_Star(*)
1292
+ [[
1293
+ ::anno::author("NVIDIA vMaterials"),
1294
+ ::anno::contributor("Rüdiger Raab"),
1295
+ ::anno::contributor("Maik Rohland"),
1296
+ ::anno::display_name("Aluminum Sheet - Star Punch"),
1297
+ ::anno::description(DESCRIPTION_PUNCH),
1298
+ ::anno::copyright_notice(COPYRIGHT),
1299
+ ::anno::thumbnail("./.thumbs/Aluminum_Sheet.Aluminum_Sheet_Punched_Star.png"),
1300
+ ::anno::key_words(string[]("metal", "sheet", "aluminum", "aluminium", "imperfections", "interior", "exterior", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "star", "gray"))
1301
+ ]] = Aluminum_Sheet_Punched(
1302
+ // Punching parameters
1303
+ shape_select: pattern_star,
1304
+ punching_grid_size: 1.5f,
1305
+ cutout_size: 0.68f,
1306
+ cutout_roundness: 0.5f,
1307
+ cutout_bevel_width: 0.44f,
1308
+ cutout_bump_strength: 1.5f,
1309
+ hexagonal_grid: true,
1310
+ square_grid_offset: 0.0f,
1311
+ horizontal_offset: true,
1312
+
1313
+ // Material Parameters
1314
+ infinite_tiling: false,
1315
+ sheet_brightness: 0.85f,
1316
+ roughness: 0.55f,
1317
+ streaks: 0.0f,
1318
+ scratch_bump_factor: 0.0f,
1319
+ imperfections_amount: 0.33f,
1320
+ impurities_weight_1: 0.75f,
1321
+ impurities_weight_2: 0.43f,
1322
+ impurities_weight_3: 1.0f,
1323
+ enable_round_corners: false,
1324
+ roundcorner_radius: 0.01f,
1325
+ across_materials: false,
1326
+ texture_translate: 0.0f,
1327
+ texture_rotate: 0.0f,
1328
+ texture_scale: 1.0f,
1329
+ uv_space_index: 0
1330
+ );
Material/material_0404/Bronze_Sheet_Punched.mdl ADDED
@@ -0,0 +1,1267 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2024 NVIDIA Corporation. All rights reserved. *
3
+ ******************************************************************************
4
+
5
+ Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge,
6
+ to any person obtaining a copy of the sample definition code that uses our
7
+ Material Definition Language (the "MDL Materials"), to reproduce and distribute
8
+ the MDL Materials, including without limitation the rights to use, copy, merge,
9
+ publish, distribute, and sell modified and unmodified copies of the MDL
10
+ Materials, and to permit persons to whom the MDL Materials is furnished to do
11
+ so, in all cases solely for use with NVIDIA's Material Definition Language,
12
+ subject to the following further conditions:
13
+
14
+ 1. The above copyright notices, this list of conditions, and the disclaimer
15
+ that follows shall be retained in all copies of one or more of the MDL
16
+ Materials, including in any software with which the MDL Materials are bundled,
17
+ redistributed, and/or sold, and included either as stand-alone text files,
18
+ human-readable headers or in the appropriate machine-readable metadata fields
19
+ within text or binary files as long as those fields can be easily viewed by the
20
+ user, as applicable.
21
+ 2. The name of NVIDIA shall not be used to promote, endorse or advertise any
22
+ Modified Version without specific prior written permission, except a) to comply
23
+ with the notice requirements otherwise contained herein; or b) to acknowledge
24
+ the contribution(s) of NVIDIA.
25
+
26
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
27
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
28
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
29
+ TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR
30
+ ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL,
31
+ INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF
32
+ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE
33
+ THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.
34
+ */
35
+
36
+
37
+ mdl 1.6;
38
+
39
+ import ::anno::*;
40
+ import ::base::*;
41
+ import ::df::*;
42
+ import ::math::*;
43
+ import ::state::*;
44
+ import ::tex::*;
45
+ import ::nvidia::core_definitions::blend_colors;
46
+ import ::nvidia::core_definitions::dimension;
47
+
48
+
49
+ const string COPYRIGHT =
50
+ " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
51
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
52
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
53
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
54
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
55
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
56
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
57
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
58
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
59
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
60
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
61
+
62
+
63
+ const string DESCRIPTION = "A bronze sheet metal material with tweaks to add surface imperfections";
64
+
65
+
66
+ float4 tile_select(uniform int select = 0)
67
+ {
68
+ switch (select)
69
+ {
70
+ case 0: return float4(0.000, 0.333, 0.666, 1.000);
71
+ case 1: return float4(0.333, 0.666, 0.666, 1.000);
72
+ case 2: return float4(0.666, 1.000, 0.666, 1.000);
73
+
74
+ case 3: return float4(0.000, 0.333, 0.333, 0.666);
75
+ case 4: return float4(0.333, 0.666, 0.333, 0.666);
76
+ case 5: return float4(0.666, 1.000, 0.333, 0.666);
77
+
78
+ case 6: return float4(0.000, 0.333, 0.000, 0.333);
79
+ case 7: return float4(0.333, 0.666, 0.000, 0.333);
80
+ case 8: return float4(0.666, 1.000, 0.000, 0.333);
81
+
82
+ default: return float4(0.000, 0.333, 0.000, 0.333);
83
+ }
84
+ }
85
+
86
+ export struct vm_coordinates
87
+ [[
88
+ ::anno::hidden()
89
+ ]]
90
+ {
91
+ float2 uv;
92
+ float rotation;
93
+ int uv_space_index;
94
+ float4 carry;
95
+ };
96
+
97
+ enum vm_mono_select
98
+ [[
99
+ ::anno::description("Modes for the creation of a gray-scale value from a color."),
100
+ ::anno::hidden()
101
+ ]]
102
+ {
103
+ mono_r = 0,
104
+ mono_g = 1,
105
+ mono_b = 2,
106
+ mono_a = 3,
107
+ mono_average = 4
108
+ };
109
+
110
+ vm_coordinates vm_coord
111
+ (
112
+ float2 translation = float2(0.0f, 0.0) [[
113
+ ::anno::display_name("Translation"),
114
+ ::anno::description("Translates the coordinates.")
115
+ ]],
116
+ float rotation = 0.0f [[
117
+ ::anno::display_name("Rotation"),
118
+ ::anno::description("Rotates the coordinates in degrees.")
119
+ ]],
120
+ float2 scaling = float2(1.0f, 1.0f) [[
121
+ ::anno::display_name("Scaling"),
122
+ ::anno::description("Scales the coordinates.")
123
+ ]],
124
+ uniform int uv_space = 0 [[
125
+ ::anno::display_name("UV Space"),
126
+ ::anno::description("Chose the UV space.")
127
+ ]]
128
+ )
129
+ [[
130
+ ::anno::display_name("vm Transform"),
131
+ ::anno::description("Generates coordinates to be used in vm_lookup functions.")
132
+ ]]
133
+ {
134
+ vm_coordinates uv;
135
+ ::base::texture_coordinate_info info = ::base::coordinate_source( ::base::texture_coordinate_uvw, uv_space);
136
+ uv.rotation = (rotation * 3.1415926535897932384626433832f) / 180.f;
137
+ uv.uv = float2(info.position.x, info.position.y);
138
+ float sine = ::math::sin(uv.rotation);
139
+ float cosine = ::math::cos(uv.rotation);
140
+ float2x2 rot = float2x2(cosine, -sine, sine, cosine);
141
+ uv.uv = rot * uv.uv;
142
+ uv.uv /= scaling;
143
+ uv.uv += translation;
144
+ return uv;
145
+ }
146
+
147
+
148
+ vm_coordinates vm_coord_hex(
149
+ vm_coordinates uv,
150
+ float scale = 1.0f)
151
+ {
152
+ vm_coordinates uv_return;
153
+ float2 uv_ = float2(uv.uv.x, uv.uv.y);
154
+
155
+ // same as from function get_hex above
156
+ float2 s = float2(1.0f, 1.7320508f);
157
+ float2 n = uv_ - float2(0.5f, 1.0f);
158
+ float4 c = ::math::floor(float4(uv_.x, uv_.y, n.x, n.y)/float4(s.x, s.y, s.x, s.y)) + 0.5f;
159
+ float2 h_1 = uv_ - float2(c.x, c.y) * s;
160
+ float2 h_2 = uv_ - (float2(c.z, c.w) + 0.5f) * s;
161
+ float4 uv_id = ::math::dot(h_1, h_1) < ::math::dot(h_2, h_2) ? float4(h_1.x, h_1.y, c.x, c.y) : float4(h_2.x, h_2.y, c.z, c.w);
162
+
163
+ uv_return.uv = float2(uv_id.x*scale+0.5, uv_id.y*scale+0.5);
164
+ // unless we introduce random cell rotations where we need to compensate for this in the rotation
165
+ // we can just plain copy the rotation value
166
+ uv_return.rotation = uv.rotation;
167
+ return uv_return;
168
+ }
169
+
170
+ // Offsets a set of uv coordinates in either row (u) or column (v) direction
171
+ vm_coordinates vm_coord_rowcol_offset(
172
+ vm_coordinates uv,
173
+ float offset,
174
+ bool horizontal_offset = true
175
+ )
176
+ {
177
+ // if (horizontal_offset)
178
+ // {
179
+ // uv.uv = float2( uv.uv.x + ::math::floor(uv.uv.y) * offset, uv.uv.y);
180
+ // }
181
+ // else
182
+ // {
183
+ // uv.uv = float2(uv.uv.x, uv.uv.y + ::math::floor(uv.uv.x) * offset);
184
+ // }
185
+
186
+ // Workaround
187
+ int index = horizontal_offset ? 0 : 1;
188
+ uv.uv[index] += ::math::floor(uv.uv[index ^ 1]) * offset;
189
+
190
+ return uv;
191
+ }
192
+
193
+ vm_coordinates vm_coord_grid(
194
+ vm_coordinates uv,
195
+ float scale = 1.0f
196
+ )
197
+ {
198
+ float2x2 scal = float2x2(scale, 0., 0., scale);
199
+ uv.uv = ::math::frac(uv.uv);
200
+ uv.uv -= 0.5f;
201
+ uv.uv = scal * uv.uv;
202
+ uv.uv = uv.uv + 0.5f;
203
+ return uv;
204
+ }
205
+
206
+ ::base::texture_return vm_tex_lookup(
207
+ uniform texture_2d tex,
208
+ vm_coordinates uv = vm_coord(),
209
+ uniform vm_mono_select mono_source = mono_a,
210
+ float4 scale = float4(1.0f),
211
+
212
+ uniform ::tex::wrap_mode wrap_u = ::tex::wrap_repeat,
213
+ uniform ::tex::wrap_mode wrap_v = ::tex::wrap_repeat,
214
+ uniform float2 crop_u = float2(0.0, 1.0),
215
+ uniform float2 crop_v = float2(0.0, 1.0)
216
+ )
217
+ {
218
+ float mono;
219
+ float4 lookup = ::tex::lookup_float4(tex, uv.uv, wrap_u, wrap_v, crop_u, crop_v) * scale;
220
+ switch( mono_source ) {
221
+ case mono_r: mono = lookup.x;
222
+ break;
223
+ case mono_g: mono = lookup.y;
224
+ break;
225
+ case mono_b: mono = lookup.z;
226
+ break;
227
+ case mono_a: mono = lookup.w;
228
+ break;
229
+ case mono_average: mono = ::math::average(float3(lookup.x, lookup.y, lookup.z));
230
+ break;
231
+ }
232
+ return ::base::texture_return(color(lookup.x, lookup.y, lookup.z), mono);
233
+ }
234
+
235
+ // *** SET CUTOUT ENUM NAMES ***
236
+ export enum cutout_pattern
237
+ [[
238
+ ::anno::description("Cutout Pattern."),
239
+ ::anno::hidden()
240
+
241
+ ]]
242
+ {
243
+ pattern_circle = 0
244
+ [[ anno::display_name("Circle")]],
245
+ pattern_hexagon = 1
246
+ [[ anno::display_name("Hexagon")]],
247
+ pattern_line = 2
248
+ [[ anno::display_name("Line") ]],
249
+
250
+ pattern_square = 3
251
+ [[ anno::display_name("Square")]],
252
+ pattern_rectangle = 4
253
+ [[ anno::display_name("Rectangle")]],
254
+ pattern_cross = 5
255
+ [[ anno::display_name("Cross")]],
256
+
257
+ pattern_rhombus = 6
258
+ [[ anno::display_name("Rhombus")]],
259
+ pattern_triangle = 7
260
+ [[ anno::display_name("Triangle")]],
261
+ pattern_star = 8
262
+ [[ anno::display_name("Star")]]
263
+ };
264
+
265
+
266
+
267
+ float3 srgb2rgb(float3 val)
268
+ {
269
+ return ::math::pow(::math::max(val, float3(0.0f)), 2.2);
270
+ }
271
+
272
+
273
+ float uint2float(int x)
274
+ {
275
+ return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0);
276
+ }
277
+
278
+ int lowbias32(int x)
279
+ {
280
+ x ^= x >>> 16;
281
+ x *= 0x7feb352d;
282
+ x ^= x >>> 15;
283
+ x *= 0x846ca68b;
284
+ x ^= x >>> 16;
285
+ return x;
286
+ }
287
+
288
+ float2 rnd22(int2 p) {
289
+ float2 ret_val = float2(
290
+ uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f,
291
+ uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f
292
+ );
293
+ return ret_val;
294
+ }
295
+
296
+ ::base::texture_coordinate_info vmat_transform(
297
+ uniform float2 translation = float2(0.0, 0.0),
298
+ uniform float rotation = 0.0,
299
+ uniform float2 scaling = float2(1.0, 1.0),
300
+ uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw,
301
+ uniform int uv_space = 0
302
+ )
303
+ {
304
+ float4x4 scale =
305
+ float4x4(1.0 /scaling.x, 0. , 0. , 0.,
306
+ 0. , 1.0 /scaling.y , 0. , 0.,
307
+ 0. , 0. , 1.0, 0.,
308
+ translation.x , translation.y , 0.0, 1.);
309
+
310
+ float s = ::math::sin(rotation);
311
+ float c = ::math::cos(rotation);
312
+ float4x4 rotate =
313
+ float4x4( c , -s , 0.0 , 0.0,
314
+ s , c , 0.0 , 0.0,
315
+ 0.0, 0.0 , 1.0 , 0.0,
316
+ 0. , 0.0 , 0.0 , 1.);
317
+
318
+ return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space));
319
+ }
320
+
321
+ float2x2 invert_2x2(float2x2 M)
322
+ {
323
+ float det = M[0][0]*M[1][1] - M[0][1]*M[1][0];
324
+ //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/
325
+ return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]);
326
+ }
327
+
328
+ float3 nonrepeat_lookup(
329
+ uniform texture_2d texture = texture_2d(),
330
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
331
+ float texture_scale = 1.0,
332
+ float3 average_color = float3(0.5),
333
+ float patch_size = 8.0
334
+ )
335
+ {
336
+
337
+ float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale;
338
+ float Z = patch_size; // patch scale inside example texture
339
+ float CON = 1.0f;
340
+
341
+ float3 O = float3(0.f);
342
+ float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f);
343
+ float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space
344
+
345
+ float2 U = uv_in;
346
+ float2 V = M * uv_in; //pre-tilted hexa coordinates
347
+ int2 I = int2(::math::floor(V)); // hexa-tile id
348
+
349
+ // The mean color needs to be determined in Photoshop then to make the
350
+ // average color work out, take the float value and calculate the apropriate
351
+ // mean value as (value^(1/2.2))
352
+
353
+ float3 m = average_color;
354
+
355
+ float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W;
356
+ F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates
357
+
358
+ if( F[2] > 0.f )
359
+
360
+ O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON))
361
+ + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON))
362
+ + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON));
363
+ else
364
+ O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON))
365
+ + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON))
366
+ + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON));
367
+ O = m + O/::math::length(W);
368
+ O = ::math::clamp( (O), 0.0, 1.0);
369
+
370
+ return float3(O);
371
+ }
372
+
373
+
374
+ color endless_texture(
375
+ uniform texture_2d texture = texture_2d(),
376
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
377
+ float texture_scale = 10.0,
378
+ float3 average_color = float3(0.5, 0.5, 1.0),
379
+ float patch_size = 8.0,
380
+ bool gamma_correct_lookup = true
381
+ )
382
+ {
383
+ return gamma_correct_lookup ? color(srgb2rgb(
384
+ nonrepeat_lookup (
385
+ texture: texture,
386
+ uvw: uvw,
387
+ texture_scale: texture_scale,
388
+ average_color: average_color,
389
+ patch_size: patch_size
390
+ ))
391
+ ) : color(nonrepeat_lookup (
392
+ texture: texture,
393
+ uvw: uvw,
394
+ texture_scale: texture_scale,
395
+ average_color: average_color,
396
+ patch_size: patch_size
397
+ ));
398
+ }
399
+
400
+
401
+ color gradient_lookup_smooth(uniform texture_2d gradient_texture, float position, float gradient_select = 0)
402
+ {
403
+ // Pixel centers lie in the middle. To properly access the pixel centers of the gradients, apply an offset
404
+ float2 texel_coord = float2(position, gradient_select + (0.5f / ::tex::height(gradient_texture)));
405
+ return color(::tex::lookup_float3(gradient_texture, texel_coord));
406
+ }
407
+
408
+ float remap_xy_to_0_1(float input, float x, float y)
409
+ {
410
+ return (input - x)/(y - x);
411
+ }
412
+
413
+ float histogram_scan_big(float input, float width, float position)
414
+ {
415
+ return ::math::clamp(
416
+ remap_xy_to_0_1(input,
417
+ ::math::lerp(-width, 1.0, position),
418
+ ::math::lerp(0.0, 1.0 + width, position)),
419
+ 0.0,
420
+ 1.0);
421
+ }
422
+
423
+ export material Bronze_Sheet_Punched(
424
+ uniform bool infinite_tiling = false [[
425
+ ::anno::description("Enables infinite tiling feature which removes repeating texture patterns. Note that depending on the material this feature changes the appearance of the material slightly."),
426
+ ::anno::display_name("Infinite Tiling"),
427
+ ::anno::in_group("Appearance", "Infinite Tiing"),
428
+ ::anno::ui_order(0)
429
+ ]],
430
+ float copper_tint = 0.5f [[
431
+ ::anno::description("Blends between the bronze types. 0.0 yields yellowish bronze, increasing the copper amount fades to reddish bronze."),
432
+ ::anno::display_name("Copper Tint"),
433
+ ::anno::in_group("Appearance", "Main"),
434
+ ::anno::hard_range(0.f, 1.f),
435
+ ::anno::ui_order(1)
436
+ ]],
437
+ float sheet_brightness = .85f [[
438
+ ::anno::description("Adjusts the brightness of the reflection."),
439
+ ::anno::display_name("Brightness"),
440
+ ::anno::in_group("Appearance", "Main"),
441
+ ::anno::hard_range(0.f, 1.f),
442
+ ::anno::ui_order(2)
443
+ ]],
444
+ float roughness = 0.5f [[
445
+ ::anno::description("Higher values lead to blurrier reflections."),
446
+ ::anno::display_name("Roughness"),
447
+ ::anno::in_group("Appearance", "Main"),
448
+ ::anno::hard_range(0.f, 1.f),
449
+ ::anno::ui_order(3)
450
+ ]],
451
+ float streaks = 0.05f [[
452
+ ::anno::description("Reveals streaks from the manufacturing process."),
453
+ ::anno::display_name("Streaks Weight"),
454
+ ::anno::in_group("Appearance", "Main"),
455
+ ::anno::hard_range(0.f, 1.f),
456
+ ::anno::ui_order(4)
457
+ ]],
458
+ uniform float scratch_bump_factor = 0.05f [[
459
+ ::anno::description("Determines the degree of bumpiness."),
460
+ ::anno::display_name("Bump Factor Streaks"),
461
+ ::anno::in_group("Appearance", "Main"),
462
+ ::anno::ui_order(5)
463
+ ]],
464
+ float imperfections_amount = .265f [[
465
+ ::anno::description("Balances between a perfectly smooth metal and one that shows imperfections."),
466
+ ::anno::display_name("Imperfections Amount"),
467
+ ::anno::in_group("Appearance", "Imperfections"),
468
+ ::anno::hard_range(0.f, 1.f),
469
+ ::anno::ui_order(6)
470
+ ]],
471
+ uniform float impurities_weight_1 = 0.75f [[
472
+ ::anno::description("Adds impurities which have an influence on the reflection."),
473
+ ::anno::display_name("Directional Washed Ratio"),
474
+ ::anno::in_group("Appearance", "Imperfections"),
475
+ ::anno::hard_range(0.f, 1.f),
476
+ ::anno::ui_order(7)
477
+ ]],
478
+ uniform float impurities_weight_2 = 0.43f [[
479
+ ::anno::description("Adds impurities which have an influence on the reflection."),
480
+ ::anno::display_name("Noisy Ratio"),
481
+ ::anno::in_group("Appearance", "Imperfections"),
482
+ ::anno::hard_range(0.f, 1.f),
483
+ ::anno::ui_order(8)
484
+ ]],
485
+ uniform float impurities_weight_3 = 0.1f [[
486
+ ::anno::description("Adds impurities which have an influence on the reflection."),
487
+ ::anno::display_name("Soft Splotches Ratio"),
488
+ ::anno::in_group("Appearance", "Imperfections"),
489
+ ::anno::hard_range(0.f, 1.f),
490
+ ::anno::ui_order(9)
491
+ ]],
492
+ uniform float2 texture_translate = 0.f [[
493
+ ::anno::description("Controls the position of the texture."),
494
+ ::anno::display_name("Texture Translate"),
495
+ ::anno::in_group("Transform"),
496
+ ::anno::ui_order(10)
497
+ ]],
498
+ uniform float texture_rotate = 0.f [[
499
+ ::anno::description("Rotates angle of the texture in degrees."),
500
+ ::anno::display_name("Texture Rotate"),
501
+ ::anno::in_group("Transform"),
502
+ ::anno::ui_order(11)
503
+ ]],
504
+ uniform float2 texture_scale = 1.0f [[
505
+ ::anno::description("Larger numbers increase the size."),
506
+ ::anno::display_name("Texture Scale"),
507
+ ::anno::in_group("Transform"),
508
+ ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)),
509
+ ::anno::ui_order(12)
510
+ ]],
511
+ uniform int uv_space_index = 0 [[
512
+ ::anno::description("Uses selected UV space for material."),
513
+ ::anno::display_name("UV Space Index"),
514
+ ::anno::in_group("Transform"),
515
+ ::anno::ui_order(13)
516
+ ]],
517
+ uniform bool enable_round_corners = false [[
518
+ ::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."),
519
+ ::anno::display_name("Enable Round Corners"),
520
+ ::anno::in_group("Round Corners"),
521
+ ::anno::ui_order(14)
522
+ ]],
523
+ uniform float roundcorners_radius_mm = 1.5f [[
524
+ ::anno::description("Radius of the rounded corners in millimeters."),
525
+ ::anno::display_name("Round Corner Radius (mm)"),
526
+ ::anno::in_group("Round Corners"),
527
+ ::anno::soft_range(0.f, 10.f),
528
+ ::anno::ui_order(15)
529
+ ]],
530
+ uniform bool across_materials = false [[
531
+ ::anno::description("Applies the round corner effect across different materials when enabled."),
532
+ ::anno::display_name("Across Materials"),
533
+ ::anno::in_group("Round Corners"),
534
+ ::anno::ui_order(16)
535
+ ]])
536
+ [[
537
+ ::anno::author("NVIDIA vMaterials"),
538
+ ::anno::contributor("Rüdiger Raab"),
539
+ ::anno::contributor("Maik Rohland"),
540
+ ::anno::display_name("Bronze Sheet - Template"),
541
+ ::anno::description(DESCRIPTION),
542
+ ::anno::copyright_notice(COPYRIGHT),
543
+ ::anno::hidden(),
544
+ ::anno::thumbnail("./.thumbs/Bronze_Sheet_Punched.Bronze_Sheet_Punched.png"),
545
+ ::anno::key_words(string[]("metal", "bronze", "decorative", "reflective", "new", "smooth", "shiny", "sheet", "sanitary", "construction", "design", "yellow", "warm"))
546
+ ]]
547
+ =
548
+ let {
549
+ float copper_amount_remap = copper_tint / 1.5f;
550
+ bool tmp0 = false;
551
+ material_surface tmp1(::df::color_custom_curve_layer(gradient_lookup_smooth(texture_2d("./bronze_gradients.png", ::tex::gamma_srgb), 0.5f, copper_amount_remap), color(0.998699009f, 1.f, 1.f), 5.f, color(::math::lerp(0.400000006f, 1.f, sheet_brightness) * ::math::lerp(1.f, ::math::pow(float3(::base::file_texture(texture_2d("./sheet_metal_R_rough_G_ao_B_streaks.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 2.20000005f), ::math::lerp(0.f, 0.300000012f, streaks))), ::df::weighted_layer(0.0700000003f, ::df::microfacet_ggx_smith_bsdf(0.150000006f, 0.150000006f, gradient_lookup_smooth(texture_2d("./bronze_gradients.png", ::tex::gamma_srgb), 0.5f, copper_amount_remap), gradient_lookup_smooth(texture_2d("./bronze_gradients.png", ::tex::gamma_srgb), 0.5f, copper_amount_remap), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::microfacet_ggx_smith_bsdf((::math::lerp(roughness * 0.5f, (impurities_weight_1 + impurities_weight_2 + impurities_weight_3 > 0.f ? impurities_weight_1 / (impurities_weight_1 + impurities_weight_2 + impurities_weight_3) : 0.333299994f) * roughness * float3(infinite_tiling ? endless_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.633000016f, 0.495000005f, 0.542999983f), 2.f, false) : ::base::file_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] + (impurities_weight_1 + impurities_weight_2 + impurities_weight_3 > 0.f ? impurities_weight_2 / (impurities_weight_1 + impurities_weight_2 + impurities_weight_3) : 0.333299994f) * roughness * float3(infinite_tiling ? endless_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.633000016f, 0.495000005f, 0.542999983f), 2.f, false) : ::base::file_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1] + (impurities_weight_1 + impurities_weight_2 + impurities_weight_3 > 0.f ? impurities_weight_3 / (impurities_weight_1 + impurities_weight_2 + impurities_weight_3) : 0.333299994f) * roughness * float3(infinite_tiling ? endless_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.633000016f, 0.495000005f, 0.542999983f), 2.f, false) : ::base::file_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], imperfections_amount) + (float3(::base::file_texture(texture_2d("./sheet_metal_R_rough_G_ao_B_streaks.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] - 0.5f) * (streaks * 0.5f * 0.5f)) * (::math::lerp(roughness * 0.5f, (impurities_weight_1 + impurities_weight_2 + impurities_weight_3 > 0.f ? impurities_weight_1 / (impurities_weight_1 + impurities_weight_2 + impurities_weight_3) : 0.333299994f) * roughness * float3(infinite_tiling ? endless_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.633000016f, 0.495000005f, 0.542999983f), 2.f, false) : ::base::file_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] + (impurities_weight_1 + impurities_weight_2 + impurities_weight_3 > 0.f ? impurities_weight_2 / (impurities_weight_1 + impurities_weight_2 + impurities_weight_3) : 0.333299994f) * roughness * float3(infinite_tiling ? endless_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.633000016f, 0.495000005f, 0.542999983f), 2.f, false) : ::base::file_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1] + (impurities_weight_1 + impurities_weight_2 + impurities_weight_3 > 0.f ? impurities_weight_3 / (impurities_weight_1 + impurities_weight_2 + impurities_weight_3) : 0.333299994f) * roughness * float3(infinite_tiling ? endless_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.633000016f, 0.495000005f, 0.542999983f), 2.f, false) : ::base::file_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], imperfections_amount) + (float3(::base::file_texture(texture_2d("./sheet_metal_R_rough_G_ao_B_streaks.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] - 0.5f) * (streaks * 0.5f * 0.5f)), (::math::lerp(roughness * 0.5f, (impurities_weight_1 + impurities_weight_2 + impurities_weight_3 > 0.f ? impurities_weight_1 / (impurities_weight_1 + impurities_weight_2 + impurities_weight_3) : 0.333299994f) * roughness * float3(infinite_tiling ? endless_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.633000016f, 0.495000005f, 0.542999983f), 2.f, false) : ::base::file_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] + (impurities_weight_1 + impurities_weight_2 + impurities_weight_3 > 0.f ? impurities_weight_2 / (impurities_weight_1 + impurities_weight_2 + impurities_weight_3) : 0.333299994f) * roughness * float3(infinite_tiling ? endless_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.633000016f, 0.495000005f, 0.542999983f), 2.f, false) : ::base::file_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1] + (impurities_weight_1 + impurities_weight_2 + impurities_weight_3 > 0.f ? impurities_weight_3 / (impurities_weight_1 + impurities_weight_2 + impurities_weight_3) : 0.333299994f) * roughness * float3(infinite_tiling ? endless_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.633000016f, 0.495000005f, 0.542999983f), 2.f, false) : ::base::file_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], imperfections_amount) + (float3(::base::file_texture(texture_2d("./sheet_metal_R_rough_G_ao_B_streaks.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] - 0.5f) * (streaks * 0.5f * 0.5f)) * (::math::lerp(roughness * 0.5f, (impurities_weight_1 + impurities_weight_2 + impurities_weight_3 > 0.f ? impurities_weight_1 / (impurities_weight_1 + impurities_weight_2 + impurities_weight_3) : 0.333299994f) * roughness * float3(infinite_tiling ? endless_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.633000016f, 0.495000005f, 0.542999983f), 2.f, false) : ::base::file_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] + (impurities_weight_1 + impurities_weight_2 + impurities_weight_3 > 0.f ? impurities_weight_2 / (impurities_weight_1 + impurities_weight_2 + impurities_weight_3) : 0.333299994f) * roughness * float3(infinite_tiling ? endless_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.633000016f, 0.495000005f, 0.542999983f), 2.f, false) : ::base::file_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1] + (impurities_weight_1 + impurities_weight_2 + impurities_weight_3 > 0.f ? impurities_weight_3 / (impurities_weight_1 + impurities_weight_2 + impurities_weight_3) : 0.333299994f) * roughness * float3(infinite_tiling ? endless_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.633000016f, 0.495000005f, 0.542999983f), 2.f, false) : ::base::file_texture(texture_2d("./sheet_metal_multi_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], imperfections_amount) + (float3(::base::file_texture(texture_2d("./sheet_metal_R_rough_G_ao_B_streaks.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] - 0.5f) * (streaks * 0.5f * 0.5f)), color(1.f, 1.f, 1.f), color(0.577580988f, 0.577580988f, 0.577580988f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::math::normalize(::math::lerp(::state::normal(), ::base::tangent_space_normal_texture(texture_2d("./sheet_metal_norm.jpg", ::tex::gamma_linear), scratch_bump_factor, 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), histogram_scan_big(float3(::base::file_texture(texture_2d("./sheet_metal_R_rough_G_ao_B_streaks.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.242000014f, 0.850000024f)))), bsdf(), ::math::normalize(::math::lerp(::state::normal(), ::base::tangent_space_normal_texture(texture_2d("./sheet_metal_norm.jpg", ::tex::gamma_linear), scratch_bump_factor, 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), histogram_scan_big(float3(::base::file_texture(texture_2d("./sheet_metal_R_rough_G_ao_B_streaks.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.242000014f, 0.850000024f)))), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
552
+ material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
553
+ color tmp3 = color(1.f, 1.f, 1.f);
554
+ 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));
555
+ material_geometry tmp5(float3(0.f), 1.f, enable_round_corners ? ::state::rounded_corner_normal(roundcorners_radius_mm * 0.00100000005f, across_materials, 1.f) : ::state::normal());
556
+ hair_bsdf tmp6 = hair_bsdf();
557
+ } in
558
+ material(
559
+ thin_walled: tmp0,
560
+ surface: tmp1,
561
+ backface: tmp2,
562
+ ior: tmp3,
563
+ volume: tmp4,
564
+ geometry: tmp5,
565
+ hair: tmp6);
566
+
567
+
568
+ export material Bronze_Sheet_Punched_(
569
+ // Cutout parameters
570
+
571
+ uniform cutout_pattern shape_select = pattern_circle //select atlas tile here
572
+ [[
573
+ ::anno::description("Select a cutout shape."),
574
+ ::anno::display_name("Cutout Shape"),
575
+ ::anno::in_group("Appearance", "Cutout"),
576
+ ::anno::ui_order(0)
577
+ ]],
578
+ float2 punching_grid_size = float2(.5f, .5f)
579
+ [[
580
+ ::anno::description("Scales the size of the punching grid."),
581
+ ::anno::display_name("Punching Grid Size"),
582
+ ::anno::in_group("Appearance", "Cutout"),
583
+ ::anno::ui_order(1)
584
+ ]],
585
+ float cutout_size = .92f
586
+ [[
587
+ ::anno::description("Scales the size of the cutout pattern independently from the base material."),
588
+ ::anno::display_name("Cutout Size"),
589
+ ::anno::hard_range(0.f, 1.2f),
590
+ ::anno::soft_range(0.f, 1.0f),
591
+ ::anno::in_group("Appearance", "Cutout"),
592
+ ::anno::ui_order(2)
593
+ ]],
594
+ float cutout_roundness = .4f
595
+ [[
596
+ ::anno::description("At low values it makes the cutouts sharper. Higher values give the shapes a more rounded look."),
597
+ ::anno::display_name("Cutout Roundness"),
598
+ ::anno::hard_range(0.f, 1.f),
599
+ ::anno::in_group("Appearance", "Cutout"),
600
+ ::anno::ui_order(3)
601
+ ]],
602
+ float cutout_bevel_width = 0.5f
603
+ [[
604
+ ::anno::description("Adjusts the width of the bevel transition."),
605
+ ::anno::display_name("Cutout Bevel Width"),
606
+ ::anno::hard_range(0.f, 1.f),
607
+ ::anno::in_group("Appearance", "Cutout"),
608
+ ::anno::ui_order(4)
609
+ ]],
610
+ float cutout_bump_strength = .8f
611
+ [[
612
+ ::anno::description("Sets the strength of the bevelled normal around the cutout."),
613
+ ::anno::display_name("Cutout Bevel Strength"),
614
+ ::anno::soft_range(0.0f, 1.0f),
615
+ ::anno::hard_range(0.0f, 2.0f),
616
+ ::anno::in_group("Appearance", "Cutout"),
617
+ ::anno::ui_order(5)
618
+ ]],
619
+ // Grid Layout parameters
620
+ bool hexagonal_grid = true
621
+ [[
622
+ ::anno::description("When enabled, the punching will occur on a hexagonal grid, otherwise a square grid."),
623
+ ::anno::display_name("Enable Hexagonal Grid"),
624
+ ::anno::in_group("Appearance", "Cutout Layout"),
625
+ ::anno::ui_order(6)
626
+ ]],
627
+ float square_grid_offset = 0.0f
628
+ [[
629
+ ::anno::description("Offsets each row of the grid by a certain amount."),
630
+ ::anno::display_name("Square Grid Offset"),
631
+ ::anno::in_group("Appearance", "Cutout Layout"),
632
+ ::anno::enable_if("hexagonal_grid==false"),
633
+ ::anno::ui_order(7)
634
+ ]],
635
+ bool horizontal_offset = true
636
+ [[
637
+ ::anno::description("Choose whether to offset either in row or column direction."),
638
+ ::anno::display_name("Horizontal Offset"),
639
+ ::anno::in_group("Appearance", "Cutout Layout"),
640
+ ::anno::enable_if("hexagonal_grid==false"),
641
+ ::anno::ui_order(8)
642
+ ]],
643
+
644
+
645
+
646
+ // Bronze Sheet parameters
647
+ uniform bool infinite_tiling = false [[
648
+ ::anno::description("Enables infinite tiling feature which removes repeating texture patterns. Note that depending on the material this feature changes the appearance of the material slightly."),
649
+ ::anno::display_name("Infinite Tiling"),
650
+ ::anno::in_group("Appearance", "Infinite Tiing"),
651
+ ::anno::ui_order(9)
652
+ ]],
653
+ float copper_tint = 0.5f [[
654
+ ::anno::description("Blends between the bronze types. 0.0 yields yellowish bronze, increasing the copper amount fades to reddish bronze."),
655
+ ::anno::display_name("Copper Tint"),
656
+ ::anno::in_group("Appearance", "Main"),
657
+ ::anno::hard_range(0.f, 1.f),
658
+ ::anno::ui_order(10)
659
+ ]],
660
+ float sheet_brightness = .85f [[
661
+ ::anno::description("Adjusts the brightness of the reflection."),
662
+ ::anno::display_name("Brightness"),
663
+ ::anno::in_group("Appearance", "Main"),
664
+ ::anno::hard_range(0.f, 1.f),
665
+ ::anno::ui_order(11)
666
+ ]],
667
+ float roughness = 0.5f [[
668
+ ::anno::description("Higher values lead to blurrier reflections."),
669
+ ::anno::display_name("Roughness"),
670
+ ::anno::in_group("Appearance", "Main"),
671
+ ::anno::hard_range(0.f, 1.f),
672
+ ::anno::ui_order(12)
673
+ ]],
674
+ float streaks = 0.05f [[
675
+ ::anno::description("Reveals streaks from the manufacturing process."),
676
+ ::anno::display_name("Streaks Weight"),
677
+ ::anno::in_group("Appearance", "Main"),
678
+ ::anno::hard_range(0.f, 1.f),
679
+ ::anno::ui_order(13)
680
+ ]],
681
+ uniform float scratch_bump_factor = 0.05f [[
682
+ ::anno::description("Determines the degree of bumpiness."),
683
+ ::anno::display_name("Bump Factor Streaks"),
684
+ ::anno::in_group("Appearance", "Main"),
685
+ ::anno::ui_order(14)
686
+ ]],
687
+ float imperfections_amount = 0.265f [[
688
+ ::anno::description("Balances between a perfectly smooth metal and one that shows imperfections."),
689
+ ::anno::display_name("Imperfections Amount"),
690
+ ::anno::in_group("Appearance", "Imperfections"),
691
+ ::anno::hard_range(0.f, 1.f),
692
+ ::anno::ui_order(15)
693
+ ]],
694
+ uniform float impurities_weight_1 = 0.75f [[
695
+ ::anno::description("Adds impurities which have an influence on the reflection."),
696
+ ::anno::display_name("Directional Washed Ratio"),
697
+ ::anno::in_group("Appearance", "Imperfections"),
698
+ ::anno::hard_range(0.f, 1.f),
699
+ ::anno::ui_order(16)
700
+ ]],
701
+ uniform float impurities_weight_2 = 0.43f [[
702
+ ::anno::description("Adds impurities which have an influence on the reflection."),
703
+ ::anno::display_name("Noisy Ratio"),
704
+ ::anno::in_group("Appearance", "Imperfections"),
705
+ ::anno::hard_range(0.f, 1.f),
706
+ ::anno::ui_order(17)
707
+ ]],
708
+ uniform float impurities_weight_3 = 0.0f [[
709
+ ::anno::description("Adds impurities which have an influence on the reflection."),
710
+ ::anno::display_name("Soft Splotches Ratio"),
711
+ ::anno::in_group("Appearance", "Imperfections"),
712
+ ::anno::hard_range(0.f, 1.f),
713
+ ::anno::ui_order(18)
714
+ ]],
715
+ uniform float2 texture_translate = 0.f [[
716
+ ::anno::description("Controls the position of the texture."),
717
+ ::anno::display_name("Texture Translate"),
718
+ ::anno::in_group("Transform"),
719
+ ::anno::ui_order(19)
720
+ ]],
721
+ uniform float texture_rotate = 0.f [[
722
+ ::anno::description("Rotates angle of the texture in degrees."),
723
+ ::anno::display_name("Texture Rotate"),
724
+ ::anno::in_group("Transform"),
725
+ ::anno::ui_order(20)
726
+ ]],
727
+ uniform float2 texture_scale = 1.0f [[
728
+ ::anno::description("Larger numbers increase the size."),
729
+ ::anno::display_name("Texture Scale"),
730
+ ::anno::in_group("Transform"),
731
+ ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)),
732
+ ::anno::ui_order(21)
733
+ ]],
734
+ uniform int uv_space_index = 0 [[
735
+ ::anno::description("Uses selected UV space for material."),
736
+ ::anno::display_name("UV Space Index"),
737
+ ::anno::in_group("Transform"),
738
+ ::anno::ui_order(22)
739
+ ]],
740
+ uniform bool enable_round_corners = false [[
741
+ ::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."),
742
+ ::anno::display_name("Enable Round Corners"),
743
+ ::anno::in_group("Round Corners"),
744
+ ::anno::ui_order(23)
745
+ ]],
746
+ uniform float roundcorners_radius_mm = 1.5f [[
747
+ ::anno::description("Radius of the rounded corners in millimeters."),
748
+ ::anno::display_name("Round Corner Radius (mm)"),
749
+ ::anno::in_group("Round Corners"),
750
+ ::anno::soft_range(0.f, 10.f),
751
+ ::anno::ui_order(24)
752
+ ]],
753
+ uniform bool across_materials = false [[
754
+ ::anno::description("Applies the round corner effect across different materials when enabled."),
755
+ ::anno::display_name("Across Materials"),
756
+ ::anno::in_group("Round Corners"),
757
+ ::anno::ui_order(25)
758
+ ]]
759
+
760
+ )
761
+ [[
762
+ ::anno::author("NVIDIA vMaterials"),
763
+ ::anno::contributor("Rüdiger Raab"),
764
+ ::anno::contributor("Maik Rohland"),
765
+ ::anno::display_name("Bronze Sheet - Circular Punch"),
766
+ ::anno::description(DESCRIPTION),
767
+ ::anno::copyright_notice(COPYRIGHT),
768
+ ::anno::thumbnail("./.thumbs/Bronze_Sheet_Punched.Bronze_Sheet_Punched_.png"),
769
+ ::anno::key_words(string[]("metal", "bronze", "decorative", "reflective", "new", "smooth", "shiny", "sheet", "sanitary", "construction", "design", "architecture", "yellow", "punched", "punching", "circular", "warm"))
770
+ ]] = let
771
+ {
772
+ material base_mat = Bronze_Sheet_Punched(
773
+ infinite_tiling: infinite_tiling,
774
+ copper_tint: copper_tint,
775
+ sheet_brightness: sheet_brightness,
776
+ roughness: roughness,
777
+ streaks: streaks,
778
+ scratch_bump_factor: scratch_bump_factor,
779
+ imperfections_amount: imperfections_amount,
780
+ impurities_weight_1: impurities_weight_1,
781
+ impurities_weight_2: impurities_weight_2,
782
+ impurities_weight_3: impurities_weight_3,
783
+ texture_translate: texture_translate,
784
+ texture_rotate: texture_rotate,
785
+ texture_scale: texture_scale,
786
+ uv_space_index: uv_space_index,
787
+ enable_round_corners: enable_round_corners,
788
+ roundcorners_radius_mm: roundcorners_radius_mm,
789
+ across_materials: across_materials
790
+ );
791
+ texture_2d punching_cutout = texture_2d("./atlas_02_norm_dist.png", ::tex::gamma_linear);
792
+
793
+ // remap range of slider to avoid artifacts in the bevelling
794
+ float2 punching_scale = texture_scale * 0.01f * punching_grid_size;
795
+ float cutout_roundness_ = cutout_roundness*0.6f+0.4f;
796
+ float cutout_size_lin = (1.0f/cutout_size);
797
+ float cutout_bevel_width_ = 0.1 + cutout_bevel_width * 0.9f;
798
+
799
+ vm_coordinates uv = vm_coord(
800
+ translation: texture_translate,
801
+ rotation: texture_rotate,
802
+ scaling: punching_scale,
803
+ uv_space: uv_space_index
804
+ );
805
+
806
+ vm_coordinates punching_uv = hexagonal_grid ? vm_coord_hex(
807
+ uv: uv,
808
+ scale: cutout_roundness_ * cutout_size_lin
809
+ ) : vm_coord_grid(
810
+ uv: vm_coord_rowcol_offset(
811
+ uv: uv,
812
+ offset: square_grid_offset,
813
+ horizontal_offset: horizontal_offset
814
+ ),
815
+ scale: cutout_roundness_ * cutout_size_lin
816
+ );
817
+ // select the correct subtile from the atlas
818
+ float4 crop = tile_select(shape_select);
819
+
820
+ ::base::texture_return lookup = vm_tex_lookup(
821
+ tex: punching_cutout,
822
+ uv: punching_uv,
823
+ mono_source: mono_a,
824
+ scale: float4(1.0f),
825
+ crop_u: float2(crop.x, crop.y),
826
+ crop_v: float2(crop.z, crop.w),
827
+ wrap_u: ::tex::wrap_clamp,
828
+ wrap_v: ::tex::wrap_clamp
829
+ );
830
+
831
+ float low = (1.0 - cutout_roundness_);
832
+ float high = (cutout_size_lin * (cutout_bevel_width_ * 0.2f) * cutout_roundness_) + (1.0 - cutout_roundness_);
833
+ // remap x...y to (clamped) 0...1
834
+ float x = ::math::clamp((lookup.mono - low)/(high - low), 0.0, 1.0);
835
+ // spherical falloff
836
+ float falloff=::math::sqrt(1.0-x*x);
837
+ // masking falloff as the center of the cutout is flat
838
+ float masked_falloff=falloff<=0.0?1.0:falloff;
839
+
840
+ // where base material is still there, use the value of the base material
841
+ float cutout= ::math::min(falloff<=0.0?0.0:1.0, base_mat.geometry.cutout_opacity);
842
+
843
+ // bring in -.5 ... +.5 range and lerp between lookup and flat normal
844
+ float3 remap_norm = ::math::lerp(float3(lookup.tint), float3(0.5, 0.5, 1.0), masked_falloff) - float3(0.5);
845
+ float3 t_norm = ::math::normalize(remap_norm * float3(cutout_bump_strength, cutout_bump_strength, 1.0));
846
+
847
+ float3 rotfix_norm = float3(::math::cos(punching_uv.rotation) * t_norm.x - ::math::sin(punching_uv.rotation) * t_norm.y,
848
+ ::math::sin(punching_uv.rotation) * t_norm.x + ::math::cos(punching_uv.rotation) * t_norm.y,
849
+ t_norm.z);
850
+
851
+ float3 normal = ::state::texture_tangent_u(punching_uv.uv_space_index) * rotfix_norm.x +
852
+ ::state::texture_tangent_v(punching_uv.uv_space_index) * rotfix_norm.y +
853
+ ::state::normal() * rotfix_norm.z;
854
+
855
+ float3 final_normal = ::base::blend_normals(
856
+ base_normal: normal,
857
+ base_normal_weight: 1.0f,
858
+ detail_normal: base_mat.geometry.normal,
859
+ detail_normal_weight: 1.0f
860
+ );
861
+
862
+ } in material(
863
+ surface: material_surface(
864
+ scattering: base_mat.surface.scattering
865
+ ),
866
+ volume: base_mat.volume,
867
+ ior: base_mat.ior,
868
+ thin_walled: true,
869
+ geometry: material_geometry(
870
+ displacement: base_mat.geometry.displacement,
871
+ normal: final_normal,
872
+ cutout_opacity: cutout
873
+ )
874
+ );
875
+
876
+ export material Bronze_Sheet_Punched_Small_Circular(*)
877
+ [[
878
+ ::anno::author("NVIDIA vMaterials"),
879
+ ::anno::contributor("Rüdiger Raab"),
880
+ ::anno::contributor("Maik Rohland"),
881
+ ::anno::display_name("Bronze Sheet - Small Circular Punch"),
882
+ ::anno::description(DESCRIPTION),
883
+ ::anno::copyright_notice(COPYRIGHT),
884
+ ::anno::thumbnail("./.thumbs/Bronze_Sheet_Punched.Bronze_Sheet_Punched_Small_Circular.png"),
885
+ ::anno::key_words(string[]("metal", "bronze", "decorative", "reflective", "new", "smooth", "shiny", "sheet", "sanitary", "construction", "design", "architecture", "yellow", "punched", "punching", "circular", "warm"))
886
+ ]] = Bronze_Sheet_Punched_
887
+ (
888
+ // Punching parameters
889
+ shape_select: pattern_circle,
890
+ punching_grid_size: 1.0f,
891
+ cutout_size: 0.5f,
892
+ cutout_roundness: 0.4f,
893
+ cutout_bevel_width: 0.5f,
894
+ cutout_bump_strength: 0.8f,
895
+ hexagonal_grid: true,
896
+ square_grid_offset: 0.0f,
897
+ horizontal_offset: true,
898
+
899
+ // Bronze Sheet Parameters
900
+ infinite_tiling: true,
901
+ copper_tint: 0.5f,
902
+ sheet_brightness: 0.85f,
903
+ roughness: 0.5f,
904
+ streaks: 0.05f,
905
+ scratch_bump_factor: 0.05f,
906
+ imperfections_amount: 0.265f,
907
+ impurities_weight_1: 0.75f,
908
+ impurities_weight_2: 0.43f,
909
+ impurities_weight_3: 0.00f,
910
+ texture_translate: 0.0f,
911
+ texture_rotate: 0.0f,
912
+ texture_scale: 1.0f,
913
+ enable_round_corners: false,
914
+ roundcorners_radius_mm: 1.0f,
915
+ across_materials: false,
916
+ uv_space_index: 0
917
+ );
918
+
919
+
920
+ export material Bronze_Sheet_Punched_Hexagonal(*)
921
+ [[
922
+ ::anno::author("NVIDIA vMaterials"),
923
+ ::anno::contributor("Rüdiger Raab"),
924
+ ::anno::contributor("Maik Rohland"),
925
+ ::anno::display_name("Bronze Sheet - Hexagonal Punch"),
926
+ ::anno::description(DESCRIPTION),
927
+ ::anno::copyright_notice(COPYRIGHT),
928
+ ::anno::thumbnail("./.thumbs/Bronze_Sheet_Punched.Bronze_Sheet_Punched_Hexagonal.png"),
929
+ ::anno::key_words(string[]("metal", "bronze", "decorative", "reflective", "new", "smooth", "shiny", "sheet", "sanitary", "construction", "design", "architecture", "yellow", "punched", "punching", "hexagonal", "warm"))
930
+ ]] = Bronze_Sheet_Punched_
931
+ (
932
+ // Punching parameters
933
+ shape_select: pattern_hexagon,
934
+ punching_grid_size: 1.5f,
935
+ cutout_size: .95f,
936
+ cutout_roundness: 0.4f,
937
+ cutout_bevel_width: 0.5f,
938
+ cutout_bump_strength: 1.5f,
939
+ hexagonal_grid: true,
940
+ square_grid_offset: 0.0f,
941
+ horizontal_offset: true,
942
+
943
+ // Bronze Sheet Parameters
944
+ infinite_tiling: true,
945
+ copper_tint: 0.5f,
946
+ sheet_brightness: 0.85f,
947
+ roughness: 0.5f,
948
+ streaks: 0.05f,
949
+ scratch_bump_factor: 0.05f,
950
+ imperfections_amount: 0.265f,
951
+ impurities_weight_1: 0.75f,
952
+ impurities_weight_2: 0.43f,
953
+ impurities_weight_3: 0.00f,
954
+ texture_translate: 0.0f,
955
+ texture_rotate: 0.0f,
956
+ texture_scale: 1.0f,
957
+ enable_round_corners: false,
958
+ roundcorners_radius_mm: 1.0f,
959
+ across_materials: false,
960
+ uv_space_index: 0
961
+ );
962
+
963
+
964
+ export material Bronze_Sheet_Punched_Hexagonal_Small(*)
965
+ [[
966
+ ::anno::author("NVIDIA vMaterials"),
967
+ ::anno::contributor("Rüdiger Raab"),
968
+ ::anno::contributor("Maik Rohland"),
969
+ ::anno::display_name("Bronze Sheet - Small Hexagonal Punch"),
970
+ ::anno::description(DESCRIPTION),
971
+ ::anno::copyright_notice(COPYRIGHT),
972
+ ::anno::thumbnail("./.thumbs/Bronze_Sheet_Punched.Bronze_Sheet_Punched_Hexagonal_Small.png"),
973
+ ::anno::key_words(string[]("metal", "bronze", "decorative", "reflective", "new", "smooth", "shiny", "sheet", "sanitary", "construction", "design", "architecture", "yellow", "punched", "punching", "hexagonal", "warm"))
974
+ ]] = Bronze_Sheet_Punched_
975
+ (
976
+ // Punching parameters
977
+ shape_select: pattern_hexagon,
978
+ punching_grid_size: float2(.75f),
979
+ cutout_size: .58f,
980
+ cutout_roundness: 0.4f,
981
+ cutout_bevel_width: 0.3f,
982
+ cutout_bump_strength: 1.5f,
983
+ hexagonal_grid: true,
984
+ square_grid_offset: 0.0f,
985
+ horizontal_offset: true,
986
+
987
+ // Bronze Sheet Parameters
988
+ infinite_tiling: true,
989
+ copper_tint: 0.5f,
990
+ sheet_brightness: 0.85f,
991
+ roughness: 0.5f,
992
+ streaks: 0.05f,
993
+ scratch_bump_factor: 0.05f,
994
+ imperfections_amount: 0.265f,
995
+ impurities_weight_1: 0.75f,
996
+ impurities_weight_2: 0.43f,
997
+ impurities_weight_3: 0.00f,
998
+ texture_translate: 0.0f,
999
+ texture_rotate: 0.0f,
1000
+ texture_scale: 1.0f,
1001
+ enable_round_corners: false,
1002
+ roundcorners_radius_mm: 1.0f,
1003
+ across_materials: false,
1004
+ uv_space_index: 0
1005
+ );
1006
+
1007
+ export material Bronze_Sheet_Punched_Square(*)
1008
+ [[
1009
+ ::anno::author("NVIDIA vMaterials"),
1010
+ ::anno::contributor("Rüdiger Raab"),
1011
+ ::anno::contributor("Maik Rohland"),
1012
+ ::anno::display_name("Bronze Sheet - Square Punch"),
1013
+ ::anno::description(DESCRIPTION),
1014
+ ::anno::copyright_notice(COPYRIGHT),
1015
+ ::anno::thumbnail("./.thumbs/Bronze_Sheet_Punched.Bronze_Sheet_Punched_Square.png"),
1016
+ ::anno::key_words(string[]("metal", "bronze", "decorative", "reflective", "new", "smooth", "shiny", "sheet", "sanitary", "construction", "design", "architecture", "yellow", "punched", "punching", "square", "warm"))
1017
+ ]] = Bronze_Sheet_Punched_
1018
+ (
1019
+ // Punching parameters
1020
+ shape_select: pattern_square,
1021
+ punching_grid_size: 1.2f,
1022
+ cutout_size: 0.56f,
1023
+ cutout_roundness: 0.1f,
1024
+ cutout_bevel_width: 0.5f,
1025
+ cutout_bump_strength: 1.5f,
1026
+ hexagonal_grid: false,
1027
+ square_grid_offset: 0.5f,
1028
+ horizontal_offset: true,
1029
+ // Bronze Sheet Parameters
1030
+ infinite_tiling: true,
1031
+ copper_tint: 0.5f,
1032
+ sheet_brightness: 0.85f,
1033
+ roughness: 0.5f,
1034
+ streaks: 0.05f,
1035
+ scratch_bump_factor: 0.05f,
1036
+ imperfections_amount: 0.265f,
1037
+ impurities_weight_1: 0.75f,
1038
+ impurities_weight_2: 0.43f,
1039
+ impurities_weight_3: 0.00f,
1040
+ texture_translate: 0.0f,
1041
+ texture_rotate: 0.0f,
1042
+ texture_scale: 1.0f,
1043
+ enable_round_corners: false,
1044
+ roundcorners_radius_mm: 1.0f,
1045
+ across_materials: false,
1046
+ uv_space_index: 0
1047
+ );
1048
+
1049
+
1050
+ export material Bronze_Sheet_Punched_Line(*)
1051
+ [[
1052
+ ::anno::author("NVIDIA vMaterials"),
1053
+ ::anno::contributor("Rüdiger Raab"),
1054
+ ::anno::contributor("Maik Rohland"),
1055
+ ::anno::display_name("Bronze Sheet - Line Punch"),
1056
+ ::anno::description(DESCRIPTION),
1057
+ ::anno::copyright_notice(COPYRIGHT),
1058
+ ::anno::thumbnail("./.thumbs/Bronze_Sheet_Punched.Bronze_Sheet_Punched_Line.png"),
1059
+ ::anno::key_words(string[]("metal", "bronze", "decorative", "reflective", "new", "smooth", "shiny", "sheet", "sanitary", "construction", "design", "architecture", "yellow", "punched", "punching", "line", "warm"))
1060
+ ]] = Bronze_Sheet_Punched_
1061
+ (
1062
+ // Punching parameters
1063
+ shape_select: pattern_line,
1064
+ punching_grid_size: 1.3f,
1065
+ cutout_size: 0.59f,
1066
+ cutout_roundness: 0.4f,
1067
+ cutout_bevel_width: 0.3f,
1068
+ cutout_bump_strength: 1.5f,
1069
+ hexagonal_grid: false,
1070
+ square_grid_offset: 0.3333f,
1071
+ horizontal_offset: true,
1072
+
1073
+ // Bronze Sheet Parameters
1074
+ infinite_tiling: true,
1075
+ copper_tint: 0.5f,
1076
+ sheet_brightness: 0.85f,
1077
+ roughness: 0.5f,
1078
+ streaks: 0.05f,
1079
+ scratch_bump_factor: 0.05f,
1080
+ imperfections_amount: 0.265f,
1081
+ impurities_weight_1: 0.75f,
1082
+ impurities_weight_2: 0.43f,
1083
+ impurities_weight_3: 0.00f,
1084
+ texture_translate: 0.0f,
1085
+ texture_rotate: 0.0f,
1086
+ texture_scale: 1.0f,
1087
+ enable_round_corners: false,
1088
+ roundcorners_radius_mm: 1.0f,
1089
+ across_materials: false,
1090
+ uv_space_index: 0
1091
+ );
1092
+
1093
+
1094
+ export material Bronze_Sheet_Punched_Cross(*)
1095
+ [[
1096
+ ::anno::author("NVIDIA vMaterials"),
1097
+ ::anno::contributor("Rüdiger Raab"),
1098
+ ::anno::contributor("Maik Rohland"),
1099
+ ::anno::display_name("Bronze Sheet - Cross Punch"),
1100
+ ::anno::description(DESCRIPTION),
1101
+ ::anno::copyright_notice(COPYRIGHT),
1102
+ ::anno::thumbnail("./.thumbs/Bronze_Sheet_Punched.Bronze_Sheet_Punched_Cross.png"),
1103
+ ::anno::key_words(string[]("metal", "bronze", "decorative", "reflective", "new", "smooth", "shiny", "sheet", "sanitary", "construction", "design", "architecture", "yellow", "punched", "punching", "cross", "warm"))
1104
+ ]] = Bronze_Sheet_Punched_
1105
+ (
1106
+ // Punching parameters
1107
+ shape_select: pattern_cross,
1108
+ punching_grid_size: 2.0f,
1109
+ cutout_size: 0.59f,
1110
+ cutout_roundness: 0.1f,
1111
+ cutout_bevel_width: 0.44f,
1112
+ cutout_bump_strength: 1.5f,
1113
+ hexagonal_grid: true,
1114
+ square_grid_offset: 0.0f,
1115
+ horizontal_offset: true,
1116
+
1117
+ // Bronze Sheet Parameters
1118
+ infinite_tiling: true,
1119
+ copper_tint: 0.5f,
1120
+ sheet_brightness: 0.85f,
1121
+ roughness: 0.5f,
1122
+ streaks: 0.05f,
1123
+ scratch_bump_factor: 0.05f,
1124
+ imperfections_amount: 0.265f,
1125
+ impurities_weight_1: 0.75f,
1126
+ impurities_weight_2: 0.43f,
1127
+ impurities_weight_3: 0.00f,
1128
+ texture_translate: 0.0f,
1129
+ texture_rotate: 0.0f,
1130
+ texture_scale: 1.0f,
1131
+ enable_round_corners: false,
1132
+ roundcorners_radius_mm: 1.0f,
1133
+ across_materials: false,
1134
+ uv_space_index: 0
1135
+ );
1136
+
1137
+
1138
+ export material Bronze_Sheet_Punched_Rhombus(*)
1139
+ [[
1140
+ ::anno::author("NVIDIA vMaterials"),
1141
+ ::anno::contributor("Rüdiger Raab"),
1142
+ ::anno::contributor("Maik Rohland"),
1143
+ ::anno::display_name("Bronze Sheet - Rhombus Punch"),
1144
+ ::anno::description(DESCRIPTION),
1145
+ ::anno::copyright_notice(COPYRIGHT),
1146
+ ::anno::thumbnail("./.thumbs/Bronze_Sheet_Punched.Bronze_Sheet_Punched_Rhombus.png"),
1147
+ ::anno::key_words(string[]("metal", "bronze", "decorative", "reflective", "new", "smooth", "shiny", "sheet", "sanitary", "construction", "design", "architecture", "yellow", "punched", "punching", "rhombus", "warm"))
1148
+ ]] = Bronze_Sheet_Punched_
1149
+ (
1150
+ // Punching parameters
1151
+ shape_select: pattern_rhombus,
1152
+ punching_grid_size: 1.4f,
1153
+ cutout_size: 1.0f,
1154
+ cutout_roundness: 0.8f,
1155
+ cutout_bevel_width: 0.5f,
1156
+ cutout_bump_strength: 1.5f,
1157
+ hexagonal_grid: true,
1158
+ square_grid_offset: 0.0f,
1159
+ horizontal_offset: true,
1160
+
1161
+ // Bronze Sheet Parameters
1162
+ infinite_tiling: true,
1163
+ copper_tint: 0.5f,
1164
+ sheet_brightness: 0.85f,
1165
+ roughness: 0.5f,
1166
+ streaks: 0.05f,
1167
+ scratch_bump_factor: 0.05f,
1168
+ imperfections_amount: 0.265f,
1169
+ impurities_weight_1: 0.75f,
1170
+ impurities_weight_2: 0.43f,
1171
+ impurities_weight_3: 0.00f,
1172
+ texture_translate: 0.0f,
1173
+ texture_rotate: 0.0f,
1174
+ texture_scale: 1.0f,
1175
+ enable_round_corners: false,
1176
+ roundcorners_radius_mm: 1.0f,
1177
+ across_materials: false,
1178
+ uv_space_index: 0
1179
+ );
1180
+
1181
+
1182
+ export material Bronze_Sheet_Punched_Triangle(*)
1183
+ [[
1184
+ ::anno::author("NVIDIA vMaterials"),
1185
+ ::anno::contributor("Rüdiger Raab"),
1186
+ ::anno::contributor("Maik Rohland"),
1187
+ ::anno::display_name("Bronze Sheet - Triangle Punch"),
1188
+ ::anno::description(DESCRIPTION),
1189
+ ::anno::copyright_notice(COPYRIGHT),
1190
+ ::anno::thumbnail("./.thumbs/Bronze_Sheet_Punched.Bronze_Sheet_Punched_Triangle.png"),
1191
+ ::anno::key_words(string[]("metal", "bronze", "decorative", "reflective", "new", "smooth", "shiny", "sheet", "sanitary", "construction", "design", "architecture", "yellow", "punched", "punching", "triangle", "triangular", "warm"))
1192
+ ]] = Bronze_Sheet_Punched_
1193
+ (
1194
+ // Punching parameters
1195
+ shape_select: pattern_triangle,
1196
+ punching_grid_size: 1.3f,
1197
+ cutout_size: 1.08f,
1198
+ cutout_roundness: 1.0f,
1199
+ cutout_bevel_width: 1.0f,
1200
+ cutout_bump_strength: 1.5f,
1201
+ hexagonal_grid: true,
1202
+ square_grid_offset: 0.0f,
1203
+ horizontal_offset: true,
1204
+
1205
+ // Bronze Sheet Parameters
1206
+ infinite_tiling: true,
1207
+ copper_tint: 0.5f,
1208
+ sheet_brightness: 0.85f,
1209
+ roughness: 0.5f,
1210
+ streaks: 0.05f,
1211
+ scratch_bump_factor: 0.05f,
1212
+ imperfections_amount: 0.265f,
1213
+ impurities_weight_1: 0.75f,
1214
+ impurities_weight_2: 0.43f,
1215
+ impurities_weight_3: 0.00f,
1216
+ texture_translate: 0.0f,
1217
+ texture_rotate: 0.0f,
1218
+ texture_scale: 1.0f,
1219
+ enable_round_corners: false,
1220
+ roundcorners_radius_mm: 1.0f,
1221
+ across_materials: false,
1222
+ uv_space_index: 0
1223
+ );
1224
+
1225
+
1226
+ export material Bronze_Sheet_Punched_Star(*)
1227
+ [[
1228
+ ::anno::author("NVIDIA vMaterials"),
1229
+ ::anno::contributor("Rüdiger Raab"),
1230
+ ::anno::contributor("Maik Rohland"),
1231
+ ::anno::display_name("Bronze Sheet - Star Punch"),
1232
+ ::anno::description(DESCRIPTION),
1233
+ ::anno::copyright_notice(COPYRIGHT),
1234
+ ::anno::thumbnail("./.thumbs/Bronze_Sheet_Punched.Bronze_Sheet_Punched_Star.png"),
1235
+ ::anno::key_words(string[]("metal", "bronze", "decorative", "reflective", "new", "smooth", "shiny", "sheet", "sanitary", "construction", "design", "architecture", "yellow", "punched", "punching", "star", "warm"))
1236
+ ]] = Bronze_Sheet_Punched_
1237
+ (
1238
+ // Punching parameters
1239
+ shape_select: pattern_star,
1240
+ punching_grid_size: 1.5f,
1241
+ cutout_size: 0.68f,
1242
+ cutout_roundness: 0.5f,
1243
+ cutout_bevel_width: 0.44f,
1244
+ cutout_bump_strength: 1.5f,
1245
+ hexagonal_grid: true,
1246
+ square_grid_offset: 0.0f,
1247
+ horizontal_offset: true,
1248
+
1249
+ // Bronze Sheet Parameters
1250
+ infinite_tiling: true,
1251
+ copper_tint: 0.5f,
1252
+ sheet_brightness: 0.85f,
1253
+ roughness: 0.5f,
1254
+ streaks: 0.05f,
1255
+ scratch_bump_factor: 0.05f,
1256
+ imperfections_amount: 0.265f,
1257
+ impurities_weight_1: 0.75f,
1258
+ impurities_weight_2: 0.43f,
1259
+ impurities_weight_3: 0.00f,
1260
+ texture_translate: 0.0f,
1261
+ texture_rotate: 0.0f,
1262
+ texture_scale: 1.0f,
1263
+ enable_round_corners: false,
1264
+ roundcorners_radius_mm: 1.0f,
1265
+ across_materials: false,
1266
+ uv_space_index: 0
1267
+ );
Material/material_0407/Chromium_Brushed.mdl ADDED
@@ -0,0 +1,301 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2024 NVIDIA Corporation. All rights reserved.
3
+ ******************************************************************************
4
+
5
+ Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge,
6
+ to any person obtaining a copy of the sample definition code that uses our
7
+ Material Definition Language (the "MDL Materials"), to reproduce and distribute
8
+ the MDL Materials, including without limitation the rights to use, copy, merge,
9
+ publish, distribute, and sell modified and unmodified copies of the MDL
10
+ Materials, and to permit persons to whom the MDL Materials is furnished to do
11
+ so, in all cases solely for use with NVIDIA's Material Definition Language,
12
+ subject to the following further conditions:
13
+
14
+ 1. The above copyright notices, this list of conditions, and the disclaimer
15
+ that follows shall be retained in all copies of one or more of the MDL
16
+ Materials, including in any software with which the MDL Materials are bundled,
17
+ redistributed, and/or sold, and included either as stand-alone text files,
18
+ human-readable headers or in the appropriate machine-readable metadata fields
19
+ within text or binary files as long as those fields can be easily viewed by the
20
+ user, as applicable.
21
+ 2. The name of NVIDIA shall not be used to promote, endorse or advertise any
22
+ Modified Version without specific prior written permission, except a) to comply
23
+ with the notice requirements otherwise contained herein; or b) to acknowledge
24
+ the contribution(s) of NVIDIA.
25
+
26
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
27
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
28
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
29
+ TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR
30
+ ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL,
31
+ INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF
32
+ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE
33
+ THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.
34
+ */
35
+
36
+ mdl 1.5;
37
+ import ::anno::*;
38
+ import ::base::*;
39
+ import ::math::*;
40
+ import ::state::*;
41
+ import ::std::*;
42
+ import ::tex::*;
43
+ import ::df::*;
44
+ import ::nvidia::core_definitions::*;
45
+
46
+
47
+ const string COPYRIGHT =
48
+ " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
49
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
50
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
51
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
52
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
53
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
54
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
55
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
56
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
57
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
58
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
59
+
60
+ const string DESCRIPTION = "Brushed metal material with adjustable settings for the brushing";
61
+
62
+
63
+ float histogram_range(float input, float range, float position)
64
+ {
65
+ float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0);
66
+ float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0);
67
+ return ::math::lerp(low, high, input);
68
+ }
69
+
70
+ ::base::texture_coordinate_info vmat_transform(
71
+ uniform float2 translation = float2(0.0, 0.0),
72
+ uniform float rotation = 0.0,
73
+ uniform float2 scaling = float2(1.0, 1.0),
74
+ uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw,
75
+ uniform int uv_space = 0
76
+ )
77
+ {
78
+ float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f;
79
+ float4x4 scale =
80
+ float4x4(1.0 /scaling.x, 0. , 0. , 0.,
81
+ 0. , 1.0 /scaling.y , 0. , 0.,
82
+ 0. , 0. , 1.0, 0.,
83
+ translation.x , translation.y , 0.0, 1.);
84
+
85
+ float s = ::math::sin(rotation_rad);
86
+ float c = ::math::cos(rotation_rad);
87
+ float4x4 rotate =
88
+ float4x4( c , -s , 0.0 , 0.0,
89
+ s , c , 0.0 , 0.0,
90
+ 0.0, 0.0 , 1.0 , 0.0,
91
+ 0. , 0.0 , 0.0 , 1.);
92
+
93
+ return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space));
94
+ }
95
+
96
+
97
+ export material Chromium_Brushed(
98
+ float brush_width = 1.0f [[
99
+ ::anno::display_name("Roughness Width"),
100
+ ::anno::description("Widens the anisotropic metal reflections which leads to a stronger effect of "
101
+ "the metal brushing."),
102
+ ::anno::hard_range(0.0f, 1.0f),
103
+ ::anno::in_group("Appearance")
104
+ ]],
105
+ float brush_height_blur = 0.75f [[
106
+ ::anno::display_name("Roughness Height"),
107
+ ::anno::description("Increases the anisotropy of the brushed metal, blurring the reflections."),
108
+ ::anno::hard_range(0.0f, 1.0f),
109
+ ::anno::in_group("Appearance")
110
+ ]],
111
+ float scratch_variation_amount = 1.f [[
112
+ ::anno::description("Adds a bit variation to the roughness of the brushing pattern in the form of occasional scratches that sprea dout in a wider range."),
113
+ ::anno::display_name("Scratch Variation Amount"),
114
+ ::anno::hard_range(0.0f, 1.0f),
115
+ ::anno::in_group("Appearance")
116
+ ]],
117
+ float scratch_reflection_variation = 0.4f [[
118
+ ::anno::description("Attenuates the reflection of the brushed metal which will also make the material appear darker."),
119
+ ::anno::display_name("Scratch Reflection Variation"),
120
+ ::anno::hard_range(0.0f, 1.0f),
121
+ ::anno::in_group("Appearance")
122
+ ]],
123
+ float scratches_bump = 0.65f [[
124
+ ::anno::description("Introduces normal-mapped scratches which further add to the realistic appearance of the surface. However, this might become for the renderer more difficult to resolve."),
125
+ ::anno::display_name("Scratches Bump Amount"),
126
+ ::anno::hard_range(0.0f, 1.0f),
127
+ ::anno::in_group("Appearance")
128
+ ]],
129
+ uniform bool enable_round_corners = false [[
130
+ ::anno::display_name("Enable Round Corners"),
131
+ ::anno::in_group("Round Corners")
132
+ ]],
133
+ uniform float roundcorner_radius = 0.01f [[
134
+ ::anno::display_name("Round Corner Radius"),
135
+ ::anno::description("Adjusts the radius of the round corner effect."),
136
+ ::anno::soft_range(0.0f, 0.1f),
137
+ ::anno::in_group("Round Corners")
138
+ ]],
139
+ uniform bool across_materials = false [[
140
+ ::anno::display_name("Across Materials"),
141
+ ::anno::description("Applies the rounded corner effect also between other materials."),
142
+ ::anno::in_group("Round Corners")
143
+ ]],
144
+ uniform float2 texture_translate = 0.f [[
145
+ ::anno::description("Controls the position of the texture."),
146
+ ::anno::display_name("Translate"),
147
+ ::anno::in_group("Transform")
148
+ ]],
149
+ uniform float texture_rotate = 0.f [[
150
+ ::anno::description("Rotates angle of the texture in degrees."),
151
+ ::anno::display_name("Rotate"),
152
+ ::anno::in_group("Transform")
153
+ ]],
154
+ uniform float2 texture_scale = 1.f [[
155
+ ::anno::description("Larger numbers increase the size."),
156
+ ::anno::display_name("Scale"),
157
+ ::nvidia::core_definitions::dimension(float2(0.75f, 0.75f)),
158
+ ::anno::in_group("Transform")
159
+ ]],
160
+ uniform int uv_space_index = 0 [[
161
+ ::anno::description("Use selected UV space for material."),
162
+ ::anno::display_name("UV Space Index"),
163
+ ::anno::in_group("Advanced")
164
+ ]]
165
+ )
166
+ [[
167
+ ::anno::author("NVIDIA vMaterials"),
168
+ ::anno::display_name("Brushed Chromium - Strong Brushing"),
169
+ ::anno::description(DESCRIPTION),
170
+ ::anno::copyright_notice(COPYRIGHT),
171
+ ::anno::thumbnail("./.thumbs/Chromium_Brushed.Chromium_Brushed.png"),
172
+ ::anno::key_words(string[]("aec", "metal", "chromium", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral"))
173
+ ]]
174
+ =
175
+ let {
176
+ color normal_reflectivity = color(0.549302f, 0.5560554f, 0.5542377f);
177
+ color grazing_reflectivity = color(0.99942f, 1.f, 1.f);
178
+
179
+ bool tmp0 = false;
180
+ material_surface tmp1(
181
+ ::df::color_custom_curve_layer(::nvidia::core_definitions::blend_colors(normal_reflectivity, color(float3(::base::file_texture(texture_2d("./brushed_metal_linear_R_rough_G_scratchvar_B_impurities.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.25f, ::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]), ::base::color_layer_multiply, scratch_reflection_variation).tint, ::nvidia::core_definitions::blend_colors(grazing_reflectivity, color(float3(::base::file_texture(texture_2d("./brushed_metal_linear_R_rough_G_scratchvar_B_impurities.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.25f, ::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]), ::base::color_layer_multiply, scratch_reflection_variation).tint, 5.f, color(1.f, 1.f, 1.f), ::df::weighted_layer(0.0900000036f, ::df::microfacet_ggx_smith_bsdf(0.399000019f, 0.399000019f, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::microfacet_ggx_smith_bsdf(::math::lerp(histogram_range(float3(::base::file_texture(texture_2d("./brushed_metal_linear_R_rough_G_scratchvar_B_impurities.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.25f, ::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.183000013f, ::math::lerp(0.100000001f, 0.400000006f, brush_width)), 0.376000017f, scratch_variation_amount * float3(::base::file_texture(texture_2d("./brushed_metal_linear_R_rough_G_scratchvar_B_impurities.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.25f, ::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(histogram_range(float3(::base::file_texture(texture_2d("./brushed_metal_linear_R_rough_G_scratchvar_B_impurities.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.25f, ::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.183000013f, ::math::lerp(0.100000001f, 0.400000006f, brush_width)), 0.376000017f, scratch_variation_amount * float3(::base::file_texture(texture_2d("./brushed_metal_linear_R_rough_G_scratchvar_B_impurities.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.25f, ::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(histogram_range(float3(::base::file_texture(texture_2d("./brushed_metal_linear_R_rough_G_scratchvar_B_impurities.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.25f, ::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.100000001f, ::math::lerp(0.0500000007f, 0.25f, brush_height_blur)), 0.376000017f, scratch_variation_amount * float3(::base::file_texture(texture_2d("./brushed_metal_linear_R_rough_G_scratchvar_B_impurities.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.25f, ::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(histogram_range(float3(::base::file_texture(texture_2d("./brushed_metal_linear_R_rough_G_scratchvar_B_impurities.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.25f, ::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.100000001f, ::math::lerp(0.0500000007f, 0.25f, brush_height_blur)), 0.376000017f, scratch_variation_amount * float3(::base::file_texture(texture_2d("./brushed_metal_linear_R_rough_G_scratchvar_B_impurities.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.25f, ::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]), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::math::lerp(::state::normal(), ::base::tangent_space_normal_texture(texture_2d("./brushed_metal_linear_norm.jpg", ::tex::gamma_linear), 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.25f, ::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), scratches_bump)), bsdf(), ::math::lerp(::state::normal(), ::base::tangent_space_normal_texture(texture_2d("./brushed_metal_linear_norm.jpg", ::tex::gamma_linear), 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.25f, ::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), scratches_bump)),
182
+ material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
183
+ material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
184
+ color tmp3 = color(1.f, 1.f, 1.f);
185
+ 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));
186
+ material_geometry tmp5 = enable_round_corners ? material_geometry(float3(0.f), 1.f, ::state::rounded_corner_normal(roundcorner_radius, across_materials, 1.f)) : material_geometry(float3(0.f), 1.f, ::state::normal());
187
+ } in
188
+ material(
189
+ thin_walled: tmp0,
190
+ surface: tmp1,
191
+ backface: tmp2,
192
+ ior: tmp3,
193
+ volume: tmp4,
194
+ geometry: tmp5);
195
+
196
+
197
+
198
+ export material Chromium_Brushed_Light_Brushing(*)
199
+ [[
200
+ ::anno::author("NVIDIA vMaterials"),
201
+ ::anno::display_name("Brushed Chromium - Light Brushing"),
202
+ ::anno::description(DESCRIPTION),
203
+ ::anno::copyright_notice(COPYRIGHT),
204
+ ::anno::thumbnail("./.thumbs/Chromium_Brushed.Chromium_Brushed_Light_Brushing.png"),
205
+ ::anno::key_words(string[]("aec", "metal", "chromium", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral"))
206
+ ]]
207
+ = Chromium_Brushed (
208
+ brush_width: 0.225f,
209
+ brush_height_blur: 0.035f,
210
+ scratch_variation_amount: 1.0f,
211
+ scratch_reflection_variation: 0.4f,
212
+ scratches_bump: 0.2f,
213
+ enable_round_corners: false,
214
+ roundcorner_radius: 0.01f,
215
+ across_materials: false,
216
+ texture_translate: 0.0f,
217
+ texture_rotate: 0.0f,
218
+ texture_scale: 1.0f,
219
+ uv_space_index: 0
220
+ );
221
+
222
+
223
+
224
+ export material Chromium_Brushed_Medium_Light_Brushing(*)
225
+ [[
226
+ ::anno::author("NVIDIA vMaterials"),
227
+ ::anno::display_name("Brushed Chromium - Medium Light Brushing"),
228
+ ::anno::description(DESCRIPTION),
229
+ ::anno::copyright_notice(COPYRIGHT),
230
+ ::anno::thumbnail("./.thumbs/Chromium_Brushed.Chromium_Brushed_Medium_Light_Brushing.png"),
231
+ ::anno::key_words(string[]("aec", "metal", "chromium", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral"))
232
+ ]]
233
+ = Chromium_Brushed (
234
+ brush_width: 0.361f,
235
+ brush_height_blur: 0.204f,
236
+ scratch_variation_amount: 1.0f,
237
+ scratch_reflection_variation: 0.559f,
238
+ scratches_bump: 0.35f,
239
+ enable_round_corners: false,
240
+ roundcorner_radius: 0.01f,
241
+ across_materials: false,
242
+ texture_translate: 0.0f,
243
+ texture_rotate: 0.0f,
244
+ texture_scale: 1.0f,
245
+ uv_space_index: 0
246
+ );
247
+
248
+
249
+
250
+ export material Chromium_Brushed_Medium_Brushing(*)
251
+ [[
252
+ ::anno::author("NVIDIA vMaterials"),
253
+ ::anno::display_name("Brushed Chromium - Medium Brushing"),
254
+ ::anno::description(DESCRIPTION),
255
+ ::anno::copyright_notice(COPYRIGHT),
256
+ ::anno::thumbnail("./.thumbs/Chromium_Brushed.Chromium_Brushed_Medium_Brushing.png"),
257
+ ::anno::key_words(string[]("aec", "metal", "chromium", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral"))
258
+ ]]
259
+ = Chromium_Brushed (
260
+ brush_width: 0.665f,
261
+ brush_height_blur: 0.471f,
262
+ scratch_variation_amount: 1.0f,
263
+ scratch_reflection_variation: 0.621f,
264
+ scratches_bump: 0.5f,
265
+ enable_round_corners: false,
266
+ roundcorner_radius: 0.01f,
267
+ across_materials: false,
268
+ texture_translate: 0.0f,
269
+ texture_rotate: 0.0f,
270
+ texture_scale: 1.0f,
271
+ uv_space_index: 0
272
+ );
273
+
274
+
275
+ export material Chromium_Brushed_Very_Strong_Brushing(*)
276
+ [[
277
+ ::anno::author("NVIDIA vMaterials"),
278
+ ::anno::display_name("Brushed Chromium - Very Strong Brushing"),
279
+ ::anno::description(DESCRIPTION),
280
+ ::anno::copyright_notice(COPYRIGHT),
281
+ ::anno::thumbnail("./.thumbs/Chromium_Brushed.Chromium_Brushed_Very_Strong_Brushing.png"),
282
+ ::anno::key_words(string[]("aec", "metal", "chromium", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral"))
283
+ ]]
284
+ = Chromium_Brushed (
285
+ brush_width: 1.0f,
286
+ brush_height_blur: 1.0f,
287
+ scratch_variation_amount: 1.0f,
288
+ scratch_reflection_variation: 0.824f,
289
+ scratches_bump: 1.0f,
290
+ enable_round_corners: false,
291
+ roundcorner_radius: 0.01f,
292
+ across_materials: false,
293
+ texture_translate: 0.0f,
294
+ texture_rotate: 0.0f,
295
+ texture_scale: 1.0f,
296
+ uv_space_index: 0
297
+ );
298
+
299
+
300
+
301
+
Material/material_0415/Copper_Brushed.mdl ADDED
@@ -0,0 +1,301 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2024 NVIDIA Corporation. All rights reserved.
3
+ ******************************************************************************
4
+
5
+ Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge,
6
+ to any person obtaining a copy of the sample definition code that uses our
7
+ Material Definition Language (the "MDL Materials"), to reproduce and distribute
8
+ the MDL Materials, including without limitation the rights to use, copy, merge,
9
+ publish, distribute, and sell modified and unmodified copies of the MDL
10
+ Materials, and to permit persons to whom the MDL Materials is furnished to do
11
+ so, in all cases solely for use with NVIDIA's Material Definition Language,
12
+ subject to the following further conditions:
13
+
14
+ 1. The above copyright notices, this list of conditions, and the disclaimer
15
+ that follows shall be retained in all copies of one or more of the MDL
16
+ Materials, including in any software with which the MDL Materials are bundled,
17
+ redistributed, and/or sold, and included either as stand-alone text files,
18
+ human-readable headers or in the appropriate machine-readable metadata fields
19
+ within text or binary files as long as those fields can be easily viewed by the
20
+ user, as applicable.
21
+ 2. The name of NVIDIA shall not be used to promote, endorse or advertise any
22
+ Modified Version without specific prior written permission, except a) to comply
23
+ with the notice requirements otherwise contained herein; or b) to acknowledge
24
+ the contribution(s) of NVIDIA.
25
+
26
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
27
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
28
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
29
+ TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR
30
+ ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL,
31
+ INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF
32
+ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE
33
+ THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.
34
+ */
35
+
36
+ mdl 1.5;
37
+ import ::anno::*;
38
+ import ::base::*;
39
+ import ::math::*;
40
+ import ::state::*;
41
+ import ::std::*;
42
+ import ::tex::*;
43
+ import ::df::*;
44
+ import ::nvidia::core_definitions::*;
45
+
46
+
47
+ const string COPYRIGHT =
48
+ " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
49
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
50
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
51
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
52
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
53
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
54
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
55
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
56
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
57
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
58
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
59
+
60
+ const string DESCRIPTION = "Brushed metal material with adjustable settings for the brushing";
61
+
62
+
63
+ float histogram_range(float input, float range, float position)
64
+ {
65
+ float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0);
66
+ float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0);
67
+ return ::math::lerp(low, high, input);
68
+ }
69
+
70
+ ::base::texture_coordinate_info vmat_transform(
71
+ uniform float2 translation = float2(0.0, 0.0),
72
+ uniform float rotation = 0.0,
73
+ uniform float2 scaling = float2(1.0, 1.0),
74
+ uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw,
75
+ uniform int uv_space = 0
76
+ )
77
+ {
78
+ float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f;
79
+ float4x4 scale =
80
+ float4x4(1.0 /scaling.x, 0. , 0. , 0.,
81
+ 0. , 1.0 /scaling.y , 0. , 0.,
82
+ 0. , 0. , 1.0, 0.,
83
+ translation.x , translation.y , 0.0, 1.);
84
+
85
+ float s = ::math::sin(rotation_rad);
86
+ float c = ::math::cos(rotation_rad);
87
+ float4x4 rotate =
88
+ float4x4( c , -s , 0.0 , 0.0,
89
+ s , c , 0.0 , 0.0,
90
+ 0.0, 0.0 , 1.0 , 0.0,
91
+ 0. , 0.0 , 0.0 , 1.);
92
+
93
+ return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space));
94
+ }
95
+
96
+
97
+ export material Copper_Brushed(
98
+ float brush_width = 1.0f [[
99
+ ::anno::display_name("Roughness Width"),
100
+ ::anno::description("Widens the anisotropic metal reflections which leads to a stronger effect of "
101
+ "the metal brushing."),
102
+ ::anno::hard_range(0.0f, 1.0f),
103
+ ::anno::in_group("Appearance")
104
+ ]],
105
+ float brush_height_blur = 0.75f [[
106
+ ::anno::display_name("Roughness Height"),
107
+ ::anno::description("Increases the anisotropy of the brushed metal, blurring the reflections."),
108
+ ::anno::hard_range(0.0f, 1.0f),
109
+ ::anno::in_group("Appearance")
110
+ ]],
111
+ float scratch_variation_amount = 1.f [[
112
+ ::anno::description("Adds a bit variation to the roughness of the brushing pattern in the form of occasional scratches that sprea dout in a wider range."),
113
+ ::anno::display_name("Scratch Variation Amount"),
114
+ ::anno::hard_range(0.0f, 1.0f),
115
+ ::anno::in_group("Appearance")
116
+ ]],
117
+ float scratch_reflection_variation = 0.4f [[
118
+ ::anno::description("Attenuates the reflection of the brushed metal which will also make the material appear darker."),
119
+ ::anno::display_name("Scratch Reflection Variation"),
120
+ ::anno::hard_range(0.0f, 1.0f),
121
+ ::anno::in_group("Appearance")
122
+ ]],
123
+ float scratches_bump = 0.65f [[
124
+ ::anno::description("Introduces normal-mapped scratches which further add to the realistic appearance of the surface. However, this might become for the renderer more difficult to resolve."),
125
+ ::anno::display_name("Scratches Bump Amount"),
126
+ ::anno::hard_range(0.0f, 1.0f),
127
+ ::anno::in_group("Appearance")
128
+ ]],
129
+ uniform bool enable_round_corners = false [[
130
+ ::anno::display_name("Enable Round Corners"),
131
+ ::anno::in_group("Round Corners")
132
+ ]],
133
+ uniform float roundcorner_radius = 0.01f [[
134
+ ::anno::display_name("Round Corner Radius"),
135
+ ::anno::description("Adjusts the radius of the round corner effect."),
136
+ ::anno::soft_range(0.0f, 0.1f),
137
+ ::anno::in_group("Round Corners")
138
+ ]],
139
+ uniform bool across_materials = false [[
140
+ ::anno::display_name("Across Materials"),
141
+ ::anno::description("Applies the rounded corner effect also between other materials."),
142
+ ::anno::in_group("Round Corners")
143
+ ]],
144
+ uniform float2 texture_translate = 0.f [[
145
+ ::anno::display_name("Translate"),
146
+ ::anno::description("Controls the position of the texture."),
147
+ ::anno::in_group("Transform")
148
+ ]],
149
+ uniform float texture_rotate = 0.f [[
150
+ ::anno::display_name("Rotate"),
151
+ ::anno::description("Rotates angle of the texture in degrees."),
152
+ ::anno::in_group("Transform")
153
+ ]],
154
+ uniform float2 texture_scale = 1.f [[
155
+ ::anno::display_name("Scale"),
156
+ ::anno::description("Larger numbers increase the size."),
157
+ ::nvidia::core_definitions::dimension(float2(0.75f, 0.75f)),
158
+ ::anno::in_group("Transform")
159
+ ]],
160
+ uniform int uv_space_index = 0 [[
161
+ ::anno::display_name("UV Space Index"),
162
+ ::anno::description("Use selected UV space for material."),
163
+ ::anno::in_group("Advanced")
164
+ ]]
165
+ )
166
+ [[
167
+ ::anno::author("NVIDIA vMaterials"),
168
+ ::anno::display_name("Brushed Copper - Strong Brushing"),
169
+ ::anno::description(DESCRIPTION),
170
+ ::anno::copyright_notice(COPYRIGHT),
171
+ ::anno::thumbnail("./.thumbs/Copper_Brushed.Copper_Brushed.png"),
172
+ ::anno::key_words(string[]("aec", "metal", "copper", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral"))
173
+ ]]
174
+ =
175
+ let {
176
+ color normal_reflectivity = color(0.9654565f, 0.6899602f, 0.4830392f);
177
+ color grazing_reflectivity = color(0.99942f, 1.f, 1.f);
178
+
179
+ bool tmp0 = false;
180
+ material_surface tmp1(
181
+ ::df::color_custom_curve_layer(::nvidia::core_definitions::blend_colors(normal_reflectivity, color(float3(::base::file_texture(texture_2d("./brushed_metal_linear_R_rough_G_scratchvar_B_impurities.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.25f, ::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]), ::base::color_layer_multiply, scratch_reflection_variation).tint, ::nvidia::core_definitions::blend_colors(grazing_reflectivity, color(float3(::base::file_texture(texture_2d("./brushed_metal_linear_R_rough_G_scratchvar_B_impurities.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.25f, ::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]), ::base::color_layer_multiply, scratch_reflection_variation).tint, 5.f, color(1.f, 1.f, 1.f), ::df::weighted_layer(0.0900000036f, ::df::microfacet_ggx_smith_bsdf(0.399000019f, 0.399000019f, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::microfacet_ggx_smith_bsdf(::math::lerp(histogram_range(float3(::base::file_texture(texture_2d("./brushed_metal_linear_R_rough_G_scratchvar_B_impurities.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.25f, ::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.183000013f, ::math::lerp(0.100000001f, 0.400000006f, brush_width)), 0.376000017f, scratch_variation_amount * float3(::base::file_texture(texture_2d("./brushed_metal_linear_R_rough_G_scratchvar_B_impurities.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.25f, ::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(histogram_range(float3(::base::file_texture(texture_2d("./brushed_metal_linear_R_rough_G_scratchvar_B_impurities.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.25f, ::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.183000013f, ::math::lerp(0.100000001f, 0.400000006f, brush_width)), 0.376000017f, scratch_variation_amount * float3(::base::file_texture(texture_2d("./brushed_metal_linear_R_rough_G_scratchvar_B_impurities.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.25f, ::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(histogram_range(float3(::base::file_texture(texture_2d("./brushed_metal_linear_R_rough_G_scratchvar_B_impurities.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.25f, ::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.100000001f, ::math::lerp(0.0500000007f, 0.25f, brush_height_blur)), 0.376000017f, scratch_variation_amount * float3(::base::file_texture(texture_2d("./brushed_metal_linear_R_rough_G_scratchvar_B_impurities.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.25f, ::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(histogram_range(float3(::base::file_texture(texture_2d("./brushed_metal_linear_R_rough_G_scratchvar_B_impurities.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.25f, ::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.100000001f, ::math::lerp(0.0500000007f, 0.25f, brush_height_blur)), 0.376000017f, scratch_variation_amount * float3(::base::file_texture(texture_2d("./brushed_metal_linear_R_rough_G_scratchvar_B_impurities.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.25f, ::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]), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::math::lerp(::state::normal(), ::base::tangent_space_normal_texture(texture_2d("./brushed_metal_linear_norm.jpg", ::tex::gamma_linear), 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.25f, ::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), scratches_bump)), bsdf(), ::math::lerp(::state::normal(), ::base::tangent_space_normal_texture(texture_2d("./brushed_metal_linear_norm.jpg", ::tex::gamma_linear), 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.25f, ::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), scratches_bump)),
182
+ material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
183
+ material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
184
+ color tmp3 = color(1.f, 1.f, 1.f);
185
+ 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));
186
+ material_geometry tmp5 = enable_round_corners ? material_geometry(float3(0.f), 1.f, ::state::rounded_corner_normal(roundcorner_radius, across_materials, 1.f)) : material_geometry(float3(0.f), 1.f, ::state::normal());
187
+ } in
188
+ material(
189
+ thin_walled: tmp0,
190
+ surface: tmp1,
191
+ backface: tmp2,
192
+ ior: tmp3,
193
+ volume: tmp4,
194
+ geometry: tmp5);
195
+
196
+
197
+
198
+ export material Copper_Brushed_Light_Brushing(*)
199
+ [[
200
+ ::anno::author("NVIDIA vMaterials"),
201
+ ::anno::display_name("Brushed Copper - Light Brushing"),
202
+ ::anno::description(DESCRIPTION),
203
+ ::anno::copyright_notice(COPYRIGHT),
204
+ ::anno::thumbnail("./.thumbs/Copper_Brushed.Copper_Brushed_Light_Brushing.png"),
205
+ ::anno::key_words(string[]("aec", "metal", "copper", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral"))
206
+ ]]
207
+ = Copper_Brushed (
208
+ brush_width: 0.225f,
209
+ brush_height_blur: 0.035f,
210
+ scratch_variation_amount: 1.0f,
211
+ scratch_reflection_variation: 0.4f,
212
+ scratches_bump: 0.2f,
213
+ enable_round_corners: false,
214
+ roundcorner_radius: 0.01f,
215
+ across_materials: false,
216
+ texture_translate: 0.0f,
217
+ texture_rotate: 0.0f,
218
+ texture_scale: 1.0f,
219
+ uv_space_index: 0
220
+ );
221
+
222
+
223
+
224
+ export material Copper_Brushed_Medium_Light_Brushing(*)
225
+ [[
226
+ ::anno::author("NVIDIA vMaterials"),
227
+ ::anno::display_name("Brushed Copper - Medium Light Brushing"),
228
+ ::anno::description(DESCRIPTION),
229
+ ::anno::copyright_notice(COPYRIGHT),
230
+ ::anno::thumbnail("./.thumbs/Copper_Brushed.Copper_Brushed_Medium_Light_Brushing.png"),
231
+ ::anno::key_words(string[]("aec", "metal", "copper", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral"))
232
+ ]]
233
+ = Copper_Brushed (
234
+ brush_width: 0.361f,
235
+ brush_height_blur: 0.204f,
236
+ scratch_variation_amount: 1.0f,
237
+ scratch_reflection_variation: 0.559f,
238
+ scratches_bump: 0.35f,
239
+ enable_round_corners: false,
240
+ roundcorner_radius: 0.01f,
241
+ across_materials: false,
242
+ texture_translate: 0.0f,
243
+ texture_rotate: 0.0f,
244
+ texture_scale: 1.0f,
245
+ uv_space_index: 0
246
+ );
247
+
248
+
249
+
250
+ export material Copper_Brushed_Medium_Brushing(*)
251
+ [[
252
+ ::anno::author("NVIDIA vMaterials"),
253
+ ::anno::display_name("Brushed Copper - Medium Brushing"),
254
+ ::anno::description(DESCRIPTION),
255
+ ::anno::copyright_notice(COPYRIGHT),
256
+ ::anno::thumbnail("./.thumbs/Copper_Brushed.Copper_Brushed_Medium_Brushing.png"),
257
+ ::anno::key_words(string[]("aec", "metal", "copper", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral"))
258
+ ]]
259
+ = Copper_Brushed (
260
+ brush_width: 0.665f,
261
+ brush_height_blur: 0.471f,
262
+ scratch_variation_amount: 1.0f,
263
+ scratch_reflection_variation: 0.621f,
264
+ scratches_bump: 0.5f,
265
+ enable_round_corners: false,
266
+ roundcorner_radius: 0.01f,
267
+ across_materials: false,
268
+ texture_translate: 0.0f,
269
+ texture_rotate: 0.0f,
270
+ texture_scale: 1.0f,
271
+ uv_space_index: 0
272
+ );
273
+
274
+
275
+ export material Copper_Brushed_Very_Strong_Brushing(*)
276
+ [[
277
+ ::anno::author("NVIDIA vMaterials"),
278
+ ::anno::display_name("Brushed Copper - Very Strong Brushing"),
279
+ ::anno::description(DESCRIPTION),
280
+ ::anno::copyright_notice(COPYRIGHT),
281
+ ::anno::thumbnail("./.thumbs/Copper_Brushed.Copper_Brushed_Very_Strong_Brushing.png"),
282
+ ::anno::key_words(string[]("aec", "metal", "copper", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral"))
283
+ ]]
284
+ = Copper_Brushed (
285
+ brush_width: 1.0f,
286
+ brush_height_blur: 1.0f,
287
+ scratch_variation_amount: 1.0f,
288
+ scratch_reflection_variation: 0.824f,
289
+ scratches_bump: 1.0f,
290
+ enable_round_corners: false,
291
+ roundcorner_radius: 0.01f,
292
+ across_materials: false,
293
+ texture_translate: 0.0f,
294
+ texture_rotate: 0.0f,
295
+ texture_scale: 1.0f,
296
+ uv_space_index: 0
297
+ );
298
+
299
+
300
+
301
+
Material/material_0417/Copper_Hammered.mdl ADDED
@@ -0,0 +1,263 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2024 NVIDIA Corporation. All rights reserved.
3
+ ******************************************************************************
4
+
5
+ Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge,
6
+ to any person obtaining a copy of the sample definition code that uses our
7
+ Material Definition Language (the "MDL Materials"), to reproduce and distribute
8
+ the MDL Materials, including without limitation the rights to use, copy, merge,
9
+ publish, distribute, and sell modified and unmodified copies of the MDL
10
+ Materials, and to permit persons to whom the MDL Materials is furnished to do
11
+ so, in all cases solely for use with NVIDIA's Material Definition Language,
12
+ subject to the following further conditions:
13
+
14
+ 1. The above copyright notices, this list of conditions, and the disclaimer
15
+ that follows shall be retained in all copies of one or more of the MDL
16
+ Materials, including in any software with which the MDL Materials are bundled,
17
+ redistributed, and/or sold, and included either as stand-alone text files,
18
+ human-readable headers or in the appropriate machine-readable metadata fields
19
+ within text or binary files as long as those fields can be easily viewed by the
20
+ user, as applicable.
21
+ 2. The name of NVIDIA shall not be used to promote, endorse or advertise any
22
+ Modified Version without specific prior written permission, except a) to comply
23
+ with the notice requirements otherwise contained herein; or b) to acknowledge
24
+ the contribution(s) of NVIDIA.
25
+
26
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
27
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
28
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
29
+ TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR
30
+ ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL,
31
+ INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF
32
+ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE
33
+ THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.
34
+ */
35
+
36
+ mdl 1.5;
37
+
38
+ import ::anno::*;
39
+ import ::math::*;
40
+ import ::base::*;
41
+ import ::df::*;
42
+ import ::nvidia::core_definitions::*;
43
+ import ::state::*;
44
+ import ::tex::*;
45
+
46
+
47
+ const string COPYRIGHT =
48
+ " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
49
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
50
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
51
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
52
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
53
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
54
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
55
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
56
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
57
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
58
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
59
+
60
+ const string DESCRIPTION = "A hammered metal material";
61
+
62
+
63
+
64
+ float histogram_range(float input, float range = 1.0f, float position = 0.5f)
65
+ {
66
+ float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0);
67
+ float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0);
68
+ return ::math::lerp(low, high, input);
69
+ }
70
+
71
+ ::base::texture_coordinate_info transform_coordinate_2(
72
+ float4x4 transform
73
+ [[ ::anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix.") ]],
74
+ ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info()
75
+ [[ ::anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection.") ]]
76
+ ) [[
77
+ ::anno::description("Transform a texture coordinate by a matrix.") ,
78
+ ::anno::noinline()
79
+ ]]
80
+ {
81
+ // Version 2
82
+ float4 r_position = transform * float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1);
83
+ //Try aproximating it for the case that the rotation is only aroud z and assuming the texture layout is nice and z is ~constant.
84
+ //just pretend there is no other rotation happening
85
+ //get rid of scaling and translation. Then extract fields where sin and cos would be in a simple 2d transform around z.
86
+ float4 u = transform[0];
87
+ float3 ru = ::math::normalize(float3(u.x,u.y,u.z));
88
+ float cos = ru.x;
89
+ float sin = -ru.y;
90
+
91
+ return ::base::texture_coordinate_info(
92
+ float3(r_position.x,r_position.y,r_position.z),
93
+ ::math::normalize(cos * coordinate.tangent_u - sin * coordinate.tangent_v),
94
+ ::math::normalize(cos * coordinate.tangent_v + sin * coordinate.tangent_u));
95
+ }
96
+
97
+
98
+ // Takes the standard input that every material has. It combines a couple of
99
+ // functions in one convenience function.
100
+ ::base::texture_coordinate_info vmat_transform(
101
+ float2 translation = float2(0.0, 0.0),
102
+ float rotation = 0.0, // rotation in degrees
103
+ float2 scaling = float2(1.0, 1.0),
104
+ uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw,
105
+ uniform int uv_space = 0
106
+ )
107
+ {
108
+ float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f;
109
+ float4x4 scale =
110
+ float4x4(1.0 /scaling.x, 0. , 0. , 0.,
111
+ 0. , 1.0 /scaling.y , 0. , 0.,
112
+ 0. , 0. , 1.0, 0.,
113
+ translation.x , translation.y , 0.0, 1.);
114
+
115
+ float s = ::math::sin(rotation_rad);
116
+ float c = ::math::cos(rotation_rad);
117
+ float4x4 rotate =
118
+ float4x4( c , -s , 0.0 , 0.0,
119
+ s , c , 0.0 , 0.0,
120
+ 0.0, 0.0 , 1.0 , 0.0,
121
+ 0. , 0.0 , 0.0 , 1.);
122
+
123
+ return transform_coordinate_2(scale*rotate, ::base::coordinate_source(system, uv_space));
124
+ }
125
+
126
+ export material Copper_Hammered(
127
+ color metal_color = color(0.38854f, 0.18195f, 0.10889f) [[
128
+ ::anno::description("Adjusts the reflection color of the metal material."),
129
+ ::anno::display_name("Metal Color"),
130
+ ::anno::in_group("Appearance")
131
+ ]],
132
+ float roughness = 0.5f [[
133
+ ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."),
134
+ ::anno::display_name("Roughness"),
135
+ ::anno::in_group("Appearance"),
136
+ ::anno::hard_range(0.f, 1.f)
137
+ ]],
138
+ float diffuse_variation = 0.8f [[
139
+ ::anno::description("Adds grime, dirt and imperfections."),
140
+ ::anno::display_name("Variation"),
141
+ ::anno::in_group("Appearance"),
142
+ ::anno::hard_range(0.f, 1.f)
143
+ ]],
144
+ uniform float bump_strength = 0.8f [[
145
+ ::anno::description("Determines the degree of bumpiness."),
146
+ ::anno::display_name("Bump Strength"),
147
+ ::anno::in_group("Appearance"),
148
+ ::anno::hard_range(0.f, 1.f)
149
+ ]],
150
+
151
+ uniform bool roundcorners_enable = false [[
152
+ ::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."),
153
+ ::anno::display_name("Enable Round Corners"),
154
+ ::anno::in_group("Round Corners")
155
+ ]],
156
+ uniform float roundcorners_radius_mm = 1.5f [[
157
+ ::anno::description("Radius of the rounded corners."),
158
+ ::anno::display_name("Round Corner Radius"),
159
+ ::anno::in_group("Round Corners")
160
+ ]],
161
+ uniform bool roundcorners_across_materials = false [[
162
+ ::anno::description("Applies the round corner effect across different materials when enabled."),
163
+ ::anno::display_name("Across Materials"),
164
+ ::anno::in_group("Round Corners")
165
+ ]],
166
+ float2 texture_translate = 0.f [[
167
+ ::anno::description("Controls the position of the texture."),
168
+ ::anno::display_name("Texture Translate"),
169
+ ::anno::in_group("Transform")
170
+ ]],
171
+ float texture_rotate = 0.f [[
172
+ ::anno::description("Rotates angle of the texture in degrees."),
173
+ ::anno::display_name("Texture Rotate"),
174
+ ::anno::in_group("Transform")
175
+ ]],
176
+ float2 texture_scale = 1.f [[
177
+ ::anno::description("Larger numbers increase the size."),
178
+ ::anno::display_name("Texture Scale"),
179
+ ::nvidia::core_definitions::dimension(float2(.4f, 0.4f)),
180
+ ::anno::in_group("Transform")
181
+ ]],
182
+ uniform int uv_space_index = 0 [[
183
+ ::anno::description("Use selected UV space."),
184
+ ::anno::display_name("UV Space index"),
185
+ ::anno::in_group("Advanced")
186
+ ]]
187
+ )
188
+ [[
189
+ ::anno::display_name("Hammered Copper - Dark Pits"),
190
+ ::anno::author("NVIDIA vMaterials"),
191
+ ::anno::in_group("Metal"),
192
+ ::anno::key_words(string[]("metal", "copper", "hammered", "blackened", "design", "classic", "architecture", "pattern", "reflective", "rough", "bumped", "conductor", "warm")),
193
+ ::anno::thumbnail("./.thumbs/Copper_Hammered.Copper_Hammered.png"),
194
+ ::anno::description(DESCRIPTION),
195
+ ::anno::copyright_notice(COPYRIGHT)
196
+ ]]
197
+ =
198
+ let {
199
+ bool tmp0 = false;
200
+ material_surface tmp1(::df::weighted_layer(float3(::base::file_texture(texture_2d("./hammered_multi_R_rough_G_corrspots_B_metal.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], ::df::directional_factor(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(metal_color, color(::math::pow(float3(::base::file_texture(texture_2d("./hammered_multi_R_pit_G_ao_B_hammer.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], 2.20000005f)), ::base::color_layer_multiply, diffuse_variation).tint, color(float3(::base::file_texture(texture_2d("./hammered_multi_R_pit_G_ao_B_hammer.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), ::base::color_layer_overlay, diffuse_variation).tint, color(1.f, 1.f, 1.f), 3.f, ::df::microfacet_ggx_smith_bsdf(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(color(histogram_range(float3(::base::file_texture(texture_2d("./hammered_multi_R_rough_G_corrspots_B_metal.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], ::math::lerp(0.40200001f, 0.245000005f, roughness), ::math::lerp(0.234000012f, 0.395000011f, roughness))), color(float3(::base::file_texture(texture_2d("./hammered_multi_R_rough_G_corrspots_B_metal.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), ::base::color_layer_add, ::math::lerp(0.582000017f, 0.280000001f, roughness)).tint, color(::math::pow(float3(::base::file_texture(texture_2d("./hammered_multi_R_pit_G_ao_B_hammer.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_add, ::math::lerp(0.70600003f, 0.560000002f, roughness)).tint, color(::math::pow(1.f - float3(::base::file_texture(texture_2d("./hammered_multi_R_pit_G_ao_B_hammer.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], 2.20000005f)), ::base::color_layer_add, ::math::lerp(0.185000002f, 0.960000038f, roughness)).mono * nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(color(histogram_range(float3(::base::file_texture(texture_2d("./hammered_multi_R_rough_G_corrspots_B_metal.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], ::math::lerp(0.40200001f, 0.245000005f, roughness), ::math::lerp(0.234000012f, 0.395000011f, roughness))), color(float3(::base::file_texture(texture_2d("./hammered_multi_R_rough_G_corrspots_B_metal.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), ::base::color_layer_add, ::math::lerp(0.582000017f, 0.280000001f, roughness)).tint, color(::math::pow(float3(::base::file_texture(texture_2d("./hammered_multi_R_pit_G_ao_B_hammer.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_add, ::math::lerp(0.70600003f, 0.560000002f, roughness)).tint, color(::math::pow(1.f - float3(::base::file_texture(texture_2d("./hammered_multi_R_pit_G_ao_B_hammer.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], 2.20000005f)), ::base::color_layer_add, ::math::lerp(0.185000002f, 0.960000038f, roughness)).mono, nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(color(histogram_range(float3(::base::file_texture(texture_2d("./hammered_multi_R_rough_G_corrspots_B_metal.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], ::math::lerp(0.40200001f, 0.245000005f, roughness), ::math::lerp(0.234000012f, 0.395000011f, roughness))), color(float3(::base::file_texture(texture_2d("./hammered_multi_R_rough_G_corrspots_B_metal.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), ::base::color_layer_add, ::math::lerp(0.582000017f, 0.280000001f, roughness)).tint, color(::math::pow(float3(::base::file_texture(texture_2d("./hammered_multi_R_pit_G_ao_B_hammer.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_add, ::math::lerp(0.70600003f, 0.560000002f, roughness)).tint, color(::math::pow(1.f - float3(::base::file_texture(texture_2d("./hammered_multi_R_pit_G_ao_B_hammer.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], 2.20000005f)), ::base::color_layer_add, ::math::lerp(0.185000002f, 0.960000038f, roughness)).mono * nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(color(histogram_range(float3(::base::file_texture(texture_2d("./hammered_multi_R_rough_G_corrspots_B_metal.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], ::math::lerp(0.40200001f, 0.245000005f, roughness), ::math::lerp(0.234000012f, 0.395000011f, roughness))), color(float3(::base::file_texture(texture_2d("./hammered_multi_R_rough_G_corrspots_B_metal.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), ::base::color_layer_add, ::math::lerp(0.582000017f, 0.280000001f, roughness)).tint, color(::math::pow(float3(::base::file_texture(texture_2d("./hammered_multi_R_pit_G_ao_B_hammer.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_add, ::math::lerp(0.70600003f, 0.560000002f, roughness)).tint, color(::math::pow(1.f - float3(::base::file_texture(texture_2d("./hammered_multi_R_pit_G_ao_B_hammer.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], 2.20000005f)), ::base::color_layer_add, ::math::lerp(0.185000002f, 0.960000038f, roughness)).mono, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, "")), ::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(color(histogram_range(float3(::base::file_texture(texture_2d("./hammered_multi_R_rough_G_corrspots_B_metal.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], ::math::lerp(0.40200001f, 0.245000005f, roughness), ::math::lerp(0.234000012f, 0.395000011f, roughness))), color(float3(::base::file_texture(texture_2d("./hammered_multi_R_rough_G_corrspots_B_metal.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), ::base::color_layer_add, ::math::lerp(0.582000017f, 0.280000001f, roughness)).tint, color(::math::pow(float3(::base::file_texture(texture_2d("./hammered_multi_R_pit_G_ao_B_hammer.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_add, ::math::lerp(0.70600003f, 0.560000002f, roughness)).tint, color(::math::pow(1.f - float3(::base::file_texture(texture_2d("./hammered_multi_R_pit_G_ao_B_hammer.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], 2.20000005f)), ::base::color_layer_add, ::math::lerp(0.185000002f, 0.960000038f, roughness)).mono * nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(color(histogram_range(float3(::base::file_texture(texture_2d("./hammered_multi_R_rough_G_corrspots_B_metal.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], ::math::lerp(0.40200001f, 0.245000005f, roughness), ::math::lerp(0.234000012f, 0.395000011f, roughness))), color(float3(::base::file_texture(texture_2d("./hammered_multi_R_rough_G_corrspots_B_metal.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), ::base::color_layer_add, ::math::lerp(0.582000017f, 0.280000001f, roughness)).tint, color(::math::pow(float3(::base::file_texture(texture_2d("./hammered_multi_R_pit_G_ao_B_hammer.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_add, ::math::lerp(0.70600003f, 0.560000002f, roughness)).tint, color(::math::pow(1.f - float3(::base::file_texture(texture_2d("./hammered_multi_R_pit_G_ao_B_hammer.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], 2.20000005f)), ::base::color_layer_add, ::math::lerp(0.185000002f, 0.960000038f, roughness)).mono, nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(color(histogram_range(float3(::base::file_texture(texture_2d("./hammered_multi_R_rough_G_corrspots_B_metal.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], ::math::lerp(0.40200001f, 0.245000005f, roughness), ::math::lerp(0.234000012f, 0.395000011f, roughness))), color(float3(::base::file_texture(texture_2d("./hammered_multi_R_rough_G_corrspots_B_metal.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), ::base::color_layer_add, ::math::lerp(0.582000017f, 0.280000001f, roughness)).tint, color(::math::pow(float3(::base::file_texture(texture_2d("./hammered_multi_R_pit_G_ao_B_hammer.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_add, ::math::lerp(0.70600003f, 0.560000002f, roughness)).tint, color(::math::pow(1.f - float3(::base::file_texture(texture_2d("./hammered_multi_R_pit_G_ao_B_hammer.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], 2.20000005f)), ::base::color_layer_add, ::math::lerp(0.185000002f, 0.960000038f, roughness)).mono * nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(color(histogram_range(float3(::base::file_texture(texture_2d("./hammered_multi_R_rough_G_corrspots_B_metal.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], ::math::lerp(0.40200001f, 0.245000005f, roughness), ::math::lerp(0.234000012f, 0.395000011f, roughness))), color(float3(::base::file_texture(texture_2d("./hammered_multi_R_rough_G_corrspots_B_metal.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), ::base::color_layer_add, ::math::lerp(0.582000017f, 0.280000001f, roughness)).tint, color(::math::pow(float3(::base::file_texture(texture_2d("./hammered_multi_R_pit_G_ao_B_hammer.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_add, ::math::lerp(0.70600003f, 0.560000002f, roughness)).tint, color(::math::pow(1.f - float3(::base::file_texture(texture_2d("./hammered_multi_R_pit_G_ao_B_hammer.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], 2.20000005f)), ::base::color_layer_add, ::math::lerp(0.185000002f, 0.960000038f, roughness)).mono, 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(metal_color, color(::math::pow(float3(::base::file_texture(texture_2d("./hammered_multi_R_pit_G_ao_B_hammer.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], 2.20000005f)), ::base::color_layer_multiply, diffuse_variation).tint, color(float3(::base::file_texture(texture_2d("./hammered_multi_R_pit_G_ao_B_hammer.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), ::base::color_layer_overlay, diffuse_variation).tint, 0.f, ""), bsdf(), ::base::tangent_space_normal_texture(texture_2d("./hammered_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), ::base::tangent_space_normal_texture(texture_2d("./hammered_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), ::base::tangent_space_normal_texture(texture_2d("./hammered_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
201
+ material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
202
+ color tmp3 = color(1.f, 1.f, 1.f);
203
+ 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));
204
+ 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());
205
+ hair_bsdf tmp6 = hair_bsdf();
206
+ } in
207
+ material(
208
+ thin_walled: tmp0,
209
+ surface: tmp1,
210
+ backface: tmp2,
211
+ ior: tmp3,
212
+ volume: tmp4,
213
+ geometry: tmp5,
214
+ hair: tmp6);
215
+
216
+
217
+ export material Copper_Hammered_Shiny(*)
218
+ [[
219
+ ::anno::display_name("Hammered Copper - Shiny"),
220
+ ::anno::author("NVIDIA vMaterials"),
221
+ ::anno::in_group("Metal"),
222
+ ::anno::key_words(string[]("metal", "copper", "hammered", "design", "classic", "architecture", "pattern", "reflective", "rough", "bumped", "conductor", "shiny", "warm")),
223
+ ::anno::thumbnail("./.thumbs/Copper_Hammered.Copper_Hammered_Shiny.png"),
224
+ ::anno::description(DESCRIPTION),
225
+ ::anno::copyright_notice(COPYRIGHT)
226
+ ]]
227
+ = Copper_Hammered(
228
+ metal_color: color(0.38854f, 0.18195f, 0.10889f),
229
+ roughness: 0.3f,
230
+ diffuse_variation: 0.2f,
231
+ bump_strength: 0.5f,
232
+ roundcorners_enable:false,
233
+ roundcorners_radius_mm: 1.5f,
234
+ roundcorners_across_materials: false,
235
+ texture_translate: 0.0f,
236
+ texture_rotate: 0.0f,
237
+ texture_scale: 1.0f,
238
+ uv_space_index: 0
239
+ );
240
+
241
+ export material Copper_Hammered_Dull(*)
242
+ [[
243
+ ::anno::display_name("Hammered Copper - Dull"),
244
+ ::anno::author("NVIDIA vMaterials"),
245
+ ::anno::in_group("Metal"),
246
+ ::anno::key_words(string[]("metal", "copper", "hammered", "design", "classic", "architecture", "pattern", "reflective", "rough", "bumped", "conductor", "matte", "dull", "warm")),
247
+ ::anno::thumbnail("./.thumbs/Copper_Hammered.Copper_Hammered_Dull.png"),
248
+ ::anno::description(DESCRIPTION),
249
+ ::anno::copyright_notice(COPYRIGHT)
250
+ ]]
251
+ = Copper_Hammered(
252
+ metal_color: color(0.38854f, 0.18195f, 0.10889f),
253
+ roughness: 1.0f,
254
+ diffuse_variation: 0.4f,
255
+ bump_strength: 0.8f,
256
+ roundcorners_enable:false,
257
+ roundcorners_radius_mm: 1.5f,
258
+ roundcorners_across_materials: false,
259
+ texture_translate: 0.0f,
260
+ texture_rotate: 0.0f,
261
+ texture_scale: 1.0f,
262
+ uv_space_index: 0
263
+ );
Material/material_0423/Diamond_Plate_Quintuple_Tear.mdl ADDED
@@ -0,0 +1,544 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ const string COPYRIGHT =
48
+ " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
49
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
50
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
51
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
52
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
53
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
54
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
55
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
56
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
57
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
58
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
59
+
60
+ const string DESCRIPTION = "A diamont metal plate material. The added texture reduces the risk of slipping, "
61
+ "making diamond plate a solution for stairs, catwalks, walkways, and ramps in industrial settings";
62
+
63
+
64
+ int lowbias32(int x)
65
+ {
66
+ x ^= x >>> 16;
67
+ x *= 0x7feb352d;
68
+ x ^= x >>> 15;
69
+ x *= 0x846ca68b;
70
+ x ^= x >>> 16;
71
+ return x;
72
+ }
73
+
74
+ float uint2float(int x)
75
+ {
76
+ return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0);
77
+ }
78
+
79
+ float2x2 invert_2x2(float2x2 M)
80
+ {
81
+ float det = M[0][0]*M[1][1] - M[0][1]*M[1][0];
82
+ //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/
83
+ return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]);
84
+ }
85
+
86
+ float2 rnd22(int2 p) {
87
+ float2 ret_val = float2(
88
+ uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f,
89
+ uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f
90
+ );
91
+ return ret_val;
92
+ }
93
+
94
+ float contrast_brightness(
95
+ float input = 0.5f,
96
+ float contrast = 0.5f,
97
+ float brightness = 0.5f
98
+ )
99
+ {
100
+ float return_value = contrast > 0.5 ?
101
+ float(math::clamp((input - 0.5) * 1/(1.000001 - (contrast - 0.5)*2.0) + 0.5, 0.0, 1.0) + (brightness - 0.5) * 2.0)
102
+ :
103
+ float(math::clamp((input - 0.5) * contrast * 2.0 + 0.5 + (brightness - 0.5)*2.0, 0.0, 1.0));
104
+
105
+ return return_value;
106
+ }
107
+
108
+ float3 transform_internal_to_tangent(float3 n)
109
+ [[
110
+ anno::hidden()
111
+ ]]
112
+ {
113
+ return
114
+ n.x* float3(state::texture_tangent_u(0).x,state::texture_tangent_v(0).x,state::normal().x)+
115
+ n.y* float3(state::texture_tangent_u(0).y,state::texture_tangent_v(0).y,state::normal().y)+
116
+ n.z* float3(state::texture_tangent_u(0).z,state::texture_tangent_v(0).z,state::normal().z);
117
+ }
118
+
119
+ // Returns the normal n in internal space, given n is in tangent space.
120
+ float3 transform_tangent_to_internal(float3 n)
121
+ [[
122
+ anno::hidden()
123
+ ]]
124
+ {
125
+ return state::texture_tangent_u(0) * n.x +
126
+ state::texture_tangent_v(0) * n.y +
127
+ state::normal() * n.z ;
128
+ }
129
+
130
+ // Returns a normal by adding a detail normal to a global normal.
131
+ // If detail blending of two normal maps gives visual artifacts, check if texture_2d are loaded
132
+ // correctly with tex::gamma_linear
133
+ float3 add_detail_normal(float3 nd = state::normal(), float3 n = state::normal())
134
+ {
135
+ // http://blog.selfshadow.com/publications/blending-in-detail/
136
+ float3 n_t = transform_internal_to_tangent(n);
137
+ float3 nd_t = transform_internal_to_tangent(nd);
138
+
139
+ n_t=n_t + float3(0.,0.,1.);
140
+ nd_t = nd_t * float3(-1.,-1.,1.);
141
+ n = n_t*math::dot(n_t, nd_t)/n_t.z - nd_t;
142
+ return ::math::normalize(transform_tangent_to_internal(n));
143
+ }
144
+
145
+ float histogram_range(float input, float range = 1.0f, float position = 0.5f)
146
+ {
147
+ float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0);
148
+ float high = ::math::clamp(math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0);
149
+ return ::math::lerp(low, high, input);
150
+ }
151
+
152
+ float remap_xy_to_0_1(float input, float x, float y)
153
+ {
154
+ return (input - x)/(y - x);
155
+ }
156
+
157
+ float histogram_scan_big(float input, float width, float position)
158
+ {
159
+ return ::math::clamp(
160
+ remap_xy_to_0_1(input,
161
+ ::math::lerp(-width, 1.0, position),
162
+ ::math::lerp(0.0, 1.0 + width, position)),
163
+ 0.0,
164
+ 1.0);
165
+ }
166
+
167
+ struct vm_coordinates{
168
+ float2 uv;
169
+ float rotation;
170
+ int uv_space_index;
171
+ float4 carry;
172
+ };
173
+
174
+ enum vm_mono_select
175
+ [[
176
+ ::anno::description("Modes for the creation of a gray-scale value from a color."),
177
+ ::anno::hidden()
178
+ ]]
179
+ {
180
+ mono_r = 0,
181
+ mono_g = 1,
182
+ mono_b = 2,
183
+ mono_a = 3,
184
+ mono_average = 4
185
+ };
186
+
187
+ vm_coordinates vm_coord
188
+ (
189
+ float2 translation = float2(0.0f, 0.0) [[
190
+ ::anno::display_name("Translation"),
191
+ ::anno::description("Translates the coordinates.")
192
+ ]],
193
+ float rotation = 0.0f [[
194
+ ::anno::display_name("Rotation"),
195
+ ::anno::description("Rotates the coordinates in degrees.")
196
+ ]],
197
+ float2 scaling = float2(1.0f, 1.0f) [[
198
+ ::anno::display_name("Scaling"),
199
+ ::anno::description("Scales the coordinates.")
200
+ ]],
201
+ uniform int uv_space = 0 [[
202
+ ::anno::display_name("UV Space"),
203
+ ::anno::description("Chose the UV space.")
204
+ ]]
205
+ )
206
+ [[
207
+ ::anno::display_name("vm Transform"),
208
+ ::anno::description("Generates coordinates to be used in vm_lookup functions.")
209
+ ]]
210
+ {
211
+ vm_coordinates uv;
212
+ ::base::texture_coordinate_info info = ::base::coordinate_source( ::base::texture_coordinate_uvw, uv_space);
213
+ uv.rotation = (rotation * 3.1415926535897932384626433832f) / 180.f;
214
+ uv.uv = float2(info.position.x, info.position.y);
215
+ float sine = ::math::sin(uv.rotation);
216
+ float cosine = ::math::cos(uv.rotation);
217
+ float2x2 rot = float2x2(cosine, -sine, sine, cosine);
218
+ uv.uv = rot * uv.uv;
219
+ uv.uv /= scaling;
220
+ uv.uv += translation;
221
+ // Translation before or after rotation?
222
+ return uv;
223
+ }
224
+
225
+ vm_coordinates vm_coord_post_scale(
226
+ vm_coordinates uv = vm_coord(),
227
+ float2 scale = 1.0f
228
+ )
229
+ {
230
+ uv.uv /= scale;
231
+ return uv;
232
+ }
233
+
234
+ float3 vm_tex_infinite(
235
+ uniform texture_2d tex = texture_2d(),
236
+ vm_coordinates uv = vm_coord(),
237
+ float3 average_color = float3(0.5f, 0.5f, 1.0f),
238
+ float patch_size = 1.0,
239
+ bool gamma_correct = true,
240
+ float gamma = 2.2f
241
+ )
242
+ {
243
+ float2 uv_in = uv.uv;
244
+
245
+ float3 O = float3(0.f);
246
+ float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f);
247
+ float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space
248
+
249
+ float2 U = uv_in;
250
+ float2 V = M * (uv.uv / patch_size); //pre-tilted hexa coordinates
251
+ int2 I = int2(::math::floor(V))+int2(800); // hexa-tile id
252
+
253
+ // The mean color needs to be determined in Photoshop then to make the
254
+ // average color work out, take the float value and calculate the apropriate
255
+ // mean value as (value^(1/2.2))
256
+
257
+ float3 m = average_color;
258
+
259
+ float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W;
260
+ F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates
261
+
262
+ if( F[2] > 0.f )
263
+ O = (W[0] = F[2]) * (( ::tex::lookup_float3(tex, U-rnd22(I))) - m)
264
+ + (W[1] = F[1]) * (( ::tex::lookup_float3(tex, U-rnd22(I+int2(0,1)))) - m)
265
+ + (W[2] = F[0]) * (( ::tex::lookup_float3(tex, U-rnd22(I+int2(1,0)))) - m);
266
+ else
267
+ O = (W[0] = -F[2]) * (( ::tex::lookup_float3(tex, U-rnd22(I+int2(1)))) - m)
268
+ + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(tex, U-rnd22(I+int2(1, 0)))) - m)
269
+ + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(tex, U-rnd22(I+int2(0, 1)))) - m);
270
+ O = m + O/::math::length(W);
271
+ O = ::math::clamp( (O), 0.0f, 1.0f);
272
+
273
+ return gamma_correct? ::math::pow(::math::max(O, float3(0.0f)), gamma) : float3(O);
274
+ }
275
+
276
+ ::base::texture_return vm_tex_lookup(
277
+ uniform texture_2d tex,
278
+ vm_coordinates uv = vm_coord(),
279
+ uniform vm_mono_select mono_source = mono_a,
280
+ float4 scale = float4(1.0f))
281
+ {
282
+ float mono;
283
+ float4 lookup = ::tex::lookup_float4(tex, uv.uv, ::tex::wrap_repeat, ::tex::wrap_repeat) * scale;
284
+ switch( mono_source ) {
285
+ case mono_r: mono = lookup.x;
286
+ break;
287
+ case mono_g: mono = lookup.y;
288
+ break;
289
+ case mono_b: mono = lookup.z;
290
+ break;
291
+ case mono_a: mono = lookup.w;
292
+ break;
293
+ case mono_average: mono = ::math::average(float3(lookup.x, lookup.y, lookup.z));
294
+ break;
295
+ }
296
+ return ::base::texture_return(color(lookup.x, lookup.y, lookup.z), mono);
297
+ }
298
+
299
+ float3 vm_tex_normal_lookup(
300
+ uniform texture_2d tex,
301
+ vm_coordinates uv = vm_coord(),
302
+ float strength = 1.0f
303
+ )
304
+ {
305
+ float rot = uv.rotation;
306
+ // Lookup and convert normal texture to -1 ... 1 range
307
+ float3 norm = (::tex::lookup_float3(tex, uv.uv, ::tex::wrap_repeat, ::tex::wrap_repeat) - float3(.5f)) * 2.0f;
308
+ norm = ::math::normalize(norm * float3(strength, strength, 1.0));
309
+ // if any rotation happened prior to the lookup, compensate for it
310
+ norm = float3(::math::cos(rot) * norm.x - ::math::sin(rot) * norm.y,
311
+ ::math::sin(rot) * norm.x + ::math::cos(rot) * norm.y,
312
+ norm.z);
313
+ return norm.x * ::state::texture_tangent_u(uv.uv_space_index) +
314
+ norm.y * ::state::texture_tangent_v(uv.uv_space_index) +
315
+ norm.z * ::state::normal();
316
+ }
317
+
318
+ export material Diamond_Plate_Quintuple_Tear(
319
+ float metal_roughness = 0.27f [[
320
+ ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."),
321
+ ::anno::display_name("Metal Roughness"),
322
+ ::anno::in_group("Appearance"),
323
+ ::anno::hard_range(0.f, 1.f),
324
+ ::anno::ui_order(0)
325
+ ]],
326
+ float roughness_variation = 0.05f [[
327
+ ::anno::description("Amount of variation applied to the roughness, higher numbers lead to non-uniform reflections of the material."),
328
+ ::anno::display_name("Roughness Variation"),
329
+ ::anno::in_group("Appearance"),
330
+ ::anno::hard_range(0.f, 1.f),
331
+ ::anno::ui_order(1)
332
+ ]],
333
+ float pattern_shininess = 0.f [[
334
+ ::anno::description("Simulates abrasion of the shape tops by making them more shiny."),
335
+ ::anno::display_name("Pattern Shininess"),
336
+ ::anno::in_group("Appearance"),
337
+ ::anno::hard_range(0.f, 1.f),
338
+ ::anno::ui_order(2)
339
+ ]],
340
+ float dirt_amount = 0.f [[
341
+ ::anno::description("The amount of dirt applied to the material."),
342
+ ::anno::display_name("Dirt Amount"),
343
+ ::anno::in_group("Appearance", "Dirt"),
344
+ ::anno::hard_range(0.f, 1.f),
345
+ ::anno::ui_order(3)
346
+ ]],
347
+ float dirt_weight = 1.f [[
348
+ ::anno::description("Makes the dirt transition sharper and more defined."),
349
+ ::anno::display_name("Dirt Weight"),
350
+ ::anno::in_group("Appearance", "Dirt"),
351
+ ::anno::hard_range(0.f, 1.f),
352
+ ::anno::ui_order(4)
353
+ ]],
354
+ float dirt_brightness = 0.38f [[
355
+ ::anno::description("Amkes the dirt arker or brighter."),
356
+ ::anno::display_name("Dirt Brightness"),
357
+ ::anno::in_group("Appearance", "Dirt"),
358
+ ::anno::hard_range(0.f, 1.f),
359
+ ::anno::ui_order(5)
360
+ ]],
361
+ float2 texture_translate = 0.f [[
362
+ ::anno::description("Controls the position of the texture."),
363
+ ::anno::display_name("Texture Translate"),
364
+ ::anno::in_group("Transform"),
365
+ ::anno::ui_order(6)
366
+ ]],
367
+ float texture_rotate = 0.f [[
368
+ ::anno::description("Rotates angle of the texture in degrees."),
369
+ ::anno::display_name("Texture Rotate"),
370
+ ::anno::in_group("Transform"),
371
+ ::anno::ui_order(7)
372
+ ]],
373
+ float2 texture_scale = 1.0f [[
374
+ ::anno::description("Larger numbers increase the size."),
375
+ ::anno::display_name("Texture Scale"),
376
+ ::anno::in_group("Transform"),
377
+ ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)),
378
+ ::anno::ui_order(8)
379
+ ]],
380
+ uniform int uv_space_index = 0 [[
381
+ ::anno::description("Uses selected UV space."),
382
+ ::anno::display_name("UV Space Index"),
383
+ ::anno::in_group("Advanced"),
384
+ ::anno::ui_order(9)
385
+ ]],
386
+ uniform bool roundcorners_enable = false [[
387
+ ::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."),
388
+ ::anno::display_name("Enable Round Corners"),
389
+ ::anno::in_group("Round Corners"),
390
+ ::anno::ui_order(10)
391
+ ]],
392
+ uniform float roundcorners_radius_mm = 1.5f [[
393
+ ::anno::description("Radius of the rounded corners."),
394
+ ::anno::display_name("Round Corner Radius"),
395
+ ::anno::in_group("Round Corners"),
396
+ ::anno::ui_order(11)
397
+ ]],
398
+ uniform bool roundcorners_across_materials = false [[
399
+ ::anno::description("Applies the round corner effect across different materials when enabled."),
400
+ ::anno::display_name("Across Materials"),
401
+ ::anno::in_group("Round Corners"),
402
+ ::anno::ui_order(12)
403
+ ]])
404
+ [[
405
+ ::anno::author("NVIDIA vMaterials"),
406
+ ::anno::display_name("Diamond Plate 5x - New Shiny"),
407
+ ::anno::contributor("Rüdiger Raab"),
408
+ ::anno::description(DESCRIPTION),
409
+ ::anno::key_words(string[]("metal", "plate", "diamond", "reflective", "pattern", "safety", "bumped", "embossed", "infinite tiling", "architecture", "naval", "sanitary", "interior", "exterior", "new", "shiny", "gray")),
410
+ ::anno::thumbnail("./.thumbs/Diamond_Plate_Quintuple_Tear.Diamond_Plate_Quintuple_Tear.png"),
411
+ ::anno::copyright_notice(COPYRIGHT)
412
+ ]]
413
+ =
414
+ let {
415
+
416
+ float2 texture_rescale = texture_scale * 0.15f;
417
+ bool tmp0 = false;
418
+ texture_2d shape_multi_ao_height = texture_2d("./fivetear_shape_multi_R_ao_G_height_B_opacity.jpg", ::tex::gamma_linear);
419
+ texture_2d shape_norm = texture_2d("./fivetear_shape_norm.jpg", ::tex::gamma_linear);
420
+
421
+ material_surface tmp1(::df::weighted_layer(contrast_brightness(::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), 5.f), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f), 0.659999967f, 0.5f), ::df::microfacet_ggx_smith_bsdf(::math::lerp(0.639999986f, histogram_range(vm_tex_infinite(texture_2d("./plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, roughness_variation * 0.400000006f, metal_roughness * 0.629999995f + 0.0500000007f) + roughness_variation * 0.299999982f * ::math::pow(1.f - float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 1.26999998f), ::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), 5.f), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f)) * (1.f - pattern_shininess * float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y) * (::math::lerp(0.639999986f, histogram_range(vm_tex_infinite(texture_2d("./plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, roughness_variation * 0.400000006f, metal_roughness * 0.629999995f + 0.0500000007f) + roughness_variation * 0.299999982f * ::math::pow(1.f - float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 1.26999998f), ::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), 5.f), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f)) * (1.f - pattern_shininess * float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y)), ::math::lerp(0.639999986f, histogram_range(vm_tex_infinite(texture_2d("./plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, roughness_variation * 0.400000006f, metal_roughness * 0.629999995f + 0.0500000007f) + roughness_variation * 0.299999982f * ::math::pow(1.f - float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 1.26999998f), ::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), 5.f), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f)) * (1.f - pattern_shininess * float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y) * (::math::lerp(0.639999986f, histogram_range(vm_tex_infinite(texture_2d("./plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, roughness_variation * 0.400000006f, metal_roughness * 0.629999995f + 0.0500000007f) + roughness_variation * 0.299999982f * ::math::pow(1.f - float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 1.26999998f), ::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), 5.f), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f)) * (1.f - pattern_shininess * float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y)), color(0.387622833f, 0.387622833f, 0.387622833f), color(0.387622833f, 0.387622833f, 0.387622833f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(vm_tex_lookup(texture_2d("./dirt.jpg", ::tex::gamma_srgb), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), 0.5f), mono_average, float4(dirt_brightness * 0.620000005f + 0.0599999987f)).tint, 0.f), bsdf(), add_detail_normal(::math::lerp(vm_tex_normal_lookup(texture_2d("./plate_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), 1.f), ::state::normal(), contrast_brightness(::math::pow(::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), 5.f), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f), 0.229999989f), 0.699999988f, 0.5f)), vm_tex_normal_lookup(shape_norm, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), 1.f))), add_detail_normal(::math::lerp(vm_tex_normal_lookup(texture_2d("./plate_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), 1.f), ::state::normal(), contrast_brightness(::math::pow(::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), 5.f), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f), 0.229999989f), 0.699999988f, 0.5f)), vm_tex_normal_lookup(shape_norm, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), 1.f))), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
422
+ material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
423
+ color tmp3 = color(1.f, 1.f, 1.f);
424
+ 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));
425
+ 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());
426
+ } in
427
+ material(
428
+ thin_walled: tmp0,
429
+ surface: tmp1,
430
+ backface: tmp2,
431
+ ior: tmp3,
432
+ volume: tmp4,
433
+ geometry: tmp5);
434
+
435
+
436
+ // 2
437
+ export material Diamond_Plate_Quintuple_Tear_Glossy(*)
438
+ [[
439
+ ::anno::author("NVIDIA vMaterials"),
440
+ ::anno::display_name("Diamond Plate 5x - Glossy"),
441
+ ::anno::contributor("Rüdiger Raab"),
442
+ ::anno::description(DESCRIPTION),
443
+ ::anno::key_words(string[]("metal", "plate", "diamond", "pattern", "safety", "bumped", "embossed", "infinite tiling", "architecture", "naval", "sanitary", "interior", "exterior", "gray", "glossy")),
444
+ ::anno::thumbnail("./.thumbs/Diamond_Plate_Quintuple_Tear.Diamond_Plate_Quintuple_Tear_Glossy.png"),
445
+ ::anno::copyright_notice(COPYRIGHT)
446
+ ]]
447
+ = Diamond_Plate_Quintuple_Tear (
448
+ metal_roughness: 0.4f,
449
+ roughness_variation: 0.47f,
450
+ pattern_shininess: 0.0f,
451
+ dirt_amount: 0.0f,
452
+ dirt_weight: 1.0f,
453
+ dirt_brightness: 0.38f,
454
+ texture_translate: 0.0f,
455
+ texture_rotate: 0.0f,
456
+ texture_scale: 1.0f,
457
+ uv_space_index: 0,
458
+ roundcorners_enable: false,
459
+ roundcorners_radius_mm: 1.5f,
460
+ roundcorners_across_materials: false
461
+ );
462
+
463
+
464
+ // 3
465
+ export material Diamond_Plate_Quintuple_Tear_Shiny_Tops(*)
466
+ [[
467
+ ::anno::author("NVIDIA vMaterials"),
468
+ ::anno::display_name("Diamond Plate 5x - Shiny Tops"),
469
+ ::anno::contributor("Rüdiger Raab"),
470
+ ::anno::description(DESCRIPTION),
471
+ ::anno::key_words(string[]("metal", "plate", "diamond", "pattern", "safety", "bumped", "embossed", "infinite tiling", "architecture", "naval", "sanitary", "interior", "exterior", "shiny", "gray")),
472
+ ::anno::thumbnail("./.thumbs/Diamond_Plate_Quintuple_Tear.Diamond_Plate_Quintuple_Tear_Shiny_Tops.png"),
473
+ ::anno::copyright_notice(COPYRIGHT)
474
+ ]]
475
+ = Diamond_Plate_Quintuple_Tear (
476
+ metal_roughness: 0.4f,
477
+ roughness_variation: 0.47f,
478
+ pattern_shininess: 0.75f,
479
+ dirt_amount: 0.0f,
480
+ dirt_weight: 1.0f,
481
+ dirt_brightness: 0.38f,
482
+ texture_translate: 0.0f,
483
+ texture_rotate: 0.0f,
484
+ texture_scale: 1.0f,
485
+ uv_space_index: 0,
486
+ roundcorners_enable: false,
487
+ roundcorners_radius_mm: 1.5f,
488
+ roundcorners_across_materials: false
489
+ );
490
+
491
+ // 4
492
+ export material Diamond_Plate_Quintuple_Tear_Matte_Aged(*)
493
+ [[
494
+ ::anno::author("NVIDIA vMaterials"),
495
+ ::anno::display_name("Diamond Plate 5x - Matte Aged"),
496
+ ::anno::contributor("Rüdiger Raab"),
497
+ ::anno::description(DESCRIPTION),
498
+ ::anno::key_words(string[]("metal", "plate", "diamond", "pattern", "safety", "bumped", "embossed", "infinite tiling", "architecture", "naval", "sanitary", "interior", "exterior", "matte", "aged", "gray")),
499
+ ::anno::thumbnail("./.thumbs/Diamond_Plate_Quintuple_Tear.Diamond_Plate_Quintuple_Tear_Matte_Aged.png"),
500
+ ::anno::copyright_notice(COPYRIGHT)
501
+ ]]
502
+ = Diamond_Plate_Quintuple_Tear (
503
+ metal_roughness: 0.63f,
504
+ roughness_variation: 0.72f,
505
+ pattern_shininess: 0.0f,
506
+ dirt_amount: 0.0f,
507
+ dirt_weight: 1.0f,
508
+ dirt_brightness: 0.4f,
509
+ texture_translate: 0.0f,
510
+ texture_rotate: 0.0f,
511
+ texture_scale: 1.0f,
512
+ uv_space_index: 0,
513
+ roundcorners_enable: false,
514
+ roundcorners_radius_mm: 1.5f,
515
+ roundcorners_across_materials: false
516
+ );
517
+
518
+
519
+ // 5
520
+ export material Diamond_Plate_Quintuple_Tear_Dirty_Worn(*)
521
+ [[
522
+ ::anno::author("NVIDIA vMaterials"),
523
+ ::anno::display_name("Diamond Plate 5x - Dirty Worn"),
524
+ ::anno::contributor("Rüdiger Raab"),
525
+ ::anno::description(DESCRIPTION),
526
+ ::anno::key_words(string[]("metal", "plate", "diamond", "pattern", "safety", "bumped", "embossed", "infinite tiling", "architecture", "naval", "sanitary", "interior", "exterior", "shiny", "gray", "worn", "old", "dirty", "decayed")),
527
+ ::anno::thumbnail("./.thumbs/Diamond_Plate_Quintuple_Tear.Diamond_Plate_Quintuple_Tear_Dirty_Worn.png"),
528
+ ::anno::copyright_notice(COPYRIGHT)
529
+ ]]
530
+ = Diamond_Plate_Quintuple_Tear (
531
+ metal_roughness: 0.38f,
532
+ roughness_variation: 0.53f,
533
+ pattern_shininess: 0.0f,
534
+ dirt_amount: 0.38f,
535
+ dirt_weight: 1.0f,
536
+ dirt_brightness: 0.4f,
537
+ texture_translate: 0.0f,
538
+ texture_rotate: 0.0f,
539
+ texture_scale: 1.0f,
540
+ uv_space_index: 0,
541
+ roundcorners_enable: false,
542
+ roundcorners_radius_mm: 1.5f,
543
+ roundcorners_across_materials: false
544
+ );
Material/material_0427/Gold.mdl ADDED
@@ -0,0 +1,380 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2024 NVIDIA Corporation. All rights reserved.
3
+ ******************************************************************************
4
+
5
+ Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge,
6
+ to any person obtaining a copy of the sample definition code that uses our
7
+ Material Definition Language (the "MDL Materials"), to reproduce and distribute
8
+ the MDL Materials, including without limitation the rights to use, copy, merge,
9
+ publish, distribute, and sell modified and unmodified copies of the MDL
10
+ Materials, and to permit persons to whom the MDL Materials is furnished to do
11
+ so, in all cases solely for use with NVIDIA's Material Definition Language,
12
+ subject to the following further conditions:
13
+
14
+ 1. The above copyright notices, this list of conditions, and the disclaimer
15
+ that follows shall be retained in all copies of one or more of the MDL
16
+ Materials, including in any software with which the MDL Materials are bundled,
17
+ redistributed, and/or sold, and included either as stand-alone text files,
18
+ human-readable headers or in the appropriate machine-readable metadata fields
19
+ within text or binary files as long as those fields can be easily viewed by the
20
+ user, as applicable.
21
+ 2. The name of NVIDIA shall not be used to promote, endorse or advertise any
22
+ Modified Version without specific prior written permission, except a) to comply
23
+ with the notice requirements otherwise contained herein; or b) to acknowledge
24
+ the contribution(s) of NVIDIA.
25
+
26
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
27
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
28
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
29
+ TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR
30
+ ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL,
31
+ INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF
32
+ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE
33
+ THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.
34
+ */
35
+
36
+ mdl 1.4;
37
+
38
+ import ::anno::*;
39
+ import ::base::*;
40
+ import ::df::*;
41
+ import ::math::*;
42
+ import ::state::*;
43
+ import ::tex::*;
44
+ import ::nvidia::core_definitions::blend_colors;
45
+ import ::nvidia::core_definitions::dimension;
46
+
47
+ const string COPYRIGHT =
48
+ " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
49
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
50
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
51
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
52
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
53
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
54
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
55
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
56
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
57
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
58
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
59
+
60
+
61
+ ::base::texture_coordinate_info vmat_transform(
62
+ uniform float2 translation = float2(0.0, 0.0),
63
+ uniform float rotation = 0.0,
64
+ uniform float2 scaling = float2(1.0, 1.0),
65
+ uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw,
66
+ uniform int uv_space = 0
67
+ )
68
+ {
69
+ float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f;
70
+
71
+ float4x4 scale =
72
+ float4x4(1.0 /scaling.x, 0. , 0. , 0.,
73
+ 0. , 1.0 /scaling.y , 0. , 0.,
74
+ 0. , 0. , 1.0, 0.,
75
+ translation.x , translation.y , 0.0, 1.);
76
+
77
+ float s = ::math::sin(rotation_rad);
78
+ float c = ::math::cos(rotation_rad);
79
+ float4x4 rotate =
80
+ float4x4( c , -s , 0.0 , 0.0,
81
+ s , c , 0.0 , 0.0,
82
+ 0.0, 0.0 , 1.0 , 0.0,
83
+ 0. , 0.0 , 0.0 , 1.);
84
+
85
+ return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space));
86
+ }
87
+
88
+
89
+ float uint2float(int x)
90
+ {
91
+ return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0);
92
+ }
93
+
94
+ int lowbias32(int x)
95
+ {
96
+ x ^= x >>> 16;
97
+ x *= 0x7feb352d;
98
+ x ^= x >>> 15;
99
+ x *= 0x846ca68b;
100
+ x ^= x >>> 16;
101
+ return x;
102
+ }
103
+
104
+ float2 rnd22(int2 p) {
105
+ float2 ret_val = float2(
106
+ uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f,
107
+ uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f
108
+ );
109
+ return ret_val;
110
+ }
111
+
112
+ float3 srgb2rgb(float3 val)
113
+ {
114
+ return ::math::pow(::math::max(val, float3(0.0f)), 2.2);
115
+ }
116
+
117
+ float2x2 invert_2x2(float2x2 M)
118
+ {
119
+ float det = M[0][0]*M[1][1] - M[0][1]*M[1][0];
120
+ //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/
121
+ return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]);
122
+ }
123
+
124
+ float3 nonrepeat_lookup(
125
+ uniform texture_2d texture = texture_2d(),
126
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
127
+ float texture_scale = 1.0,
128
+ float3 average_color = float3(0.5),
129
+ float patch_size = 8.0
130
+ )
131
+ {
132
+
133
+ float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale;
134
+ float Z = patch_size; // patch scale inside example texture
135
+ float CON = 1.0f;
136
+
137
+ float3 O = float3(0.f);
138
+ float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f);
139
+ float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space
140
+
141
+ float2 U = uv_in;
142
+ float2 V = M * uv_in; //pre-tilted hexa coordinates
143
+ int2 I = int2(::math::floor(V)); // hexa-tile id
144
+
145
+ // The mean color needs to be determined in Photoshop then to make the
146
+ // average color work out, take the float value and calculate the apropriate
147
+ // mean value as (value^(1/2.2))
148
+
149
+ float3 m = average_color;
150
+
151
+ float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W;
152
+ F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates
153
+
154
+ if( F[2] > 0.f )
155
+
156
+ O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON))
157
+ + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON))
158
+ + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON));
159
+ else
160
+ O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON))
161
+ + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON))
162
+ + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON));
163
+ O = m + O/::math::length(W);
164
+ O = ::math::clamp( (O), 0.0, 1.0);
165
+
166
+ return float3(O);
167
+ }
168
+
169
+ color endless_texture(
170
+ uniform texture_2d texture = texture_2d(),
171
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
172
+ float texture_scale = 10.0,
173
+ float3 average_color = float3(0.5, 0.5, 1.0),
174
+ float patch_size = 8.0,
175
+ bool gamma_correct_lookup = true
176
+ )
177
+ {
178
+ return gamma_correct_lookup ? color(srgb2rgb(
179
+ nonrepeat_lookup (
180
+ texture: texture,
181
+ uvw: uvw,
182
+ texture_scale: texture_scale,
183
+ average_color: average_color,
184
+ patch_size: patch_size
185
+ ))
186
+ ) : color(nonrepeat_lookup (
187
+ texture: texture,
188
+ uvw: uvw,
189
+ texture_scale: texture_scale,
190
+ average_color: average_color,
191
+ patch_size: patch_size
192
+ ));
193
+ }
194
+
195
+
196
+ export material Gold(
197
+ uniform bool infinite_tiling = true [[
198
+ ::anno::description("Enables infinite tiling feature which removes repeating texture patterns. Note that depending on the material this feature changes the appearance of the material slightly."),
199
+ ::anno::display_name("Infinite Tiling"),
200
+ ::anno::in_group("Appearance")
201
+ ]],
202
+ float roughness = 0.1f [[
203
+ ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."),
204
+ ::anno::display_name("Roughness"),
205
+ ::anno::in_group("Appearance"),
206
+ ::anno::hard_range(0.f, 1.f)
207
+ ]],
208
+ float smudges = 0.5f [[
209
+ ::anno::description("Adds blurrier reflection that follow the intensities of the Roughness texture on top."),
210
+ ::anno::display_name("Smudges"),
211
+ ::anno::in_group("Appearance"),
212
+ ::anno::hard_range(0.f, 1.f)
213
+ ]],
214
+ uniform bool enable_round_corners = false [[
215
+ ::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."),
216
+ ::anno::display_name("Enable Round Corners"),
217
+ ::anno::in_group("Round Corners")
218
+ ]],
219
+ uniform float radius = 0.03f [[
220
+ ::anno::description("Radius of the rounded corners."),
221
+ ::anno::display_name("Round Corner Radius"),
222
+ ::anno::in_group("Round Corners")
223
+ ]],
224
+ uniform bool across_materials = false [[
225
+ ::anno::display_name("Across Materials"),
226
+ ::anno::description("When enabled the round corner effect is applied across different materials."),
227
+ ::anno::in_group("Round Corners")
228
+ ]],
229
+ uniform float2 texture_translate = 0.f [[
230
+ ::anno::display_name("Texture Translate"),
231
+ ::anno::description("Controls the position of the texture."),
232
+ ::anno::in_group("Transform")
233
+ ]],
234
+ uniform float texture_rotate = 0.f [[
235
+ ::anno::display_name("Texture Rotate"),
236
+ ::anno::description("Rotates angle of the texture in degrees."),
237
+ ::anno::soft_range(0.f, 360.f),
238
+ ::anno::in_group("Transform")
239
+ ]],
240
+ uniform float2 texture_scale = 1.f [[
241
+ ::anno::display_name("Texture Scale"),
242
+ ::anno::description("Larger numbers increase the size."),
243
+ ::anno::in_group("Transform"),
244
+ ::nvidia::core_definitions::dimension(float2(.45f, .45f))
245
+ ]],
246
+ uniform int uv_space_index = 0 [[
247
+ ::anno::display_name("UV Space Index"),
248
+ ::anno::in_group("Advanced")
249
+ ]],
250
+ float3 normal = ::state::normal() [[
251
+ ::anno::description("Modify the surface normal."),
252
+ ::anno::display_name("Normal"),
253
+ ::anno::in_group("Advanced")
254
+ ]]
255
+ )
256
+ [[
257
+ ::anno::author("NVIDIA vMaterials"),
258
+ ::anno::display_name("Gold"),
259
+ ::anno::description("Pure metal material with optional smudges."),
260
+ ::anno::copyright_notice(COPYRIGHT),
261
+ ::anno::thumbnail("./.thumbs/Gold.Gold.png"),
262
+ ::anno::key_words(string[]("metal", "pure", "smudged", "design", "reflective", "infinite tiling", "smooth", "conductor", "new", "polished", "gold", "yellow", "warm"))
263
+ ]]
264
+ =
265
+ let {
266
+
267
+ color normal_reflectivity = color(1.0f,0.722306985258f,0.340058756743f);
268
+ color grazing_reflectivity = color(0.99942f, 1.f, 1.f);
269
+
270
+ bool tmp0 = false;
271
+ material_surface tmp1(
272
+ ::df::color_custom_curve_layer(normal_reflectivity, grazing_reflectivity, 5.f, color(1.f, 1.f, 1.f), ::df::microfacet_ggx_smith_bsdf(::math::lerp(::math::lerp(0.f, 0.5f, roughness), ::math::lerp(0.f, 0.5f, roughness) + smudges * (1.f - ::math::lerp(0.f, 0.5f, roughness)), infinite_tiling ? float3(endless_texture(texture_2d("./metal_smudges_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0820000023f), 8.f, false))[0] : ::base::file_texture(texture_2d("./metal_smudges_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono) * ::math::lerp(::math::lerp(0.f, 0.5f, roughness), ::math::lerp(0.f, 0.5f, roughness) + smudges * (1.f - ::math::lerp(0.f, 0.5f, roughness)), infinite_tiling ? float3(endless_texture(texture_2d("./metal_smudges_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0820000023f), 8.f, false))[0] : ::base::file_texture(texture_2d("./metal_smudges_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono), ::math::lerp(::math::lerp(0.f, 0.5f, roughness), ::math::lerp(0.f, 0.5f, roughness) + smudges * (1.f - ::math::lerp(0.f, 0.5f, roughness)), infinite_tiling ? float3(endless_texture(texture_2d("./metal_smudges_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0820000023f), 8.f, false))[0] : ::base::file_texture(texture_2d("./metal_smudges_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono) * ::math::lerp(::math::lerp(0.f, 0.5f, roughness), ::math::lerp(0.f, 0.5f, roughness) + smudges * (1.f - ::math::lerp(0.f, 0.5f, roughness)), infinite_tiling ? float3(endless_texture(texture_2d("./metal_smudges_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0820000023f), 8.f, false))[0] : ::base::file_texture(texture_2d("./metal_smudges_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), bsdf(), normal),
273
+ material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
274
+ material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
275
+ color tmp3 = color(1.f, 1.f, 1.f);
276
+ 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));
277
+ material_geometry tmp5(
278
+ float3(0.f),
279
+ 1.f,
280
+ enable_round_corners ? ::state::rounded_corner_normal(radius, across_materials, 1.f) : ::state::normal());
281
+ } in
282
+ material(
283
+ thin_walled: tmp0,
284
+ surface: tmp1,
285
+ backface: tmp2,
286
+ ior: tmp3,
287
+ volume: tmp4,
288
+ geometry: tmp5);
289
+
290
+
291
+
292
+ export material Gold_Polished(*)
293
+ [[
294
+ ::anno::author("NVIDIA vMaterials"),
295
+ ::anno::display_name("Gold Polished"),
296
+ ::anno::description("Pure metal material with optional smudges."),
297
+ ::anno::copyright_notice(COPYRIGHT),
298
+ ::anno::thumbnail("./.thumbs/Gold.Gold_Polished.png"),
299
+ ::anno::key_words(string[]("metal", "pure", "design", "reflective", "infinite tiling", "smooth", "conductor", "new", "polished", "gold", "yellow", "warm"))
300
+ ]]
301
+ = Gold(
302
+ infinite_tiling: true,
303
+ roughness: 0.0f,
304
+ smudges: 0.0f,
305
+ enable_round_corners: false,
306
+ radius: 0.03f,
307
+ across_materials: false,
308
+ texture_translate: float2(0.0f, 0.0f),
309
+ texture_rotate: 0.0f,
310
+ texture_scale: float2(1.0f, 1.0f),
311
+ uv_space_index: 0,
312
+ normal: ::state::normal()
313
+ );
314
+
315
+
316
+ export material Gold_Glossy_Fingerprints(*)
317
+ [[
318
+ ::anno::author("NVIDIA vMaterials"),
319
+ ::anno::display_name("Gold Glossy Fingerprints"),
320
+ ::anno::description("Pure metal material with optional smudges."),
321
+ ::anno::copyright_notice(COPYRIGHT),
322
+ ::anno::thumbnail("./.thumbs/Gold.Gold_Glossy_Fingerprints.png"),
323
+ ::anno::key_words(string[]("metal", "pure", "design", "smudged", "reflective", "infinite tiling", "smooth", "conductor", "new", "polished", "gold", "yellow", "warm"))
324
+ ]]
325
+ = Gold(
326
+ infinite_tiling: true,
327
+ roughness: 0.23f,
328
+ smudges: 1.0f,
329
+ enable_round_corners: false,
330
+ radius: 0.03f,
331
+ across_materials: false,
332
+ texture_translate: float2(0.0f, 0.0f),
333
+ texture_rotate: 0.0f,
334
+ texture_scale: float2(1.0f, 1.0f),
335
+ uv_space_index: 0,
336
+ normal: ::state::normal()
337
+ );
338
+
339
+
340
+
341
+
342
+ /*
343
+ - Aluminum
344
+ 0.911810895428,0.914089043421,0.920152876196
345
+
346
+ - Copper
347
+ 0.9654565, 0.6899602, 0.4830392
348
+
349
+ - Chromium
350
+ 0.549302, 0.5560554, 0.5542377
351
+
352
+ - Iron
353
+ 0.5293683, 0.5132565, 0.4942483
354
+
355
+ - Gold
356
+ 1.0,0.722306985258,0.340058756743
357
+
358
+ - Nickel
359
+ 0.696691094703,0.640529134605,0.563260231405
360
+
361
+ - Platinum
362
+ 0.678533319955,0.639590890417,0.583638675413
363
+
364
+ - Mercury
365
+ 0.780978740699,0.779541528985,0.778441417779
366
+
367
+ - Silver
368
+ 0.9614253056,0.948983344333,0.918968346466
369
+
370
+ - Titanium
371
+ 0.618264052974,0.579396264956,0.542545225681
372
+
373
+ - Tungsten
374
+ 0.951001417565,0.815051845356,0.751931718925
375
+
376
+ - Zinc
377
+ 0.87467950988,0.868943040106,0.855089634324
378
+
379
+
380
+ */
Material/material_0439/Iron_Pitted_Steel.mdl ADDED
@@ -0,0 +1,506 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ::df::*;
40
+ import ::base::*;
41
+ import ::math::*;
42
+ import ::state::*;
43
+ import ::anno::*;
44
+ import ::tex::*;
45
+ import ::nvidia::core_definitions::dimension;
46
+
47
+ const string COPYRIGHT =
48
+ " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
49
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
50
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
51
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
52
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
53
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
54
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
55
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
56
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
57
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
58
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
59
+
60
+ uniform float4x4 rotation_translation_scale(
61
+ uniform float3 rotation = float3(0.)
62
+ [[ ::anno::description("Rotation applied to every UVW coordinate.") ]],
63
+ uniform float3 translation = float3(0.)
64
+ [[ ::anno::description("Offset applied to every UVW coordinate.") ]],
65
+ uniform float3 scaling = float3(1.)
66
+ [[ ::anno::description("Scale applied to every UVW coordinate.") ]]
67
+ )
68
+ [[
69
+ ::anno::description("Construct transformation matrix from Euler rotation, translation and scale."),
70
+ ::anno::hidden()
71
+ ]]
72
+ {
73
+ float4x4 scale =
74
+ float4x4(scaling.x , 0. , 0. , 0.,
75
+ 0. , scaling.y , 0. , 0.,
76
+ 0. , 0. , scaling.z , 0.,
77
+ translation.x, translation.y, translation.z, 1.);
78
+
79
+ float3 s = ::math::sin(rotation);
80
+ float3 c = ::math::cos(rotation);
81
+ float4x4 rotate =
82
+ float4x4( c.y*c.z , -c.x*s.z + s.x*s.y*c.z , s.x*s.z + c.x*s.y*c.z , 0.0,
83
+ c.y*s.z , c.x*c.z + s.x*s.y*s.z , -s.x*c.z + c.x*s.y*s.z , 0.0,
84
+ -s.y , s.x*c.y , c.x*c.y , 0.0,
85
+ 0. , 0 , 0 , 1.);
86
+
87
+ return scale*rotate;
88
+ }
89
+
90
+
91
+ // remaps a value that lies between low_1 and high_1 to range between low_2 and high_2
92
+ // This is the general case for range remapping
93
+ float remap(float x, float low_1, float high_1, float low_2, float high_2)
94
+ {
95
+ return low_2 + ((x - low_1) * (high_2 - low_2))/(high_1 - low_1);
96
+ }
97
+
98
+
99
+ // Returns the normal n in tangent space, given n is in internal space.
100
+ float3 transform_internal_to_tangent(float3 n)
101
+ {
102
+ return
103
+ n.x* float3(::state::texture_tangent_u(0).x,::state::texture_tangent_v(0).x,::state::normal().x)+
104
+ n.y* float3(::state::texture_tangent_u(0).y,::state::texture_tangent_v(0).y,::state::normal().y)+
105
+ n.z* float3(::state::texture_tangent_u(0).z,::state::texture_tangent_v(0).z,::state::normal().z);
106
+ }
107
+
108
+ // Returns the normal n in internal space, given n is in tangent space.
109
+ float3 transform_tangent_to_internal(float3 n)
110
+ {
111
+ return ::state::texture_tangent_u(0) * n.x +
112
+ ::state::texture_tangent_v(0) * n.y +
113
+ ::state::normal() * n.z ;
114
+ }
115
+
116
+
117
+ // Returns a normal by adding a detail normal to a global normal.
118
+ float3 add_detail_normal(float3 nd = ::state::normal(), float3 n = ::state::normal())
119
+ {
120
+ // http://blog.selfshadow.com/publications/blending-in-detail/
121
+ float3 n_t = transform_internal_to_tangent(n);
122
+ float3 nd_t = transform_internal_to_tangent(nd);
123
+
124
+ n_t=n_t + float3(0.,0.,1.);
125
+ nd_t = nd_t * float3(-1.,-1.,1.);
126
+
127
+ n = n_t*::math::dot(n_t, nd_t)/n_t.z - nd_t;
128
+ return ::math::normalize(transform_tangent_to_internal(n));
129
+ }
130
+
131
+
132
+ ::base::texture_return blend_colors(
133
+ color color_1 = color(1.0, 0.0, 0.0),
134
+ color color_2 = color(0.0, 1.0, 0.0),
135
+ float blend = 0.5
136
+ )
137
+ [[
138
+ ::anno::hidden()
139
+ ]]
140
+ {
141
+ return ::base::blend_color_layers(
142
+ layers: ::base::color_layer[](
143
+ ::base::color_layer(
144
+ layer_color: color_2,
145
+ weight: blend,
146
+ mode: ::base::color_layer_blend
147
+ )),
148
+ base: color_1
149
+ );
150
+ }
151
+
152
+
153
+ ::base::texture_return overlay_colors(
154
+ color color_1 = color(1.0, 0.0, 0.0),
155
+ color color_2 = color(0.0, 1.0, 0.0),
156
+ float weight = 0.5
157
+ )
158
+ [[
159
+ ::anno::hidden()
160
+ ]]
161
+ {
162
+ return ::base::blend_color_layers(
163
+ layers: ::base::color_layer[](
164
+ ::base::color_layer(
165
+ layer_color: color_2,
166
+ weight: weight,
167
+ mode: ::base::color_layer_overlay
168
+ )),
169
+ base: color_1
170
+ );
171
+ }
172
+
173
+ export enum pit_textures
174
+ [[
175
+ ::anno::description("The available pit textures."),
176
+ ::anno::hidden()
177
+ ]]
178
+ {
179
+ LightPits,
180
+ MediumPits,
181
+ StrongPits
182
+ };
183
+
184
+
185
+ export material Iron_Pitted_Steel (
186
+ uniform pit_textures pit_texture_selection = LightPits
187
+ [[
188
+ ::anno::display_name("Pits Texture Selection"),
189
+ ::anno::in_group("Appearance"),
190
+ ::anno::description("Chooses between various textures for the pits.")
191
+ ]],
192
+ float steel_roughness = 0.0
193
+ [[
194
+ ::anno::display_name("Steel Roughness"),
195
+ ::anno::in_group("Appearance"),
196
+ ::anno::description("Adjusts the principal roughness of the steel material.")
197
+ ]],
198
+ float heat_treatment_amount = 0.0
199
+ [[
200
+ ::anno::display_name("Heat Treatment Amount"),
201
+ ::anno::in_group("Appearance"),
202
+ ::anno::description("Adjusts the amount of coloring due to the results of heat treatment.")
203
+ ]],
204
+ float rust_brightness = 0.0
205
+ [[
206
+ ::anno::display_name("Rust Pits Brightness"),
207
+ ::anno::in_group("Appearance"),
208
+ ::anno::description("Adjusts thebrightness of the rust.")
209
+ ]],
210
+ uniform float bump_amount_1 = 0.6
211
+ [[
212
+ ::anno::display_name("Steel Bump Strength"),
213
+ ::anno::description("Specifies the intensity of the normal texture."),
214
+ ::anno::in_group("Appearance")
215
+ ]],
216
+
217
+ // ----------------------- Adjustments Group -----------------------
218
+ uniform float2 texture_translate = 0.0f
219
+ [[
220
+ ::anno::display_name("Translate"),
221
+ ::anno::description("Controls the position of the texture."),
222
+ ::anno::in_group("Adjustments")
223
+ ]],
224
+ uniform float texture_rotate = 0.f
225
+ [[
226
+ ::anno::display_name("Rotate"),
227
+ ::anno::description("Rotates angle of the texture in degrees."),
228
+ ::anno::in_group("Adjustments")
229
+ ]],
230
+ uniform float2 texture_scale = 1.0f
231
+ [[
232
+ ::anno::display_name("Scale"),
233
+ ::anno::description("Larger numbers increase the size."),
234
+ ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)),
235
+ ::anno::in_group("Adjustments")
236
+ ]],
237
+
238
+ //----------------------- Advanced -----------------------
239
+ uniform int uv_space_index = 0
240
+ [[
241
+ ::anno::display_name("UV Space Index"),
242
+ ::anno::description("UV Space Index."),
243
+ ::anno::in_group("Advanced"),
244
+ ::anno::soft_range(0, 3)
245
+ ]]
246
+ )
247
+ [[
248
+ ::anno::author("NVIDIA ARC"),
249
+ ::anno::display_name("Pitted Steel"),
250
+ ::anno::description("A worn and decayed steel material with rusty pits."),
251
+ ::anno::key_words(string[]("metal", "steel", "pitted", "decayed", "oxidized", "worn", "matte", "brown", "gray")),
252
+ ::anno::thumbnail("./.thumbs/Iron_Pitted_Steel.Iron_Pitted_Steel.png"),
253
+ ::anno::copyright_notice(COPYRIGHT)
254
+ ]] = let {
255
+
256
+ float steel_roughness_remapped = steel_roughness * 0.33;
257
+ float specular_level = float(0.5);
258
+
259
+ texture_2d pitsteel_diffuse = texture_2d("./iron_pitted_steel_no_dents_diff.jpg", ::tex::gamma_srgb);
260
+ texture_2d pitsteel_heatcoloring = texture_2d("./iron_pitted_steel_heat_diff.jpg", ::tex::gamma_srgb);
261
+ texture_2d pitsteel_rust_diffuse = texture_2d("./iron_pitted_steel_rust_diffuse.jpg", ::tex::gamma_srgb);
262
+ texture_2d pitsteel_metallic = texture_2d("./iron_pitted_steel_no_spots_metal.png", ::tex::gamma_srgb);
263
+ texture_2d pitsteel_normal = texture_2d("./iron_pitted_steel_norm.jpg", ::tex::gamma_linear);
264
+ texture_2d pitsteel_roughness = texture_2d("./iron_pitted_steel_roughness_no_spots.jpg", ::tex::gamma_linear);
265
+
266
+ uniform texture_2d pitsteel_spots_bump_mask =
267
+ (pit_texture_selection == LightPits) ? texture_2d("./iron_pitted_steel_dents_bump.png", ::tex::gamma_linear) :
268
+ (pit_texture_selection == MediumPits) ? texture_2d("./iron_pitted_steel_dents_bump_03.png", ::tex::gamma_linear) :
269
+ texture_2d("./iron_pitted_steel_dents_bump_02.png", ::tex::gamma_linear);
270
+
271
+
272
+ float ior = 1.5;
273
+ float bump_amount_1_mapped = bump_amount_1 * 0.2;
274
+ float bump_amount_2_mapped = -16.0;
275
+ float rust_brightness_mapped = rust_brightness * 0.15;
276
+ float pit_transition_softness = 0.0;
277
+ float heat_treatment_amount_mapped = heat_treatment_amount * 0.15;
278
+
279
+
280
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(
281
+ coordinate_system: ::base::texture_coordinate_uvw,
282
+ texture_space: uv_space_index
283
+ );
284
+
285
+ ::base::texture_coordinate_info transformed_uvw = ::base::transform_coordinate(
286
+ transform: rotation_translation_scale(
287
+ scaling: float3(texture_scale.x, texture_scale.y, 1.0),
288
+ rotation: float3(0.0, 0.0, texture_rotate/180.*::math::PI ),
289
+ translation: float3(texture_translate.x, texture_translate.y, 0.0)
290
+ ),
291
+ coordinate: uvw
292
+ );
293
+
294
+ // Spots mask lookup
295
+ float spots_mask_lookup = ::base::file_texture(
296
+ texture: pitsteel_spots_bump_mask,
297
+ color_offset: color(0.0, 0.0, 0.0),
298
+ color_scale: color(1.0, 1.0, 1.0),
299
+ mono_source: ::base::mono_average,
300
+ uvw: transformed_uvw,
301
+ clip: false
302
+ ).mono;
303
+
304
+ // Diffuse lookup
305
+ color base_color = ::base::file_texture(
306
+ texture: pitsteel_diffuse,
307
+ color_offset: color(0.0, 0.0, 0.0),
308
+ color_scale: color(1.0, 1.0, 1.0),
309
+ mono_source: ::base::mono_average,
310
+ uvw: transformed_uvw,
311
+ clip: false
312
+ ).tint;
313
+
314
+ color rust_color = ::base::file_texture(
315
+ texture: pitsteel_rust_diffuse,
316
+ color_offset: color(rust_brightness_mapped),
317
+ color_scale: color(1.0, 1.0, 1.0),
318
+ mono_source: ::base::mono_average,
319
+ uvw: transformed_uvw,
320
+ clip: false
321
+ ).tint;
322
+
323
+ color heat_color = ::base::file_texture(
324
+ texture: pitsteel_heatcoloring,
325
+ color_offset: color(0.0),
326
+ color_scale: color(1.0),
327
+ mono_source: ::base::mono_average,
328
+ uvw: transformed_uvw,
329
+ clip: false
330
+ ).tint;
331
+
332
+ float spots_mask = ::math::clamp(remap(spots_mask_lookup, 0.0, pit_transition_softness, 0.0, 1.0), 0.0, 1.0);
333
+
334
+ color steel_base_color = blend_colors( base_color, rust_color, spots_mask).tint;
335
+ color steel_final_base_color = overlay_colors( steel_base_color, heat_color, heat_treatment_amount_mapped).tint;
336
+
337
+
338
+ // Roughness lookup & Compositing
339
+ float roughness = ::base::file_texture(
340
+ texture: pitsteel_roughness,
341
+ color_offset: color(0.0, 0.0, 0.0),
342
+ color_scale: color(1.0, 1.0, 1.0),
343
+ mono_source: ::base::mono_average,
344
+ uvw: transformed_uvw,
345
+ clip: false
346
+ ).mono + spots_mask * .45 + steel_roughness_remapped;
347
+
348
+
349
+ // Metallic lookup
350
+ float metallic = ::base::file_texture(
351
+ texture: pitsteel_metallic,
352
+ color_offset: color(0.0, 0.0, 0.0),
353
+ color_scale: color(1.0, 1.0, 1.0),
354
+ mono_source: ::base::mono_average,
355
+ uvw: transformed_uvw,
356
+ clip: false
357
+ ).mono - spots_mask * 2.0;
358
+
359
+
360
+ // Composit spots mask
361
+
362
+ bsdf diffuse_bsdf = ::df::diffuse_reflection_bsdf(
363
+ roughness: 0.0f,
364
+ tint: steel_final_base_color
365
+ );
366
+
367
+ bsdf ggx_smith_bsdf = ::df::microfacet_ggx_smith_bsdf(
368
+ roughness_u: roughness*roughness,
369
+ roughness_v: roughness*roughness,
370
+ tint: color(1.0, 1.0, 1.0),
371
+ mode: ::df::scatter_reflect
372
+ );
373
+
374
+
375
+ bsdf custom_curve_layer_bsdf = ::df::custom_curve_layer(
376
+ normal_reflectivity: 0.08 * specular_level,
377
+ grazing_reflectivity: 1.0,
378
+ exponent: 5.0,
379
+ weight: 1.0,
380
+ layer: ggx_smith_bsdf,
381
+ base: diffuse_bsdf
382
+ );
383
+
384
+ bsdf directional_factor_bsdf = ::df::directional_factor(
385
+ normal_tint: steel_final_base_color,
386
+ grazing_tint: color(1.0, 1.0, 1.0),
387
+ exponent: 3.0f,
388
+ base: ggx_smith_bsdf
389
+ );
390
+
391
+ bsdf final_bsdf = ::df::weighted_layer(
392
+ weight: metallic,
393
+ layer: directional_factor_bsdf,
394
+ base: custom_curve_layer_bsdf
395
+ );
396
+
397
+ // Normal lookup
398
+ float3 the_normal = ::base::tangent_space_normal_texture(
399
+ texture: pitsteel_normal,
400
+ factor: bump_amount_1_mapped,
401
+ uvw: transformed_uvw,
402
+ flip_tangent_u: false,
403
+ flip_tangent_v: false
404
+ );
405
+
406
+ // Dents bumpmap lookup
407
+ float3 dents_normal = ::base::file_bump_texture(
408
+ texture: pitsteel_spots_bump_mask,
409
+ factor: bump_amount_2_mapped,
410
+ bump_source: ::base::mono_average,
411
+ uvw: transformed_uvw
412
+ );
413
+
414
+ float3 the_final_normal = add_detail_normal(the_normal, dents_normal);
415
+
416
+ } in material (
417
+ ior: color(ior),
418
+ surface: material_surface(
419
+ scattering: final_bsdf
420
+ ),
421
+ geometry: material_geometry(
422
+ normal: the_final_normal
423
+ )
424
+ );
425
+
426
+
427
+
428
+ // 01 - Light Pitted Steel
429
+ export material light_pitted_steel(*)
430
+ [[
431
+ ::anno::author("NVIDIA ARC"),
432
+ ::anno::display_name("Pitted Steel - Light"),
433
+ ::anno::description("A worn and decayed steel material with rusty pits."),
434
+ ::anno::key_words(string[]("metal", "steel", "pitted", "decayed", "oxidized", "worn", "matte", "brown", "gray")),
435
+ ::anno::thumbnail("./.thumbs/Iron_Pitted_Steel.light_pitted_steel.png"),
436
+ ::anno::copyright_notice(COPYRIGHT)
437
+ ]]
438
+ = Iron_Pitted_Steel (
439
+ pit_texture_selection: LightPits,
440
+ steel_roughness: 0.0,
441
+ heat_treatment_amount: 0.0,
442
+ rust_brightness: 0.0,
443
+ bump_amount_1: 0.6,
444
+
445
+ // Adjustments Group
446
+ texture_translate: 0.0f,
447
+ texture_rotate: 0.0f,
448
+ texture_scale: 1.0f,
449
+
450
+ //Advanced
451
+ uv_space_index: 0
452
+ );
453
+
454
+
455
+ // 02 - Medium Pitted Steel
456
+ export material medium_pitted_steel(*)
457
+ [[
458
+ ::anno::author("NVIDIA ARC"),
459
+ ::anno::display_name("Pitted Steel - Medium"),
460
+ ::anno::description("A worn and decayed steel material with rusty pits."),
461
+ ::anno::key_words(string[]("metal", "steel", "pitted", "decayed", "oxidized", "worn", "matte", "brown", "gray")),
462
+ ::anno::thumbnail("./.thumbs/Iron_Pitted_Steel.medium_pitted_steel.png"),
463
+ ::anno::copyright_notice(COPYRIGHT)
464
+ ]]
465
+ = Iron_Pitted_Steel (
466
+ pit_texture_selection: MediumPits,
467
+ steel_roughness: 0.0,
468
+ heat_treatment_amount: 0.0,
469
+ rust_brightness: 0.0,
470
+ bump_amount_1: 0.6,
471
+
472
+ // Adjustments Group
473
+ texture_translate: 0.0,
474
+ texture_rotate: 0.0f,
475
+ texture_scale: 1.0f,
476
+
477
+ //Advanced
478
+ uv_space_index: 0
479
+ );
480
+
481
+
482
+ // 03 - Strong Pitted Steel
483
+ export material strong_pitted_steel(*)
484
+ [[
485
+ ::anno::author("NVIDIA ARC"),
486
+ ::anno::display_name("Pitted Steel - Strong"),
487
+ ::anno::description("A worn and decayed steel material with rusty pits."),
488
+ ::anno::key_words(string[]("metal", "steel", "pitted", "decayed", "oxidized", "worn", "matte", "brown", "gray")),
489
+ ::anno::thumbnail("./.thumbs/Iron_Pitted_Steel.strong_pitted_steel.png"),
490
+ ::anno::copyright_notice(COPYRIGHT)
491
+ ]]
492
+ = Iron_Pitted_Steel (
493
+ pit_texture_selection: StrongPits,
494
+ steel_roughness: 0.0,
495
+ heat_treatment_amount: 0.0,
496
+ rust_brightness: 0.0,
497
+ bump_amount_1: 0.6,
498
+
499
+ // Adjustments Group
500
+ texture_translate: 0.0,
501
+ texture_rotate: 0.0f,
502
+ texture_scale: 1.0f,
503
+
504
+ //Advanced
505
+ uv_space_index: 0
506
+ );
Material/material_0447/Nickel.mdl ADDED
@@ -0,0 +1,379 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2024 NVIDIA Corporation. All rights reserved.
3
+ ******************************************************************************
4
+
5
+ Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge,
6
+ to any person obtaining a copy of the sample definition code that uses our
7
+ Material Definition Language (the "MDL Materials"), to reproduce and distribute
8
+ the MDL Materials, including without limitation the rights to use, copy, merge,
9
+ publish, distribute, and sell modified and unmodified copies of the MDL
10
+ Materials, and to permit persons to whom the MDL Materials is furnished to do
11
+ so, in all cases solely for use with NVIDIA's Material Definition Language,
12
+ subject to the following further conditions:
13
+
14
+ 1. The above copyright notices, this list of conditions, and the disclaimer
15
+ that follows shall be retained in all copies of one or more of the MDL
16
+ Materials, including in any software with which the MDL Materials are bundled,
17
+ redistributed, and/or sold, and included either as stand-alone text files,
18
+ human-readable headers or in the appropriate machine-readable metadata fields
19
+ within text or binary files as long as those fields can be easily viewed by the
20
+ user, as applicable.
21
+ 2. The name of NVIDIA shall not be used to promote, endorse or advertise any
22
+ Modified Version without specific prior written permission, except a) to comply
23
+ with the notice requirements otherwise contained herein; or b) to acknowledge
24
+ the contribution(s) of NVIDIA.
25
+
26
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
27
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
28
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
29
+ TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR
30
+ ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL,
31
+ INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF
32
+ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE
33
+ THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.
34
+ */
35
+
36
+ mdl 1.5;
37
+
38
+ import ::anno::*;
39
+ import ::base::*;
40
+ import ::df::*;
41
+ import ::math::*;
42
+ import ::state::*;
43
+ import ::tex::*;
44
+ import ::nvidia::core_definitions::blend_colors;
45
+ import ::nvidia::core_definitions::dimension;
46
+
47
+ const string COPYRIGHT =
48
+ " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
49
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
50
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
51
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
52
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
53
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
54
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
55
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
56
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
57
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
58
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
59
+
60
+
61
+ ::base::texture_coordinate_info vmat_transform(
62
+ uniform float2 translation = float2(0.0, 0.0),
63
+ uniform float rotation = 0.0,
64
+ uniform float2 scaling = float2(1.0, 1.0),
65
+ uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw,
66
+ uniform int uv_space = 0
67
+ )
68
+ {
69
+ float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f;
70
+
71
+ float4x4 scale =
72
+ float4x4(1.0 /scaling.x, 0. , 0. , 0.,
73
+ 0. , 1.0 /scaling.y , 0. , 0.,
74
+ 0. , 0. , 1.0, 0.,
75
+ translation.x , translation.y , 0.0, 1.);
76
+
77
+ float s = ::math::sin(rotation_rad);
78
+ float c = ::math::cos(rotation_rad);
79
+ float4x4 rotate =
80
+ float4x4( c , -s , 0.0 , 0.0,
81
+ s , c , 0.0 , 0.0,
82
+ 0.0, 0.0 , 1.0 , 0.0,
83
+ 0. , 0.0 , 0.0 , 1.);
84
+
85
+ return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space));
86
+ }
87
+
88
+
89
+ float uint2float(int x)
90
+ {
91
+ return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0);
92
+ }
93
+
94
+ int lowbias32(int x)
95
+ {
96
+ x ^= x >>> 16;
97
+ x *= 0x7feb352d;
98
+ x ^= x >>> 15;
99
+ x *= 0x846ca68b;
100
+ x ^= x >>> 16;
101
+ return x;
102
+ }
103
+
104
+ float2 rnd22(int2 p) {
105
+ float2 ret_val = float2(
106
+ uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f,
107
+ uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f
108
+ );
109
+ return ret_val;
110
+ }
111
+
112
+ float3 srgb2rgb(float3 val)
113
+ {
114
+ return ::math::pow(::math::max(val, float3(0.0f)), 2.2);
115
+ }
116
+
117
+ float2x2 invert_2x2(float2x2 M)
118
+ {
119
+ float det = M[0][0]*M[1][1] - M[0][1]*M[1][0];
120
+ //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/
121
+ return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]);
122
+ }
123
+
124
+ float3 nonrepeat_lookup(
125
+ uniform texture_2d texture = texture_2d(),
126
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
127
+ float texture_scale = 1.0,
128
+ float3 average_color = float3(0.5),
129
+ float patch_size = 8.0
130
+ )
131
+ {
132
+
133
+ float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale;
134
+ float Z = patch_size; // patch scale inside example texture
135
+ float CON = 1.0f;
136
+
137
+ float3 O = float3(0.f);
138
+ float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f);
139
+ float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space
140
+
141
+ float2 U = uv_in;
142
+ float2 V = M * uv_in; //pre-tilted hexa coordinates
143
+ int2 I = int2(::math::floor(V)); // hexa-tile id
144
+
145
+ // The mean color needs to be determined in Photoshop then to make the
146
+ // average color work out, take the float value and calculate the apropriate
147
+ // mean value as (value^(1/2.2))
148
+
149
+ float3 m = average_color;
150
+
151
+ float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W;
152
+ F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates
153
+
154
+ if( F[2] > 0.f )
155
+
156
+ O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON))
157
+ + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON))
158
+ + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON));
159
+ else
160
+ O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON))
161
+ + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON))
162
+ + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON));
163
+ O = m + O/::math::length(W);
164
+ O = ::math::clamp( (O), 0.0, 1.0);
165
+
166
+ return float3(O);
167
+ }
168
+
169
+ color endless_texture(
170
+ uniform texture_2d texture = texture_2d(),
171
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
172
+ float texture_scale = 10.0,
173
+ float3 average_color = float3(0.5, 0.5, 1.0),
174
+ float patch_size = 8.0,
175
+ bool gamma_correct_lookup = true
176
+ )
177
+ {
178
+ return gamma_correct_lookup ? color(srgb2rgb(
179
+ nonrepeat_lookup (
180
+ texture: texture,
181
+ uvw: uvw,
182
+ texture_scale: texture_scale,
183
+ average_color: average_color,
184
+ patch_size: patch_size
185
+ ))
186
+ ) : color(nonrepeat_lookup (
187
+ texture: texture,
188
+ uvw: uvw,
189
+ texture_scale: texture_scale,
190
+ average_color: average_color,
191
+ patch_size: patch_size
192
+ ));
193
+ }
194
+
195
+
196
+ export material Nickel(
197
+ uniform bool infinite_tiling = true [[
198
+ ::anno::description("Enables infinite tiling feature which removes repeating texture patterns. Note that depending on the material this feature changes the appearance of the material slightly."),
199
+ ::anno::display_name("Infinite Tiling"),
200
+ ::anno::in_group("Appearance")
201
+ ]],
202
+ float roughness = 0.1f [[
203
+ ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."),
204
+ ::anno::display_name("Roughness"),
205
+ ::anno::in_group("Appearance"),
206
+ ::anno::hard_range(0.f, 1.f)
207
+ ]],
208
+ float smudges = 0.5f [[
209
+ ::anno::description("Adds blurrier reflection that follow the intensities of the Roughness texture on top."),
210
+ ::anno::display_name("Smudges"),
211
+ ::anno::in_group("Appearance"),
212
+ ::anno::hard_range(0.f, 1.f)
213
+ ]],
214
+ uniform bool enable_round_corners = false [[
215
+ ::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."),
216
+ ::anno::display_name("Enable Round Corners"),
217
+ ::anno::in_group("Round Corners")
218
+ ]],
219
+ uniform float radius = 0.03f [[
220
+ ::anno::description("Radius of the rounded corners."),
221
+ ::anno::display_name("Round Corner Radius"),
222
+ ::anno::in_group("Round Corners")
223
+ ]],
224
+ uniform bool across_materials = false [[
225
+ ::anno::display_name("Across Materials"),
226
+ ::anno::description("When enabled the round corner effect is applied across different materials."),
227
+ ::anno::in_group("Round Corners")
228
+ ]],
229
+ uniform float2 texture_translate = 0.f [[
230
+ ::anno::display_name("Texture Translate"),
231
+ ::anno::description("Controls the position of the texture."),
232
+ ::anno::in_group("Transform")
233
+ ]],
234
+ uniform float texture_rotate = 0.f [[
235
+ ::anno::display_name("Texture Rotate"),
236
+ ::anno::description("Rotates angle of the texture in degrees."),
237
+ ::anno::soft_range(0.f, 360.f),
238
+ ::anno::in_group("Transform")
239
+ ]],
240
+ uniform float2 texture_scale = 1.f [[
241
+ ::anno::display_name("Texture Scale"),
242
+ ::anno::description("Larger numbers increase the size."),
243
+ ::anno::in_group("Transform"),
244
+ ::nvidia::core_definitions::dimension(float2(.45f, .45f))
245
+ ]],
246
+ uniform int uv_space_index = 0 [[
247
+ ::anno::display_name("UV Space Index"),
248
+ ::anno::in_group("Advanced")
249
+ ]],
250
+ float3 normal = ::state::normal() [[
251
+ ::anno::description("Modify the surface normal."),
252
+ ::anno::display_name("Normal"),
253
+ ::anno::in_group("Advanced")
254
+ ]]
255
+ )
256
+ [[
257
+ ::anno::author("NVIDIA vMaterials"),
258
+ ::anno::display_name("Nickel"),
259
+ ::anno::description("Pure metal material with optional smudges."),
260
+ ::anno::copyright_notice(COPYRIGHT),
261
+ ::anno::thumbnail("./.thumbs/Nickel.Nickel.png"),
262
+ ::anno::key_words(string[]("metal", "pure", "smudged", "design", "reflective", "infinite tiling", "smooth", "conductor", "new", "polished", "nickel"))
263
+ ]]
264
+ =
265
+ let {
266
+
267
+ color normal_reflectivity = color(0.696691094703f,0.640529134605f,0.563260231405f); // Nickel
268
+ color grazing_reflectivity = color(0.99942f, 1.f, 1.f);
269
+
270
+ bool tmp0 = false;
271
+ material_surface tmp1(
272
+ ::df::color_custom_curve_layer(normal_reflectivity, grazing_reflectivity, 5.f, color(1.f, 1.f, 1.f), ::df::microfacet_ggx_smith_bsdf(::math::lerp(::math::lerp(0.f, 0.5f, roughness), ::math::lerp(0.f, 0.5f, roughness) + smudges * (1.f - ::math::lerp(0.f, 0.5f, roughness)), infinite_tiling ? float3(endless_texture(texture_2d("./metal_smudges_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0820000023f), 8.f, false))[0] : ::base::file_texture(texture_2d("./metal_smudges_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono) * ::math::lerp(::math::lerp(0.f, 0.5f, roughness), ::math::lerp(0.f, 0.5f, roughness) + smudges * (1.f - ::math::lerp(0.f, 0.5f, roughness)), infinite_tiling ? float3(endless_texture(texture_2d("./metal_smudges_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0820000023f), 8.f, false))[0] : ::base::file_texture(texture_2d("./metal_smudges_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono), ::math::lerp(::math::lerp(0.f, 0.5f, roughness), ::math::lerp(0.f, 0.5f, roughness) + smudges * (1.f - ::math::lerp(0.f, 0.5f, roughness)), infinite_tiling ? float3(endless_texture(texture_2d("./metal_smudges_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0820000023f), 8.f, false))[0] : ::base::file_texture(texture_2d("./metal_smudges_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono) * ::math::lerp(::math::lerp(0.f, 0.5f, roughness), ::math::lerp(0.f, 0.5f, roughness) + smudges * (1.f - ::math::lerp(0.f, 0.5f, roughness)), infinite_tiling ? float3(endless_texture(texture_2d("./metal_smudges_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0820000023f), 8.f, false))[0] : ::base::file_texture(texture_2d("./metal_smudges_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), bsdf(), normal),
273
+ material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
274
+ material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
275
+ color tmp3 = color(1.f, 1.f, 1.f);
276
+ 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));
277
+ material_geometry tmp5(
278
+ float3(0.f),
279
+ 1.f,
280
+ enable_round_corners ? ::state::rounded_corner_normal(radius, across_materials, 1.f) : ::state::normal());
281
+ } in
282
+ material(
283
+ thin_walled: tmp0,
284
+ surface: tmp1,
285
+ backface: tmp2,
286
+ ior: tmp3,
287
+ volume: tmp4,
288
+ geometry: tmp5);
289
+
290
+
291
+
292
+
293
+ export material Nickel_Polished(*)
294
+ [[
295
+ ::anno::author("NVIDIA vMaterials"),
296
+ ::anno::display_name("Nickel Polished"),
297
+ ::anno::description("Pure metal material with optional smudges."),
298
+ ::anno::copyright_notice(COPYRIGHT),
299
+ ::anno::thumbnail("./.thumbs/Nickel.Nickel_Polished.png"),
300
+ ::anno::key_words(string[]("metal", "pure", "design", "reflective", "infinite tiling", "smooth", "conductor", "new", "polished", "nickel"))
301
+ ]]
302
+ = Nickel(
303
+ infinite_tiling: true,
304
+ roughness: 0.0f,
305
+ smudges: 0.0f,
306
+ enable_round_corners: false,
307
+ radius: 0.03f,
308
+ across_materials: false,
309
+ texture_translate: float2(0.0f, 0.0f),
310
+ texture_rotate: 0.0f,
311
+ texture_scale: float2(1.0f, 1.0f),
312
+ uv_space_index: 0,
313
+ normal: ::state::normal()
314
+ );
315
+
316
+
317
+ export material Nickel_Glossy_Fingerprints(*)
318
+ [[
319
+ ::anno::author("NVIDIA vMaterials"),
320
+ ::anno::display_name("Nickel Glossy Fingerprints"),
321
+ ::anno::description("Pure metal material with optional smudges."),
322
+ ::anno::copyright_notice(COPYRIGHT),
323
+ ::anno::thumbnail("./.thumbs/Nickel.Nickel_Glossy_Fingerprints.png"),
324
+ ::anno::key_words(string[]("metal", "pure", "design", "smudged", "reflective", "infinite tiling", "smooth", "conductor", "new", "polished", "nickel"))
325
+ ]]
326
+ = Nickel(
327
+ infinite_tiling: true,
328
+ roughness: 0.23f,
329
+ smudges: 1.0f,
330
+ enable_round_corners: false,
331
+ radius: 0.03f,
332
+ across_materials: false,
333
+ texture_translate: float2(0.0f, 0.0f),
334
+ texture_rotate: 0.0f,
335
+ texture_scale: float2(1.0f, 1.0f),
336
+ uv_space_index: 0,
337
+ normal: ::state::normal()
338
+ );
339
+
340
+
341
+ /*
342
+ - Aluminum
343
+ 0.911810895428,0.914089043421,0.920152876196
344
+
345
+ - Copper
346
+ 0.9654565, 0.6899602, 0.4830392
347
+
348
+ - Chromium
349
+ 0.549302, 0.5560554, 0.5542377
350
+
351
+ - Iron
352
+ 0.5293683, 0.5132565, 0.4942483
353
+
354
+ - Gold
355
+ 1.0,0.722306985258,0.340058756743
356
+
357
+ - Nickel
358
+ 0.696691094703,0.640529134605,0.563260231405
359
+
360
+ - Platinum
361
+ 0.678533319955,0.639590890417,0.583638675413
362
+
363
+ - Mercury
364
+ 0.780978740699,0.779541528985,0.778441417779
365
+
366
+ - Silver
367
+ 0.9614253056,0.948983344333,0.918968346466
368
+
369
+ - Titanium
370
+ 0.618264052974,0.579396264956,0.542545225681
371
+
372
+ - Tungsten
373
+ 0.951001417565,0.815051845356,0.751931718925
374
+
375
+ - Zinc
376
+ 0.87467950988,0.868943040106,0.855089634324
377
+
378
+
379
+ */
Material/material_0454/PCB_Copper.mdl ADDED
@@ -0,0 +1,342 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
50
+
51
+ const string COPYRIGHT =
52
+ " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
53
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
54
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
55
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
56
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
57
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
58
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
59
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
60
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
61
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
62
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
63
+
64
+ const string DESCRIPTION = "A copper metal material for printed circuit boards (PCB)";
65
+
66
+ ::base::texture_coordinate_info vmat_transform(
67
+ uniform float2 translation = float2(0.0, 0.0),
68
+ uniform float rotation = 0.0,
69
+ uniform float2 scaling = float2(1.0, 1.0),
70
+ uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw,
71
+ uniform int uv_space = 0
72
+ )
73
+ {
74
+ float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f;
75
+
76
+ float4x4 scale =
77
+ float4x4(1.0 /scaling.x, 0. , 0. , 0.,
78
+ 0. , 1.0 /scaling.y , 0. , 0.,
79
+ 0. , 0. , 1.0, 0.,
80
+ translation.x , translation.y , 0.0, 1.);
81
+
82
+ float s = ::math::sin(rotation_rad);
83
+ float c = ::math::cos(rotation_rad);
84
+ float4x4 rotate =
85
+ float4x4( c , -s , 0.0 , 0.0,
86
+ s , c , 0.0 , 0.0,
87
+ 0.0, 0.0 , 1.0 , 0.0,
88
+ 0. , 0.0 , 0.0 , 1.);
89
+
90
+ return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space));
91
+ }
92
+
93
+ export material PCB_Copper(
94
+ float coppery = 0.5f [[
95
+ ::anno::description("Set to 1 it appears a clear copper. Set to 0 its appearance is a more altered copper."),
96
+ ::anno::display_name("Coppery"),
97
+ ::anno::in_group("Appearance"),
98
+ ::anno::hard_range(0.f, 1.f),
99
+ ::anno::ui_order(0)
100
+ ]],
101
+ color grazing_reflectivity = color(1.f, 1.f, 1.f) [[
102
+ ::anno::description("Sets the reflection color at grazing reflectivity levels."),
103
+ ::anno::display_name("Grazing Reflectivity"),
104
+ ::anno::in_group("Appearance"),
105
+ ::anno::ui_order(1)
106
+ ]],
107
+ float reflection_roughness = 0.f [[
108
+ ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."),
109
+ ::anno::display_name("Roughness"),
110
+ ::anno::in_group("Appearance"),
111
+ ::anno::hard_range(0.f, 1.f),
112
+ ::anno::ui_order(2)
113
+ ]],
114
+ float reflection_smooth = 0.f [[
115
+ ::anno::description("Adds blurrier reflection that follow the intensities of the Roughness texture on top."),
116
+ ::anno::display_name("Reflection Smooth"),
117
+ ::anno::in_group("Appearance"),
118
+ ::anno::hard_range(0.f, 1.f),
119
+ ::anno::ui_order(3)
120
+ ]],
121
+ uniform float bump_strength = .3f [[
122
+ ::anno::description("Specifies the strength of the bump. \nWhile No UV is set to false do not over exaggerate it. The normal map will brake at 0.75\nThe exaggeration is an option while using tri planar mapping. ."),
123
+ ::anno::display_name("Bump Strength"),
124
+ ::anno::in_group("Appearance"),
125
+ ::anno::hard_range(0.f, 3.f),
126
+ ::anno::soft_range(0.f, 1.f),
127
+ ::anno::ui_order(4)
128
+ ]],
129
+ uniform float2 texture_translate = 0.f [[
130
+ ::anno::description("Controls the position of the texture."),
131
+ ::anno::display_name("Translate"),
132
+ ::anno::in_group("Transform"),
133
+ ::anno::ui_order(5)
134
+ ]],
135
+ uniform float texture_rotate = 0.f [[
136
+ ::anno::description("Rotates angle of the texture in degrees."),
137
+ ::anno::display_name("Rotate"),
138
+ ::anno::in_group("Transform"),
139
+ ::anno::ui_order(6)
140
+ ]],
141
+ uniform float2 texture_scale = 1.f [[
142
+ ::anno::description("Larger numbers increase the size."),
143
+ ::anno::display_name("Scale"),
144
+ ::anno::in_group("Transform"),
145
+ ::nvidia::core_definitions::dimension(float2(.1f, .1f)),
146
+ ::anno::ui_order(7)
147
+ ]],
148
+ uniform bool enable_round_corners = false [[
149
+ ::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."),
150
+ ::anno::display_name("Enable Round Corners"),
151
+ ::anno::in_group("Round Corners"),
152
+ ::anno::ui_order(8)
153
+ ]],
154
+ uniform float radius = 0.0299999993f [[
155
+ ::anno::description("Radius of the rounded corners."),
156
+ ::anno::display_name("Round Corner Radius"),
157
+ ::anno::in_group("Round Corners"),
158
+ ::anno::ui_order(9)
159
+ ]],
160
+ uniform bool across_materials = false [[
161
+ ::anno::description("Applies the round corner effect across different materials when enabled."),
162
+ ::anno::display_name("Across Materials"),
163
+ ::anno::in_group("Round Corners"),
164
+ ::anno::ui_order(10)
165
+ ]],
166
+ uniform bool no_uv = false [[
167
+ ::anno::description("Set this to true if your model has no UV layout."),
168
+ ::anno::display_name("No UV"),
169
+ ::anno::in_group("Advanced", "Projection"),
170
+ ::anno::ui_order(11)
171
+ ]],
172
+ uniform ::base::projection_mode projection_type = ::base::projection_planar [[
173
+ ::anno::description("Projection method to be used to generate the coordinates."),
174
+ ::anno::display_name("Projection Type"),
175
+ ::anno::in_group("Advanced", "Projection"),
176
+ ::anno::ui_order(12)
177
+ ]],
178
+ uniform float scale = 1.f [[
179
+ ::anno::description("Scales the texture while No UV is true."),
180
+ ::anno::display_name("Scale Projection"),
181
+ ::anno::in_group("Advanced", "Projection"),
182
+ ::anno::ui_order(13)
183
+ ]],
184
+ uniform ::base::texture_coordinate_system coordinate_system = ::base::texture_coordinate_object [[
185
+ ::anno::description("The projection can be done based on world or object space. Do not use uvw space. Since it is disabled while No UV is set to true."),
186
+ ::anno::display_name("Coordinate System"),
187
+ ::anno::in_group("Advanced", "Projection"),
188
+ ::anno::ui_order(14)
189
+ ]],
190
+ uniform int uv_space_index = 0 [[
191
+ ::anno::description("Use selected UV space for material."),
192
+ ::anno::display_name("UV Space Index"),
193
+ ::anno::in_group("Advanced"),
194
+ ::anno::ui_order(15)
195
+ ]])
196
+ [[
197
+ ::anno::description(DESCRIPTION),
198
+ ::anno::display_name("PCB Copper"),
199
+ ::anno::copyright_notice(COPYRIGHT),
200
+ ::anno::key_words(string[]("conductiv", "metal", "copper", "pcb", "plate", "computer", "orange", "shiny", "bumped", "metallic", "construction", "light", "warm", "reflective")),
201
+ ::anno::thumbnail("./.thumbs/PCB_Copper.PCB_Copper.png"),
202
+ ::anno::author("Nvidia vMaterials"),
203
+ ::anno::contributor("Maik Rohland"),
204
+ ::anno::contributor("Ruediger Raab")
205
+ ]]
206
+ =
207
+ let {
208
+ bool tmp0 = false;
209
+ material_surface tmp1(::df::custom_curve_layer(coppery, 1.f, 5.f, 1.f, ::df::color_custom_curve_layer(color(0.9654565f, 0.6899602f, 0.4830392f), grazing_reflectivity, 5.f, color(1.f, 1.f, 1.f), ::df::microfacet_ggx_smith_bsdf(::math::lerp(::math::lerp(0.f, 0.899999976f, reflection_roughness) * ::math::lerp(0.f, 0.899999976f, reflection_roughness), ::math::lerp(0.f, 0.899999976f, reflection_roughness) * ::math::lerp(0.f, 0.899999976f, reflection_roughness) + reflection_smooth * (1.f - ::math::lerp(0.f, 0.899999976f, reflection_roughness) * ::math::lerp(0.f, 0.899999976f, reflection_roughness)), ::base::file_texture(texture_2d("./pcb_copper_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, no_uv ? ::base::coordinate_projection(coordinate_system, uv_space_index, projection_type, float4x4(scale)) : vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono) * ::math::lerp(::math::lerp(0.f, 0.899999976f, reflection_roughness) * ::math::lerp(0.f, 0.899999976f, reflection_roughness), ::math::lerp(0.f, 0.899999976f, reflection_roughness) * ::math::lerp(0.f, 0.899999976f, reflection_roughness) + reflection_smooth * (1.f - ::math::lerp(0.f, 0.899999976f, reflection_roughness) * ::math::lerp(0.f, 0.899999976f, reflection_roughness)), ::base::file_texture(texture_2d("./pcb_copper_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, no_uv ? ::base::coordinate_projection(coordinate_system, uv_space_index, projection_type, float4x4(scale)) : vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono), ::math::lerp(::math::lerp(0.f, 0.899999976f, reflection_roughness) * ::math::lerp(0.f, 0.899999976f, reflection_roughness), ::math::lerp(0.f, 0.899999976f, reflection_roughness) * ::math::lerp(0.f, 0.899999976f, reflection_roughness) + reflection_smooth * (1.f - ::math::lerp(0.f, 0.899999976f, reflection_roughness) * ::math::lerp(0.f, 0.899999976f, reflection_roughness)), ::base::file_texture(texture_2d("./pcb_copper_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, no_uv ? ::base::coordinate_projection(coordinate_system, uv_space_index, projection_type, float4x4(scale)) : vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono) * ::math::lerp(::math::lerp(0.f, 0.899999976f, reflection_roughness) * ::math::lerp(0.f, 0.899999976f, reflection_roughness), ::math::lerp(0.f, 0.899999976f, reflection_roughness) * ::math::lerp(0.f, 0.899999976f, reflection_roughness) + reflection_smooth * (1.f - ::math::lerp(0.f, 0.899999976f, reflection_roughness) * ::math::lerp(0.f, 0.899999976f, reflection_roughness)), ::base::file_texture(texture_2d("./pcb_copper_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, no_uv ? ::base::coordinate_projection(coordinate_system, uv_space_index, projection_type, float4x4(scale)) : vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), bsdf(), ::base::tangent_space_normal_texture(texture_2d("./pcb_copper_norm.jpg", ::tex::gamma_linear), ::math::lerp(0.f, 2.f, bump_strength), false, false, no_uv ? ::base::coordinate_projection(coordinate_system, uv_space_index, projection_type, float4x4(scale)) : 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)), ::df::diffuse_reflection_bsdf(::base::file_texture(texture_2d("./pcb_copper_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, no_uv ? ::base::coordinate_projection(coordinate_system, uv_space_index, projection_type, float4x4(scale)) : vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, 0.f), ::base::tangent_space_normal_texture(texture_2d("./pcb_copper_norm.jpg", ::tex::gamma_linear), ::math::lerp(0.f, 2.f, bump_strength), false, false, no_uv ? ::base::coordinate_projection(coordinate_system, uv_space_index, projection_type, float4x4(scale)) : vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
210
+ material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
211
+ color tmp3 = color(1.f, 1.f, 1.f);
212
+ material_geometry tmp5(float3(0.f), 1.f, enable_round_corners ? ::state::rounded_corner_normal(radius, across_materials, 1.f) : ::state::normal());
213
+
214
+ } in
215
+ material(
216
+ thin_walled: tmp0,
217
+ surface: tmp1,
218
+ backface: tmp2,
219
+ ior: tmp3,
220
+ geometry: tmp5);
221
+
222
+ export material PCB_Copper_Smooth(*)
223
+ [[
224
+ ::anno::display_name("PCB Copper Smooth"),
225
+ ::anno::description(DESCRIPTION),
226
+ ::anno::copyright_notice(COPYRIGHT),
227
+ ::anno::key_words(string[]("conductiv", "metal", "copper", "pcb", "plate", "computer", "orange", "shiny", "smooth", "metallic", "construction", "light", "warm", "reflective")),
228
+ ::anno::thumbnail("./.thumbs/PCB_Copper.PCB_Copper_Smooth.png"),
229
+ ::anno::author("NVIDIA vMaterials"),
230
+ ::anno::contributor("Maik Rohland"),
231
+ ::anno::contributor("Ruediger Raab")
232
+ ]]
233
+ = PCB_Copper
234
+ (
235
+ coppery: .6f,
236
+ grazing_reflectivity: color(1.f, 1.f, 1.f),
237
+ reflection_roughness: .6f,
238
+ reflection_smooth: .0f,
239
+ bump_strength: .3f,
240
+ texture_translate: 0.0f,
241
+ texture_rotate: 0.0f,
242
+ texture_scale: 1.0f,
243
+ enable_round_corners: false,
244
+ radius: 1.5f,
245
+ across_materials: false,
246
+ no_uv: false,
247
+ projection_type: ::base::projection_planar,
248
+ scale: 1.f,
249
+ coordinate_system: ::base::texture_coordinate_object,
250
+ uv_space_index: 0
251
+ );
252
+ export material PCB_Copper_Beige(*)
253
+ [[
254
+ ::anno::display_name("PCB Copper Beige"),
255
+ ::anno::description(DESCRIPTION),
256
+ ::anno::copyright_notice(COPYRIGHT),
257
+ ::anno::key_words(string[]("conductiv", "metal", "copper", "pcb", "plate", "computer", "beige", "shiny", "bumped", "metallic", "construction", "light", "warm", "reflective")),
258
+ ::anno::thumbnail("./.thumbs/PCB_Copper.PCB_Copper_Beige.png"),
259
+ ::anno::author("NVIDIA vMaterials"),
260
+ ::anno::contributor("Maik Rohland"),
261
+ ::anno::contributor("Ruediger Raab")
262
+ ]]
263
+ = PCB_Copper
264
+ (
265
+ coppery: .7f,
266
+ grazing_reflectivity: color(1.f, 1.f, 1.f),
267
+ reflection_roughness: .7f,
268
+ reflection_smooth: .4f,
269
+ bump_strength: .2f,
270
+ texture_translate: 0.0f,
271
+ texture_rotate: 0.0f,
272
+ texture_scale: 1.0f,
273
+ enable_round_corners: false,
274
+ radius: 1.5f,
275
+ across_materials: false,
276
+ no_uv: false,
277
+ projection_type: ::base::projection_planar,
278
+ scale: 1.f,
279
+ coordinate_system: ::base::texture_coordinate_object,
280
+ uv_space_index: 0
281
+ );
282
+ export material PCB_Coppery(*)
283
+ [[
284
+ ::anno::display_name("PCB Coppery"),
285
+ ::anno::description(DESCRIPTION),
286
+ ::anno::copyright_notice(COPYRIGHT),
287
+ ::anno::key_words(string[]("conductiv", "metal", "copper", "pcb", "plate", "computer", "orange", "shiny", "bumped", "metallic", "construction", "light", "warm", "reflective")),
288
+ ::anno::thumbnail("./.thumbs/PCB_Copper.PCB_Coppery.png"),
289
+ ::anno::author("NVIDIA vMaterials"),
290
+ ::anno::contributor("Maik Rohland"),
291
+ ::anno::contributor("Ruediger Raab")
292
+ ]]
293
+ = PCB_Copper
294
+ (
295
+ coppery: 1.f,
296
+ grazing_reflectivity: color(1.f, 1.f, 1.f),
297
+ reflection_roughness: .2f,
298
+ reflection_smooth: .0f,
299
+ bump_strength: .3f,
300
+ texture_translate: 0.0f,
301
+ texture_rotate: 0.0f,
302
+ texture_scale: 1.0f,
303
+ enable_round_corners: false,
304
+ radius: 1.5f,
305
+ across_materials: false,
306
+ no_uv: false,
307
+ projection_type: ::base::projection_planar,
308
+ scale: 1.f,
309
+ coordinate_system: ::base::texture_coordinate_object,
310
+ uv_space_index: 0
311
+ );
312
+ export material PCB_Coppery_Soft(*)
313
+ [[
314
+ ::anno::display_name("PCB Coppery Soft"),
315
+ ::anno::description(DESCRIPTION),
316
+ ::anno::copyright_notice(COPYRIGHT),
317
+ ::anno::key_words(string[]("conductiv", "metal", "copper", "pcb", "plate", "computer", "orange", "shiny", "bumped", "metallic", "construction", "light", "warm", "soft", "reflective")),
318
+ ::anno::thumbnail("./.thumbs/PCB_Copper.PCB_Coppery_Soft.png"),
319
+ ::anno::author("NVIDIA vMaterials"),
320
+ ::anno::contributor("Maik Rohland"),
321
+ ::anno::contributor("Ruediger Raab")
322
+ ]]
323
+ = PCB_Copper
324
+ (
325
+ coppery: 1.f,
326
+ grazing_reflectivity: color(1.f, 1.f, 1.f),
327
+ reflection_roughness: .7f,
328
+ reflection_smooth: .4f,
329
+ bump_strength: .3f,
330
+ texture_translate: 0.0f,
331
+ texture_rotate: 0.0f,
332
+ texture_scale: 1.0f,
333
+ enable_round_corners: false,
334
+ radius: 1.5f,
335
+ across_materials: false,
336
+ no_uv: false,
337
+ projection_type: ::base::projection_planar,
338
+ scale: 1.f,
339
+ coordinate_system: ::base::texture_coordinate_object,
340
+ uv_space_index: 0
341
+ );
342
+
Material/material_0460/Platinum_Knurling.mdl ADDED
@@ -0,0 +1,359 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ::df::*;
40
+ import ::tex::*;
41
+ import ::math::*;
42
+ import ::base::*;
43
+ import ::state::*;
44
+ import ::anno::*;
45
+ import ::nvidia::core_definitions::*;
46
+
47
+ const string COPYRIGHT =
48
+ " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
49
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
50
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
51
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
52
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
53
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
54
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
55
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
56
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
57
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
58
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
59
+
60
+ const string DESCRIPTION = "Metal with a diamond knurling finish";
61
+
62
+ float histogram_range(float input, float range = 1.0f, float position = 0.5f)
63
+ {
64
+ float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0);
65
+ float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0);
66
+ return ::math::lerp(low, high, input);
67
+ }
68
+
69
+ ::base::texture_coordinate_info transform_coordinate_2(
70
+ float4x4 transform
71
+ [[ ::anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix.") ]],
72
+ ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info()
73
+ [[ ::anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection.") ]]
74
+ ) [[
75
+ ::anno::description("Transform a texture coordinate by a matrix.") ,
76
+ ::anno::noinline()
77
+ ]]
78
+ {
79
+ // Version 2
80
+ float4 r_position = transform * float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1);
81
+ //Try aproximating it for the case that the rotation is only aroud z and assuming the texture layout is nice and z is ~constant.
82
+ //just pretend there is no other rotation happening
83
+ //get rid of scaling and translation. Then extract fields where sin and cos would be in a simple 2d transform around z.
84
+ float4 u = transform[0];
85
+ float3 ru = ::math::normalize(float3(u.x,u.y,u.z));
86
+ float cos = ru.x;
87
+ float sin = -ru.y;
88
+ //TODO: at least also handle sign of z?
89
+ //TODO: handle tangent becoming 0
90
+
91
+
92
+ return ::base::texture_coordinate_info(
93
+ float3(r_position.x,r_position.y,r_position.z),
94
+ ::math::normalize(cos * coordinate.tangent_u - sin * coordinate.tangent_v),
95
+ ::math::normalize(cos * coordinate.tangent_v + sin * coordinate.tangent_u));
96
+ }
97
+
98
+ ::base::texture_coordinate_info vmat_transform(
99
+ float2 translation = float2(0.0, 0.0),
100
+ float rotation = 0.0, // rotation in degrees
101
+ float2 scaling = float2(1.0, 1.0),
102
+ uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw,
103
+ uniform int uv_space = 0
104
+ )
105
+ {
106
+ float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f;
107
+ float4x4 scale =
108
+ float4x4(1.0 /scaling.x, 0. , 0. , 0.,
109
+ 0. , 1.0 /scaling.y , 0. , 0.,
110
+ 0. , 0. , 1.0, 0.,
111
+ translation.x , translation.y , 0.0, 1.);
112
+
113
+ float s = ::math::sin(rotation_rad);
114
+ float c = ::math::cos(rotation_rad);
115
+ float4x4 rotate =
116
+ float4x4( c , -s , 0.0 , 0.0,
117
+ s , c , 0.0 , 0.0,
118
+ 0.0, 0.0 , 1.0 , 0.0,
119
+ 0. , 0.0 , 0.0 , 1.);
120
+
121
+ return transform_coordinate_2(scale*rotate, ::base::coordinate_source(system, uv_space));
122
+ }
123
+
124
+ export material Platinum_Knurling(
125
+ //Appearance
126
+ float brightness = float(0.7f) [[
127
+ ::anno::description("Adjusts the brightness of the material."),
128
+ ::anno::display_name("Brightness"),
129
+ ::anno::in_group("Appearance"),
130
+ ::anno::hard_range(0.0f, 1.0f)
131
+ ]],
132
+ float roughness = float(0.5f) [[
133
+ ::anno::description("Higher values lead to a rougher appearance of the material."),
134
+ ::anno::display_name("Roughness"),
135
+ ::anno::in_group("Appearance"),
136
+ ::anno::hard_range(0.0f, 1.0f)
137
+ ]],
138
+ float grooves_dirt = float(0.4f) [[
139
+ ::anno::description("Adds dirt in the grooves of the knurling pattern."),
140
+ ::anno::display_name("Grooves Dirt"),
141
+ ::anno::in_group("Appearance"),
142
+ ::anno::hard_range(0.0f, 1.0f)
143
+ ]],
144
+ uniform float bump_strength = float(0.8f) [[
145
+ ::anno::description("Adds dirt in the grooves of the knurling pattern."),
146
+ ::anno::display_name("Bump Strength"),
147
+ ::anno::in_group("Appearance"),
148
+ ::anno::soft_range(0.0f, 1.0f)
149
+ ]],
150
+
151
+ // Round Corners
152
+ uniform bool enable_round_corners = false [[
153
+ ::anno::display_name("Enable Round Corners"),
154
+ ::anno::in_group("Round Corners")
155
+ ]],
156
+ uniform float roundcorner_radius = 0.01f [[
157
+ ::anno::display_name("Round Corner Radius"),
158
+ ::anno::description("Sets the radius of the round corners in millimeters."),
159
+ ::anno::soft_range(0.0f, 0.1f),
160
+ ::anno::in_group("Round Corners")
161
+ ]],
162
+ uniform bool across_materials = false [[
163
+ ::anno::display_name("Across Materials"),
164
+ ::anno::description("Applies the rounded corner effect also between other materials."),
165
+ ::anno::in_group("Round Corners")
166
+ ]],
167
+ //Transform
168
+ float2 texture_translate = 0.f [[
169
+ ::anno::description("Controls the position of the texture."),
170
+ ::anno::display_name("Texture Translate"),
171
+ ::anno::in_group("Transform")
172
+ ]],
173
+ float texture_rotate = 0.f [[
174
+ ::anno::description("Rotates angle of the texture in degrees."),
175
+ ::anno::display_name("Texture Rotate"),
176
+ ::anno::in_group("Transform"),
177
+ ::anno::soft_range(0.f, 360.f)
178
+ ]],
179
+ float2 texture_scale = 1.f [[
180
+ ::anno::description("Larger numbers increase the size."),
181
+ ::anno::display_name("Texture Scale"),
182
+ ::anno::in_group("Transform"),
183
+ ::nvidia::core_definitions::dimension(float2(0.35f, .35f)),
184
+ ::anno::soft_range(0.f, 2.f)
185
+ ]],
186
+
187
+ // Advanced
188
+ uniform int uv_space_index = 0 [[
189
+ ::anno::description("Uses the selected UV space index."),
190
+ ::anno::display_name("UV Space Index"),
191
+ ::anno::in_group("Advanced"),
192
+ ::anno::soft_range(0, 4)
193
+ ]]
194
+ )
195
+ [[
196
+ ::anno::display_name("Metal Knurling Platinum"),
197
+ ::anno::description(DESCRIPTION),
198
+ ::anno::copyright_notice(COPYRIGHT),
199
+ ::anno::thumbnail("./.thumbs/Platinum_Knurling.Platinum_Knurling.png"),
200
+ ::anno::key_words(string[]("metal", "platinum", "knurled", "knurling", "pattern", "design", "bumped")),
201
+ ::anno::contributor("Ruediger Raab"),
202
+ ::anno::author("NVIDIA vMaterials")
203
+ ]]
204
+ = let
205
+ {
206
+ color metal_tint = color(0.678533319955f, 0.639590890417f, 0.583638675413f); // Platinum
207
+
208
+ // Texture setup
209
+ texture_2d normal_tex = texture_2d("./metal_knurling_norm.jpg", ::tex::gamma_linear);
210
+ texture_2d multi_heights_tex = texture_2d("./metal_knurling_multi_heights.jpg", ::tex::gamma_linear);
211
+ texture_2d diff_rough_grunge_tex = texture_2d("./metal_knurling_multi_R_diff_G_rough_B_grunge.jpg", ::tex::gamma_linear);
212
+
213
+ // Coordinate setup
214
+ ::base::texture_coordinate_info uvw = vmat_transform(
215
+ translation: texture_translate,
216
+ rotation: texture_rotate,
217
+ scaling: texture_scale,
218
+ system: ::base::texture_coordinate_uvw,
219
+ uv_space: uv_space_index
220
+ );
221
+
222
+ // ---------- Diff Rough Grunge Lookup ----------
223
+
224
+ float3 diff_rough_grunge_lookup = float3(
225
+ ::base::file_texture(
226
+ texture: diff_rough_grunge_tex,
227
+ uvw: uvw,
228
+ mono_source: ::base::mono_average
229
+ ).tint );
230
+
231
+ float3 multi_height_lookup = float3(
232
+ ::base::file_texture(
233
+ texture: multi_heights_tex,
234
+ uvw: uvw,
235
+ mono_source: ::base::mono_average
236
+ ).tint );
237
+
238
+ float3 norm = ::base::tangent_space_normal_texture(
239
+ texture: normal_tex,
240
+ factor: bump_strength,
241
+ uvw: uvw
242
+ );
243
+
244
+
245
+ float remap_rough = histogram_range(
246
+ input: diff_rough_grunge_lookup.y,
247
+ range: 1.0f,
248
+ position: 0.234f
249
+ );
250
+
251
+
252
+ float roughness_mapped = remap_rough + (roughness * multi_height_lookup.y);
253
+
254
+ float remapped_diff = histogram_range(
255
+ input: diff_rough_grunge_lookup.x,
256
+ range: 1.0f,
257
+ position: (brightness * 0.4f) + 0.4f
258
+ );
259
+
260
+ float diff_contribution = ::math::pow(remapped_diff - ((grooves_dirt * 0.5) * multi_height_lookup.x * diff_rough_grunge_lookup.z), 2.67f);
261
+
262
+ bsdf ggx_smith_bumped = ::df::weighted_layer(
263
+ layer: ::df::microfacet_ggx_smith_bsdf(
264
+ roughness_u: roughness_mapped * roughness_mapped,
265
+ roughness_v: roughness_mapped * roughness_mapped,
266
+ tint: color(diff_contribution),
267
+ mode: ::df::scatter_reflect
268
+ ),
269
+ base: bsdf(),
270
+ weight: 1.0f,
271
+ normal: norm
272
+ );
273
+
274
+ bsdf diff_bsdf = ::df::diffuse_reflection_bsdf(
275
+ tint: color(diff_contribution)
276
+ );
277
+
278
+
279
+ bsdf final_bsdf = ::df::weighted_layer(
280
+ weight: 1.0f - (diff_rough_grunge_lookup.z * multi_height_lookup.x * grooves_dirt),
281
+ layer: ::df::directional_factor(
282
+ normal_tint: metal_tint,
283
+ grazing_tint: color(1.0f),
284
+ base: ggx_smith_bumped
285
+ ),
286
+ base: diff_bsdf
287
+ );
288
+
289
+
290
+ // Round Corners
291
+ float3 round_normal = enable_round_corners ?
292
+ ::state::rounded_corner_normal(
293
+ radius: roundcorner_radius * 0.001,
294
+ across_materials: across_materials
295
+ ) : ::state::normal();
296
+ }
297
+ in material (
298
+
299
+ surface: material_surface(
300
+ scattering: final_bsdf
301
+ ),
302
+ geometry: material_geometry(
303
+ normal: round_normal
304
+ )
305
+ );
306
+
307
+
308
+ export material Platinum_Knurling_Worn(*)
309
+ [[
310
+ ::anno::display_name("Metal Knurling - Platinum Worn"),
311
+ ::anno::description(DESCRIPTION),
312
+ ::anno::copyright_notice(COPYRIGHT),
313
+ ::anno::thumbnail("./.thumbs/Platinum_Knurling.Platinum_Knurling_Worn.png"),
314
+ ::anno::key_words(string[]("metal", "platinum", "knurled", "pattern", "knurling", "design", "bumped", "worn")),
315
+ ::anno::contributor("Ruediger Raab"),
316
+ ::anno::author("NVIDIA vMaterials")
317
+ ]] = Platinum_Knurling(
318
+ brightness: 0.4f,
319
+ roughness: 1.0f,
320
+ grooves_dirt: 1.0f,
321
+ bump_strength: 0.8f,
322
+
323
+ enable_round_corners: false,
324
+ roundcorner_radius: 1.2f,
325
+ across_materials: false,
326
+
327
+ texture_translate: 0.0f,
328
+ texture_rotate: 0.f,
329
+ texture_scale: 1.0f,
330
+
331
+ uv_space_index: 0
332
+ );
333
+
334
+
335
+
336
+
337
+
338
+
339
+
340
+
341
+
342
+
343
+
344
+
345
+
346
+
347
+
348
+
349
+
350
+
351
+
352
+
353
+
354
+
355
+
356
+
357
+
358
+
359
+
Material/material_0464/Silver.mdl ADDED
@@ -0,0 +1,378 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2024 NVIDIA Corporation. All rights reserved.
3
+ ******************************************************************************
4
+
5
+ Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge,
6
+ to any person obtaining a copy of the sample definition code that uses our
7
+ Material Definition Language (the "MDL Materials"), to reproduce and distribute
8
+ the MDL Materials, including without limitation the rights to use, copy, merge,
9
+ publish, distribute, and sell modified and unmodified copies of the MDL
10
+ Materials, and to permit persons to whom the MDL Materials is furnished to do
11
+ so, in all cases solely for use with NVIDIA's Material Definition Language,
12
+ subject to the following further conditions:
13
+
14
+ 1. The above copyright notices, this list of conditions, and the disclaimer
15
+ that follows shall be retained in all copies of one or more of the MDL
16
+ Materials, including in any software with which the MDL Materials are bundled,
17
+ redistributed, and/or sold, and included either as stand-alone text files,
18
+ human-readable headers or in the appropriate machine-readable metadata fields
19
+ within text or binary files as long as those fields can be easily viewed by the
20
+ user, as applicable.
21
+ 2. The name of NVIDIA shall not be used to promote, endorse or advertise any
22
+ Modified Version without specific prior written permission, except a) to comply
23
+ with the notice requirements otherwise contained herein; or b) to acknowledge
24
+ the contribution(s) of NVIDIA.
25
+
26
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
27
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
28
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
29
+ TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR
30
+ ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL,
31
+ INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF
32
+ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE
33
+ THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.
34
+ */
35
+
36
+ mdl 1.4;
37
+
38
+ import ::anno::*;
39
+ import ::base::*;
40
+ import ::df::*;
41
+ import ::math::*;
42
+ import ::state::*;
43
+ import ::tex::*;
44
+ import ::nvidia::core_definitions::blend_colors;
45
+ import ::nvidia::core_definitions::dimension;
46
+
47
+ const string COPYRIGHT =
48
+ " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
49
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
50
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
51
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
52
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
53
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
54
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
55
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
56
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
57
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
58
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
59
+
60
+
61
+ ::base::texture_coordinate_info vmat_transform(
62
+ uniform float2 translation = float2(0.0, 0.0),
63
+ uniform float rotation = 0.0,
64
+ uniform float2 scaling = float2(1.0, 1.0),
65
+ uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw,
66
+ uniform int uv_space = 0
67
+ )
68
+ {
69
+ float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f;
70
+
71
+ float4x4 scale =
72
+ float4x4(1.0 /scaling.x, 0. , 0. , 0.,
73
+ 0. , 1.0 /scaling.y , 0. , 0.,
74
+ 0. , 0. , 1.0, 0.,
75
+ translation.x , translation.y , 0.0, 1.);
76
+
77
+ float s = ::math::sin(rotation_rad);
78
+ float c = ::math::cos(rotation_rad);
79
+ float4x4 rotate =
80
+ float4x4( c , -s , 0.0 , 0.0,
81
+ s , c , 0.0 , 0.0,
82
+ 0.0, 0.0 , 1.0 , 0.0,
83
+ 0. , 0.0 , 0.0 , 1.);
84
+
85
+ return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space));
86
+ }
87
+
88
+
89
+ float uint2float(int x)
90
+ {
91
+ return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0);
92
+ }
93
+
94
+ int lowbias32(int x)
95
+ {
96
+ x ^= x >>> 16;
97
+ x *= 0x7feb352d;
98
+ x ^= x >>> 15;
99
+ x *= 0x846ca68b;
100
+ x ^= x >>> 16;
101
+ return x;
102
+ }
103
+
104
+ float2 rnd22(int2 p) {
105
+ float2 ret_val = float2(
106
+ uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f,
107
+ uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f
108
+ );
109
+ return ret_val;
110
+ }
111
+
112
+ float3 srgb2rgb(float3 val)
113
+ {
114
+ return ::math::pow(::math::max(val, float3(0.0f)), 2.2);
115
+ }
116
+
117
+ float2x2 invert_2x2(float2x2 M)
118
+ {
119
+ float det = M[0][0]*M[1][1] - M[0][1]*M[1][0];
120
+ //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/
121
+ return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]);
122
+ }
123
+
124
+ float3 nonrepeat_lookup(
125
+ uniform texture_2d texture = texture_2d(),
126
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
127
+ float texture_scale = 1.0,
128
+ float3 average_color = float3(0.5),
129
+ float patch_size = 8.0
130
+ )
131
+ {
132
+
133
+ float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale;
134
+ float Z = patch_size; // patch scale inside example texture
135
+ float CON = 1.0f;
136
+
137
+ float3 O = float3(0.f);
138
+ float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f);
139
+ float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space
140
+
141
+ float2 U = uv_in;
142
+ float2 V = M * uv_in; //pre-tilted hexa coordinates
143
+ int2 I = int2(::math::floor(V)); // hexa-tile id
144
+
145
+ // The mean color needs to be determined in Photoshop then to make the
146
+ // average color work out, take the float value and calculate the apropriate
147
+ // mean value as (value^(1/2.2))
148
+
149
+ float3 m = average_color;
150
+
151
+ float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W;
152
+ F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates
153
+
154
+ if( F[2] > 0.f )
155
+
156
+ O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON))
157
+ + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON))
158
+ + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON));
159
+ else
160
+ O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON))
161
+ + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON))
162
+ + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON));
163
+ O = m + O/::math::length(W);
164
+ O = ::math::clamp( (O), 0.0, 1.0);
165
+
166
+ return float3(O);
167
+ }
168
+
169
+ color endless_texture(
170
+ uniform texture_2d texture = texture_2d(),
171
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
172
+ float texture_scale = 10.0,
173
+ float3 average_color = float3(0.5, 0.5, 1.0),
174
+ float patch_size = 8.0,
175
+ bool gamma_correct_lookup = true
176
+ )
177
+ {
178
+ return gamma_correct_lookup ? color(srgb2rgb(
179
+ nonrepeat_lookup (
180
+ texture: texture,
181
+ uvw: uvw,
182
+ texture_scale: texture_scale,
183
+ average_color: average_color,
184
+ patch_size: patch_size
185
+ ))
186
+ ) : color(nonrepeat_lookup (
187
+ texture: texture,
188
+ uvw: uvw,
189
+ texture_scale: texture_scale,
190
+ average_color: average_color,
191
+ patch_size: patch_size
192
+ ));
193
+ }
194
+
195
+
196
+ export material Silver(
197
+ uniform bool infinite_tiling = true [[
198
+ ::anno::description("Enables infinite tiling feature which removes repeating texture patterns. Note that depending on the material this feature changes the appearance of the material slightly."),
199
+ ::anno::display_name("Infinite Tiling"),
200
+ ::anno::in_group("Appearance")
201
+ ]],
202
+ float roughness = 0.1f [[
203
+ ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."),
204
+ ::anno::display_name("Roughness"),
205
+ ::anno::in_group("Appearance"),
206
+ ::anno::hard_range(0.f, 1.f)
207
+ ]],
208
+ float smudges = 0.5f [[
209
+ ::anno::description("Adds blurrier reflection that follow the intensities of the Roughness texture on top."),
210
+ ::anno::display_name("Smudges"),
211
+ ::anno::in_group("Appearance"),
212
+ ::anno::hard_range(0.f, 1.f)
213
+ ]],
214
+ uniform bool enable_round_corners = false [[
215
+ ::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."),
216
+ ::anno::display_name("Enable Round Corners"),
217
+ ::anno::in_group("Round Corners")
218
+ ]],
219
+ uniform float radius = 0.03f [[
220
+ ::anno::description("Radius of the rounded corners."),
221
+ ::anno::display_name("Round Corner Radius"),
222
+ ::anno::in_group("Round Corners")
223
+ ]],
224
+ uniform bool across_materials = false [[
225
+ ::anno::display_name("Across Materials"),
226
+ ::anno::description("When enabled the round corner effect is applied across different materials."),
227
+ ::anno::in_group("Round Corners")
228
+ ]],
229
+ uniform float2 texture_translate = 0.f [[
230
+ ::anno::display_name("Texture Translate"),
231
+ ::anno::description("Controls the position of the texture."),
232
+ ::anno::in_group("Transform")
233
+ ]],
234
+ uniform float texture_rotate = 0.f [[
235
+ ::anno::display_name("Texture Rotate"),
236
+ ::anno::description("Rotates angle of the texture in degrees."),
237
+ ::anno::soft_range(0.f, 360.f),
238
+ ::anno::in_group("Transform")
239
+ ]],
240
+ uniform float2 texture_scale = 1.f [[
241
+ ::anno::display_name("Texture Scale"),
242
+ ::anno::description("Larger numbers increase the size."),
243
+ ::anno::in_group("Transform"),
244
+ ::nvidia::core_definitions::dimension(float2(.45f, .45f))
245
+ ]],
246
+ uniform int uv_space_index = 0 [[
247
+ ::anno::display_name("UV Space Index"),
248
+ ::anno::in_group("Advanced")
249
+ ]],
250
+ float3 normal = ::state::normal() [[
251
+ ::anno::description("Modify the surface normal."),
252
+ ::anno::display_name("Normal"),
253
+ ::anno::in_group("Advanced")
254
+ ]]
255
+ )
256
+ [[
257
+ ::anno::author("NVIDIA vMaterials"),
258
+ ::anno::display_name("Silver"),
259
+ ::anno::description("Pure metal material with optional smudges."),
260
+ ::anno::copyright_notice(COPYRIGHT),
261
+ ::anno::thumbnail("./.thumbs/Silver.Silver.png"),
262
+ ::anno::key_words(string[]("metal", "pure", "smudged", "design", "reflective", "infinite tiling", "smooth", "conductor", "new", "polished", "silver"))
263
+ ]]
264
+ =
265
+ let {
266
+
267
+ color normal_reflectivity = color(0.9614253056f, 0.948983344333f, 0.918968346466f); // Silver
268
+ color grazing_reflectivity = color(0.99942f, 1.f, 1.f);
269
+
270
+ bool tmp0 = false;
271
+ material_surface tmp1(
272
+ ::df::color_custom_curve_layer(normal_reflectivity, grazing_reflectivity, 5.f, color(1.f, 1.f, 1.f), ::df::microfacet_ggx_smith_bsdf(::math::lerp(::math::lerp(0.f, 0.5f, roughness), ::math::lerp(0.f, 0.5f, roughness) + smudges * (1.f - ::math::lerp(0.f, 0.5f, roughness)), infinite_tiling ? float3(endless_texture(texture_2d("./metal_smudges_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0820000023f), 8.f, false))[0] : ::base::file_texture(texture_2d("./metal_smudges_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono) * ::math::lerp(::math::lerp(0.f, 0.5f, roughness), ::math::lerp(0.f, 0.5f, roughness) + smudges * (1.f - ::math::lerp(0.f, 0.5f, roughness)), infinite_tiling ? float3(endless_texture(texture_2d("./metal_smudges_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0820000023f), 8.f, false))[0] : ::base::file_texture(texture_2d("./metal_smudges_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono), ::math::lerp(::math::lerp(0.f, 0.5f, roughness), ::math::lerp(0.f, 0.5f, roughness) + smudges * (1.f - ::math::lerp(0.f, 0.5f, roughness)), infinite_tiling ? float3(endless_texture(texture_2d("./metal_smudges_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0820000023f), 8.f, false))[0] : ::base::file_texture(texture_2d("./metal_smudges_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono) * ::math::lerp(::math::lerp(0.f, 0.5f, roughness), ::math::lerp(0.f, 0.5f, roughness) + smudges * (1.f - ::math::lerp(0.f, 0.5f, roughness)), infinite_tiling ? float3(endless_texture(texture_2d("./metal_smudges_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0820000023f), 8.f, false))[0] : ::base::file_texture(texture_2d("./metal_smudges_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), bsdf(), normal),
273
+ material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
274
+ material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
275
+ color tmp3 = color(1.f, 1.f, 1.f);
276
+ 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));
277
+ material_geometry tmp5(
278
+ float3(0.f),
279
+ 1.f,
280
+ enable_round_corners ? ::state::rounded_corner_normal(radius, across_materials, 1.f) : ::state::normal());
281
+ } in
282
+ material(
283
+ thin_walled: tmp0,
284
+ surface: tmp1,
285
+ backface: tmp2,
286
+ ior: tmp3,
287
+ volume: tmp4,
288
+ geometry: tmp5);
289
+
290
+
291
+ export material Silver_Polished(*)
292
+ [[
293
+ ::anno::author("NVIDIA vMaterials"),
294
+ ::anno::display_name("Silver Polished"),
295
+ ::anno::description("Pure metal material with optional smudges."),
296
+ ::anno::copyright_notice(COPYRIGHT),
297
+ ::anno::thumbnail("./.thumbs/Silver.Silver_Polished.png"),
298
+ ::anno::key_words(string[]("metal", "pure", "design", "reflective", "infinite tiling", "smooth", "conductor", "new", "polished", "silver"))
299
+ ]]
300
+ = Silver(
301
+ infinite_tiling: true,
302
+ roughness: 0.0f,
303
+ smudges: 0.0f,
304
+ enable_round_corners: false,
305
+ radius: 0.03f,
306
+ across_materials: false,
307
+ texture_translate: float2(0.0f, 0.0f),
308
+ texture_rotate: 0.0f,
309
+ texture_scale: float2(1.0f, 1.0f),
310
+ uv_space_index: 0,
311
+ normal: ::state::normal()
312
+ );
313
+
314
+
315
+ export material Silver_Glossy_Fingerprints(*)
316
+ [[
317
+ ::anno::author("NVIDIA vMaterials"),
318
+ ::anno::display_name("Silver Glossy Fingerprints"),
319
+ ::anno::description("Pure metal material with optional smudges."),
320
+ ::anno::copyright_notice(COPYRIGHT),
321
+ ::anno::thumbnail("./.thumbs/Silver.Silver_Glossy_Fingerprints.png"),
322
+ ::anno::key_words(string[]("metal", "pure", "design", "smudged", "reflective", "infinite tiling", "smooth", "conductor", "new", "polished", "Silver"))
323
+ ]]
324
+ = Silver(
325
+ infinite_tiling: true,
326
+ roughness: 0.23f,
327
+ smudges: 1.0f,
328
+ enable_round_corners: false,
329
+ radius: 0.03f,
330
+ across_materials: false,
331
+ texture_translate: float2(0.0f, 0.0f),
332
+ texture_rotate: 0.0f,
333
+ texture_scale: float2(1.0f, 1.0f),
334
+ uv_space_index: 0,
335
+ normal: ::state::normal()
336
+ );
337
+
338
+
339
+
340
+ /*
341
+ - Aluminum
342
+ 0.911810895428,0.914089043421,0.920152876196
343
+
344
+ - Copper
345
+ 0.9654565, 0.6899602, 0.4830392
346
+
347
+ - Chromium
348
+ 0.549302, 0.5560554, 0.5542377
349
+
350
+ - Iron
351
+ 0.5293683, 0.5132565, 0.4942483
352
+
353
+ - Gold
354
+ 1.0,0.722306985258,0.340058756743
355
+
356
+ - Nickel
357
+ 0.696691094703,0.640529134605,0.563260231405
358
+
359
+ - Platinum
360
+ 0.678533319955,0.639590890417,0.583638675413
361
+
362
+ - Mercury
363
+ 0.780978740699,0.779541528985,0.778441417779
364
+
365
+ - Silver
366
+ 0.9614253056,0.948983344333,0.918968346466
367
+
368
+ - Titanium
369
+ 0.618264052974,0.579396264956,0.542545225681
370
+
371
+ - Tungsten
372
+ 0.951001417565,0.815051845356,0.751931718925
373
+
374
+ - Zinc
375
+ 0.87467950988,0.868943040106,0.855089634324
376
+
377
+
378
+ */
Material/material_0474/Stainless_Steel_Brushed_Punched.mdl ADDED
The diff for this file is too large to render. See raw diff
 
Material/material_0475/Stainless_Steel_Milled.mdl ADDED
@@ -0,0 +1,327 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ const string COPYRIGHT =
48
+ " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
49
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
50
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
51
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
52
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
53
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
54
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
55
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
56
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
57
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
58
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
59
+
60
+ const string DESCRIPTION =
61
+ "A stainless steel material with adjustable roughness and controls to add secondary effects \n"
62
+ "such as stains, smudges and mechanical damage";
63
+
64
+ ::base::texture_coordinate_info vmat_transform_post_scale(
65
+ ::base::texture_coordinate_info uvw,
66
+ float2 scale = 1.0f
67
+ )
68
+ {
69
+ return ::base::texture_coordinate_info(
70
+ position: float3(uvw.position.x / scale.x,
71
+ uvw.position.y / scale.y,
72
+ uvw.position.z),
73
+ tangent_u: uvw.tangent_u,
74
+ tangent_v: uvw.tangent_v
75
+ );
76
+ }
77
+
78
+ float3 normalmap_normal(
79
+ uniform texture_2d texture,
80
+ float factor = 1.0,
81
+ ::base::texture_coordinate_info uvw = ::base::texture_coordinate_info()
82
+ )
83
+ {
84
+ float3 lookup = (::tex::lookup_float3(texture, float2(uvw.position.x, uvw.position.y)) - float3(0.5)) * (factor * 2.0);
85
+ return ::math::normalize(uvw.tangent_u * lookup.x + uvw.tangent_v * lookup.y + ::state::normal() * (lookup.z + (1.0 - factor)));
86
+ }
87
+
88
+
89
+ // Returns the normal n in tangent space, given n is in internal space.
90
+ float3 transform_internal_to_tangent(float3 n)
91
+ [[
92
+ ::anno::hidden()
93
+ ]]
94
+ {
95
+ return
96
+ n.x* float3(::state::texture_tangent_u(0).x,::state::texture_tangent_v(0).x,::state::normal().x)+
97
+ n.y* float3(::state::texture_tangent_u(0).y,::state::texture_tangent_v(0).y,::state::normal().y)+
98
+ n.z* float3(::state::texture_tangent_u(0).z,::state::texture_tangent_v(0).z,::state::normal().z);
99
+ }
100
+
101
+ // Returns the normal n in internal space, given n is in tangent space.
102
+ float3 transform_tangent_to_internal(float3 n)
103
+ [[
104
+ ::anno::hidden()
105
+ ]]
106
+ {
107
+ return ::state::texture_tangent_u(0) * n.x +
108
+ ::state::texture_tangent_v(0) * n.y +
109
+ ::state::normal() * n.z ;
110
+ }
111
+
112
+
113
+
114
+ // Returns a normal by adding a detail normal to a global normal.
115
+ // If detail blending of two normal maps gives visual artifacts, check if texture_2d are loaded
116
+ // correctly with ::tex::gamma_linear
117
+ float3 add_detail_normal(float3 nd = ::state::normal(), float3 n = ::state::normal())
118
+ {
119
+ // http://blog.selfshadow.com/publications/blending-in-detail/
120
+ float3 n_t = transform_internal_to_tangent(n);
121
+ float3 nd_t = transform_internal_to_tangent(nd);
122
+
123
+ n_t=n_t + float3(0.,0.,1.);
124
+ nd_t = nd_t * float3(-1.,-1.,1.);
125
+ n = n_t*::math::dot(n_t, nd_t)/n_t.z - nd_t;
126
+ return ::math::normalize(transform_tangent_to_internal(n));
127
+ }
128
+
129
+
130
+ ::base::texture_coordinate_info vmat_transform(
131
+ uniform float2 translation = float2(0.0, 0.0),
132
+ uniform float rotation = 0.0,
133
+ uniform float2 scaling = float2(1.0, 1.0),
134
+ uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw,
135
+ uniform int uv_space = 0
136
+ )
137
+ {
138
+ float4x4 scale =
139
+ float4x4(1.0 /scaling.x, 0. , 0. , 0.,
140
+ 0. , 1.0 /scaling.y , 0. , 0.,
141
+ 0. , 0. , 1.0, 0.,
142
+ translation.x , translation.y , 0.0, 1.);
143
+
144
+ float s = ::math::sin(rotation);
145
+ float c = ::math::cos(rotation);
146
+ float4x4 rotate =
147
+ float4x4( c , -s , 0.0 , 0.0,
148
+ s , c , 0.0 , 0.0,
149
+ 0.0, 0.0 , 1.0 , 0.0,
150
+ 0. , 0.0 , 0.0 , 1.);
151
+
152
+ return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space));
153
+ }
154
+
155
+
156
+ float histogram_range(float input, float range, float position)
157
+ {
158
+ float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0);
159
+ float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0);
160
+ return ::math::lerp(low, high, input);
161
+ }
162
+
163
+
164
+ float remap_xy_to_0_1(float input, float x, float y)
165
+ {
166
+ return (input - x)/(y - x);
167
+ }
168
+
169
+ float histogram_scan_big(float input, float width, float position)
170
+ {
171
+ return ::math::clamp(
172
+ remap_xy_to_0_1(input,
173
+ ::math::lerp(-width, 1.0, position),
174
+ ::math::lerp(0.0, 1.0 + width, position)),
175
+ 0.0,
176
+ 1.0);
177
+ }
178
+
179
+
180
+ export material Stainless_Steel_Milled(
181
+ float roughness = 0.67f [[
182
+ ::anno::description("Higher values lead to blurrier reflections."),
183
+ ::anno::display_name("Roughness"),
184
+ ::anno::in_group("Appearance"),
185
+ ::anno::hard_range(0.f, 1.f),
186
+ ::anno::ui_order(1)
187
+ ]],
188
+ float cloudiness = 0.89f [[
189
+ ::anno::description("Adds a cloudy reflection to the metal material."),
190
+ ::anno::display_name("Cloudiness"),
191
+ ::anno::in_group("Appearance"),
192
+ ::anno::hard_range(0.f, 1.f),
193
+ ::anno::ui_order(2)
194
+ ]],
195
+ float brightness = .6f [[
196
+ ::anno::description("Low values make the metal darker and add slight variation to the brightness while a high value gives it a bright uniform look."),
197
+ ::anno::display_name("Brightness"),
198
+ ::anno::in_group("Appearance"),
199
+ ::anno::hard_range(0.f, 1.f),
200
+ ::anno::ui_order(3)
201
+ ]],
202
+ float milling_bump_strength = 1.f [[
203
+ ::anno::description("Adds milled grooves on the metal."),
204
+ ::anno::display_name("Milling Bump Strength"),
205
+ ::anno::in_group("Appearance", "Bump"),
206
+ ::anno::hard_range(0.f, 1.f),
207
+ ::anno::ui_order(4)
208
+ ]],
209
+ float dents_bump_strength = 0.0f [[
210
+ ::anno::description("Adds dents and bumps."),
211
+ ::anno::display_name("Dents Bump Strength"),
212
+ ::anno::in_group("Appearance", "Bump"),
213
+ ::anno::hard_range(0.f, 1.f),
214
+ ::anno::ui_order(5)
215
+ ]],
216
+ float dents_scale = 0.52f [[
217
+ ::anno::description("Larger numbers increase the size of the dents."),
218
+ ::anno::display_name("Dents Scale"),
219
+ ::anno::in_group("Appearance", "Bump"),
220
+ ::anno::ui_order(6)
221
+ ]],
222
+ uniform float2 texture_translate = 0.f [[
223
+ ::anno::description("Controls the position of the texture."),
224
+ ::anno::display_name("Texture Translate"),
225
+ ::anno::in_group("Transform"),
226
+ ::anno::ui_order(7)
227
+ ]],
228
+ uniform float texture_rotate = 0.f [[
229
+ ::anno::description("Rotates angle of the texture in degrees."),
230
+ ::anno::display_name("Texture Rotate"),
231
+ ::anno::in_group("Transform"),
232
+ ::anno::soft_range(0.f, 360.f),
233
+ ::anno::ui_order(8)
234
+ ]],
235
+ uniform float2 texture_scale = 1.f [[
236
+ ::anno::description("Larger numbers increase the size."),
237
+ ::anno::display_name("Texture Scale"),
238
+ ::anno::in_group("Transform"),
239
+ ::nvidia::core_definitions::dimension(float2(0.33f, 0.33f)),
240
+ ::anno::ui_order(9)
241
+ ]],
242
+ uniform bool roundcorners_enable = true [[
243
+ ::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."),
244
+ ::anno::display_name("Enable Round Corners"),
245
+ ::anno::in_group("Round Corners"),
246
+ ::anno::ui_order(10)
247
+ ]],
248
+ uniform float roundcorners_radius_mm = 0.5f [[
249
+ ::anno::description("Radius of the rounded corners in millimeters."),
250
+ ::anno::display_name("Round Corner Radius (mm)"),
251
+ ::anno::in_group("Round Corners"),
252
+ ::anno::soft_range(0.f, 10.f),
253
+ ::anno::ui_order(11)
254
+ ]],
255
+ uniform bool roundcorners_across_materials = false [[
256
+ ::anno::description("Applies the round corner effect across different materials when enabled."),
257
+ ::anno::display_name("Across Materials"),
258
+ ::anno::in_group("Round Corners"),
259
+ ::anno::ui_order(12)
260
+ ]],
261
+ uniform int uv_space_index = 0 [[
262
+ ::anno::description("Uses selected UV space for material."),
263
+ ::anno::display_name("UV Space Index"),
264
+ ::anno::in_group("Advanced"),
265
+ ::anno::hard_range(0, 10),
266
+ ::anno::ui_order(13)
267
+ ]])
268
+ [[
269
+ ::anno::author("NVIDIA vMaterials"),
270
+ ::anno::contributor("Rüdiger Raab"),
271
+ ::anno::contributor("Maik Rohland"),
272
+ ::anno::display_name("Stainless Steel Milled - New"),
273
+ ::anno::description(DESCRIPTION),
274
+ ::anno::copyright_notice(COPYRIGHT),
275
+ ::anno::thumbnail("./.thumbs/Stainless_Steel_Milled.Stainless_Steel_Milled.png"),
276
+ ::anno::key_words(string[]("metal", "steel", "stainless", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "new", "shiny", "milled", "reflective", "gray"))
277
+ ]]
278
+ =
279
+ let {
280
+ bool tmp0 = false;
281
+ material_surface tmp1(::df::custom_curve_layer(0.799999952f, 1.f, 3.0999999f, 1.f, ::df::weighted_layer(cloudiness * 0.330000013f, ::df::microfacet_ggx_smith_bsdf(0.159999996f, 0.159999996f, color((brightness * 0.300000012f + 0.600000024f) * ::math::lerp(1.f, ::math::pow(float3(::base::file_texture(texture_2d("./stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), 0.200000003f), 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.40999997f), milling_bump_strength * 0.850000024f + 0.150000006f)), color((brightness * 0.300000012f + 0.600000024f) * ::math::lerp(1.f, ::math::pow(float3(::base::file_texture(texture_2d("./stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), 0.200000003f), 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.40999997f), milling_bump_strength * 0.850000024f + 0.150000006f)), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(0.799999952f, ::df::microfacet_ggx_smith_bsdf((histogram_range(float3(::base::file_texture(texture_2d("./stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), 0.200000003f), 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, ::math::lerp(0.f, 0.870000005f, roughness), ::math::lerp(0.0299999993f, 0.349999994f, roughness)) - float3(::base::file_texture(texture_2d("./stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), 0.200000003f), 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 * ::math::lerp(0.0299999993f, 0.349999994f, roughness) * dents_bump_strength) * (histogram_range(float3(::base::file_texture(texture_2d("./stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), 0.200000003f), 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, ::math::lerp(0.f, 0.870000005f, roughness), ::math::lerp(0.0299999993f, 0.349999994f, roughness)) - float3(::base::file_texture(texture_2d("./stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), 0.200000003f), 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 * ::math::lerp(0.0299999993f, 0.349999994f, roughness) * dents_bump_strength), (histogram_range(float3(::base::file_texture(texture_2d("./stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), 0.200000003f), 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, ::math::lerp(0.f, 0.870000005f, roughness), ::math::lerp(0.0299999993f, 0.349999994f, roughness)) - float3(::base::file_texture(texture_2d("./stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), 0.200000003f), 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 * ::math::lerp(0.0299999993f, 0.349999994f, roughness) * dents_bump_strength) * (histogram_range(float3(::base::file_texture(texture_2d("./stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), 0.200000003f), 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, ::math::lerp(0.f, 0.870000005f, roughness), ::math::lerp(0.0299999993f, 0.349999994f, roughness)) - float3(::base::file_texture(texture_2d("./stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), 0.200000003f), 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 * ::math::lerp(0.0299999993f, 0.349999994f, roughness) * dents_bump_strength), color((brightness * 0.300000012f + 0.600000024f) * ::math::lerp(1.f, ::math::pow(float3(::base::file_texture(texture_2d("./stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), 0.200000003f), 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.40999997f), milling_bump_strength * 0.850000024f + 0.150000006f)), color((brightness * 0.300000012f + 0.600000024f) * ::math::lerp(1.f, ::math::pow(float3(::base::file_texture(texture_2d("./stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), 0.200000003f), 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.40999997f), milling_bump_strength * 0.850000024f + 0.150000006f)), ::state::texture_tangent_u(0), ::df::scatter_reflect), bsdf(), add_detail_normal(normalmap_normal(texture_2d("./stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale * 4.f))), normalmap_normal(texture_2d("./stainless_milled_norm.jpg", ::tex::gamma_linear), (milling_bump_strength * 0.850000024f + 0.150000006f) * histogram_scan_big(1.f - float3(::base::file_texture(texture_2d("./stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale * 4.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).z, 0.189999998f, dents_bump_strength * 0.75999999f), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), 0.200000003f)))), add_detail_normal(normalmap_normal(texture_2d("./stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale * 4.f))), normalmap_normal(texture_2d("./stainless_milled_norm.jpg", ::tex::gamma_linear), (milling_bump_strength * 0.850000024f + 0.150000006f) * histogram_scan_big(1.f - float3(::base::file_texture(texture_2d("./stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale * 4.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).z, 0.189999998f, dents_bump_strength * 0.75999999f), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), 0.200000003f)))), ::df::tint(color(0.f, 0.f, 0.f), ::df::weighted_layer(cloudiness * 0.330000013f, ::df::microfacet_ggx_smith_bsdf(0.159999996f, 0.159999996f, color((brightness * 0.300000012f + 0.600000024f) * ::math::lerp(1.f, ::math::pow(float3(::base::file_texture(texture_2d("./stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), 0.200000003f), 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.40999997f), milling_bump_strength * 0.850000024f + 0.150000006f)), color((brightness * 0.300000012f + 0.600000024f) * ::math::lerp(1.f, ::math::pow(float3(::base::file_texture(texture_2d("./stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), 0.200000003f), 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.40999997f), milling_bump_strength * 0.850000024f + 0.150000006f)), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(0.799999952f, ::df::microfacet_ggx_smith_bsdf((histogram_range(float3(::base::file_texture(texture_2d("./stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), 0.200000003f), 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, ::math::lerp(0.f, 0.870000005f, roughness), ::math::lerp(0.0299999993f, 0.349999994f, roughness)) - float3(::base::file_texture(texture_2d("./stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), 0.200000003f), 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 * ::math::lerp(0.0299999993f, 0.349999994f, roughness) * dents_bump_strength) * (histogram_range(float3(::base::file_texture(texture_2d("./stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), 0.200000003f), 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, ::math::lerp(0.f, 0.870000005f, roughness), ::math::lerp(0.0299999993f, 0.349999994f, roughness)) - float3(::base::file_texture(texture_2d("./stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), 0.200000003f), 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 * ::math::lerp(0.0299999993f, 0.349999994f, roughness) * dents_bump_strength), (histogram_range(float3(::base::file_texture(texture_2d("./stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), 0.200000003f), 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, ::math::lerp(0.f, 0.870000005f, roughness), ::math::lerp(0.0299999993f, 0.349999994f, roughness)) - float3(::base::file_texture(texture_2d("./stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), 0.200000003f), 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 * ::math::lerp(0.0299999993f, 0.349999994f, roughness) * dents_bump_strength) * (histogram_range(float3(::base::file_texture(texture_2d("./stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), 0.200000003f), 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, ::math::lerp(0.f, 0.870000005f, roughness), ::math::lerp(0.0299999993f, 0.349999994f, roughness)) - float3(::base::file_texture(texture_2d("./stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), 0.200000003f), 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 * ::math::lerp(0.0299999993f, 0.349999994f, roughness) * dents_bump_strength), color((brightness * 0.300000012f + 0.600000024f) * ::math::lerp(1.f, ::math::pow(float3(::base::file_texture(texture_2d("./stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), 0.200000003f), 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.40999997f), milling_bump_strength * 0.850000024f + 0.150000006f)), color((brightness * 0.300000012f + 0.600000024f) * ::math::lerp(1.f, ::math::pow(float3(::base::file_texture(texture_2d("./stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), 0.200000003f), 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.40999997f), milling_bump_strength * 0.850000024f + 0.150000006f)), ::state::texture_tangent_u(0), ::df::scatter_reflect), bsdf(), add_detail_normal(normalmap_normal(texture_2d("./stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale * 4.f))), normalmap_normal(texture_2d("./stainless_milled_norm.jpg", ::tex::gamma_linear), (milling_bump_strength * 0.850000024f + 0.150000006f) * histogram_scan_big(1.f - float3(::base::file_texture(texture_2d("./stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale * 4.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).z, 0.189999998f, dents_bump_strength * 0.75999999f), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), 0.200000003f)))), add_detail_normal(normalmap_normal(texture_2d("./stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale * 4.f))), normalmap_normal(texture_2d("./stainless_milled_norm.jpg", ::tex::gamma_linear), (milling_bump_strength * 0.850000024f + 0.150000006f) * histogram_scan_big(1.f - float3(::base::file_texture(texture_2d("./stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale * 4.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).z, 0.189999998f, dents_bump_strength * 0.75999999f), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), 0.200000003f))))), ::state::normal()), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
282
+ material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
283
+ color tmp3 = color(1.f, 1.f, 1.f);
284
+ 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));
285
+ 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());
286
+ hair_bsdf tmp6 = hair_bsdf();
287
+ } in
288
+ material(
289
+ thin_walled: tmp0,
290
+ surface: tmp1,
291
+ backface: tmp2,
292
+ ior: tmp3,
293
+ volume: tmp4,
294
+ geometry: tmp5,
295
+ hair: tmp6);
296
+
297
+
298
+
299
+ export material Stainless_Steel_Milled_Worn(*)
300
+ [[
301
+ ::anno::author("NVIDIA vMaterials"),
302
+ ::anno::contributor("Rüdiger Raab"),
303
+ ::anno::contributor("Maik Rohland"),
304
+ ::anno::display_name("Stainless Steel Milled - Worn"),
305
+ ::anno::description(DESCRIPTION),
306
+ ::anno::copyright_notice(COPYRIGHT),
307
+ ::anno::thumbnail("./.thumbs/Stainless_Steel_Milled.Stainless_Steel_Milled_Worn.png"),
308
+ ::anno::key_words(string[]("metal", "steel", "stainless", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "new", "shiny", "milled", "reflective", "gray"))
309
+ ]] = Stainless_Steel_Milled(
310
+ roughness: 0.67f,
311
+ cloudiness: 0.89f,
312
+ brightness: 0.6f,
313
+ milling_bump_strength: 1.0f,
314
+ dents_bump_strength: 1.0f,
315
+ dents_scale: 0.52f,
316
+ texture_translate: 0.0f,
317
+ texture_rotate: 0.0f,
318
+ texture_scale: 1.0f,
319
+ roundcorners_enable: false,
320
+ roundcorners_radius_mm: 0.5f,
321
+ roundcorners_across_materials: false,
322
+ uv_space_index: 0
323
+ );
324
+
325
+
326
+
327
+
Material/material_0481/Titanium.mdl ADDED
@@ -0,0 +1,378 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2024 NVIDIA Corporation. All rights reserved.
3
+ ******************************************************************************
4
+
5
+ Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge,
6
+ to any person obtaining a copy of the sample definition code that uses our
7
+ Material Definition Language (the "MDL Materials"), to reproduce and distribute
8
+ the MDL Materials, including without limitation the rights to use, copy, merge,
9
+ publish, distribute, and sell modified and unmodified copies of the MDL
10
+ Materials, and to permit persons to whom the MDL Materials is furnished to do
11
+ so, in all cases solely for use with NVIDIA's Material Definition Language,
12
+ subject to the following further conditions:
13
+
14
+ 1. The above copyright notices, this list of conditions, and the disclaimer
15
+ that follows shall be retained in all copies of one or more of the MDL
16
+ Materials, including in any software with which the MDL Materials are bundled,
17
+ redistributed, and/or sold, and included either as stand-alone text files,
18
+ human-readable headers or in the appropriate machine-readable metadata fields
19
+ within text or binary files as long as those fields can be easily viewed by the
20
+ user, as applicable.
21
+ 2. The name of NVIDIA shall not be used to promote, endorse or advertise any
22
+ Modified Version without specific prior written permission, except a) to comply
23
+ with the notice requirements otherwise contained herein; or b) to acknowledge
24
+ the contribution(s) of NVIDIA.
25
+
26
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
27
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
28
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
29
+ TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR
30
+ ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL,
31
+ INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF
32
+ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE
33
+ THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.
34
+ */
35
+
36
+ mdl 1.5;
37
+
38
+ import ::anno::*;
39
+ import ::base::*;
40
+ import ::df::*;
41
+ import ::math::*;
42
+ import ::state::*;
43
+ import ::tex::*;
44
+ import ::nvidia::core_definitions::blend_colors;
45
+ import ::nvidia::core_definitions::dimension;
46
+
47
+ const string COPYRIGHT =
48
+ " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
49
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
50
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
51
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
52
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
53
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
54
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
55
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
56
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
57
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
58
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
59
+
60
+
61
+ ::base::texture_coordinate_info vmat_transform(
62
+ uniform float2 translation = float2(0.0, 0.0),
63
+ uniform float rotation = 0.0,
64
+ uniform float2 scaling = float2(1.0, 1.0),
65
+ uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw,
66
+ uniform int uv_space = 0
67
+ )
68
+ {
69
+ float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f;
70
+
71
+ float4x4 scale =
72
+ float4x4(1.0 /scaling.x, 0. , 0. , 0.,
73
+ 0. , 1.0 /scaling.y , 0. , 0.,
74
+ 0. , 0. , 1.0, 0.,
75
+ translation.x , translation.y , 0.0, 1.);
76
+
77
+ float s = ::math::sin(rotation_rad);
78
+ float c = ::math::cos(rotation_rad);
79
+ float4x4 rotate =
80
+ float4x4( c , -s , 0.0 , 0.0,
81
+ s , c , 0.0 , 0.0,
82
+ 0.0, 0.0 , 1.0 , 0.0,
83
+ 0. , 0.0 , 0.0 , 1.);
84
+
85
+ return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space));
86
+ }
87
+
88
+
89
+ float uint2float(int x)
90
+ {
91
+ return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0);
92
+ }
93
+
94
+ int lowbias32(int x)
95
+ {
96
+ x ^= x >>> 16;
97
+ x *= 0x7feb352d;
98
+ x ^= x >>> 15;
99
+ x *= 0x846ca68b;
100
+ x ^= x >>> 16;
101
+ return x;
102
+ }
103
+
104
+ float2 rnd22(int2 p) {
105
+ float2 ret_val = float2(
106
+ uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f,
107
+ uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f
108
+ );
109
+ return ret_val;
110
+ }
111
+
112
+ float3 srgb2rgb(float3 val)
113
+ {
114
+ return ::math::pow(::math::max(val, float3(0.0f)), 2.2);
115
+ }
116
+
117
+ float2x2 invert_2x2(float2x2 M)
118
+ {
119
+ float det = M[0][0]*M[1][1] - M[0][1]*M[1][0];
120
+ //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/
121
+ return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]);
122
+ }
123
+
124
+ float3 nonrepeat_lookup(
125
+ uniform texture_2d texture = texture_2d(),
126
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
127
+ float texture_scale = 1.0,
128
+ float3 average_color = float3(0.5),
129
+ float patch_size = 8.0
130
+ )
131
+ {
132
+
133
+ float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale;
134
+ float Z = patch_size; // patch scale inside example texture
135
+ float CON = 1.0f;
136
+
137
+ float3 O = float3(0.f);
138
+ float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f);
139
+ float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space
140
+
141
+ float2 U = uv_in;
142
+ float2 V = M * uv_in; //pre-tilted hexa coordinates
143
+ int2 I = int2(::math::floor(V)); // hexa-tile id
144
+
145
+ // The mean color needs to be determined in Photoshop then to make the
146
+ // average color work out, take the float value and calculate the apropriate
147
+ // mean value as (value^(1/2.2))
148
+
149
+ float3 m = average_color;
150
+
151
+ float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W;
152
+ F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates
153
+
154
+ if( F[2] > 0.f )
155
+
156
+ O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON))
157
+ + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON))
158
+ + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON));
159
+ else
160
+ O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON))
161
+ + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON))
162
+ + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON));
163
+ O = m + O/::math::length(W);
164
+ O = ::math::clamp( (O), 0.0, 1.0);
165
+
166
+ return float3(O);
167
+ }
168
+
169
+ color endless_texture(
170
+ uniform texture_2d texture = texture_2d(),
171
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
172
+ float texture_scale = 10.0,
173
+ float3 average_color = float3(0.5, 0.5, 1.0),
174
+ float patch_size = 8.0,
175
+ bool gamma_correct_lookup = true
176
+ )
177
+ {
178
+ return gamma_correct_lookup ? color(srgb2rgb(
179
+ nonrepeat_lookup (
180
+ texture: texture,
181
+ uvw: uvw,
182
+ texture_scale: texture_scale,
183
+ average_color: average_color,
184
+ patch_size: patch_size
185
+ ))
186
+ ) : color(nonrepeat_lookup (
187
+ texture: texture,
188
+ uvw: uvw,
189
+ texture_scale: texture_scale,
190
+ average_color: average_color,
191
+ patch_size: patch_size
192
+ ));
193
+ }
194
+
195
+
196
+ export material Titanium(
197
+ uniform bool infinite_tiling = true [[
198
+ ::anno::description("Enables infinite tiling feature which removes repeating texture patterns. Note that depending on the material this feature changes the appearance of the material slightly."),
199
+ ::anno::display_name("Infinite Tiling"),
200
+ ::anno::in_group("Appearance")
201
+ ]],
202
+ float roughness = 0.1f [[
203
+ ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."),
204
+ ::anno::display_name("Roughness"),
205
+ ::anno::in_group("Appearance"),
206
+ ::anno::hard_range(0.f, 1.f)
207
+ ]],
208
+ float smudges = 0.5f [[
209
+ ::anno::description("Adds blurrier reflection that follow the intensities of the Roughness texture on top."),
210
+ ::anno::display_name("Smudges"),
211
+ ::anno::in_group("Appearance"),
212
+ ::anno::hard_range(0.f, 1.f)
213
+ ]],
214
+ uniform bool enable_round_corners = false [[
215
+ ::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."),
216
+ ::anno::display_name("Enable Round Corners"),
217
+ ::anno::in_group("Round Corners")
218
+ ]],
219
+ uniform float radius = 0.03f [[
220
+ ::anno::description("Radius of the rounded corners."),
221
+ ::anno::display_name("Round Corner Radius"),
222
+ ::anno::in_group("Round Corners")
223
+ ]],
224
+ uniform bool across_materials = false [[
225
+ ::anno::display_name("Across Materials"),
226
+ ::anno::description("When enabled the round corner effect is applied across different materials."),
227
+ ::anno::in_group("Round Corners")
228
+ ]],
229
+ uniform float2 texture_translate = 0.f [[
230
+ ::anno::display_name("Texture Translate"),
231
+ ::anno::description("Controls the position of the texture."),
232
+ ::anno::in_group("Transform")
233
+ ]],
234
+ uniform float texture_rotate = 0.f [[
235
+ ::anno::display_name("Texture Rotate"),
236
+ ::anno::description("Rotates angle of the texture in degrees."),
237
+ ::anno::soft_range(0.f, 360.f),
238
+ ::anno::in_group("Transform")
239
+ ]],
240
+ uniform float2 texture_scale = 1.f [[
241
+ ::anno::display_name("Texture Scale"),
242
+ ::anno::description("Larger numbers increase the size."),
243
+ ::anno::in_group("Transform"),
244
+ ::nvidia::core_definitions::dimension(float2(.45f, .45f))
245
+ ]],
246
+ uniform int uv_space_index = 0 [[
247
+ ::anno::display_name("UV Space Index"),
248
+ ::anno::in_group("Advanced")
249
+ ]],
250
+ float3 normal = ::state::normal() [[
251
+ ::anno::description("Modify the surface normal."),
252
+ ::anno::display_name("Normal"),
253
+ ::anno::in_group("Advanced")
254
+ ]]
255
+ )
256
+ [[
257
+ ::anno::author("NVIDIA vMaterials"),
258
+ ::anno::display_name("Titanium"),
259
+ ::anno::description("Pure metal material with optional smudges."),
260
+ ::anno::copyright_notice(COPYRIGHT),
261
+ ::anno::thumbnail("./.thumbs/Titanium.Titanium.png"),
262
+ ::anno::key_words(string[]("metal", "pure", "smudged", "design", "reflective", "infinite tiling", "smooth", "conductor", "new", "polished", "titanium"))
263
+ ]]
264
+ =
265
+ let {
266
+
267
+ color normal_reflectivity = color(0.618264052974f, 0.579396264956f, 0.542545225681f); // Titanium
268
+ color grazing_reflectivity = color(0.99942f, 1.f, 1.f);
269
+
270
+ bool tmp0 = false;
271
+ material_surface tmp1(
272
+ ::df::color_custom_curve_layer(normal_reflectivity, grazing_reflectivity, 5.f, color(1.f, 1.f, 1.f), ::df::microfacet_ggx_smith_bsdf(::math::lerp(::math::lerp(0.f, 0.5f, roughness), ::math::lerp(0.f, 0.5f, roughness) + smudges * (1.f - ::math::lerp(0.f, 0.5f, roughness)), infinite_tiling ? float3(endless_texture(texture_2d("./metal_smudges_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0820000023f), 8.f, false))[0] : ::base::file_texture(texture_2d("./metal_smudges_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono) * ::math::lerp(::math::lerp(0.f, 0.5f, roughness), ::math::lerp(0.f, 0.5f, roughness) + smudges * (1.f - ::math::lerp(0.f, 0.5f, roughness)), infinite_tiling ? float3(endless_texture(texture_2d("./metal_smudges_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0820000023f), 8.f, false))[0] : ::base::file_texture(texture_2d("./metal_smudges_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono), ::math::lerp(::math::lerp(0.f, 0.5f, roughness), ::math::lerp(0.f, 0.5f, roughness) + smudges * (1.f - ::math::lerp(0.f, 0.5f, roughness)), infinite_tiling ? float3(endless_texture(texture_2d("./metal_smudges_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0820000023f), 8.f, false))[0] : ::base::file_texture(texture_2d("./metal_smudges_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono) * ::math::lerp(::math::lerp(0.f, 0.5f, roughness), ::math::lerp(0.f, 0.5f, roughness) + smudges * (1.f - ::math::lerp(0.f, 0.5f, roughness)), infinite_tiling ? float3(endless_texture(texture_2d("./metal_smudges_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.0820000023f), 8.f, false))[0] : ::base::file_texture(texture_2d("./metal_smudges_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), bsdf(), normal),
273
+ material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
274
+ material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
275
+ color tmp3 = color(1.f, 1.f, 1.f);
276
+ 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));
277
+ material_geometry tmp5(
278
+ float3(0.f),
279
+ 1.f,
280
+ enable_round_corners ? ::state::rounded_corner_normal(radius, across_materials, 1.f) : ::state::normal());
281
+ } in
282
+ material(
283
+ thin_walled: tmp0,
284
+ surface: tmp1,
285
+ backface: tmp2,
286
+ ior: tmp3,
287
+ volume: tmp4,
288
+ geometry: tmp5);
289
+
290
+
291
+ export material Titanium_Polished(*)
292
+ [[
293
+ ::anno::author("NVIDIA vMaterials"),
294
+ ::anno::display_name("Titanium Polished"),
295
+ ::anno::description("Pure metal material with optional smudges."),
296
+ ::anno::copyright_notice(COPYRIGHT),
297
+ ::anno::thumbnail("./.thumbs/Titanium.Titanium_Polished.png"),
298
+ ::anno::key_words(string[]("metal", "pure", "design", "reflective", "infinite tiling", "smooth", "conductor", "new", "polished", "titanium"))
299
+ ]]
300
+ = Titanium(
301
+ infinite_tiling: true,
302
+ roughness: 0.0f,
303
+ smudges: 0.0f,
304
+ enable_round_corners: false,
305
+ radius: 0.03f,
306
+ across_materials: false,
307
+ texture_translate: float2(0.0f, 0.0f),
308
+ texture_rotate: 0.0f,
309
+ texture_scale: float2(1.0f, 1.0f),
310
+ uv_space_index: 0,
311
+ normal: ::state::normal()
312
+ );
313
+
314
+
315
+ export material Titanium_Glossy_Fingerprints(*)
316
+ [[
317
+ ::anno::author("NVIDIA vMaterials"),
318
+ ::anno::display_name("Titanium Glossy Fingerprints"),
319
+ ::anno::description("Pure metal material with optional smudges."),
320
+ ::anno::copyright_notice(COPYRIGHT),
321
+ ::anno::thumbnail("./.thumbs/Titanium.Titanium_Glossy_Fingerprints.png"),
322
+ ::anno::key_words(string[]("metal", "pure", "design", "smudged", "reflective", "infinite tiling", "smooth", "conductor", "new", "polished", "titanium"))
323
+ ]]
324
+ = Titanium(
325
+ infinite_tiling: true,
326
+ roughness: 0.23f,
327
+ smudges: 1.0f,
328
+ enable_round_corners: false,
329
+ radius: 0.03f,
330
+ across_materials: false,
331
+ texture_translate: float2(0.0f, 0.0f),
332
+ texture_rotate: 0.0f,
333
+ texture_scale: float2(1.0f, 1.0f),
334
+ uv_space_index: 0,
335
+ normal: ::state::normal()
336
+ );
337
+
338
+
339
+
340
+ /*
341
+ - Aluminum
342
+ 0.911810895428,0.914089043421,0.920152876196
343
+
344
+ - Copper
345
+ 0.9654565, 0.6899602, 0.4830392
346
+
347
+ - Chromium
348
+ 0.549302, 0.5560554, 0.5542377
349
+
350
+ - Iron
351
+ 0.5293683, 0.5132565, 0.4942483
352
+
353
+ - Gold
354
+ 1.0,0.722306985258,0.340058756743
355
+
356
+ - Nickel
357
+ 0.696691094703,0.640529134605,0.563260231405
358
+
359
+ - Platinum
360
+ 0.678533319955,0.639590890417,0.583638675413
361
+
362
+ - Mercury
363
+ 0.780978740699,0.779541528985,0.778441417779
364
+
365
+ - Silver
366
+ 0.9614253056,0.948983344333,0.918968346466
367
+
368
+ - Titanium
369
+ 0.618264052974,0.579396264956,0.542545225681
370
+
371
+ - Tungsten
372
+ 0.951001417565,0.815051845356,0.751931718925
373
+
374
+ - Zinc
375
+ 0.87467950988,0.868943040106,0.855089634324
376
+
377
+
378
+ */
Material/material_0497/Zinc_Foil.mdl ADDED
@@ -0,0 +1,498 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2024 NVIDIA Corporation. All rights reserved.
3
+ ******************************************************************************
4
+
5
+ Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge,
6
+ to any person obtaining a copy of the sample definition code that uses our
7
+ Material Definition Language (the "MDL Materials"), to reproduce and distribute
8
+ the MDL Materials, including without limitation the rights to use, copy, merge,
9
+ publish, distribute, and sell modified and unmodified copies of the MDL
10
+ Materials, and to permit persons to whom the MDL Materials is furnished to do
11
+ so, in all cases solely for use with NVIDIA's Material Definition Language,
12
+ subject to the following further conditions:
13
+
14
+ 1. The above copyright notices, this list of conditions, and the disclaimer
15
+ that follows shall be retained in all copies of one or more of the MDL
16
+ Materials, including in any software with which the MDL Materials are bundled,
17
+ redistributed, and/or sold, and included either as stand-alone text files,
18
+ human-readable headers or in the appropriate machine-readable metadata fields
19
+ within text or binary files as long as those fields can be easily viewed by the
20
+ user, as applicable.
21
+ 2. The name of NVIDIA shall not be used to promote, endorse or advertise any
22
+ Modified Version without specific prior written permission, except a) to comply
23
+ with the notice requirements otherwise contained herein; or b) to acknowledge
24
+ the contribution(s) of NVIDIA.
25
+
26
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
27
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
28
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
29
+ TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR
30
+ ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL,
31
+ INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF
32
+ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE
33
+ THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.
34
+ */
35
+
36
+
37
+ mdl 1.5;
38
+
39
+ import ::anno::*;
40
+ import ::base::*;
41
+ import ::df::*;
42
+ import ::math::*;
43
+ import ::state::*;
44
+ import ::tex::*;
45
+ import ::nvidia::core_definitions::blend_colors;
46
+ import ::nvidia::core_definitions::dimension;
47
+
48
+ const string COPYRIGHT =
49
+ " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
50
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
51
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
52
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
53
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
54
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
55
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
56
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
57
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
58
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
59
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
60
+
61
+ const string DESCRIPTION = "Metal foil material with additional controls for wrinkling the material";
62
+
63
+ float remap_xy_to_0_1(float input, float x, float y)
64
+ {
65
+ return (input - x)/(y - x);
66
+ }
67
+
68
+ float histogram_scan_big(float input, float width, float position)
69
+ {
70
+ return ::math::clamp(
71
+ remap_xy_to_0_1(input,
72
+ ::math::lerp(-width, 1.0, position),
73
+ ::math::lerp(0.0, 1.0 + width, position)),
74
+ 0.0,
75
+ 1.0);
76
+ }
77
+
78
+ ::base::texture_coordinate_info vmat_transform(
79
+ uniform float2 translation = float2(0.0, 0.0),
80
+ uniform float rotation = 0.0,
81
+ uniform float2 scaling = float2(1.0, 1.0),
82
+ uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw,
83
+ uniform int uv_space = 0
84
+ )
85
+ {
86
+ float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f;
87
+
88
+ float4x4 scale =
89
+ float4x4(1.0 /scaling.x, 0. , 0. , 0.,
90
+ 0. , 1.0 /scaling.y , 0. , 0.,
91
+ 0. , 0. , 1.0, 0.,
92
+ translation.x , translation.y , 0.0, 1.);
93
+
94
+ float s = ::math::sin(rotation_rad);
95
+ float c = ::math::cos(rotation_rad);
96
+ float4x4 rotate =
97
+ float4x4( c , -s , 0.0 , 0.0,
98
+ s , c , 0.0 , 0.0,
99
+ 0.0, 0.0 , 1.0 , 0.0,
100
+ 0. , 0.0 , 0.0 , 1.);
101
+
102
+ return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space));
103
+ }
104
+
105
+ float histogram_range(float input, float range, float position)
106
+ {
107
+ float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0);
108
+ float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0);
109
+ return ::math::lerp(low, high, input);
110
+ }
111
+
112
+ float uint2float(int x)
113
+ {
114
+ return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0);
115
+ }
116
+
117
+ int lowbias32(int x)
118
+ {
119
+ x ^= x >>> 16;
120
+ x *= 0x7feb352d;
121
+ x ^= x >>> 15;
122
+ x *= 0x846ca68b;
123
+ x ^= x >>> 16;
124
+ return x;
125
+ }
126
+
127
+ float2 rnd22(int2 p) {
128
+ float2 ret_val = float2(
129
+ uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f,
130
+ uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f
131
+ );
132
+ return ret_val;
133
+ }
134
+
135
+ float3 srgb2rgb(float3 val)
136
+ {
137
+ return ::math::pow(::math::max(val, float3(0.0f)), 2.2);
138
+ }
139
+
140
+ float2x2 invert_2x2(float2x2 M)
141
+ {
142
+ float det = M[0][0]*M[1][1] - M[0][1]*M[1][0];
143
+ //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/
144
+ return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]);
145
+ }
146
+
147
+ float3 nonrepeat_lookup(
148
+ uniform texture_2d texture = texture_2d(),
149
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
150
+ float texture_scale = 1.0,
151
+ float3 average_color = float3(0.5),
152
+ float patch_size = 8.0
153
+ )
154
+ {
155
+
156
+ float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale;
157
+ float Z = patch_size; // patch scale inside example texture
158
+ float CON = 1.0f;
159
+
160
+ float3 O = float3(0.f);
161
+ float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f);
162
+ float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space
163
+
164
+ float2 U = uv_in;
165
+ float2 V = M * uv_in; //pre-tilted hexa coordinates
166
+ int2 I = int2(::math::floor(V)); // hexa-tile id
167
+
168
+ // The mean color needs to be determined in Photoshop then to make the
169
+ // average color work out, take the float value and calculate the apropriate
170
+ // mean value as (value^(1/2.2))
171
+
172
+ float3 m = average_color;
173
+
174
+ float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W;
175
+ F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates
176
+
177
+ if( F[2] > 0.f )
178
+
179
+ O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON))
180
+ + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON))
181
+ + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON));
182
+ else
183
+ O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON))
184
+ + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON))
185
+ + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON));
186
+ O = m + O/::math::length(W);
187
+ O = ::math::clamp( (O), 0.0, 1.0);
188
+
189
+ return float3(O);
190
+ }
191
+
192
+ color endless_texture(
193
+ uniform texture_2d texture = texture_2d(),
194
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
195
+ float texture_scale = 10.0,
196
+ float3 average_color = float3(0.5, 0.5, 1.0),
197
+ float patch_size = 8.0,
198
+ bool gamma_correct_lookup = true
199
+ )
200
+ {
201
+ return gamma_correct_lookup ? color(srgb2rgb(
202
+ nonrepeat_lookup (
203
+ texture: texture,
204
+ uvw: uvw,
205
+ texture_scale: texture_scale,
206
+ average_color: average_color,
207
+ patch_size: patch_size
208
+ ))
209
+ ) : color(nonrepeat_lookup (
210
+ texture: texture,
211
+ uvw: uvw,
212
+ texture_scale: texture_scale,
213
+ average_color: average_color,
214
+ patch_size: patch_size
215
+ ));
216
+ }
217
+
218
+ float3 endless_normal(
219
+ uniform texture_2d texture = texture_2d(),
220
+ float factor = 1.0,
221
+ bool flip_tangent_u = false,
222
+ bool flip_tangent_v = false,
223
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
224
+ float texture_scale = 1.0,
225
+ float3 average_color = float3(0.5, 0.5, 1.0),
226
+ float patch_size = 8.0
227
+ )
228
+ {
229
+ float3 transformed_tangent_u = flip_tangent_u ? uvw.tangent_u : - uvw.tangent_u;
230
+ float3 transformed_tangent_v = flip_tangent_v ? uvw.tangent_v : - uvw.tangent_v;
231
+
232
+ if (flip_tangent_u)
233
+ transformed_tangent_u=-transformed_tangent_u;
234
+ if (flip_tangent_v)
235
+ transformed_tangent_v=-transformed_tangent_v;
236
+
237
+ // normalized Lookup
238
+ float3 tangent_space_normal =
239
+ (nonrepeat_lookup (
240
+ texture: texture,
241
+ uvw: uvw,
242
+ texture_scale: texture_scale,
243
+ average_color: average_color,
244
+ patch_size: patch_size
245
+ ) - 0.5) * (2.0 * factor);
246
+
247
+ return ::math::normalize(uvw.tangent_u * tangent_space_normal.x +
248
+ uvw.tangent_v * tangent_space_normal.y +
249
+ ::state::normal()*1.0);
250
+ }
251
+
252
+ export material Zinc_Foil(
253
+ uniform bool infinite_tiling = true [[
254
+ ::anno::description("Enables infinite tiling feature which removes repeating texture patterns. Note that depending on the material this feature changes the appearance of the material slightly."),
255
+ ::anno::display_name("Infinite Tiling"),
256
+ ::anno::in_group("Infinite Tiing")
257
+ ]],
258
+ float brightness = 1.f [[
259
+ ::anno::description("Ajusts the total reflectivity of the metal."),
260
+ ::anno::display_name("Brightness"),
261
+ ::anno::hard_range(0.f, 1.f),
262
+ ::anno::in_group("Appearance")
263
+ ]],
264
+ float roughness = 0.15f [[
265
+ ::anno::display_name("Roughness"),
266
+ ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."),
267
+ ::anno::hard_range(0.f, 1.f),
268
+ ::anno::in_group("Appearance")
269
+ ]],
270
+ float roughness_variation = 0.564f [[
271
+ ::anno::description("Amount of variation applied to the roughness, higher numbers add more non uniform appearance to the reflectivity of the material."),
272
+ ::anno::display_name("Roughness Variation"),
273
+ ::anno::hard_range(0.f, 1.f),
274
+ ::anno::in_group("Appearance")
275
+ ]],
276
+ float smudges = 0.35f [[
277
+ ::anno::description("Adds blurrier reflections that show smudges on the surface."),
278
+ ::anno::display_name("Smudges"),
279
+ ::anno::hard_range(0.f, 1.f),
280
+ ::anno::in_group("Appearance")
281
+ ]],
282
+ uniform float bump_strength = 0.05f [[
283
+ ::anno::description("Specifies the strength of the bump."),
284
+ ::anno::display_name("Bump Strength"),
285
+ ::anno::hard_range(0.f, 1.f),
286
+ ::anno::in_group("Appearance")
287
+ ]],
288
+ uniform float2 texture_translate = 0.f [[
289
+ ::anno::description("Controls the position of the texture."),
290
+ ::anno::display_name("Texture Translate"),
291
+ ::anno::in_group("Transform")
292
+ ]],
293
+ uniform float texture_rotate = 0.0f [[
294
+ ::anno::description("Rotates angle of the texture in degrees."),
295
+ ::anno::display_name("Texture Rotate"),
296
+ ::anno::in_group("Transform")
297
+ ]],
298
+ uniform float2 texture_scale = 1.f [[
299
+ ::anno::description("Larger numbers increase the size."),
300
+ ::anno::display_name("Texture Scale"),
301
+ ::nvidia::core_definitions::dimension(float2(0.4, 0.4)),
302
+ ::anno::in_group("Transform")
303
+ ]],
304
+ uniform int uv_space_index = 0 [[
305
+ ::anno::display_name("UV Space Index"),
306
+ ::anno::in_group("Transform")
307
+ ]],
308
+ uniform bool enable_round_corners = false [[
309
+ ::anno::description("Enables the round corner effect. Comes at a slight performance cost as additional raytracing calls are required to evaluate the round corner effect."),
310
+ ::anno::display_name("Enable Round Corners"),
311
+ ::anno::in_group("Round Corners")
312
+ ]],
313
+ uniform float radius = 0.002f [[
314
+ ::anno::description("Radius of the rounded corners."),
315
+ ::anno::display_name("Round Corner Radius"),
316
+ ::anno::in_group("Round Corners")
317
+ ]],
318
+ uniform bool across_materials = false [[
319
+ ::anno::display_name("Across Materials"),
320
+ ::anno::in_group("Round Corners")
321
+ ]]
322
+ )
323
+ [[
324
+ ::anno::author("NVIDIA vMaterials"),
325
+ ::anno::display_name("Metal Foil Zinc - Slightly Wrinkled"),
326
+ ::anno::description(DESCRIPTION),
327
+ ::anno::copyright_notice(COPYRIGHT),
328
+ ::anno::thumbnail("./.thumbs/Zinc_Foil.Zinc_Foil.png"),
329
+ ::anno::key_words(string[]("design", "metal", "zinc", "aluminium", "foil", "smooth", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral"))
330
+ ]]
331
+ =
332
+ let {
333
+ color normal_reflectivity = color(0.87467950988f, 0.868943040106f, 0.855089634324f); // Zinc
334
+ color grazing_reflectivity = color(0.99942f, 1.f, 1.f);
335
+
336
+ bool tmp0 = false;
337
+ material_surface tmp1(
338
+ ::df::weighted_layer(0.0299999993f, ::df::microfacet_ggx_smith_bsdf(0.300000012f, 0.300000012f, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::color_custom_curve_layer(normal_reflectivity, grazing_reflectivity, 5.f, color(::math::lerp(0.600000024f, 1.f, brightness) * histogram_scan_big(::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.328999996f, 0.513999999f, 0.764999986f), 8.f, false) : ::base::file_texture(texture_2d("./foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 2.20000005f), 1.f, bump_strength * 0.400000006f)), ::df::microfacet_ggx_smith_bsdf((histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.328999996f, 0.513999999f, 0.764999986f), 8.f, false) : ::base::file_texture(texture_2d("./foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], roughness * 0.5f * roughness_variation, roughness * 0.5f) + roughness * 0.5f * roughness_variation * (float3(infinite_tiling ? endless_texture(texture_2d("./foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.328999996f, 0.513999999f, 0.764999986f), 8.f, false) : ::base::file_texture(texture_2d("./foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1] - 0.5f) + (1.f - roughness) * smudges * float3(infinite_tiling ? endless_texture(texture_2d("./foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.0820000023f), 8.f, false) : ::base::file_texture(texture_2d("./foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] + roughness_variation * 0.200000003f * float3(infinite_tiling ? endless_texture(texture_2d("./foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.0820000023f), 8.f, false) : ::base::file_texture(texture_2d("./foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]) * (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.328999996f, 0.513999999f, 0.764999986f), 8.f, false) : ::base::file_texture(texture_2d("./foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], roughness * 0.5f * roughness_variation, roughness * 0.5f) + roughness * 0.5f * roughness_variation * (float3(infinite_tiling ? endless_texture(texture_2d("./foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.328999996f, 0.513999999f, 0.764999986f), 8.f, false) : ::base::file_texture(texture_2d("./foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1] - 0.5f) + (1.f - roughness) * smudges * float3(infinite_tiling ? endless_texture(texture_2d("./foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.0820000023f), 8.f, false) : ::base::file_texture(texture_2d("./foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] + roughness_variation * 0.200000003f * float3(infinite_tiling ? endless_texture(texture_2d("./foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.0820000023f), 8.f, false) : ::base::file_texture(texture_2d("./foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.328999996f, 0.513999999f, 0.764999986f), 8.f, false) : ::base::file_texture(texture_2d("./foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], roughness * 0.5f * roughness_variation, roughness * 0.5f) + roughness * 0.5f * roughness_variation * (float3(infinite_tiling ? endless_texture(texture_2d("./foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.328999996f, 0.513999999f, 0.764999986f), 8.f, false) : ::base::file_texture(texture_2d("./foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1] - 0.5f) + (1.f - roughness) * smudges * float3(infinite_tiling ? endless_texture(texture_2d("./foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.0820000023f), 8.f, false) : ::base::file_texture(texture_2d("./foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] + roughness_variation * 0.200000003f * float3(infinite_tiling ? endless_texture(texture_2d("./foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.0820000023f), 8.f, false) : ::base::file_texture(texture_2d("./foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]) * (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.328999996f, 0.513999999f, 0.764999986f), 8.f, false) : ::base::file_texture(texture_2d("./foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], roughness * 0.5f * roughness_variation, roughness * 0.5f) + roughness * 0.5f * roughness_variation * (float3(infinite_tiling ? endless_texture(texture_2d("./foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.328999996f, 0.513999999f, 0.764999986f), 8.f, false) : ::base::file_texture(texture_2d("./foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1] - 0.5f) + (1.f - roughness) * smudges * float3(infinite_tiling ? endless_texture(texture_2d("./foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.0820000023f), 8.f, false) : ::base::file_texture(texture_2d("./foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] + roughness_variation * 0.200000003f * float3(infinite_tiling ? endless_texture(texture_2d("./foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.0820000023f), 8.f, false) : ::base::file_texture(texture_2d("./foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), bsdf(), infinite_tiling ? endless_normal(texture_2d("./foil_crumpled_norm.jpg", ::tex::gamma_linear), bump_strength * 1.5f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.5f, 0.5f, 1.f), 8.f) : ::base::tangent_space_normal_texture(texture_2d("./foil_crumpled_norm.jpg", ::tex::gamma_linear), bump_strength * 1.5f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), infinite_tiling ? endless_normal(texture_2d("./foil_crumpled_norm.jpg", ::tex::gamma_linear), bump_strength * 1.5f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.5f, 0.5f, 1.f), 8.f) : ::base::tangent_space_normal_texture(texture_2d("./foil_crumpled_norm.jpg", ::tex::gamma_linear), bump_strength * 1.5f, 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)),
339
+ material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
340
+ material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
341
+ color tmp3 = color(1.f, 1.f, 1.f);
342
+ 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));
343
+ material_geometry tmp5(
344
+ float3(0.f),
345
+ 1.f,
346
+ enable_round_corners ? ::state::rounded_corner_normal(radius, across_materials, 1.f) : ::state::normal());
347
+ } in
348
+ material(
349
+ thin_walled: tmp0,
350
+ surface: tmp1,
351
+ backface: tmp2,
352
+ ior: tmp3,
353
+ volume: tmp4,
354
+ geometry: tmp5);
355
+
356
+
357
+ export material Zinc_Foil_Smudged_Foil(*)
358
+ [[
359
+ ::anno::author("NVIDIA vMaterials"),
360
+ ::anno::display_name("Metal Foil Zinc - Smudgy Foil"),
361
+ ::anno::description(DESCRIPTION),
362
+ ::anno::copyright_notice(COPYRIGHT),
363
+ ::anno::thumbnail("./.thumbs/Zinc_Foil.Zinc_Foil_Smudged_Foil.png"),
364
+ ::anno::key_words(string[]("design", "metal", "zinc", "aluminium", "foil", "smooth", "unfinished", "decorative", "creative", "neutral"))
365
+ ]]
366
+ = Zinc_Foil(
367
+ infinite_tiling: true,
368
+ roughness: 0.15f,
369
+ roughness_variation: 0.84f,
370
+ smudges: 0.35f,
371
+ bump_strength: 0.0f,
372
+ texture_translate: 0.0f,
373
+ texture_rotate: 0.0f,
374
+ texture_scale: 1.0f,
375
+ uv_space_index: 0,
376
+ enable_round_corners: false,
377
+ radius: 0.002f,
378
+ across_materials: false
379
+ );
380
+
381
+
382
+
383
+ export material Zinc_Foil_Shiny_Wrinkled(*)
384
+ [[
385
+ ::anno::author("NVIDIA vMaterials"),
386
+ ::anno::display_name("Metal Foil Zinc - Shiny Wrinkled"),
387
+ ::anno::description(DESCRIPTION),
388
+ ::anno::copyright_notice(COPYRIGHT),
389
+ ::anno::thumbnail("./.thumbs/Zinc_Foil.Zinc_Foil_Shiny_Wrinkled.png"),
390
+ ::anno::key_words(string[]("design", "metal", "zinc", "aluminium", "foil", "shiny", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral"))
391
+ ]]
392
+ = Zinc_Foil(
393
+ infinite_tiling: true,
394
+ roughness: 0.25f,
395
+ roughness_variation: 0.25f,
396
+ smudges: 0.75f,
397
+ bump_strength: 0.25f,
398
+ texture_translate: 0.0f,
399
+ texture_rotate: 0.0f,
400
+ texture_scale: 1.0f,
401
+ uv_space_index: 0,
402
+ enable_round_corners: false,
403
+ radius: 0.002f,
404
+ across_materials: false
405
+ );
406
+
407
+
408
+
409
+
410
+ export material Zinc_Foil_Matte_Wrinkled(*)
411
+ [[
412
+ ::anno::author("NVIDIA vMaterials"),
413
+ ::anno::display_name("Metal Foil Zinc - Matte Wrinkled"),
414
+ ::anno::description(DESCRIPTION),
415
+ ::anno::copyright_notice(COPYRIGHT),
416
+ ::anno::thumbnail("./.thumbs/Zinc_Foil.Zinc_Foil_Matte_Wrinkled.png"),
417
+ ::anno::key_words(string[]("design", "metal", "zinc", "aluminium", "foil", "matte", "smooth", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral", "gray"))
418
+ ]]
419
+ = Zinc_Foil(
420
+ infinite_tiling: true,
421
+ roughness: 0.65f,
422
+ roughness_variation: 1.0f,
423
+ smudges: 0.4f,
424
+ bump_strength: 0.15f,
425
+ texture_translate: 0.0f,
426
+ texture_rotate: 0.0f,
427
+ texture_scale: 1.0f,
428
+ uv_space_index: 0,
429
+ enable_round_corners: false,
430
+ radius: 0.002f,
431
+ across_materials: false
432
+ );
433
+
434
+
435
+
436
+ export material Zinc_Foil_Heavy_Glossy_Wrinkles(*)
437
+ [[
438
+ ::anno::author("NVIDIA vMaterials"),
439
+ ::anno::display_name("Metal Foil Zinc - Heavy Glossy Wrinkles"),
440
+ ::anno::description(DESCRIPTION),
441
+ ::anno::copyright_notice(COPYRIGHT),
442
+ ::anno::thumbnail("./.thumbs/Zinc_Foil.Zinc_Foil_Heavy_Glossy_Wrinkles.png"),
443
+ ::anno::key_words(string[]("design", "metal", "zinc", "aluminium", "foil", "smooth", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral"))
444
+ ]]
445
+ = Zinc_Foil(
446
+ infinite_tiling: true,
447
+ roughness: 0.164f,
448
+ roughness_variation: 0.021f,
449
+ smudges: 0.143f,
450
+ bump_strength: 0.99f,
451
+ texture_translate: 0.0f,
452
+ texture_rotate: 0.0f,
453
+ texture_scale: 1.0f,
454
+ uv_space_index: 0,
455
+ enable_round_corners: false,
456
+ radius: 0.002f,
457
+ across_materials: false
458
+ );
459
+
460
+
461
+
462
+ export material Zinc_Foil_Heavy_Matte_Wrinkled(*)
463
+ [[
464
+ ::anno::author("NVIDIA vMaterials"),
465
+ ::anno::display_name("Metal Foil Zinc - Heavy Matte Wrinkled"),
466
+ ::anno::description(DESCRIPTION),
467
+ ::anno::copyright_notice(COPYRIGHT),
468
+ ::anno::thumbnail("./.thumbs/Zinc_Foil.Zinc_Foil_Heavy_Matte_Wrinkled.png"),
469
+ ::anno::key_words(string[]("design", "metal", "zinc", "aluminium", "foil", "matte", "bumped", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral", "gray"))
470
+ ]]
471
+ = Zinc_Foil(
472
+ infinite_tiling: true,
473
+ roughness: 0.889f,
474
+ roughness_variation: 0.018f,
475
+ smudges: 0.246f,
476
+ bump_strength: 0.732f,
477
+ texture_translate: 0.0f,
478
+ texture_rotate: 0.0f,
479
+ texture_scale: 1.0f,
480
+ uv_space_index: 0,
481
+ enable_round_corners: false,
482
+ radius: 0.002f,
483
+ across_materials: false
484
+ );
485
+
486
+
487
+
488
+
489
+
490
+
491
+
492
+
493
+
494
+
495
+
496
+
497
+
498
+
Material/material_0557/OSB_Wood_Splattered.mdl ADDED
@@ -0,0 +1,423 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2024 NVIDIA Corporation. All rights reserved.
3
+ ******************************************************************************
4
+
5
+ Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge,
6
+ to any person obtaining a copy of the sample definition code that uses our
7
+ Material Definition Language (the "MDL Materials"), to reproduce and distribute
8
+ the MDL Materials, including without limitation the rights to use, copy, merge,
9
+ publish, distribute, and sell modified and unmodified copies of the MDL
10
+ Materials, and to permit persons to whom the MDL Materials is furnished to do
11
+ so, in all cases solely for use with NVIDIA's Material Definition Language,
12
+ subject to the following further conditions:
13
+
14
+ 1. The above copyright notices, this list of conditions, and the disclaimer
15
+ that follows shall be retained in all copies of one or more of the MDL
16
+ Materials, including in any software with which the MDL Materials are bundled,
17
+ redistributed, and/or sold, and included either as stand-alone text files,
18
+ human-readable headers or in the appropriate machine-readable metadata fields
19
+ within text or binary files as long as those fields can be easily viewed by the
20
+ user, as applicable.
21
+ 2. The name of NVIDIA shall not be used to promote, endorse or advertise any
22
+ Modified Version without specific prior written permission, except a) to comply
23
+ with the notice requirements otherwise contained herein; or b) to acknowledge
24
+ the contribution(s) of NVIDIA.
25
+
26
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
27
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
28
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
29
+ TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR
30
+ ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL,
31
+ INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF
32
+ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE
33
+ THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.
34
+ */
35
+
36
+ mdl 1.5;
37
+
38
+ import ::anno::*;
39
+ import ::base::*;
40
+ import ::df::*;
41
+ import ::math::*;
42
+ import ::state::*;
43
+ import ::tex::*;
44
+ import ::nvidia::core_definitions::blend_colors;
45
+ import ::nvidia::core_definitions::dimension;
46
+
47
+
48
+ const string COPYRIGHT =
49
+ " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
50
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
51
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
52
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
53
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
54
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
55
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
56
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
57
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
58
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
59
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
60
+
61
+
62
+ ::base::texture_coordinate_info vmat_transform(
63
+ uniform float2 translation = float2(0.0, 0.0),
64
+ uniform float rotation = 0.0,
65
+ uniform float2 scaling = float2(1.0, 1.0),
66
+ uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw,
67
+ uniform int uv_space = 0
68
+ )
69
+ {
70
+ float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f;
71
+
72
+ float4x4 scale =
73
+ float4x4(1.0 /scaling.x, 0. , 0. , 0.,
74
+ 0. , 1.0 /scaling.y , 0. , 0.,
75
+ 0. , 0. , 1.0, 0.,
76
+ translation.x , translation.y , 0.0, 1.);
77
+
78
+ float s = ::math::sin(rotation_rad);
79
+ float c = ::math::cos(rotation_rad);
80
+ float4x4 rotate =
81
+ float4x4( c , -s , 0.0 , 0.0,
82
+ s , c , 0.0 , 0.0,
83
+ 0.0, 0.0 , 1.0 , 0.0,
84
+ 0. , 0.0 , 0.0 , 1.);
85
+
86
+ return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space));
87
+ }
88
+
89
+ float remap_xy_to_0_1(float input, float x, float y)
90
+ {
91
+ return (input - x)/(y - x);
92
+ }
93
+
94
+ float histogram_scan(float input, float width, float position)
95
+ {
96
+ float low = ::math::clamp(1.0f - position * 2.0, 0.0f ,1.0f);
97
+ float high = ::math::clamp(position > 0.5f ? 1.0 : 2.0f - 2 * position, 0.0f, 1.0f);
98
+ //float center = (low + high)/2.0f);
99
+ float offset = ((high - low) / 2.0) * width;
100
+ low += offset;
101
+ high -= offset;
102
+ return ::math::clamp(
103
+ remap_xy_to_0_1(input,
104
+ low,
105
+ high),
106
+ 0.0,
107
+ 1.0);
108
+ }
109
+
110
+
111
+ float histogram_scan_big(float input, float width, float position)
112
+ {
113
+ return ::math::clamp(
114
+ remap_xy_to_0_1(input,
115
+ ::math::lerp(-width, 1.0, position),
116
+ ::math::lerp(0.0, 1.0 + width, position)),
117
+ 0.0,
118
+ 1.0);
119
+ }
120
+
121
+
122
+ float histogram_range(float input, float range, float position)
123
+ {
124
+ float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0);
125
+ float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0);
126
+ return ::math::lerp(low, high, input);
127
+ }
128
+
129
+
130
+
131
+ float uint2float(int x)
132
+ {
133
+ return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0);
134
+ }
135
+
136
+ int lowbias32(int x)
137
+ {
138
+ x ^= x >>> 16;
139
+ x *= 0x7feb352d;
140
+ x ^= x >>> 15;
141
+ x *= 0x846ca68b;
142
+ x ^= x >>> 16;
143
+ return x;
144
+ }
145
+
146
+ float2 rnd22(int2 p) {
147
+ float2 ret_val = float2(
148
+ uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f,
149
+ uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f
150
+ );
151
+ return ret_val;
152
+ }
153
+
154
+ float3 srgb2rgb(float3 val)
155
+ {
156
+ return ::math::pow(::math::max(val, float3(0.0f)), 2.2);
157
+ }
158
+
159
+ float2x2 invert_2x2(float2x2 M)
160
+ {
161
+ float det = M[0][0]*M[1][1] - M[0][1]*M[1][0];
162
+ //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/
163
+ return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]);
164
+ }
165
+
166
+ float3 nonrepeat_lookup(
167
+ uniform texture_2d texture = texture_2d(),
168
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
169
+ float texture_scale = 1.0,
170
+ float3 average_color = float3(0.5),
171
+ float patch_size = 8.0
172
+ )
173
+ {
174
+
175
+ float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale;
176
+ float Z = patch_size; // patch scale inside example texture
177
+ float CON = 1.0f;
178
+
179
+ float3 O = float3(0.f);
180
+ float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f);
181
+ float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space
182
+
183
+ float2 U = uv_in;
184
+ float2 V = M * uv_in; //pre-tilted hexa coordinates
185
+ int2 I = int2(::math::floor(V)); // hexa-tile id
186
+
187
+ // The mean color needs to be determined in Photoshop then to make the
188
+ // average color work out, take the float value and calculate the apropriate
189
+ // mean value as (value^(1/2.2))
190
+
191
+ float3 m = average_color;
192
+
193
+ float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W;
194
+ F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates
195
+
196
+ if( F[2] > 0.f )
197
+
198
+ O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON))
199
+ + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON))
200
+ + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON));
201
+ else
202
+ O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON))
203
+ + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON))
204
+ + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON));
205
+ O = m + O/::math::length(W);
206
+ O = ::math::clamp( (O), 0.0, 1.0);
207
+
208
+ return float3(O);
209
+ }
210
+
211
+ color endless_texture(
212
+ uniform texture_2d texture = texture_2d(),
213
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
214
+ float texture_scale = 10.0,
215
+ float3 average_color = float3(0.5, 0.5, 1.0),
216
+ float patch_size = 8.0,
217
+ bool gamma_correct_lookup = true
218
+ )
219
+ {
220
+ return gamma_correct_lookup ? color(srgb2rgb(
221
+ nonrepeat_lookup (
222
+ texture: texture,
223
+ uvw: uvw,
224
+ texture_scale: texture_scale,
225
+ average_color: average_color,
226
+ patch_size: patch_size
227
+ ))
228
+ ) : color(nonrepeat_lookup (
229
+ texture: texture,
230
+ uvw: uvw,
231
+ texture_scale: texture_scale,
232
+ average_color: average_color,
233
+ patch_size: patch_size
234
+ ));
235
+ }
236
+
237
+ float3 endless_normal(
238
+ uniform texture_2d texture = texture_2d(),
239
+ float factor = 1.0,
240
+ bool flip_tangent_u = false,
241
+ bool flip_tangent_v = false,
242
+ ::base::texture_coordinate_info uvw = ::base::coordinate_source(),
243
+ float texture_scale = 1.0,
244
+ float3 average_color = float3(0.5, 0.5, 1.0),
245
+ float patch_size = 8.0
246
+ )
247
+ {
248
+ float3 transformed_tangent_u = flip_tangent_u ? uvw.tangent_u : - uvw.tangent_u;
249
+ float3 transformed_tangent_v = flip_tangent_v ? uvw.tangent_v : - uvw.tangent_v;
250
+
251
+ if (flip_tangent_u)
252
+ transformed_tangent_u=-transformed_tangent_u;
253
+ if (flip_tangent_v)
254
+ transformed_tangent_v=-transformed_tangent_v;
255
+
256
+ // normalized Lookup
257
+ float3 tangent_space_normal =
258
+ (nonrepeat_lookup (
259
+ texture: texture,
260
+ uvw: uvw,
261
+ texture_scale: texture_scale,
262
+ average_color: average_color,
263
+ patch_size: patch_size
264
+ ) - 0.5) * (2.0 * factor);
265
+
266
+ return ::math::normalize(uvw.tangent_u * tangent_space_normal.x +
267
+ uvw.tangent_v * tangent_space_normal.y +
268
+ ::state::normal()*1.0);
269
+ }
270
+
271
+
272
+ export material OSB_Wood_Splattered(
273
+ uniform bool infinite_tiling = true [[
274
+ ::anno::description("Enables infinite tiling feature which removes repeating texture patterns. Note that depending on the material this feature changes the appearance of the material slightly."),
275
+ ::anno::display_name("Infinite Tiling"),
276
+ ::anno::in_group("Appearance")
277
+ ]],
278
+ color wood_tint = color(0.5f, 0.5f, 0.5f) [[
279
+ ::anno::description("Allows to adjusts the tint of the wood."),
280
+ ::anno::display_name("Wood Tint"),
281
+ ::anno::in_group("Appearance")
282
+ ]],
283
+ // float wood_brightness = 0.54f [[
284
+ // ::anno::description("Adjusts the lightness of the material."),
285
+ // ::anno::display_name("Brightness"),
286
+ // ::anno::in_group("Appearance"),
287
+ // ::anno::hard_range(0.f, 1.f)
288
+ // ]],
289
+ float roughness = 0.27f [[
290
+ ::anno::description("Adjusts the roughness of the surface. Higher values lead to blurrier reflections."),
291
+ ::anno::display_name("Roughness"),
292
+ ::anno::in_group("Appearance"),
293
+ ::anno::hard_range(0.f, 1.f)
294
+ ]],
295
+ uniform float wood_bump_strength = 1.f [[
296
+ ::anno::description("Adjusts the strength of the bump for the wood."),
297
+ ::anno::display_name("Wood Bump Strength"),
298
+ ::anno::in_group("Appearance"),
299
+ ::anno::soft_range(0.f, 1.f),
300
+ ::anno::hard_range(0.f, 3.f)
301
+ ]],
302
+ float splatter_amount = 0.55f [[
303
+ ::anno::description("Controls the amount of cement splatters on the osb wood."),
304
+ ::anno::display_name("Splatter Amount"),
305
+ ::anno::in_group("Appearance", "Splatter"),
306
+ ::anno::hard_range(0.f, 1.f)
307
+ ]],
308
+ uniform float splatter_bump_strength = 1.f [[
309
+ ::anno::description("Adjusts the strength of the bump of the splattered cement."),
310
+ ::anno::display_name("Splatter Bump Strength"),
311
+ ::anno::in_group("Appearance", "Splatter"),
312
+ ::anno::hard_range(0.f, 3.f),
313
+ ::anno::soft_range(0.f, 1.f)
314
+ ]],
315
+ float splatter_layer_opacity = 1.f [[
316
+ ::anno::description("Adjusts the transparency of the splatter layer."),
317
+ ::anno::display_name("Splatter Transparency"),
318
+ ::anno::in_group("Appearance", "Splatter"),
319
+ ::anno::hard_range(0.f, 1.f)
320
+ ]],
321
+ float splatter_brightness = 0.5f [[
322
+ ::anno::description("Adjusts the brightness of the splattered concrete."),
323
+ ::anno::display_name("Splatter Brightness"),
324
+ ::anno::in_group("Appearance", "Splatter"),
325
+ ::anno::hard_range(0.f, 1.f)
326
+ ]],
327
+ uniform float2 texture_translate = 0.f [[
328
+ ::anno::description("Controls the position of the texture."),
329
+ ::anno::display_name("Texture Translate"),
330
+ ::anno::in_group("Transform")
331
+ ]],
332
+ uniform float texture_rotate = 0.f [[
333
+ ::anno::description("Rotates angle of the texture in degrees."),
334
+ ::anno::display_name("Texture Rotate"),
335
+ ::anno::in_group("Transform"),
336
+ ::anno::soft_range(-360.f, 360.f)
337
+ ]],
338
+ uniform float2 texture_scale = 1.f [[
339
+ ::anno::description("Larger numbers increase the size."),
340
+ ::anno::display_name("Texture Scale"),
341
+ ::nvidia::core_definitions::dimension(float2(1.0, 1.0)),
342
+ ::anno::in_group("Transform")
343
+ ]],
344
+ uniform bool round_corners_enable = false [[
345
+ ::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."),
346
+ ::anno::display_name("Round Corners"),
347
+ ::anno::in_group("Round Corners")
348
+ ]],
349
+ uniform float round_corners_radius_mm = 2.5f [[
350
+ ::anno::description("Radius of the rounded corners in mm."),
351
+ ::anno::display_name("Radius"),
352
+ ::anno::in_group("Round Corners"),
353
+ ::anno::soft_range(0.f, 10.f)
354
+ ]],
355
+ uniform bool round_corners_across_materials = false [[
356
+ ::anno::description("Applies the round corner effect across different materials when enabled."),
357
+ ::anno::display_name("Across Materials"),
358
+ ::anno::in_group("Round Corners")
359
+ ]],
360
+ uniform int uv_space_index = 0 [[
361
+ ::anno::description("Uses selected UV space for material."),
362
+ ::anno::display_name("UV Space Index"),
363
+ ::anno::in_group("Advanced")
364
+ ]]
365
+ )
366
+ [[
367
+ ::anno::description("An OSB Wood material with splattered cement on top. OSB wood is composited from compressed wood strands, suitable for load-bearing constructions."),
368
+ ::anno::in_group("Wood"),
369
+ ::anno::display_name("OSB Wood Splattered"),
370
+ ::anno::copyright_notice(COPYRIGHT),
371
+ ::anno::thumbnail("./.thumbs/OSB_Wood_Splattered.OSB_Wood_Splattered.png"),
372
+ ::anno::key_words(string[]("wood", "OSB", "board", "infinite tiling", "particle", "construction", "wall", "interior", "exterior", "bumped", "dirty", "dirt", "splatter", "worn", "old", "rough", "brown")),
373
+ ::anno::author("NVIDIA vMaterials"),
374
+ ::anno::contributor("Ruediger Raab"),
375
+ ::anno::contributor("Maik Rohland")
376
+ ]]
377
+ =
378
+ let {
379
+ float wood_brightness = 0.54f;
380
+
381
+ material_surface tmp1(::df::custom_curve_layer(0.03f, 1.f, 5.f, histogram_scan(float3(infinite_tiling ? endless_texture(texture_2d("./osb_wood_R_rough_G_ao_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.73999977f, float3(0.62f, 0.89f, 0.f), 4.73999977f, false) : ::base::file_texture(texture_2d("./osb_wood_R_rough_G_ao_B_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.719999969f, 0.209999993f), ::df::microfacet_ggx_smith_bsdf(::math::lerp(::math::min(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./osb_wood_R_rough_G_ao_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.73999977f, float3(0.620000005f, 0.898000002f, 0.f), 4.73999977f, false) : ::base::file_texture(texture_2d("./osb_wood_R_rough_G_ao_B_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, roughness * 0.300000012f + 0.400000006f), histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./osb_wood_R_rough_G_ao_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.73999977f, float3(0.620000005f, 0.898000002f, 0.f), 4.73999977f, false) : ::base::file_texture(texture_2d("./osb_wood_R_rough_G_ao_B_rough.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], roughness * 0.0599999987f + 0.200000003f, roughness * 0.270000011f + 0.430000007f)), 0.789999962f, ::math::lerp(::math::lerp(0.f, histogram_scan_big(infinite_tiling ? float3(endless_texture(texture_2d("./splatter_splatter_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.73999977f, float3(0.172999993f), 4.73999977f, true))[0] : ::base::file_texture(texture_2d("./splatter_splatter_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.159999996f, ::math::lerp(0.810000002f, 0.150000006f, splatter_amount)), splatter_layer_opacity), histogram_scan_big(infinite_tiling ? float3(endless_texture(texture_2d("./splatter_splatter_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.73999977f, float3(0.172999993f), 4.73999977f, true))[0] : ::base::file_texture(texture_2d("./splatter_splatter_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.159999996f, ::math::lerp(0.810000002f, 0.150000006f, splatter_amount)), 0.25f)) * ::math::lerp(::math::min(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./osb_wood_R_rough_G_ao_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.73999977f, float3(0.620000005f, 0.898000002f, 0.f), 4.73999977f, false) : ::base::file_texture(texture_2d("./osb_wood_R_rough_G_ao_B_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, roughness * 0.300000012f + 0.400000006f), histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./osb_wood_R_rough_G_ao_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.73999977f, float3(0.620000005f, 0.898000002f, 0.f), 4.73999977f, false) : ::base::file_texture(texture_2d("./osb_wood_R_rough_G_ao_B_rough.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], roughness * 0.0599999987f + 0.200000003f, roughness * 0.270000011f + 0.430000007f)), 0.789999962f, ::math::lerp(::math::lerp(0.f, histogram_scan_big(infinite_tiling ? float3(endless_texture(texture_2d("./splatter_splatter_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.73999977f, float3(0.172999993f), 4.73999977f, true))[0] : ::base::file_texture(texture_2d("./splatter_splatter_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.159999996f, ::math::lerp(0.810000002f, 0.150000006f, splatter_amount)), splatter_layer_opacity), histogram_scan_big(infinite_tiling ? float3(endless_texture(texture_2d("./splatter_splatter_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.73999977f, float3(0.172999993f), 4.73999977f, true))[0] : ::base::file_texture(texture_2d("./splatter_splatter_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.159999996f, ::math::lerp(0.810000002f, 0.150000006f, splatter_amount)), 0.25f)), ::math::lerp(::math::min(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./osb_wood_R_rough_G_ao_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.73999977f, float3(0.620000005f, 0.898000002f, 0.f), 4.73999977f, false) : ::base::file_texture(texture_2d("./osb_wood_R_rough_G_ao_B_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, roughness * 0.300000012f + 0.400000006f), histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./osb_wood_R_rough_G_ao_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.73999977f, float3(0.620000005f, 0.898000002f, 0.f), 4.73999977f, false) : ::base::file_texture(texture_2d("./osb_wood_R_rough_G_ao_B_rough.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], roughness * 0.0599999987f + 0.200000003f, roughness * 0.270000011f + 0.430000007f)), 0.789999962f, ::math::lerp(::math::lerp(0.f, histogram_scan_big(infinite_tiling ? float3(endless_texture(texture_2d("./splatter_splatter_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.73999977f, float3(0.172999993f), 4.73999977f, true))[0] : ::base::file_texture(texture_2d("./splatter_splatter_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.159999996f, ::math::lerp(0.810000002f, 0.150000006f, splatter_amount)), splatter_layer_opacity), histogram_scan_big(infinite_tiling ? float3(endless_texture(texture_2d("./splatter_splatter_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.73999977f, float3(0.172999993f), 4.73999977f, true))[0] : ::base::file_texture(texture_2d("./splatter_splatter_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.159999996f, ::math::lerp(0.810000002f, 0.150000006f, splatter_amount)), 0.25f)) * ::math::lerp(::math::min(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./osb_wood_R_rough_G_ao_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.73999977f, float3(0.620000005f, 0.898000002f, 0.f), 4.73999977f, false) : ::base::file_texture(texture_2d("./osb_wood_R_rough_G_ao_B_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, roughness * 0.300000012f + 0.400000006f), histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./osb_wood_R_rough_G_ao_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.73999977f, float3(0.620000005f, 0.898000002f, 0.f), 4.73999977f, false) : ::base::file_texture(texture_2d("./osb_wood_R_rough_G_ao_B_rough.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], roughness * 0.0599999987f + 0.200000003f, roughness * 0.270000011f + 0.430000007f)), 0.789999962f, ::math::lerp(::math::lerp(0.f, histogram_scan_big(infinite_tiling ? float3(endless_texture(texture_2d("./splatter_splatter_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.73999977f, float3(0.172999993f), 4.73999977f, true))[0] : ::base::file_texture(texture_2d("./splatter_splatter_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.159999996f, ::math::lerp(0.810000002f, 0.150000006f, splatter_amount)), splatter_layer_opacity), histogram_scan_big(infinite_tiling ? float3(endless_texture(texture_2d("./splatter_splatter_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.73999977f, float3(0.172999993f), 4.73999977f, true))[0] : ::base::file_texture(texture_2d("./splatter_splatter_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.159999996f, ::math::lerp(0.810000002f, 0.150000006f, splatter_amount)), 0.25f)), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(infinite_tiling ? endless_texture(texture_2d("./osb_wood_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.73999977f, float3(0.728999972f, 0.481999993f, 0.282000005f), 4.73999977f, true) : ::base::file_texture(texture_2d("./osb_wood_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, ::base::file_texture(texture_2d("./concrete_diff.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), ::math::lerp(color(0.74841398f, 0.74841398f, 0.74841398f), color(splatter_brightness * 0.699999988f + 0.300000012f), ::math::max(0.199999988f, ::math::pow(infinite_tiling ? float3(endless_texture(texture_2d("./splatter_splatter_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.73999977f, float3(0.172999993f), 4.73999977f, true))[0] : ::base::file_texture(texture_2d("./splatter_splatter_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 1.36000001f))), ::base::mono_alpha, vmat_transform(0.f, 0.f, texture_scale * 0.5f, ::base::texture_coordinate_uvw, 0), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, ::base::color_layer_blend, ::math::lerp(0.f, histogram_scan_big(infinite_tiling ? float3(endless_texture(texture_2d("./splatter_splatter_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.73999977f, float3(0.172999993f), 4.73999977f, true))[0] : ::base::file_texture(texture_2d("./splatter_splatter_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.159999996f, ::math::lerp(0.810000002f, 0.150000006f, splatter_amount)), splatter_layer_opacity)).tint, color(0.f, 0.f, 0.f), ::base::color_layer_multiply, wood_brightness * -0.300000012f + 0.300000012f).tint, wood_tint, ::base::color_layer_overlay, 1.f).tint, 0.f, ""), bsdf(), ::math::normalize(::math::lerp(infinite_tiling ? endless_normal(texture_2d("./osb_wood_norm.jpg", ::tex::gamma_linear), wood_bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.73999977f, float3(0.486000001f, 0.501999974f, 0.987999976f), 4.73999977f) : ::base::tangent_space_normal_texture(texture_2d("./osb_wood_norm.jpg", ::tex::gamma_linear), wood_bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f), infinite_tiling ? endless_normal(texture_2d("./splatter_splatter_norm.jpg", ::tex::gamma_linear), splatter_bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.73999977f, float3(0.486000001f, 0.501999974f, 0.987999976f), 4.73999977f) : ::base::tangent_space_normal_texture(texture_2d("./splatter_splatter_norm.jpg", ::tex::gamma_linear), splatter_bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f), ::math::lerp(0.f, histogram_scan_big(infinite_tiling ? float3(endless_texture(texture_2d("./splatter_splatter_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.73999977f, float3(0.172999993f), 4.73999977f, true))[0] : ::base::file_texture(texture_2d("./splatter_splatter_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.159999996f, ::math::lerp(0.810000002f, 0.150000006f, splatter_amount)), splatter_layer_opacity)))), ::math::normalize(::math::lerp(infinite_tiling ? endless_normal(texture_2d("./osb_wood_norm.jpg", ::tex::gamma_linear), wood_bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.73999977f, float3(0.486000001f, 0.501999974f, 0.987999976f), 4.73999977f) : ::base::tangent_space_normal_texture(texture_2d("./osb_wood_norm.jpg", ::tex::gamma_linear), wood_bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f), infinite_tiling ? endless_normal(texture_2d("./splatter_splatter_norm.jpg", ::tex::gamma_linear), splatter_bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.73999977f, float3(0.486000001f, 0.501999974f, 0.987999976f), 4.73999977f) : ::base::tangent_space_normal_texture(texture_2d("./splatter_splatter_norm.jpg", ::tex::gamma_linear), splatter_bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f), ::math::lerp(0.f, histogram_scan_big(infinite_tiling ? float3(endless_texture(texture_2d("./splatter_splatter_mask.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.73999977f, float3(0.172999993f), 4.73999977f, true))[0] : ::base::file_texture(texture_2d("./splatter_splatter_mask.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, 0.159999996f, ::math::lerp(0.810000002f, 0.150000006f, splatter_amount)), splatter_layer_opacity)))), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
382
+ material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
383
+ color tmp3 = color(1.f, 1.f, 1.f);
384
+ 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));
385
+ material_geometry tmp5(float3(0.f), 1.f, round_corners_enable ? ::state::rounded_corner_normal(round_corners_radius_mm * 0.00100000005f, round_corners_across_materials, 1.f) : ::state::normal());
386
+ } in
387
+ material(
388
+ thin_walled: false,
389
+ surface: tmp1,
390
+ backface: tmp2,
391
+ ior: tmp3,
392
+ volume: tmp4,
393
+ geometry: tmp5);
394
+
395
+ export material OSB_Wood_Splattered_Dense(*)
396
+ [[
397
+ ::anno::description("An OSB Wood material with splattered cement on top. OSB wood is composited from compressed wood strands, suitable for load-bearing constructions."),
398
+ ::anno::in_group("Wood"),
399
+ ::anno::display_name("OSB Wood Dense Splattered"),
400
+ ::anno::copyright_notice(COPYRIGHT),
401
+ ::anno::thumbnail("./.thumbs/OSB_Wood_Splattered.OSB_Wood_Splattered_Dense.png"),
402
+ ::anno::key_words(string[]("wood", "OSB", "board", "infinite tiling", "particle", "construction", "wall", "interior", "exterior", "bumped", "dirty", "dirt", "splatter", "worn", "old", "rough", "brown")),
403
+ ::anno::author("NVIDIA vMaterials"),
404
+ ::anno::contributor("Ruediger Raab"),
405
+ ::anno::contributor("Maik Rohland")
406
+ ]] = OSB_Wood_Splattered
407
+ (
408
+ infinite_tiling: true,
409
+ wood_tint: color(0.5f, 0.5f, 0.5f),
410
+ roughness: 0.7f,
411
+ wood_bump_strength: 1.0f,
412
+ splatter_amount: 1.0f,
413
+ splatter_bump_strength: 1.0f,
414
+ splatter_layer_opacity: 1.0f,
415
+ splatter_brightness: 0.5f,
416
+ texture_translate: 0.0f,
417
+ texture_rotate: 0.0f,
418
+ texture_scale: 1.0f,
419
+ round_corners_enable: false,
420
+ round_corners_radius_mm: 2.5f,
421
+ round_corners_across_materials: false,
422
+ uv_space_index: 0
423
+ );
Material/material_0569/Wood_Tiles_Pine_Multicolor.mdl ADDED
@@ -0,0 +1,1591 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2024 NVIDIA Corporation. All rights reserved.
3
+ ******************************************************************************
4
+
5
+ Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge,
6
+ to any person obtaining a copy of the sample definition code that uses our
7
+ Material Definition Language (the "MDL Materials"), to reproduce and distribute
8
+ the MDL Materials, including without limitation the rights to use, copy, merge,
9
+ publish, distribute, and sell modified and unmodified copies of the MDL
10
+ Materials, and to permit persons to whom the MDL Materials is furnished to do
11
+ so, in all cases solely for use with NVIDIA's Material Definition Language,
12
+ subject to the following further conditions:
13
+
14
+ 1. The above copyright notices, this list of conditions, and the disclaimer
15
+ that follows shall be retained in all copies of one or more of the MDL
16
+ Materials, including in any software with which the MDL Materials are bundled,
17
+ redistributed, and/or sold, and included either as stand-alone text files,
18
+ human-readable headers or in the appropriate machine-readable metadata fields
19
+ within text or binary files as long as those fields can be easily viewed by the
20
+ user, as applicable.
21
+ 2. The name of NVIDIA shall not be used to promote, endorse or advertise any
22
+ Modified Version without specific prior written permission, except a) to comply
23
+ with the notice requirements otherwise contained herein; or b) to acknowledge
24
+ the contribution(s) of NVIDIA.
25
+
26
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
27
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
28
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
29
+ TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR
30
+ ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL,
31
+ INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF
32
+ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE
33
+ THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.
34
+ */
35
+
36
+
37
+ mdl 1.5;
38
+
39
+ import ::anno::*;
40
+ import ::base::*;
41
+ import ::df::*;
42
+ import ::math::*;
43
+ import ::state::*;
44
+ import ::tex::*;
45
+ import ::nvidia::core_definitions::blend_colors;
46
+ import ::nvidia::core_definitions::dimension;
47
+
48
+
49
+ const string COPYRIGHT =
50
+ " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
51
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
52
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
53
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
54
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
55
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
56
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
57
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
58
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
59
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
60
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
61
+
62
+ const string DESCRIPTION = "A wooden tile material with adjustments to produce a rich variety of wooden floor styles ranging from new to worn.";
63
+
64
+ annotation preview_scale( float f);
65
+
66
+ struct vm_coordinates{
67
+ float2 uv;
68
+ float rotation;
69
+ int uv_space_index;
70
+ float4 carry;
71
+ };
72
+
73
+ enum vm_mono_select
74
+ [[
75
+ anno::description("Modes for the creation of a gray-scale value from a color."),
76
+ anno::hidden()
77
+ ]]
78
+ {
79
+ mono_r = 0,
80
+ mono_g = 1,
81
+ mono_b = 2,
82
+ mono_a = 3,
83
+ mono_average = 4
84
+ };
85
+
86
+ vm_coordinates vm_coord
87
+ (
88
+ float2 translation = float2(0.0f, 0.0) [[
89
+ ::anno::display_name("Translation"),
90
+ ::anno::description("Translates the coordinates.")
91
+ ]],
92
+ float rotation = 0.0f [[
93
+ ::anno::display_name("Rotation"),
94
+ ::anno::description("Rotates the coordinates in degrees.")
95
+ ]],
96
+ float2 scaling = float2(1.0f, 1.0f) [[
97
+ ::anno::display_name("Scaling"),
98
+ ::anno::description("Scales the coordinates.")
99
+ ]],
100
+ uniform int uv_space = 0 [[
101
+ ::anno::display_name("UV Space"),
102
+ ::anno::description("Chose the UV space.")
103
+ ]]
104
+ )
105
+ [[
106
+ ::anno::display_name("vm Transform"),
107
+ ::anno::description("Generates coordinates to be used in vm_lookup functions.")
108
+ ]]
109
+ {
110
+ vm_coordinates uv;
111
+ ::base::texture_coordinate_info info = ::base::coordinate_source( ::base::texture_coordinate_uvw, uv_space);
112
+ uv.rotation = (rotation * 3.1415926535897932384626433832f) / 180.f;
113
+ uv.uv = float2(info.position.x, info.position.y);
114
+ float sine = ::math::sin(uv.rotation);
115
+ float cosine = ::math::cos(uv.rotation);
116
+ float2x2 rot = float2x2(cosine, -sine, sine, cosine);
117
+ uv.uv = rot * uv.uv;
118
+ uv.uv /= scaling;
119
+ uv.uv += translation;
120
+ // Translation before or after rotation?
121
+ return uv;
122
+ }
123
+
124
+ vm_coordinates vm_coord_post_scale(
125
+ vm_coordinates uv = vm_coord(),
126
+ float2 scale = 1.0f
127
+ )
128
+ {
129
+ uv.uv /= scale;
130
+ return uv;
131
+ }
132
+
133
+ ::base::texture_return vm_tex_lookup(
134
+ uniform texture_2d tex,
135
+ vm_coordinates uv = vm_coord(),
136
+ uniform vm_mono_select mono_source = mono_a,
137
+ float4 scale = float4(1.0f))
138
+ {
139
+ float mono;
140
+ float4 lookup = ::tex::lookup_float4(tex, uv.uv, ::tex::wrap_repeat, ::tex::wrap_repeat) * scale;
141
+ switch( mono_source ) {
142
+ case mono_r: mono = lookup.x;
143
+ break;
144
+ case mono_g: mono = lookup.y;
145
+ break;
146
+ case mono_b: mono = lookup.z;
147
+ break;
148
+ case mono_a: mono = lookup.w;
149
+ break;
150
+ case mono_average: mono = ::math::average(float3(lookup.x, lookup.y, lookup.z));
151
+ break;
152
+ }
153
+ return ::base::texture_return(color(lookup.x, lookup.y, lookup.z), mono);
154
+ }
155
+
156
+ float3 vm_tex_normal_lookup(
157
+ uniform texture_2d tex,
158
+ vm_coordinates uv = vm_coord(),
159
+ float strength = 1.0f
160
+ )
161
+ {
162
+ float rot = uv.rotation;
163
+ // Lookup and convert normal texture to -1 ... 1 range
164
+ float3 norm = (::tex::lookup_float3(tex, uv.uv, ::tex::wrap_repeat, ::tex::wrap_repeat) - float3(.5f)) * 2.0f;
165
+ norm = ::math::normalize(norm * float3(strength, strength, 1.0));
166
+ // if any rotation happened prior to the lookup, compensate for it
167
+ norm = float3(::math::cos(rot) * norm.x - ::math::sin(rot) * norm.y,
168
+ ::math::sin(rot) * norm.x + ::math::cos(rot) * norm.y,
169
+ norm.z);
170
+ return norm.x * ::state::texture_tangent_u(uv.uv_space_index) +
171
+ norm.y * ::state::texture_tangent_v(uv.uv_space_index) +
172
+ norm.z * ::state::normal();
173
+ }
174
+
175
+
176
+ // ----------------------------------------------------------------------------------------------------------------------
177
+
178
+
179
+ float histogram_range(float input, float range = 1.0f, float position = 0.5f)
180
+ {
181
+ float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0);
182
+ float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0);
183
+ return ::math::lerp(low, high, input);
184
+ }
185
+
186
+ float remap_xy_to_0_1(float input, float x, float y)
187
+ {
188
+ return (input - x)/(y - x);
189
+ }
190
+
191
+ float histogram_scan_big(float input, float width, float position)
192
+ {
193
+ return ::math::clamp(
194
+ remap_xy_to_0_1(input,
195
+ ::math::lerp(-width, 1.0, position),
196
+ ::math::lerp(0.0, 1.0 + width, position)),
197
+ 0.0,
198
+ 1.0);
199
+ }
200
+
201
+ // ********** Randomization functions -I- **********
202
+
203
+ int random(int seed = 0, int modulus = 65536, int multiplier = 1664525, int increment = 1013904223)
204
+ {
205
+ return (multiplier * seed + increment) % modulus;
206
+ }
207
+
208
+
209
+ // Returns the normal n in tangent space, given n is in internal space.
210
+ float3 transform_internal_to_tangent(float3 n)
211
+ [[
212
+ ::anno::hidden()
213
+ ]]
214
+ {
215
+ return
216
+ n.x* float3(::state::texture_tangent_u(0).x,::state::texture_tangent_v(0).x,::state::normal().x)+
217
+ n.y* float3(::state::texture_tangent_u(0).y,::state::texture_tangent_v(0).y,::state::normal().y)+
218
+ n.z* float3(::state::texture_tangent_u(0).z,::state::texture_tangent_v(0).z,::state::normal().z);
219
+ }
220
+
221
+ // Returns the normal n in internal space, given n is in tangent space.
222
+ float3 transform_tangent_to_internal(float3 n)
223
+ [[
224
+ ::anno::hidden()
225
+ ]]
226
+ {
227
+ return ::state::texture_tangent_u(0) * n.x +
228
+ ::state::texture_tangent_v(0) * n.y +
229
+ ::state::normal() * n.z ;
230
+ }
231
+
232
+
233
+
234
+ // Returns a normal by adding a detail normal to a global normal.
235
+ // If detail blending of two normal maps gives visual artifacts, check if texture_2d are loaded
236
+ // correctly with ::tex::gamma_linear
237
+ float3 add_detail_normal(float3 nd = ::state::normal(), float3 n = ::state::normal())
238
+ {
239
+ // http://blog.selfshadow.com/publications/blending-in-detail/
240
+ float3 n_t = transform_internal_to_tangent(n);
241
+ float3 nd_t = transform_internal_to_tangent(nd);
242
+
243
+ n_t=n_t + float3(0.,0.,1.);
244
+ nd_t = nd_t * float3(-1.,-1.,1.);
245
+
246
+ n = n_t*::math::dot(n_t, nd_t)/n_t.z - nd_t;
247
+ return ::math::normalize(transform_tangent_to_internal(n));
248
+ }
249
+
250
+
251
+ // For the rotated tangent I just used the code for the rotation of the tangent vector
252
+ // asselmbled from the former 'vmat_transform' and 'transform_coordinate_2' functions
253
+ float3 rotated_tangent(
254
+ float rotation = 0,
255
+ uniform int uv_space = 0
256
+ )
257
+ {
258
+ float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f;
259
+ float sin = ::math::sin(rotation_rad);
260
+ float cos = ::math::cos(rotation_rad);
261
+
262
+ ::base::texture_coordinate_info coord = ::base::coordinate_source(::base::texture_coordinate_uvw, uv_space);
263
+
264
+ return ::math::normalize(cos * coord.tangent_u - sin * coord.tangent_v);
265
+ }
266
+
267
+
268
+ // Returns 4 random IDs for a given pattern
269
+ float4 rand_tile_id(
270
+ vm_coordinates uv,
271
+ ::base::texture_return id_offset_map, // map containing the ID in r channel
272
+ //and the cell offset in g channel.
273
+ int seed = 0
274
+ )
275
+ [[
276
+ ::anno::noinline()
277
+ ]]
278
+ {
279
+ float4 ret_val;
280
+ int offset_x, offset_y;
281
+
282
+
283
+ float3 id_offset_map_2 = float3(id_offset_map.tint);
284
+ float offset_id = id_offset_map_2.y;
285
+ int rand_id = int(id_offset_map_2.x * 254.f); // the more logical value of 255 causes sometimes rendering artifacts
286
+ // with the random number generator. Setting it to 254 apparently fixes it
287
+
288
+ // Offset of overlapping tiles stored in G-channel
289
+ // [0 - 0.25[ : ( 0/ 0) Grayscale value: 0.1
290
+ // [0.25 - 0.5 [ : (-1/ 0) Grayscale value: 0.37
291
+ // [0.5 - 0.75[ : (-1/-1) Grayscale value: 0.62
292
+ // [0.75 - 1.0 [ : ( 0/-1) Grayscale value: 0.87
293
+
294
+ offset_x = offset_id < 0.25f ? 0 : (offset_id < .75f) ? 1 : 0;
295
+ offset_y = offset_id < 0.5 ? 0 : 1;
296
+
297
+ int2 cell_id = int2(int(::math::floor(uv.uv.x) - offset_x), int(::math::floor(uv.uv.y) - offset_y));
298
+
299
+ /* Using Linear congruential generator for pseudorandom numbers which is good enough */
300
+ int rand_val_0 = random(seed);
301
+ int rand_val_1 = random(rand_val_0 + rand_id + random(cell_id.x + random(cell_id.y)));
302
+ int rand_val_2 = random(rand_val_1);
303
+ int rand_val_3 = random(rand_val_2);
304
+ int rand_val_4 = random(rand_val_3);
305
+
306
+ ret_val = float4(rand_val_1, rand_val_2, rand_val_3, rand_val_4);
307
+
308
+ return float4(ret_val/65535.0f);
309
+ }
310
+
311
+
312
+ // ******************************************************************************************************
313
+ // Variation of the wood material which features another texture thats masks a secondary color
314
+ // Also the map includes a mask that prevents random color variations
315
+ export material Wood_Tiles_Pine_Multicolor(
316
+ int seed = 0 [[
317
+ ::anno::display_name("Randomization Seed"),
318
+ ::anno::description("Different seed values while causes different patterns of randomization on the tiles."),
319
+ ::anno::in_group("Randomization")
320
+ ]],
321
+ color wood_color = color(0.22424f, 0.67323f, 0.71724f) [[
322
+ ::anno::display_name("Color Tint"),
323
+ ::anno::description("Applies an overlay color to tint the wood. A grayscale value of 0.5 has no effect, "
324
+ "brighter values brighten it while darker colors will have a darkening effect."),
325
+ ::anno::in_group("Appearance")
326
+ ]],
327
+ color wood_secondary_color = color(0.59109f, 0.67586f, 0.22063f) [[
328
+ ::anno::description("Choose the secondary overlay color to tint the wood. A grayscale value of 0.5 has no effect, "
329
+ "brighter values brighten it while darker colors will have a darkening effect."),
330
+ ::anno::display_name("Secondary Color Tint"),
331
+ ::anno::in_group("Appearance")
332
+ ]],
333
+ float age_dirt = 0.4f [[
334
+ ::anno::display_name("Age Dirt"),
335
+ ::anno::description("Adds dark dirt spots on top of the surface to create the appearance of a somewhat aged surface."),
336
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
337
+ ::anno::enable_if("coating_reflectivity > 0.0f"),
338
+ ::anno::hard_range(0.f, 1.f)
339
+ ]],
340
+ uniform float wood_bump_strength = 0.4f // Determines the degree of bumpiness"),
341
+ [[
342
+ ::anno::display_name("Wood Bump Strength"),
343
+ ::anno::description("Adjusts the strength of the wood bump map."),
344
+ ::anno::in_group("Appearance"),
345
+ ::anno::hard_range(0.f, 2.f)
346
+ ]],
347
+ float floor_brightness = 0.8f [[
348
+ ::anno::description("Adjusts the general brightness of the wood."),
349
+ ::anno::display_name("Wood Brightness"),
350
+ ::anno::in_group("Appearance", "Tiles"),
351
+ ::anno::hard_range(0.f, 1.f)
352
+ ]],
353
+ float wood_brightness_variation = 0.5f [[
354
+ ::anno::display_name("Wood Brightness Variation"),
355
+ ::anno::description("Randomly darkens the tiles of the floor."),
356
+ ::anno::in_group("Appearance", "Tiles"),
357
+ ::anno::hard_range(0.f, 1.f)
358
+ ]],
359
+ float wood_random_rotation = 0.015f [[
360
+ ::anno::display_name("Wood Random Rotation"),
361
+ ::anno::description("Adds a random rotation around the main wood tile alignment direction."),
362
+ ::anno::in_group("Appearance", "Tiles"),
363
+ ::anno::hard_range(0.f, 1.f)
364
+ ]],
365
+
366
+ float2 wood_scale = 1.4f [[
367
+ ::anno::description("Sets the size of the wood relative to the tiles pattern. Larger numbers increase the size of the wood texture within the tiles."),
368
+ ::anno::display_name("Wood Scale"),
369
+ ::anno::in_group("Appearance", "Tiles"),
370
+ ::anno::soft_range(0.0f, 2.0f)
371
+ ]],
372
+
373
+
374
+ uniform float tiles_bump_strength = 0.3f [[
375
+ ::anno::description("Determines the degree of bumpiness of the tiles texture (grooves and bent tiles)."),
376
+ ::anno::display_name("Tiles Bump Strength"),
377
+ ::anno::in_group("Appearance", "Tiles"),
378
+ ::anno::hard_range(0.f, 1.f)
379
+ ]],
380
+ float tiles_random_slope_orientation = 0.15f [[
381
+ ::anno::display_name("Tiles Random Slope Orientation"),
382
+ ::anno::description("Makes tiles individual tiles to appear tilted in random directions. Good for old floors and to take away too perfect appearing tiled floors."),
383
+ ::anno::in_group("Appearance", "Tiles"),
384
+ ::anno::hard_range(0.f, 1.f)
385
+ ]],
386
+ float gaps_brightness = 0.3f [[
387
+ ::anno::display_name("Grout Brightness"),
388
+ ::anno::description("Adjusts the brightness and roughness of the gaps between the tiles."),
389
+ ::anno::in_group("Appearance", "Tiles"),
390
+ ::anno::hard_range(0.f, 1.f)
391
+ ]],
392
+ float tiles_base_roughness = 0.45f [[
393
+ ::anno::description("Adjusts the roughness of the coating. Higher value leading to blurrier and softer reflections."),
394
+ ::anno::display_name("Coating Roughness"),
395
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
396
+ ::anno::enable_if("coating_reflectivity > 0.0f"),
397
+ ::anno::hard_range(0.f, 1.f)
398
+ ]],
399
+ float base_roughness_range = 0.6f [[
400
+ ::anno::description("Applies roughness variation to the coating, introducing signs of wear such as footprints and smudges."),
401
+ ::anno::display_name("Coating Roughness Variation"),
402
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
403
+ ::anno::enable_if("coating_reflectivity > 0.0f"),
404
+ ::anno::hard_range(0.f, 1.f)
405
+ ]],
406
+ uniform float tiles_orange_peel_bump_factor = 0.1f [[
407
+ ::anno::display_name("Coating Unevenness"),
408
+ ::anno::description("Applies an unevenness to the clear coat layer akin to orange peel."),
409
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
410
+ ::anno::enable_if("coating_reflectivity > 0.0f"),
411
+ ::anno::hard_range(0.f, 1.f)
412
+ ]],
413
+ float coating_reflectivity = 1.f [[
414
+ ::anno::display_name("Coating Reflectivity"),
415
+ ::anno::description("The overall reflectivity of the clearcoat layer. Note that other parameters will show no effect when the clearcoat reflectivity is 0."),
416
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
417
+ ::anno::hard_range(0.f, 1.f)
418
+ ]],
419
+
420
+ float dirt_and_spots_amount = 0.3f [[
421
+ ::anno::description("Adds random dirt and spots on top of the surface which adds variation to the clearcoat roughness."),
422
+ ::anno::display_name("Dirt and Spots"),
423
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
424
+ ::anno::enable_if("coating_reflectivity > 0.0f"),
425
+ ::anno::hard_range(0.f, 1.f)
426
+ ]],
427
+ float edgewear_roughness_amount = 0.2f [[
428
+ ::anno::description("Adds edgewear around the tile borders which results in a more worn and rough look of the clearcoat."),
429
+ ::anno::display_name("Edgewear Roughness Amount"),
430
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
431
+ ::anno::enable_if("coating_reflectivity > 0.0f"),
432
+ ::anno::hard_range(0.f, 1.f)
433
+ ]],
434
+
435
+ //-----------------------------------------------
436
+
437
+ float2 texture_translate = 0.f [[
438
+ ::anno::display_name("Texture Translate"),
439
+ ::anno::description("Controls the position of the texture."),
440
+ ::anno::in_group("Transform")
441
+ ]],
442
+ float texture_rotate = 0.f [[
443
+ ::anno::display_name("Texture Rotate"),
444
+ ::anno::description("Rotates angle of the texture in degrees."),
445
+ ::anno::in_group("Transform")
446
+ ]],
447
+ float2 texture_scale = 1.0f [[
448
+ ::anno::display_name("Texture Scale"),
449
+ ::anno::description("Larger numbers increase the size."),
450
+ ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)),
451
+ ::anno::in_group("Transform")
452
+ ]],
453
+ uniform int uv_space_index = 0 [[
454
+ ::anno::display_name("UV Space Index"),
455
+ ::anno::description("Uses selected UV space for material."),
456
+ ::anno::in_group("Transform")
457
+ ]],
458
+ uniform bool round_corners = false [[
459
+ ::anno::display_name("Round Corners"),
460
+ ::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."),
461
+ ::anno::in_group("Round Corners")
462
+ ]],
463
+ uniform float roundcorner_radius_mm = 1.5f [[
464
+ ::anno::display_name("Radius (mm)"),
465
+ ::anno::description("Radius of the rounded corners in millimeters."),
466
+ ::anno::in_group("Round Corners"),
467
+ ::anno::soft_range(0.f, 10.f)
468
+ ]],
469
+ uniform bool across_materials = false [[
470
+ ::anno::display_name("Across Materials"),
471
+ ::anno::description("Applies the round corner effect across different materials when enabled."),
472
+ ::anno::in_group("Round Corners")
473
+ ]],
474
+
475
+ // WOOD Highlights (Not accessible to regular users)
476
+ uniform bool preview_wood_highlights = false
477
+ [[
478
+ ::anno::display_name("Preview Wood Specular"),
479
+ ::anno::description("Enables previewing of the wood specular highlights for tweaking."),
480
+ ::anno::in_group("Advanced", "Wood Highlight")
481
+ ]], // just previews the highlights of the wood material
482
+ float isotropic_roughness = 0.377f // The average roughness value of the isotropic highlight. When roughness variation is applied, the variation will go above and below those values.")
483
+ [[
484
+ ::anno::display_name("Isotropic Roughness"),
485
+ ::anno::description("Sets the roughness of the isotropic component of the wood reflection."),
486
+ ::anno::hard_range(0.f, 1.f),
487
+ ::anno::in_group("Advanced", "Wood Highlight")
488
+ ]],
489
+ float isotropic_roughness_range = 0.689f // Adjusts the range of variation being applied to the isotropic highlight, a value of zero has no effect at all whereas 1 produces the most variation")
490
+ [[
491
+ ::anno::display_name("Isotropic Roughness Range"),
492
+ ::anno::description("Sets the degree roughness variation around the isotropic highlight."),
493
+ ::anno::hard_range(0.f, 1.f),
494
+ ::anno::in_group("Advanced", "Wood Highlight")
495
+ ]],
496
+ float isotropic_specular_brightness = 1.0f // Sets how strong the isotropic specular highlight appears
497
+ [[
498
+ ::anno::display_name("Isotropic Highlight Brightness"),
499
+ ::anno::description("Sets the brightness of the isotropic wood highlight."),
500
+ ::anno::hard_range(0.f, 1.f),
501
+ ::anno::in_group("Advanced", "Wood Highlight")
502
+ ]],
503
+ float wood_specular_level = 1.f // Adjusts the specular level (PBR Style)
504
+ [[
505
+ ::anno::display_name("Wood Specular Level"),
506
+ ::anno::description("Adjusts the falloff of the wood highlights."),
507
+ ::anno::hard_range(0.f, 1.f),
508
+ ::anno::in_group("Advanced", "Wood Highlight")
509
+ ]],
510
+ float aniso_attenuation = 0.393f //Attenuates the the anisotropic highlight using a texture. Use the preview for exclusively previewing the wood hightligghts for properly adjusting this term"
511
+ [[
512
+ ::anno::display_name("Anisotropic Attenuation"),
513
+ ::anno::description("Breaks up the reflection of the anisotropic highlight."),
514
+ ::anno::hard_range(0.f, 1.f),
515
+ ::anno::in_group("Advanced", "Wood Highlight")
516
+ ]],
517
+ float aniso_bsdf_width = 0.459f //Controls the width of the anisotropic highlight"
518
+ [[
519
+ ::anno::display_name("Anisotropic Width"),
520
+ ::anno::description("Adjusts the width of the anisotropic wood highlight."),
521
+ ::anno::hard_range(0.f, 1.f),
522
+ ::anno::in_group("Advanced", "Wood Highlight")
523
+ ]],
524
+ float aniso_bsdf_height = 0.680f //Controls the height of the anisotropic highlight"
525
+ [[
526
+ ::anno::display_name("Anisotropic Height"),
527
+ ::anno::description("Adjusts the height of the anisotropic highlight."),
528
+ ::anno::hard_range(0.f, 1.f),
529
+ ::anno::in_group("Advanced", "Wood Highlight")
530
+ ]],
531
+ float anisotropic_isotropic_balance = 0.607f // Balances the Anisotropic vs. the isotropic wood highlight"
532
+ [[
533
+ ::anno::display_name("Anisotropic - Isotropic Balance"),
534
+ ::anno::description("Blends between the contribution of isotropic and anisotropic highlight."),
535
+ ::anno::hard_range(0.f, 1.f),
536
+ ::anno::in_group("Advanced", "Wood Highlight")
537
+ ]],
538
+
539
+ // ------------------ TEXTURES (Not accessible to regular users) ------------------
540
+ // Diffuse
541
+ uniform texture_2d tex_srgb_wood_color = texture_2d("./pine_diff.jpg", ::tex::gamma_srgb)
542
+ [[
543
+ ::anno::display_name("Diffuse Wood Texture"),
544
+ ::anno::description("The diffuse wood texture used to cover the tiles (srgb)."),
545
+ ::anno::in_group("Advanced", "Textures")
546
+ ]],
547
+ // Anisotropic Roughness AKA "Rough Detail"
548
+ uniform texture_2d tex_lin_wood_rough_detail = texture_2d("./pine_rough_detail.jpg", ::tex::gamma_linear)
549
+ [[
550
+ ::anno::display_name("Anisotropic Variation Texture"),
551
+ ::anno::description("Texture to add variation to the anisotropic reflections of the wood (linear space)."),
552
+ ::anno::in_group("Advanced", "Textures")
553
+ ]],
554
+ // Isotropic Roughness AKA "Rough Grain"
555
+ uniform texture_2d tex_lin_wood_rough_grain = texture_2d("./pine_rough_grain.jpg", ::tex::gamma_linear)
556
+ [[
557
+ ::anno::display_name("Isotropic Variation Texture"),
558
+ ::anno::description("Texture to add variation to the isotropic reflections of the wood (linear space)."),
559
+ ::anno::in_group("Advanced", "Textures")
560
+ ]],
561
+ // Wood detail Normal - Grain & Structure
562
+ uniform texture_2d tex_lin_wood_detail_norm = texture_2d("./pine_norm.jpg", ::tex::gamma_linear)
563
+ [[
564
+ ::anno::display_name("Wood Normal Texture"),
565
+ ::anno::description("Tangent Space Normal texture for defining the bumpiness of the wood."),
566
+ ::anno::in_group("Advanced", "Textures")
567
+ ]],
568
+ // Tiles ID, Offset & Rotation
569
+ uniform texture_2d tex_lin_tiles_id_offset_rotation = texture_2d("./melbury_R_id_G_offset_B_rotation.png", ::tex::gamma_linear)
570
+ [[
571
+ ::anno::display_name("Tiles ID - Offset - Rotation Texture"),
572
+ ::anno::description("Texture that holds information about the wood tiles needed to create the wood tiles effect. R - Tiles ID, G - Tiles offset, B - Tiles Rotation (linear space)."),
573
+ ::anno::in_group("Advanced", "Textures")
574
+ ]],
575
+ // Edgewear, Gaps(AO), Gaps Roughnesss
576
+ uniform texture_2d tex_lin_tiles_edgewear_gaps_gapsrough= texture_2d("./melbury_R_edgewear_G_gaps_B_gaps_rough.jpg", ::tex::gamma_linear)
577
+ [[
578
+ ::anno::display_name("Edgewear - Gaps - Gap Rough"),
579
+ ::anno::description("Texture that holds maps for the edgewear roughness, the tile gaps and the gaps roughness (linear space)."),
580
+ ::anno::in_group("Advanced", "Textures")
581
+ ]],
582
+ // Tiles Normal (Grout and Bend)
583
+ uniform texture_2d tex_lin_tiles_normal = texture_2d("./melbury_norm.jpg", ::tex::gamma_linear)
584
+ [[
585
+ ::anno::display_name("Tiles Normal Texture"),
586
+ ::anno::description("Texture that holds the normal map for the tiles (linear space)."),
587
+ ::anno::in_group("Advanced", "Textures")
588
+ ]],
589
+ // Secondary color (grayscale) mask, randomization mask
590
+ uniform texture_2d tex_lin_tiles_R_2nd_col_G_randmask = texture_2d("./melbury_R_2ndcol_G_randmask.png", ::tex::gamma_linear)
591
+ [[
592
+ ::anno::display_name("2nd Color - Random Mask"),
593
+ ::anno::description("Texture that holds maps for blending with the secondary color and a color randomization mask that specifies in which area brightness randomization should occur (linear space)."),
594
+ ::anno::in_group("Advanced", "Textures")
595
+ ]],
596
+ // Tiles Roughness, Dents and Spots
597
+ uniform texture_2d tex_lin_tiles_rough_dents_spots = texture_2d("./tiles_wood_R_rough_G_dents_B_spots.jpg", ::tex::gamma_linear)
598
+ [[
599
+ ::anno::display_name("Tiles Rough - Dents - Spots"),
600
+ ::anno::description("Texture that contains maps for the tiles roughness, dents and spots which is a roughness effect applied to the wood coating layer (linear space)."),
601
+ ::anno::in_group("Advanced", "Textures")
602
+ ]],
603
+ // Tiles orange Peel
604
+ uniform texture_2d tex_lin_tiles_orange_peel = texture_2d("./tiles_wood_orangepeel_norm.jpg", ::tex::gamma_linear)
605
+ [[
606
+ ::anno::display_name("Tiles Orange Peel"),
607
+ ::anno::description("Tangent Space Normal texture for the orange peel which is applied to the coating of the tiles."),
608
+ ::anno::in_group("Advanced", "Textures")
609
+ ]]
610
+
611
+ )
612
+ [[
613
+ ::anno::author("NVIDIA vMaterials"),
614
+ ::anno::display_name("Wood Tiles Pine - Multicolor Master"),
615
+ ::anno::description("Master template material. This material should be hidden."
616
+ "If you see this material, the integration is not hiding it correctly."),
617
+ // reflective, varnished, bumped, matte, natural, stained, exterior, new, aged, decayed, abstract, modern, classic
618
+ ::anno::key_words(string[]("wood", "pine", "master", "tiles", "tiled", "pattern", "decorative", "multimaterial", "multicolor", "organic", "natural", "coated", "infinite tiling", "architecture", "interior")),
619
+ ::anno::thumbnail("./.thumbs/Wood_Tiles_Pine_Multicolor.Wood_Tiles_Pine_Multicolor.png"),
620
+ ::anno::copyright_notice(COPYRIGHT),
621
+ ::anno::hidden()
622
+ ]]
623
+ =
624
+ let {
625
+ /*
626
+ texture_2d tex_srgb_wood_color = texture_2d("./pine_diff.jpg", ::tex::gamma_srgb); // Diffuse
627
+ texture_2d tex_lin_wood_rough_detail = texture_2d("./pine_rough_detail.jpg", ::tex::gamma_linear); // Anisotropic Roughness AKA "Rough Detail"
628
+ texture_2d tex_lin_wood_rough_grain = texture_2d("./pine_rough_grain.jpg", ::tex::gamma_linear); // Isotropic Roughness AKA "Rough Grain"
629
+ texture_2d tex_lin_wood_detail_norm = texture_2d("./pine_norm.jpg", ::tex::gamma_linear); // Wood detail Normal - Grain & Structure
630
+ texture_2d tex_lin_tiles_id_offset_rotation = texture_2d("./brickbond_R_id_G_offs_B_rotation.png", ::tex::gamma_linear); // Tiles ID, Offset & Rotation
631
+ texture_2d tex_lin_tiles_edgewear_gaps_gapsrough= texture_2d("./brickbond_R_edgewear_G_gaps_B_gaps_rough.jpg", ::tex::gamma_linear); // Edgewear, Gaps(AO), Gaps Roughnesss
632
+ texture_2d tex_lin_tiles_normal = texture_2d("./brickbond_norm.png", ::tex::gamma_linear); // Tiles Normal (Grout and Bend)
633
+ texture_2d tex_lin_tiles_rough_dents_spots = texture_2d("./tiles_wood_R_rough_G_dents_B_spots.jpg", ::tex::gamma_linear); // Tiles Roughness, Dents and Spots
634
+ texture_2d tex_lin_tiles_orange_peel = texture_2d("./tiles_wood_orangepeel_norm.jpg", ::tex::gamma_linear); // Tiles orange Peel
635
+ */
636
+ /*
637
+ // Wood Highlight tweaks
638
+ bool preview_wood_highlights = false; // just previews the highlights of the wood material
639
+ float wood_specular_level = 1.f; // Adjusts the specular level (PBR Style)
640
+ float isotropic_specular_brightness = 1.0f; // Sets how strong the isotropic specular highlight appears
641
+ float aniso_attenuation = 0.5f; //Attenuates the the anisotropic highlight using a texture. Use the preview for exclusively previewing the wood hightligghts for properly adjusting this term"
642
+ float anisotropic_isotropic_balance = 0.467f; // Balances the Anisotropic vs. the isotropic wood highlight"
643
+ float isotropic_roughness_range = 0.66f; // Adjusts the range of variation being applied to the isotropic highlight, a value of zero has no effect at all whereas 1 produces the most variation")
644
+ float isotropic_roughness = 0.34f; // The average roughness value of the isotropic highlight. When roughness variation is applied, the variation will go above and below those values."),
645
+
646
+ float aniso_bsdf_width = 0.36f; //Controls the width of the anisotropic highlight"
647
+ float aniso_bsdf_height = 0.50f; //Controls the height of the anisotropic highlight"),
648
+ */
649
+ float wood_scale_variation = 0.1f;
650
+
651
+ // Prepare the UV coordinates for regular texture lookups
652
+ vm_coordinates base_uv = vm_coord(
653
+ translation:texture_translate,
654
+ rotation: texture_rotate,
655
+ scaling: texture_scale,
656
+ uv_space: uv_space_index
657
+ );
658
+
659
+ // Random tile transform
660
+ // R: tile_id
661
+ // G: tile_offset
662
+ // B: tile_rotation
663
+ // A: secondary color blend weight
664
+
665
+ ::base::texture_return rand_id_offset_lookup = vm_tex_lookup(
666
+ tex: tex_lin_tiles_id_offset_rotation,
667
+ uv: base_uv,
668
+ mono_source: mono_a
669
+ );
670
+
671
+ float3 R_2nd_col_G_randmask = ::tex::lookup_float3(tex_lin_tiles_R_2nd_col_G_randmask, base_uv.uv, ::tex::wrap_repeat, ::tex::wrap_repeat) ;
672
+
673
+
674
+
675
+ float4 rand_vals = rand_tile_id(
676
+ uv: base_uv,
677
+ id_offset_map: rand_id_offset_lookup,
678
+ seed: seed
679
+ );
680
+
681
+ float2 rand_translation = float2(rand_vals.x, rand_vals.y);
682
+ float rand_rotation = texture_rotate + (float3(rand_id_offset_lookup.tint).z + (rand_vals.z - 0.5) * wood_random_rotation) * 360;
683
+ float2 rand_scale = float2(wood_scale/(1.0 - wood_scale_variation * 0.5 * rand_vals.x)) * texture_scale;
684
+
685
+ // *** TILE UV *** - The randomized UV lookup for the tiles
686
+
687
+
688
+ vm_coordinates tile_uv = vm_coord(
689
+ translation:rand_translation,
690
+ rotation: rand_rotation,
691
+ scaling: rand_scale,
692
+ uv_space: uv_space_index
693
+ );
694
+
695
+
696
+ // Tiling Lookups and compositing
697
+ // R: Edgewear
698
+ // G: Gaps
699
+ // B: Gaps Damage Roughness
700
+ float3 egdewear_gaps_gapsrough_lookup = float3( vm_tex_lookup(
701
+ tex: tex_lin_tiles_edgewear_gaps_gapsrough,
702
+ uv: base_uv,
703
+ mono_source: mono_a
704
+ ).tint);
705
+
706
+ // R: Coat Base Roughness (Footsteps, Grain, Wipe)
707
+ // G: Dents (Dirt/Ao)
708
+ // B: Spots (Liquid-alike)
709
+ float3 rough_dents_spots_lookup = float3( vm_tex_lookup(
710
+ tex: tex_lin_tiles_rough_dents_spots,
711
+ uv: base_uv,
712
+ mono_source: mono_a
713
+ ).tint);
714
+
715
+ float dirt_and_spots_amount_remap = dirt_and_spots_amount * 0.5;
716
+
717
+ float coat_roughness = egdewear_gaps_gapsrough_lookup.x * edgewear_roughness_amount + // edgewear
718
+ egdewear_gaps_gapsrough_lookup.z * dirt_and_spots_amount_remap + // Gaps Damage
719
+ histogram_range(rough_dents_spots_lookup.x, base_roughness_range, tiles_base_roughness) + // base roughness
720
+ rough_dents_spots_lookup.z * dirt_and_spots_amount + // Spots (rough)
721
+ (1.0 - rough_dents_spots_lookup.y) * dirt_and_spots_amount; // Dents
722
+
723
+ float coat_roughness_squared = coat_roughness*coat_roughness; // roughness squared
724
+
725
+ bsdf coating_bsdf = ::df::microfacet_ggx_smith_bsdf(
726
+ roughness_u: coat_roughness_squared,
727
+ roughness_v: coat_roughness_squared,
728
+ tint: color(1.0f),
729
+ mode: ::df::scatter_reflect
730
+ );
731
+
732
+ // ******** NORMALS ********
733
+
734
+ // Tiles normal
735
+
736
+
737
+ float3 tiles_normal = vm_tex_normal_lookup(
738
+ tex: tex_lin_tiles_normal,
739
+ strength: tiles_bump_strength,
740
+ uv: base_uv
741
+ );
742
+
743
+ float3 wood_detail_normal = vm_tex_normal_lookup(
744
+ tex: tex_lin_wood_detail_norm,
745
+ strength: wood_bump_strength,
746
+ uv: tile_uv
747
+ );
748
+
749
+ float3 orange_peel_normal = vm_tex_normal_lookup(
750
+ tex: tex_lin_tiles_orange_peel,
751
+ strength: tiles_orange_peel_bump_factor * 0.1f,
752
+ uv: base_uv
753
+ );
754
+
755
+ // Randomized Tiles normals - This needs to be probably rotated with the normal of the uv-tiles
756
+ float slope_amount = 0.07 * tiles_random_slope_orientation;
757
+ float3 slope = ::math::normalize(
758
+ ::state::texture_tangent_u(uv_space_index) * (rand_vals.y - 0.5) * slope_amount +
759
+ ::state::texture_tangent_v(uv_space_index) * (rand_vals.z - 0.5) * slope_amount +
760
+ ::state::normal() * ((1.0f - slope_amount) + 1.0f)
761
+ );
762
+
763
+ float3 tiles_slope_normal = add_detail_normal(
764
+ n: slope,
765
+ nd: tiles_normal
766
+ );
767
+
768
+ float3 tiles_slope_detail_normal = add_detail_normal(
769
+ n: tiles_slope_normal,
770
+ nd: wood_detail_normal
771
+ );
772
+
773
+ float3 normal_final = add_detail_normal(
774
+ n: tiles_slope_detail_normal,
775
+ nd: orange_peel_normal
776
+ );
777
+
778
+ // ******** Anisotropic Highlight ********
779
+ // Lookup for anisotropic brightness variation
780
+ vm_coordinates aniso_brightnessvar_lookup_uv = vm_coord_post_scale(
781
+ uv: base_uv,
782
+ scale: texture_scale * 0.6
783
+ );
784
+
785
+ ::base::texture_return aniso_brightnessvar_lookup = vm_tex_lookup(
786
+ tex: tex_lin_wood_rough_detail,
787
+ uv: aniso_brightnessvar_lookup_uv,
788
+ mono_source: mono_average
789
+ );
790
+
791
+ float aniso_brightnessvar = histogram_scan_big(
792
+ input: aniso_brightnessvar_lookup.mono,
793
+ width: 0.911,
794
+ position: aniso_attenuation
795
+ );
796
+
797
+ ::base::texture_return aniso_mod_lookup = vm_tex_lookup(
798
+ tex: tex_lin_wood_rough_detail,
799
+ uv: tile_uv,
800
+ mono_source: mono_average
801
+ );
802
+
803
+ float aniso_detail_u = histogram_range(aniso_mod_lookup.mono, 1.0, aniso_bsdf_width);
804
+ float aniso_detail_v = histogram_range(aniso_mod_lookup.mono, 1.0, aniso_bsdf_height);
805
+
806
+ bsdf wood_highlight_aniso = ::df::weighted_layer(
807
+ layer: ::df::microfacet_ggx_smith_bsdf(
808
+ roughness_u: aniso_detail_u * aniso_detail_u,
809
+ roughness_v: aniso_detail_v * aniso_detail_v,
810
+ tint: color(aniso_brightnessvar),
811
+ tangent_u: rotated_tangent(texture_rotate, uv_space_index),
812
+ mode: ::df::scatter_reflect
813
+ ),
814
+ weight: 1.0f,
815
+ normal: tiles_slope_normal
816
+ );
817
+
818
+ // ******** Isotropic Highlight ********
819
+ ::base::texture_return iso_mod_lookup = vm_tex_lookup(
820
+ tex: tex_lin_wood_rough_grain,
821
+ uv: tile_uv,
822
+ mono_source: mono_average
823
+ );
824
+
825
+ float iso_mod = histogram_range(
826
+ input: iso_mod_lookup.mono,
827
+ range: isotropic_roughness_range,
828
+ position: isotropic_roughness
829
+ );
830
+
831
+ float iso_mod_squared = iso_mod * iso_mod;
832
+
833
+ bsdf wood_highlight_isotropic = ::df::microfacet_ggx_smith_bsdf(
834
+ roughness_u: iso_mod_squared,
835
+ roughness_v: iso_mod_squared,
836
+ tint: color(isotropic_specular_brightness),
837
+ mode: ::df::scatter_reflect
838
+ );
839
+
840
+ // ******** Comping Anisotropic and Isotropic Highlight ********
841
+
842
+ bsdf wood_highlight_isotropic_bumped = ::df::weighted_layer(
843
+ layer: wood_highlight_isotropic,
844
+ base: wood_highlight_aniso,
845
+ weight: anisotropic_isotropic_balance,
846
+ normal: tiles_slope_detail_normal
847
+ );
848
+
849
+
850
+ // ******** Diffuse Comping ********
851
+
852
+ // Linear interpolation magic to keep brightness appear the same across different values for
853
+ // 'floor_brightness' and 'wood_brightness_variation'
854
+
855
+ float floor_brightness_fix = ::math::lerp(
856
+ ::math::lerp(0.0f, 0.3f, floor_brightness),
857
+ ::math::lerp(0.42f, 1.0f, floor_brightness),
858
+ wood_brightness_variation);
859
+
860
+ float floor_brightness_remap = floor_brightness_fix * 0.7f + 0.3f; // remapping from 0.3 to 0.7
861
+
862
+
863
+ float4 diffuse_attenuation = float4(::math::lerp(
864
+ a: gaps_brightness,
865
+ b: floor_brightness_remap,
866
+ l: egdewear_gaps_gapsrough_lookup.y));
867
+
868
+
869
+ ::base::texture_return diffuse_lookup = vm_tex_lookup(
870
+ tex: tex_srgb_wood_color,
871
+ uv: tile_uv,
872
+ mono_source: mono_a,
873
+ scale: diffuse_attenuation
874
+ );
875
+
876
+ // Randomly varies brightness from 0.73 - 1.0 which is a simplification from the two nested lerp calls used in a previous version
877
+ float rand_tile_brightness = 1.0f - 0.27 * wood_brightness_variation + 0.27 * wood_brightness_variation * rand_vals.z * R_2nd_col_G_randmask.y;
878
+ // float rand_tile_brightness = R_2nd_col_G_randmask.x;
879
+
880
+ // adding the darkening of the dents texture channel
881
+ float rand_tile_brightness_dents = rand_tile_brightness * ::math::lerp(1.0f, rough_dents_spots_lookup.y, age_dirt);
882
+
883
+
884
+ ::base::texture_return tiles_rand_brightness = ::nvidia::core_definitions::blend_colors(
885
+ color_1: diffuse_lookup.tint,
886
+ color_2: color(::math::pow( a: rand_tile_brightness_dents, b: 2.2)), // do gamma compensation
887
+ mode: ::base::color_layer_multiply,
888
+ weight: 1.0f
889
+ );
890
+
891
+ // blend wood color and wood secondary color based on maps
892
+ ::base::texture_return wood_2_colored = ::nvidia::core_definitions::blend_colors(
893
+ color_1: wood_color,
894
+ color_2: wood_secondary_color,
895
+ mode: ::base::color_layer_blend,
896
+ weight: R_2nd_col_G_randmask.x
897
+ );
898
+
899
+ ::base::texture_return tiles_rand_brightness_tint = ::nvidia::core_definitions::blend_colors(
900
+ color_1: tiles_rand_brightness.tint,
901
+ color_2: wood_2_colored.tint,
902
+ mode: ::base::color_layer_overlay,
903
+ weight: .95f
904
+ );
905
+
906
+ bsdf diffuse = ::df::weighted_layer(
907
+ layer: ::df::diffuse_reflection_bsdf(
908
+ tint: tiles_rand_brightness_tint.tint
909
+ ),
910
+ normal: tiles_slope_detail_normal,
911
+ weight: 1.0
912
+ );
913
+
914
+ // Diffuse + Highlights BSDF
915
+
916
+ bsdf diffuse_and_highlights_bsdf = ::df::custom_curve_layer(
917
+ normal_reflectivity: wood_specular_level * 0.08,
918
+ grazing_reflectivity: 1.0f,
919
+ weight: aniso_brightnessvar ,
920
+ layer: wood_highlight_isotropic_bumped,
921
+ base: diffuse
922
+ );
923
+
924
+ // DEBUG
925
+ bsdf debug_diffuse_and_highlights_bsdf = ::df::custom_curve_layer(
926
+ normal_reflectivity: wood_specular_level * 0.08,
927
+ grazing_reflectivity: 1.0f,
928
+ weight: aniso_brightnessvar ,
929
+ layer: wood_highlight_isotropic_bumped
930
+ );
931
+
932
+ // Coating Layer
933
+ // separate controls for the reflectivity of the gaps and the general reflectivity of the coat
934
+ // Note that "gaps_brightness" also controls the diffuse texture (saving an additional parameter here)
935
+ float coating_weight = ::math::lerp(
936
+ a: gaps_brightness,
937
+ b: coating_reflectivity,
938
+ l: egdewear_gaps_gapsrough_lookup.y
939
+ );
940
+
941
+ // apply the coating layer
942
+ bsdf coated_wood_tiles_bsdf = ::df::custom_curve_layer(
943
+ normal_reflectivity: 0.03, //may as well be made adjustable (0.08 * specular_level)
944
+ grazing_reflectivity: 1.0f,
945
+ layer: coating_bsdf,
946
+ weight: coating_weight,
947
+ base: diffuse_and_highlights_bsdf,
948
+ normal: normal_final
949
+ );
950
+
951
+
952
+ // ******** Round Corners ********
953
+ float3 round_normal = round_corners ?
954
+ ::state::rounded_corner_normal(
955
+ radius: roundcorner_radius_mm * 0.001, // is in mm
956
+ across_materials: across_materials
957
+ ) : ::state::normal();
958
+
959
+ } in material(
960
+ surface: material_surface(
961
+ scattering: preview_wood_highlights ? debug_diffuse_and_highlights_bsdf : coated_wood_tiles_bsdf
962
+ ),
963
+ geometry: material_geometry(
964
+ normal: round_normal
965
+ )
966
+ );
967
+
968
+
969
+ // ******************************************************************************************************
970
+ // 01
971
+
972
+ export material Wood_Tiles_Pine_Melbury(
973
+ int seed = 0 [[
974
+ ::anno::display_name("Randomization Seed"),
975
+ ::anno::description("Different seed values while causes different patterns of randomization on the tiles."),
976
+ ::anno::in_group("Randomization")
977
+ ]],
978
+ color wood_color = color(0.22424f, 0.67323f, 0.71724f) [[
979
+ ::anno::display_name("Color Tint"),
980
+ ::anno::description("Applies an overlay color to tint the wood. A grayscale value of 0.5 has no effect, "
981
+ "brighter values brighten it while darker colors will have a darkening effect."),
982
+ ::anno::in_group("Appearance")
983
+ ]],
984
+ color wood_secondary_color = color(0.59109f, 0.67586f, 0.22063f) [[
985
+ ::anno::display_name("Secondary Color Tint"),
986
+ ::anno::description("Choose the secondary overlay color to tint the wood. A grayscale value of 0.5 has no effect, "
987
+ "brighter values brighten it while darker colors will have a darkening effect."),
988
+ ::anno::in_group("Appearance")
989
+ ]],
990
+ uniform float wood_bump_strength = 0.4f // Determines the degree of bumpiness"),
991
+ [[
992
+ ::anno::display_name("Wood Bump Strength"),
993
+ ::anno::description("Adjusts the strength of the wood bump map."),
994
+ ::anno::in_group("Appearance"),
995
+ ::anno::hard_range(0.f, 2.f)
996
+ ]],
997
+ float floor_brightness = 0.8f [[
998
+ ::anno::display_name("Wood Brightness"),
999
+ ::anno::description("Adjusts the general brightness of the wood."),
1000
+ ::anno::in_group("Appearance", "Tiles"),
1001
+ ::anno::hard_range(0.f, 1.f)
1002
+ ]],
1003
+ float wood_brightness_variation = 0.5f [[
1004
+ ::anno::display_name("Wood Brightness Variation"),
1005
+ ::anno::description("Adds a random brightness variation to the wooden tiles."),
1006
+ ::anno::in_group("Appearance", "Tiles"),
1007
+ ::anno::hard_range(0.f, 1.f)
1008
+ ]],
1009
+ float2 wood_scale = 1.4f [[
1010
+ ::anno::description("Sets the size of the wood relative to the tiles pattern. Larger numbers increase the size of the wood texture within the tiles."),
1011
+ ::anno::display_name("Wood Scale"),
1012
+ ::anno::in_group("Appearance", "Tiles"),
1013
+ ::anno::soft_range(0.f, 2.f)
1014
+ ]],
1015
+ uniform float tiles_bump_strength = 0.4f [[
1016
+ ::anno::description("Determines the degree of bumpiness of the tiles texture (grooves and bent tiles)."),
1017
+ ::anno::display_name("Tiles Bump Strength"),
1018
+ ::anno::in_group("Appearance", "Tiles"),
1019
+ ::anno::hard_range(0.f, 1.f)
1020
+ ]],
1021
+ float tiles_random_slope_orientation = 0.05f [[
1022
+ ::anno::display_name("Tiles Random Slope Orientation"),
1023
+ ::anno::description("Makes tiles individual tiles to appear tilted in random directions. Good for old floors and to take away too perfect appearing tiled floors."),
1024
+ ::anno::in_group("Appearance", "Tiles"),
1025
+ ::anno::hard_range(0.f, 1.f)
1026
+ ]],
1027
+ float gaps_brightness = 0.3f [[
1028
+ ::anno::display_name("Grout Brightness"),
1029
+ ::anno::description("Adjusts the brightness and roughness of the gaps between the tiles."),
1030
+ ::anno::in_group("Appearance", "Tiles"),
1031
+ ::anno::hard_range(0.f, 1.f)
1032
+ ]],
1033
+ float tiles_base_roughness = 0.45f [[
1034
+ ::anno::description("Adjusts the roughness of the coating. Higher value leading to blurrier and softer reflections."),
1035
+ ::anno::display_name("Coating Roughness"),
1036
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
1037
+ ::anno::enable_if("coating_reflectivity > 0.0f"),
1038
+ ::anno::hard_range(0.f, 1.f)
1039
+ ]],
1040
+ float base_roughness_range = 0.6f [[
1041
+ ::anno::description("Applies roughness variation to the coating, introducing signs of wear such as footprints and smudges."),
1042
+ ::anno::display_name("Coating Roughness Variation"),
1043
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
1044
+ ::anno::enable_if("coating_reflectivity > 0.0f"),
1045
+ ::anno::hard_range(0.f, 1.f)
1046
+ ]],
1047
+ uniform float tiles_orange_peel_bump_factor = 0.0f [[
1048
+ ::anno::display_name("Coating Unevenness"),
1049
+ ::anno::description("Applies an unevenness to the clear coat layer akin to orange peel."),
1050
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
1051
+ ::anno::enable_if("coating_reflectivity > 0.0f"),
1052
+ ::anno::hard_range(0.f, 1.f)
1053
+ ]],
1054
+ float coating_reflectivity = 1.f [[
1055
+ ::anno::display_name("Coating Reflectivity"),
1056
+ ::anno::description("The overall reflectivity of the clearcoat layer. Note that other parameters will show no effect when the clearcoat reflectivity is 0."),
1057
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
1058
+ ::anno::hard_range(0.f, 1.f)
1059
+ ]],
1060
+ float dirt_and_spots_amount = 0.3f [[
1061
+ ::anno::description("Adds random dirt and spots on top of the surface which adds variation to the clearcoat roughness."),
1062
+ ::anno::display_name("Dirt and Spots"),
1063
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
1064
+ ::anno::enable_if("coating_reflectivity > 0.0f"),
1065
+ ::anno::hard_range(0.f, 1.f)
1066
+ ]],
1067
+ float edgewear_roughness_amount = 0.2f [[
1068
+ ::anno::description("Adds edgewear around the tile borders which results in a more worn and rough look of the clearcoat."),
1069
+ ::anno::display_name("Edgewear Roughness Amount"),
1070
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
1071
+ ::anno::enable_if("coating_reflectivity > 0.0f"),
1072
+ ::anno::hard_range(0.f, 1.f)
1073
+ ]],
1074
+
1075
+ //-----------------------------------------------
1076
+
1077
+ float2 texture_translate = 0.f [[
1078
+ ::anno::display_name("Texture Translate"),
1079
+ ::anno::description("Controls the position of the texture."),
1080
+ ::anno::in_group("Transform")
1081
+ ]],
1082
+ float texture_rotate = 0.f [[
1083
+ ::anno::display_name("Texture Rotate"),
1084
+ ::anno::description("Rotates angle of the texture in degrees."),
1085
+ ::anno::in_group("Transform")
1086
+ ]],
1087
+ float2 texture_scale = 1.0f [[
1088
+ ::anno::display_name("Texture Scale"),
1089
+ ::anno::description("Larger numbers increase the size."),
1090
+ ::nvidia::core_definitions::dimension(float2(.5f, .5f)),
1091
+ ::anno::in_group("Transform")
1092
+ ]],
1093
+ uniform int uv_space_index = 0 [[
1094
+ ::anno::display_name("UV Space Index"),
1095
+ ::anno::description("Uses selected UV space for material."),
1096
+ ::anno::in_group("Transform")
1097
+ ]],
1098
+ uniform bool round_corners = false [[
1099
+ ::anno::display_name("Round Corners"),
1100
+ ::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."),
1101
+ ::anno::in_group("Round Corners")
1102
+ ]],
1103
+ uniform float roundcorner_radius_mm = 1.5f [[
1104
+ ::anno::display_name("Radius (mm)"),
1105
+ ::anno::description("Radius of the rounded corners in millimeters."),
1106
+ ::anno::in_group("Round Corners"),
1107
+ ::anno::soft_range(0.f, 10.f)
1108
+ ]],
1109
+ uniform bool across_materials = false [[
1110
+ ::anno::display_name("Across Materials"),
1111
+ ::anno::description("Applies the round corner effect across different materials when enabled."),
1112
+ ::anno::in_group("Round Corners")
1113
+ ]]
1114
+ )
1115
+ [[
1116
+ ::anno::author("NVIDIA vMaterials"),
1117
+ ::anno::display_name("Wood Tiles Pine - Multicolor Melbury"),
1118
+ ::anno::description(DESCRIPTION),
1119
+ // reflective, varnished, bumped, matte, natural, stained, exterior, new, aged, decayed, abstract, modern, classic
1120
+ ::anno::key_words(string[]("wood", "pine", "tiles", "tiled", "pattern", "decorative", "multimaterial", "multicolor", "organic", "natural", "coated", "infinite tiling", "melbury", "architecture", "interior")),
1121
+ ::anno::thumbnail("./.thumbs/Wood_Tiles_Pine_Multicolor.Wood_Tiles_Pine_Melbury.png"),
1122
+ ::anno::copyright_notice(COPYRIGHT)
1123
+ //::anno::hidden()
1124
+ ]]
1125
+ = Wood_Tiles_Pine_Multicolor(
1126
+ seed: seed,
1127
+ wood_color: wood_color,
1128
+ wood_secondary_color: wood_secondary_color,
1129
+ wood_bump_strength: wood_bump_strength,
1130
+ floor_brightness: floor_brightness,
1131
+ wood_brightness_variation: wood_brightness_variation,
1132
+ wood_random_rotation: 0.006f,
1133
+ wood_scale: wood_scale,
1134
+
1135
+ tiles_bump_strength: tiles_bump_strength,
1136
+ tiles_random_slope_orientation: tiles_random_slope_orientation,
1137
+ gaps_brightness: gaps_brightness,
1138
+ tiles_orange_peel_bump_factor: tiles_orange_peel_bump_factor,
1139
+ coating_reflectivity: coating_reflectivity,
1140
+ tiles_base_roughness: tiles_base_roughness,
1141
+ base_roughness_range: base_roughness_range,
1142
+ dirt_and_spots_amount: dirt_and_spots_amount,
1143
+ edgewear_roughness_amount: edgewear_roughness_amount,
1144
+
1145
+ texture_translate: texture_translate,
1146
+ texture_rotate: texture_rotate,
1147
+ texture_scale: texture_scale,
1148
+ uv_space_index: uv_space_index,
1149
+
1150
+ round_corners: round_corners,
1151
+ roundcorner_radius_mm: roundcorner_radius_mm,
1152
+ across_materials: across_materials,
1153
+
1154
+ preview_wood_highlights: false,
1155
+ isotropic_roughness: 0.377f,
1156
+ isotropic_roughness_range: 0.689f,
1157
+ isotropic_specular_brightness: 1.0f,
1158
+ wood_specular_level: 1.0f,
1159
+ aniso_attenuation: 0.393f,
1160
+ aniso_bsdf_width: 0.459f,
1161
+ aniso_bsdf_height: 0.680f,
1162
+ anisotropic_isotropic_balance: 0.607f,
1163
+
1164
+ tex_srgb_wood_color: texture_2d("./pine_diff.jpg", ::tex::gamma_srgb),
1165
+ tex_lin_wood_rough_detail: texture_2d("./pine_rough_detail.jpg", ::tex::gamma_linear),
1166
+ tex_lin_wood_rough_grain: texture_2d("./pine_rough_grain.jpg", ::tex::gamma_linear),
1167
+ tex_lin_wood_detail_norm: texture_2d("./pine_norm.jpg", ::tex::gamma_linear),
1168
+ tex_lin_tiles_id_offset_rotation: texture_2d("./melbury_R_id_G_offset_B_rotation.png", ::tex::gamma_linear),
1169
+ tex_lin_tiles_edgewear_gaps_gapsrough: texture_2d("./melbury_R_edgewear_G_gaps_B_gaps_rough.jpg", ::tex::gamma_linear),
1170
+ tex_lin_tiles_normal: texture_2d("./melbury_norm.jpg", ::tex::gamma_linear),
1171
+ tex_lin_tiles_R_2nd_col_G_randmask: texture_2d("./melbury_R_2ndcol_G_randmask.png", ::tex::gamma_linear),
1172
+ tex_lin_tiles_rough_dents_spots: texture_2d("./tiles_wood_R_rough_G_dents_B_spots.jpg", ::tex::gamma_linear),
1173
+ tex_lin_tiles_orange_peel: texture_2d("./tiles_wood_orangepeel_norm.jpg", ::tex::gamma_linear)
1174
+ );
1175
+
1176
+
1177
+
1178
+ // 02
1179
+
1180
+ export material Wood_Tiles_Pine_Large_Star(
1181
+ int seed = 0 [[
1182
+ ::anno::display_name("Randomization Seed"),
1183
+ ::anno::description("Different seed values while causes different patterns of randomization on the tiles."),
1184
+ ::anno::in_group("Randomization")
1185
+ ]],
1186
+ color wood_color = color(0.22424f, 0.67323f, 0.71724f) [[
1187
+ ::anno::display_name("Color Tint"),
1188
+ ::anno::description("Applies an overlay color to tint the wood. A grayscale value of 0.5 has no effect, "
1189
+ "brighter values brighten it while darker colors will have a darkening effect."),
1190
+ ::anno::in_group("Appearance")
1191
+ ]],
1192
+ color wood_secondary_color = color(0.59109f, 0.67586f, 0.22063f) [[
1193
+ ::anno::display_name("Secondary Color Tint"),
1194
+ ::anno::description("Choose the secondary overlay color to tint the wood. A grayscale value of 0.5 has no effect, "
1195
+ "brighter values brighten it while darker colors will have a darkening effect."),
1196
+ ::anno::in_group("Appearance")
1197
+ ]],
1198
+ uniform float wood_bump_strength = 0.4f // Determines the degree of bumpiness"),
1199
+ [[
1200
+ ::anno::display_name("Wood Bump Strength"),
1201
+ ::anno::description("Adjusts the strength of the wood bump map."),
1202
+ ::anno::in_group("Appearance"),
1203
+ ::anno::hard_range(0.f, 2.f)
1204
+ ]],
1205
+ float floor_brightness = 0.8f [[
1206
+ ::anno::display_name("Wood Brightness"),
1207
+ ::anno::description("Adjusts the general brightness of the wood."),
1208
+ ::anno::in_group("Appearance", "Tiles"),
1209
+ ::anno::hard_range(0.f, 1.f)
1210
+ ]],
1211
+ float wood_brightness_variation = .4f [[
1212
+ ::anno::display_name("Wood Brightness Variation"),
1213
+ ::anno::description("Adds a random brightness variation to the wooden tiles."),
1214
+ ::anno::in_group("Appearance", "Tiles"),
1215
+ ::anno::hard_range(0.f, 1.f)
1216
+ ]],
1217
+ float2 wood_scale = 1.4f [[
1218
+ ::anno::description("Sets the size of the wood relative to the tiles pattern. Larger numbers increase the size of the wood texture within the tiles."),
1219
+ ::anno::display_name("Wood Scale"),
1220
+ ::anno::in_group("Appearance", "Tiles"),
1221
+ ::anno::soft_range(0.0f, 2.0f)
1222
+ ]],
1223
+ uniform float tiles_bump_strength = 0.3f [[
1224
+ ::anno::description("Determines the degree of bumpiness of the tiles texture (grooves and bent tiles)."),
1225
+ ::anno::display_name("Tiles Bump Strength"),
1226
+ ::anno::in_group("Appearance", "Tiles"),
1227
+ ::anno::hard_range(0.f, 1.f)
1228
+ ]],
1229
+ float tiles_random_slope_orientation = 0.4f [[
1230
+ ::anno::display_name("Tiles Random Slope Orientation"),
1231
+ ::anno::description("Makes tiles individual tiles to appear tilted in random directions. Good for old floors and to take away too perfect appearing tiled floors."),
1232
+ ::anno::in_group("Appearance", "Tiles"),
1233
+ ::anno::hard_range(0.f, 1.f)
1234
+ ]],
1235
+ float gaps_brightness = 0.0f [[
1236
+ ::anno::display_name("Grout Brightness"),
1237
+ ::anno::description("Adjusts the brightness and roughness of the gaps between the tiles."),
1238
+ ::anno::in_group("Appearance", "Tiles"),
1239
+ ::anno::hard_range(0.f, 1.f)
1240
+ ]],
1241
+ float tiles_base_roughness = 0.45f [[
1242
+ ::anno::description("Adjusts the roughness of the coating. Higher value leading to blurrier and softer reflections."),
1243
+ ::anno::display_name("Coating Roughness"),
1244
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
1245
+ ::anno::enable_if("coating_reflectivity > 0.0f"),
1246
+ ::anno::hard_range(0.f, 1.f)
1247
+ ]],
1248
+ float base_roughness_range = 1.0f [[
1249
+ ::anno::description("Applies roughness variation to the coating, introducing signs of wear such as footprints and smudges."),
1250
+ ::anno::display_name("Coating Roughness Variation"),
1251
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
1252
+ ::anno::enable_if("coating_reflectivity > 0.0f"),
1253
+ ::anno::hard_range(0.f, 1.f)
1254
+ ]],
1255
+ uniform float tiles_orange_peel_bump_factor = 0.3f [[
1256
+ ::anno::display_name("Coating Unevenness"),
1257
+ ::anno::description("Applies an unevenness to the clear coat layer akin to orange peel."),
1258
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
1259
+ ::anno::enable_if("coating_reflectivity > 0.0f"),
1260
+ ::anno::hard_range(0.f, 1.f)
1261
+ ]],
1262
+ float coating_reflectivity = 1.f [[
1263
+ ::anno::display_name("Coating Reflectivity"),
1264
+ ::anno::description("The overall reflectivity of the clearcoat layer. Note that other parameters will show no effect when the clearcoat reflectivity is 0."),
1265
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
1266
+ ::anno::hard_range(0.f, 1.f)
1267
+ ]],
1268
+ float dirt_and_spots_amount = 0.3f [[
1269
+ ::anno::description("Adds random dirt and spots on top of the surface which adds variation to the clearcoat roughness."),
1270
+ ::anno::display_name("Dirt and Spots"),
1271
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
1272
+ ::anno::enable_if("coating_reflectivity > 0.0f"),
1273
+ ::anno::hard_range(0.f, 1.f)
1274
+ ]],
1275
+ float edgewear_roughness_amount = 0.2f [[
1276
+ ::anno::description("Adds edgewear around the tile borders which results in a more worn and rough look of the clearcoat."),
1277
+ ::anno::display_name("Edgewear Roughness Amount"),
1278
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
1279
+ ::anno::enable_if("coating_reflectivity > 0.0f"),
1280
+ ::anno::hard_range(0.f, 1.f)
1281
+ ]],
1282
+
1283
+ //-----------------------------------------------
1284
+
1285
+ float2 texture_translate = 0.f [[
1286
+ ::anno::display_name("Texture Translate"),
1287
+ ::anno::description("Controls the position of the texture."),
1288
+ ::anno::in_group("Transform")
1289
+ ]],
1290
+ float texture_rotate = 0.f [[
1291
+ ::anno::display_name("Texture Rotate"),
1292
+ ::anno::description("Rotates angle of the texture in degrees."),
1293
+ ::anno::in_group("Transform")
1294
+ ]],
1295
+ float2 texture_scale = 1.0f [[
1296
+ ::anno::display_name("Texture Scale"),
1297
+ ::anno::description("Larger numbers increase the size."),
1298
+ ::nvidia::core_definitions::dimension(float2(0.3333f, 0.3333f)),
1299
+ ::anno::in_group("Transform")
1300
+ ]],
1301
+ uniform int uv_space_index = 0 [[
1302
+ ::anno::display_name("UV Space Index"),
1303
+ ::anno::description("Uses selected UV space for material."),
1304
+ ::anno::in_group("Transform")
1305
+ ]],
1306
+ uniform bool round_corners = false [[
1307
+ ::anno::display_name("Round Corners"),
1308
+ ::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."),
1309
+ ::anno::in_group("Round Corners")
1310
+ ]],
1311
+ uniform float roundcorner_radius_mm = 1.5f [[
1312
+ ::anno::display_name("Radius (mm)"),
1313
+ ::anno::description("Radius of the rounded corners in millimeters."),
1314
+ ::anno::in_group("Round Corners"),
1315
+ ::anno::soft_range(0.f, 10.f)
1316
+ ]],
1317
+ uniform bool across_materials = false [[
1318
+ ::anno::display_name("Across Materials"),
1319
+ ::anno::description("Applies the round corner effect across different materials when enabled."),
1320
+ ::anno::in_group("Round Corners")
1321
+ ]]
1322
+ )
1323
+ [[
1324
+ ::anno::author("NVIDIA vMaterials"),
1325
+ ::anno::display_name("Wood Tiles Pine - Multicolor Large Star"),
1326
+ ::anno::description(DESCRIPTION),
1327
+ // reflective, varnished, bumped, matte, natural, stained, exterior, new, aged, decayed, abstract, modern, classic
1328
+ ::anno::key_words(string[]("wood", "pine", "tiles", "tiled", "pattern", "decorative", "multimaterial", "multicolor", "organic", "natural", "coated", "infinite tiling", "star", "architecture", "interior")),
1329
+ ::anno::thumbnail("./.thumbs/Wood_Tiles_Pine_Multicolor.Wood_Tiles_Pine_Large_Star.png"),
1330
+ ::anno::copyright_notice(COPYRIGHT)
1331
+ //::anno::hidden()
1332
+ ]]
1333
+ = Wood_Tiles_Pine_Multicolor(
1334
+ seed: seed,
1335
+ wood_color: wood_color,
1336
+ wood_secondary_color: wood_secondary_color,
1337
+ wood_bump_strength: wood_bump_strength,
1338
+ floor_brightness: floor_brightness,
1339
+ wood_brightness_variation: wood_brightness_variation,
1340
+ wood_random_rotation: 0.005f,
1341
+ wood_scale: wood_scale,
1342
+
1343
+ tiles_bump_strength: tiles_bump_strength,
1344
+ tiles_random_slope_orientation: tiles_random_slope_orientation,
1345
+ gaps_brightness: gaps_brightness,
1346
+ tiles_orange_peel_bump_factor: tiles_orange_peel_bump_factor,
1347
+ coating_reflectivity: coating_reflectivity,
1348
+ tiles_base_roughness: tiles_base_roughness,
1349
+ base_roughness_range: base_roughness_range,
1350
+ dirt_and_spots_amount: dirt_and_spots_amount,
1351
+ edgewear_roughness_amount: edgewear_roughness_amount,
1352
+
1353
+ texture_translate: texture_translate,
1354
+ texture_rotate: texture_rotate,
1355
+ texture_scale: texture_scale,
1356
+ uv_space_index: uv_space_index,
1357
+
1358
+ round_corners: round_corners,
1359
+ roundcorner_radius_mm: roundcorner_radius_mm,
1360
+ across_materials: across_materials,
1361
+
1362
+ preview_wood_highlights: false,
1363
+ isotropic_roughness: 0.377f,
1364
+ isotropic_roughness_range: 0.689f,
1365
+ isotropic_specular_brightness: 1.0f,
1366
+ wood_specular_level: 1.0f,
1367
+ aniso_attenuation: 0.393f,
1368
+ aniso_bsdf_width: 0.459f,
1369
+ aniso_bsdf_height: 0.680f,
1370
+ anisotropic_isotropic_balance: 0.607f,
1371
+
1372
+ tex_srgb_wood_color: texture_2d("./pine_diff.jpg", ::tex::gamma_srgb),
1373
+ tex_lin_wood_rough_detail: texture_2d("./pine_rough_detail.jpg", ::tex::gamma_linear),
1374
+ tex_lin_wood_rough_grain: texture_2d("./pine_rough_grain.jpg", ::tex::gamma_linear),
1375
+ tex_lin_wood_detail_norm: texture_2d("./pine_norm.jpg", ::tex::gamma_linear),
1376
+ tex_lin_tiles_id_offset_rotation: texture_2d("./star_large_R_id_G_offset_B_rotation.png", ::tex::gamma_linear),
1377
+ tex_lin_tiles_edgewear_gaps_gapsrough: texture_2d("./star_large_R_edgewear_G_gaps_B_gaps_rough.jpg", ::tex::gamma_linear),
1378
+ tex_lin_tiles_normal: texture_2d("./star_large_norm.jpg", ::tex::gamma_linear),
1379
+ tex_lin_tiles_R_2nd_col_G_randmask: texture_2d("./star_large_R_2ndcol_G_randmask.png", ::tex::gamma_linear),
1380
+ tex_lin_tiles_rough_dents_spots: texture_2d("./tiles_wood_R_rough_G_dents_B_spots.jpg", ::tex::gamma_linear),
1381
+ tex_lin_tiles_orange_peel: texture_2d("./tiles_wood_orangepeel_norm.jpg", ::tex::gamma_linear)
1382
+ );
1383
+
1384
+
1385
+
1386
+ // 03
1387
+
1388
+ export material Wood_Tiles_Pine_Stars(
1389
+ int seed = 0 [[
1390
+ ::anno::display_name("Randomization Seed"),
1391
+ ::anno::description("Different seed values while causes different patterns of randomization on the tiles."),
1392
+ ::anno::in_group("Randomization")
1393
+ ]],
1394
+ color wood_color = color(0.22424f, 0.67323f, 0.71724f) [[
1395
+ ::anno::display_name("Color Tint"),
1396
+ ::anno::description("Applies an overlay color to tint the wood. A grayscale value of 0.5 has no effect, "
1397
+ "brighter values brighten it while darker colors will have a darkening effect."),
1398
+ ::anno::in_group("Appearance")
1399
+ ]],
1400
+ color wood_secondary_color = color(0.59109f, 0.67586f, 0.22063f) [[
1401
+ ::anno::display_name("Secondary Color Tint"),
1402
+ ::anno::description("Choose the secondary overlay color to tint the wood. A grayscale value of 0.5 has no effect, "
1403
+ "brighter values brighten it while darker colors will have a darkening effect."),
1404
+ ::anno::in_group("Appearance")
1405
+ ]],
1406
+ uniform float wood_bump_strength = 0.4f // Determines the degree of bumpiness"),
1407
+ [[
1408
+ ::anno::display_name("Wood Bump Strength"),
1409
+ ::anno::description("Adjusts the strength of the wood bump map."),
1410
+ ::anno::in_group("Appearance"),
1411
+ ::anno::hard_range(0.f, 2.f)
1412
+ ]],
1413
+ float floor_brightness = 0.8f [[
1414
+ ::anno::display_name("Wood Brightness"),
1415
+ ::anno::description("Adjusts the general brightness of the wood."),
1416
+ ::anno::in_group("Appearance", "Tiles"),
1417
+ ::anno::hard_range(0.f, 1.f)
1418
+ ]],
1419
+ float wood_brightness_variation = .35f [[
1420
+ ::anno::display_name("Wood Brightness Variation"),
1421
+ ::anno::description("Adds a random brightness variation to the wooden tiles."),
1422
+ ::anno::in_group("Appearance", "Tiles"),
1423
+ ::anno::hard_range(0.f, 1.f)
1424
+ ]],
1425
+ float2 wood_scale = 1.4f [[
1426
+ ::anno::description("Sets the size of the wood relative to the tiles pattern. Larger numbers increase the size of the wood texture within the tiles."),
1427
+ ::anno::display_name("Wood Scale"),
1428
+ ::anno::in_group("Appearance", "Tiles"),
1429
+ ::anno::soft_range(0.0f, 2.0f)
1430
+ ]],
1431
+ uniform float tiles_bump_strength = 0.3f [[
1432
+ ::anno::description("Determines the degree of bumpiness of the tiles texture (grooves and bent tiles)."),
1433
+ ::anno::display_name("Tiles Bump Strength"),
1434
+ ::anno::in_group("Appearance", "Tiles"),
1435
+ ::anno::hard_range(0.f, 1.f)
1436
+ ]],
1437
+ float tiles_random_slope_orientation = 0.4f [[
1438
+ ::anno::display_name("Tiles Random Slope Orientation"),
1439
+ ::anno::description("Makes tiles individual tiles to appear tilted in random directions. Good for old floors and to take away too perfect appearing tiled floors."),
1440
+ ::anno::in_group("Appearance", "Tiles"),
1441
+ ::anno::hard_range(0.f, 1.f)
1442
+ ]],
1443
+ float gaps_brightness = 0.0f [[
1444
+ ::anno::display_name("Grout Brightness"),
1445
+ ::anno::description("Adjusts the brightness and roughness of the gaps between the tiles."),
1446
+ ::anno::in_group("Appearance", "Tiles"),
1447
+ ::anno::hard_range(0.f, 1.f)
1448
+ ]],
1449
+ float tiles_base_roughness = 0.45f [[
1450
+ ::anno::description("Adjusts the roughness of the coating. Higher value leading to blurrier and softer reflections."),
1451
+ ::anno::display_name("Coating Roughness"),
1452
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
1453
+ ::anno::enable_if("coating_reflectivity > 0.0f"),
1454
+ ::anno::hard_range(0.f, 1.f)
1455
+ ]],
1456
+ float base_roughness_range = 1.0f [[
1457
+ ::anno::description("Applies roughness variation to the coating, introducing signs of wear such as footprints and smudges."),
1458
+ ::anno::display_name("Coating Roughness Variation"),
1459
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
1460
+ ::anno::enable_if("coating_reflectivity > 0.0f"),
1461
+ ::anno::hard_range(0.f, 1.f)
1462
+ ]],
1463
+ uniform float tiles_orange_peel_bump_factor = 0.3f [[
1464
+ ::anno::display_name("Coating Unevenness"),
1465
+ ::anno::description("Applies an unevenness to the clear coat layer akin to orange peel."),
1466
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
1467
+ ::anno::enable_if("coating_reflectivity > 0.0f"),
1468
+ ::anno::hard_range(0.f, 1.f)
1469
+ ]],
1470
+ float coating_reflectivity = 1.f [[
1471
+ ::anno::display_name("Coating Reflectivity"),
1472
+ ::anno::description("The overall reflectivity of the clearcoat layer. Note that other parameters will show no effect when the clearcoat reflectivity is 0."),
1473
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
1474
+ ::anno::hard_range(0.f, 1.f)
1475
+ ]],
1476
+ float dirt_and_spots_amount = 0.3f [[
1477
+ ::anno::description("Adds random dirt and spots on top of the surface which adds variation to the clearcoat roughness."),
1478
+ ::anno::display_name("Dirt and Spots"),
1479
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
1480
+ ::anno::enable_if("coating_reflectivity > 0.0f"),
1481
+ ::anno::hard_range(0.f, 1.f)
1482
+ ]],
1483
+ float edgewear_roughness_amount = 0.2f [[
1484
+ ::anno::description("Adds edgewear around the tile borders which results in a more worn and rough look of the clearcoat."),
1485
+ ::anno::display_name("Edgewear Roughness Amount"),
1486
+ ::anno::in_group("Appearance", "Tiles", "Coating"),
1487
+ ::anno::enable_if("coating_reflectivity > 0.0f"),
1488
+ ::anno::hard_range(0.f, 1.f)
1489
+ ]],
1490
+
1491
+ //-----------------------------------------------
1492
+
1493
+ float2 texture_translate = 0.f [[
1494
+ ::anno::display_name("Texture Translate"),
1495
+ ::anno::description("Controls the position of the texture."),
1496
+ ::anno::in_group("Transform")
1497
+ ]],
1498
+ float texture_rotate = 0.f [[
1499
+ ::anno::display_name("Texture Rotate"),
1500
+ ::anno::description("Rotates angle of the texture in degrees."),
1501
+ ::anno::in_group("Transform")
1502
+ ]],
1503
+ float2 texture_scale = 1.0f [[
1504
+ ::anno::display_name("Texture Scale"),
1505
+ ::anno::description("Larger numbers increase the size."),
1506
+ ::nvidia::core_definitions::dimension(float2(0.5f, 0.5f)),
1507
+ ::preview_scale(0.33f),
1508
+ ::anno::in_group("Transform")
1509
+ ]],
1510
+ uniform int uv_space_index = 0 [[
1511
+ ::anno::display_name("UV Space Index"),
1512
+ ::anno::description("Uses selected UV space for material."),
1513
+ ::anno::in_group("Transform")
1514
+ ]],
1515
+ uniform bool round_corners = false [[
1516
+ ::anno::display_name("Round Corners"),
1517
+ ::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."),
1518
+ ::anno::in_group("Round Corners")
1519
+ ]],
1520
+ uniform float roundcorner_radius_mm = 1.5f [[
1521
+ ::anno::display_name("Radius (mm)"),
1522
+ ::anno::description("Radius of the rounded corners in millimeters."),
1523
+ ::anno::in_group("Round Corners"),
1524
+ ::anno::soft_range(0.f, 10.f)
1525
+ ]],
1526
+ uniform bool across_materials = false [[
1527
+ ::anno::display_name("Across Materials"),
1528
+ ::anno::description("Applies the round corner effect across different materials when enabled."),
1529
+ ::anno::in_group("Round Corners")
1530
+ ]]
1531
+ )
1532
+ [[
1533
+ ::anno::author("NVIDIA vMaterials"),
1534
+ ::anno::display_name("Wood Tiles Pine - Multicolor Stars"),
1535
+ ::anno::description(DESCRIPTION),
1536
+ // reflective, varnished, bumped, matte, natural, stained, exterior, new, aged, decayed, abstract, modern, classic
1537
+ ::anno::key_words(string[]("wood", "pine", "tiles", "tiled", "pattern", "decorative", "multimaterial", "multicolor", "organic", "natural", "coated", "infinite tiling", "star", "stars", "architecture", "interior")),
1538
+ ::anno::thumbnail("./.thumbs/Wood_Tiles_Pine_Multicolor.Wood_Tiles_Pine_Stars.png"),
1539
+ ::anno::copyright_notice(COPYRIGHT)
1540
+ //::anno::hidden()
1541
+ ]]
1542
+ = Wood_Tiles_Pine_Multicolor(
1543
+ seed: seed,
1544
+ wood_color: wood_color,
1545
+ wood_secondary_color: wood_secondary_color,
1546
+ wood_bump_strength: wood_bump_strength,
1547
+ floor_brightness: floor_brightness,
1548
+ wood_brightness_variation: wood_brightness_variation,
1549
+ wood_random_rotation: 0.00f,
1550
+ wood_scale: wood_scale,
1551
+
1552
+ tiles_bump_strength: tiles_bump_strength,
1553
+ tiles_random_slope_orientation: tiles_random_slope_orientation,
1554
+ gaps_brightness: gaps_brightness,
1555
+ tiles_orange_peel_bump_factor: tiles_orange_peel_bump_factor,
1556
+ coating_reflectivity: coating_reflectivity,
1557
+ tiles_base_roughness: tiles_base_roughness,
1558
+ base_roughness_range: base_roughness_range,
1559
+ dirt_and_spots_amount: dirt_and_spots_amount,
1560
+ edgewear_roughness_amount: edgewear_roughness_amount,
1561
+
1562
+ texture_translate: texture_translate,
1563
+ texture_rotate: texture_rotate,
1564
+ texture_scale: texture_scale,
1565
+ uv_space_index: uv_space_index,
1566
+
1567
+ round_corners: round_corners,
1568
+ roundcorner_radius_mm: roundcorner_radius_mm,
1569
+ across_materials: across_materials,
1570
+
1571
+ preview_wood_highlights: false,
1572
+ isotropic_roughness: 0.377f,
1573
+ isotropic_roughness_range: 0.689f,
1574
+ isotropic_specular_brightness: 1.0f,
1575
+ wood_specular_level: 1.0f,
1576
+ aniso_attenuation: 0.393f,
1577
+ aniso_bsdf_width: 0.459f,
1578
+ aniso_bsdf_height: 0.680f,
1579
+ anisotropic_isotropic_balance: 0.607f,
1580
+
1581
+ tex_srgb_wood_color: texture_2d("./pine_diff.jpg", ::tex::gamma_srgb),
1582
+ tex_lin_wood_rough_detail: texture_2d("./pine_rough_detail.jpg", ::tex::gamma_linear),
1583
+ tex_lin_wood_rough_grain: texture_2d("./pine_rough_grain.jpg", ::tex::gamma_linear),
1584
+ tex_lin_wood_detail_norm: texture_2d("./pine_norm.jpg", ::tex::gamma_linear),
1585
+ tex_lin_tiles_id_offset_rotation: texture_2d("./stars_R_id_G_offset_B_rotation.png", ::tex::gamma_linear),
1586
+ tex_lin_tiles_edgewear_gaps_gapsrough: texture_2d("./stars_R_edgewear_G_gaps_B_gaps_rough.jpg", ::tex::gamma_linear),
1587
+ tex_lin_tiles_normal: texture_2d("./stars_norm.jpg", ::tex::gamma_linear),
1588
+ tex_lin_tiles_R_2nd_col_G_randmask: texture_2d("./stars_R_2ndcol_G_randmask.png", ::tex::gamma_linear),
1589
+ tex_lin_tiles_rough_dents_spots: texture_2d("./tiles_wood_R_rough_G_dents_B_spots.jpg", ::tex::gamma_linear),
1590
+ tex_lin_tiles_orange_peel: texture_2d("./tiles_wood_orangepeel_norm.jpg", ::tex::gamma_linear)
1591
+ );
Material/material_0572/Wood_Tiles_Walnut.mdl ADDED
The diff for this file is too large to render. See raw diff
 
README.md CHANGED
@@ -18,8 +18,10 @@ Assets for evaluating **RoboDojo** dual-arm tasks on **IsaacLab-Arena** with the
18
  | Path | Description |
19
  |------|-------------|
20
  | `Embodiment/x5/` | ARX X5 dual-arm robot USD / meshes |
 
 
21
  | `texture/` | Dome / material textures used by eval |
22
- | `Layouts/RoboDojo/` | Scene layouts for the original 10 RoboDojo tasks and the P1 batch |
23
  | `Objects/RoboDojo/` | Object USD instances referenced by those layouts |
24
  | `Room/` | Simple rooms selected by the saved layouts |
25
  | `Material/` | Table and ground materials selected by the saved layouts |
@@ -27,9 +29,7 @@ Assets for evaluating **RoboDojo** dual-arm tasks on **IsaacLab-Arena** with the
27
 
28
  ## Tasks
29
 
30
- Original 10: `build_tower`, `classify_objects`, `put_bottles_into_dustbin`, `pour_balls_into_vase`, `general_pickup`, `cover_blocks`, `insert_tubes`, `sort_nesting_dolls_by_size`, `deposit_coin`, `organize_table`
31
-
32
- P1: `stack_blocks_by_language`, `classify_objects_by_language`, `swap_T`, `arrange_largest_number`, `stack_bowls`, `arrange_largest_number_random`, `sort_nesting_dolls_by_size_random`, `stack_blocks_random`, `stack_bowls_random`
33
 
34
  ## Download
35
 
 
18
  | Path | Description |
19
  |------|-------------|
20
  | `Embodiment/x5/` | ARX X5 dual-arm robot USD / meshes |
21
+ | `Robots/franka/` | Franka support arm used by the auxiliary-arm tasks |
22
+ | `Traj/RoboDojo/` | Auxiliary-arm trajectories for those tasks |
23
  | `texture/` | Dome / material textures used by eval |
24
+ | `Layouts/RoboDojo/` | Saved scene layouts for the 54 RoboDojo tasks |
25
  | `Objects/RoboDojo/` | Object USD instances referenced by those layouts |
26
  | `Room/` | Simple rooms selected by the saved layouts |
27
  | `Material/` | Table and ground materials selected by the saved layouts |
 
29
 
30
  ## Tasks
31
 
32
+ `align_blocks`, `arrange_largest_number`, `arrange_largest_number_random`, `build_tower`, `classify_objects`, `classify_objects_by_language`, `cover_blocks`, `deposit_coin`, `fasten_screws`, `fill_egg_holder`, `fill_pen_holder`, `fold_clothes`, `fold_clothes_random`, `general_pickup`, `hang_mugs`, `hang_mugs_random`, `imitate_sorting_sequence`, `insert_key`, `insert_tubes`, `make_kong`, `make_toast`, `make_toast_random`, `match_and_pick_from_conveyor`, `organize_table`, `pack_objects_into_box`, `pack_objects_into_box_random`, `pick_from_conveyor_by_image`, `play_Xylophone`, `play_stacking_toy`, `play_tic_tac_toe`, `plug_in_charger`, `pour_balls_into_vase`, `pour_by_language`, `pour_liquid_into_cup`, `pour_liquid_into_cup_random`, `press_by_number`, `push_T`, `push_T_random`, `put_bottles_into_dustbin`, `solve_equation`, `sort_nesting_dolls_by_size`, `sort_nesting_dolls_by_size_random`, `stack_blocks`, `stack_blocks_by_language`, `stack_blocks_random`, `stack_bowls`, `stack_bowls_random`, `store_laptop_and_headphones`, `store_laptop_and_headphones_random`, `store_tools_in_toolbox`, `swap_T`, `swap_blocks`, `sweep_blocks`, `sweep_blocks_random`
 
 
33
 
34
  ## Download
35