diff --git a/Layouts/RoboDojo/stack_bowls/stack_bowls_21.json b/Layouts/RoboDojo/stack_bowls/stack_bowls_21.json new file mode 100644 index 0000000000000000000000000000000000000000..7d3de35cb512c0dd528d3a02530f650168851d02 --- /dev/null +++ b/Layouts/RoboDojo/stack_bowls/stack_bowls_21.json @@ -0,0 +1,277 @@ +{ + "Rigid": { + "bowl": [ + { + "category": "bowl", + "category_idx": 10, + "group": null, + "xlim": [ + -0.45, + 0.45 + ], + "ylim": [ + -0.25, + 0.07 + ], + "zlim": null, + "qpos": [ + 1, + 0, + 0, + 0 + ], + "rotate_deg": 0, + "rotate_rand": false, + "relative_plane": "Table", + "place_tag": null, + "margin": 0.01, + "check_mode": "bbox", + "need_check_stable": true, + "label": "bowl0", + "default_pos": [ + 0.3790022243565138, + 0.04956659685870095, + 0.79 + ], + "default_ori": [ + 1.0, + 0.0, + 0.0, + 0.0 + ], + "scale": [ + 1.0, + 1.0, + 1.0 + ], + "physics": { + "mass": 0.22, + "friction": 0.25, + "type": "rigid" + }, + "visual": {} + }, + { + "category": "bowl", + "category_idx": 10, + "group": null, + "xlim": [ + -0.45, + 0.45 + ], + "ylim": [ + -0.25, + 0.07 + ], + "zlim": null, + "qpos": [ + 1, + 0, + 0, + 0 + ], + "rotate_deg": 0, + "rotate_rand": false, + "relative_plane": "Table", + "place_tag": null, + "margin": 0.01, + "check_mode": "bbox", + "need_check_stable": true, + "label": "bowl1", + "default_pos": [ + 0.03105463591043024, + -0.22361179234485498, + 0.79 + ], + "default_ori": [ + 1.0, + 0.0, + 0.0, + 0.0 + ], + "scale": [ + 1.0, + 1.0, + 1.0 + ], + "physics": { + "mass": 0.22, + "friction": 0.25, + "type": "rigid" + }, + "visual": {} + }, + { + "category": "bowl", + "category_idx": 10, + "group": null, + "xlim": [ + -0.45, + 0.45 + ], + "ylim": [ + -0.25, + 0.07 + ], + "zlim": null, + "qpos": [ + 1, + 0, + 0, + 0 + ], + "rotate_deg": 0, + "rotate_rand": false, + "relative_plane": "Table", + "place_tag": null, + "margin": 0.01, + "check_mode": "bbox", + "need_check_stable": true, + "label": "bowl2", + "default_pos": [ + 0.1590480206558747, + 0.04121560865650907, + 0.79 + ], + "default_ori": [ + 1.0, + 0.0, + 0.0, + 0.0 + ], + "scale": [ + 1.0, + 1.0, + 1.0 + ], + "physics": { + "mass": 0.22, + "friction": 0.25, + "type": "rigid" + }, + "visual": {} + } + ] + }, + "Geometry": { + "camera_stand": [ + { + "category": "camera_stand", + "category_idx": 0, + "group": null, + "xlim": [ + 0.0, + 0.0 + ], + "ylim": [ + -0.47, + -0.47 + ], + "zlim": [ + 0.715, + 0.715 + ], + "qpos": [ + 0.707, + -0.707, + 0.0, + 0.0 + ], + "rotate_deg": 0, + "rotate_rand": false, + "relative_plane": "Ground", + "place_tag": null, + "margin": 0.01, + "check_mode": "bbox", + "need_check_stable": true, + "label": "camera_stand", + "default_pos": [ + 0.0, + -0.47, + 0.765 + ], + "default_ori": [ + 0.707, + -0.707, + 0.0, + 0.0 + ], + "scale": [ + 1.0, + 1.0, + 1.0 + ], + "physics": { + "type": "geometry" + }, + "visual": {} + } + ] + }, + "Room": { + "default": "Simple_Room_nolight", + "default_pos": [ + 0.0, + 0.0, + 0.0 + ], + "default_rot": [ + 1.0, + 0.0, + 0.0, + 0.0 + ], + "scale": [ + 0.5, + 0.5, + 0.5 + ] + }, + "Table": { + "default": "material_0122", + "scale": [ + 1.4, + 1.1, + 0.05 + ], + "default_pos": [ + 0.0, + -0.05, + 0.74 + ], + "default_ori": [ + 1.0, + 0.0, + 0.0, + 0.0 + ] + }, + "Ground": { + "geometry": "cube", + "thickness": 0.1, + "axis": "Z", + "default_pos": [ + 0.0, + 0.0, + 0.0 + ], + "materials": { + "type": "mdl", + "default": "material_0564", + "random": false + }, + "physics_material": { + "static_friction": 1.0, + "dynamic_friction": 1.0, + "restitution": 0.0, + "friction_combine_mode": "multiply", + "restitution_combine_mode": "multiply", + "compliant_contact_stiffness": 0.0, + "compliant_contact_damping": 0.0 + } + }, + "Background": { + "intensity": 1000, + "category_name": "brown_photostudio_02_4k.hdr" + } +} diff --git a/Layouts/RoboDojo/stack_bowls/stack_bowls_31.json b/Layouts/RoboDojo/stack_bowls/stack_bowls_31.json new file mode 100644 index 0000000000000000000000000000000000000000..b37e53a5f74374d104fe9346bd219c19af8844b9 --- /dev/null +++ b/Layouts/RoboDojo/stack_bowls/stack_bowls_31.json @@ -0,0 +1,277 @@ +{ + "Rigid": { + "bowl": [ + { + "category": "bowl", + "category_idx": 8, + "group": null, + "xlim": [ + -0.45, + 0.45 + ], + "ylim": [ + -0.25, + 0.07 + ], + "zlim": null, + "qpos": [ + 1, + 0, + 0, + 0 + ], + "rotate_deg": 0, + "rotate_rand": false, + "relative_plane": "Table", + "place_tag": null, + "margin": 0.01, + "check_mode": "bbox", + "need_check_stable": true, + "label": "bowl0", + "default_pos": [ + 0.1982231182896335, + -0.05852992166814689, + 0.7951007198659328 + ], + "default_ori": [ + 0.999997175011971, + 0.0008999974575107739, + 0.0021999937850263364, + 0.0 + ], + "scale": [ + 1.0, + 1.0, + 1.0 + ], + "physics": { + "mass": 0.35, + "friction": 0.25, + "type": "rigid" + }, + "visual": {} + }, + { + "category": "bowl", + "category_idx": 8, + "group": null, + "xlim": [ + -0.45, + 0.45 + ], + "ylim": [ + -0.25, + 0.07 + ], + "zlim": null, + "qpos": [ + 1, + 0, + 0, + 0 + ], + "rotate_deg": 0, + "rotate_rand": false, + "relative_plane": "Table", + "place_tag": null, + "margin": 0.01, + "check_mode": "bbox", + "need_check_stable": true, + "label": "bowl1", + "default_pos": [ + -0.3299554138559001, + 0.04584901254418671, + 0.7951007198659328 + ], + "default_ori": [ + 0.999997175011971, + 0.0008999974575107739, + 0.0021999937850263364, + 0.0 + ], + "scale": [ + 1.0, + 1.0, + 1.0 + ], + "physics": { + "mass": 0.35, + "friction": 0.25, + "type": "rigid" + }, + "visual": {} + }, + { + "category": "bowl", + "category_idx": 8, + "group": null, + "xlim": [ + -0.45, + 0.45 + ], + "ylim": [ + -0.25, + 0.07 + ], + "zlim": null, + "qpos": [ + 1, + 0, + 0, + 0 + ], + "rotate_deg": 0, + "rotate_rand": false, + "relative_plane": "Table", + "place_tag": null, + "margin": 0.01, + "check_mode": "bbox", + "need_check_stable": true, + "label": "bowl2", + "default_pos": [ + -0.12335777987716966, + -0.20177570554586965, + 0.7951007198659328 + ], + "default_ori": [ + 0.999997175011971, + 0.0008999974575107739, + 0.0021999937850263364, + 0.0 + ], + "scale": [ + 1.0, + 1.0, + 1.0 + ], + "physics": { + "mass": 0.35, + "friction": 0.25, + "type": "rigid" + }, + "visual": {} + } + ] + }, + "Geometry": { + "camera_stand": [ + { + "category": "camera_stand", + "category_idx": 0, + "group": null, + "xlim": [ + 0.0, + 0.0 + ], + "ylim": [ + -0.47, + -0.47 + ], + "zlim": [ + 0.715, + 0.715 + ], + "qpos": [ + 0.707, + -0.707, + 0.0, + 0.0 + ], + "rotate_deg": 0, + "rotate_rand": false, + "relative_plane": "Ground", + "place_tag": null, + "margin": 0.01, + "check_mode": "bbox", + "need_check_stable": true, + "label": "camera_stand", + "default_pos": [ + 0.0, + -0.47, + 0.765 + ], + "default_ori": [ + 0.707, + -0.707, + 0.0, + 0.0 + ], + "scale": [ + 1.0, + 1.0, + 1.0 + ], + "physics": { + "type": "geometry" + }, + "visual": {} + } + ] + }, + "Room": { + "default": "Simple_Room_nolight", + "default_pos": [ + 0.0, + 0.0, + 0.0 + ], + "default_rot": [ + 1.0, + 0.0, + 0.0, + 0.0 + ], + "scale": [ + 0.5, + 0.5, + 0.5 + ] + }, + "Table": { + "default": "material_0122", + "scale": [ + 1.4, + 1.1, + 0.05 + ], + "default_pos": [ + 0.0, + -0.05, + 0.74 + ], + "default_ori": [ + 1.0, + 0.0, + 0.0, + 0.0 + ] + }, + "Ground": { + "geometry": "cube", + "thickness": 0.1, + "axis": "Z", + "default_pos": [ + 0.0, + 0.0, + 0.0 + ], + "materials": { + "type": "mdl", + "default": "material_0564", + "random": false + }, + "physics_material": { + "static_friction": 1.0, + "dynamic_friction": 1.0, + "restitution": 0.0, + "friction_combine_mode": "multiply", + "restitution_combine_mode": "multiply", + "compliant_contact_stiffness": 0.0, + "compliant_contact_damping": 0.0 + } + }, + "Background": { + "intensity": 1000, + "category_name": "brown_photostudio_02_4k.hdr" + } +} diff --git a/Layouts/RoboDojo/stack_bowls/stack_bowls_35.json b/Layouts/RoboDojo/stack_bowls/stack_bowls_35.json new file mode 100644 index 0000000000000000000000000000000000000000..7fbfd4ac139884123b210ace70c610cf1b1e1b2b --- /dev/null +++ b/Layouts/RoboDojo/stack_bowls/stack_bowls_35.json @@ -0,0 +1,277 @@ +{ + "Rigid": { + "bowl": [ + { + "category": "bowl", + "category_idx": 5, + "group": null, + "xlim": [ + -0.45, + 0.45 + ], + "ylim": [ + -0.25, + 0.07 + ], + "zlim": null, + "qpos": [ + 1, + 0, + 0, + 0 + ], + "rotate_deg": 0, + "rotate_rand": false, + "relative_plane": "Table", + "place_tag": null, + "margin": 0.01, + "check_mode": "bbox", + "need_check_stable": true, + "label": "bowl0", + "default_pos": [ + 0.32624703789138637, + -0.21024363853466133, + 0.7951 + ], + "default_ori": [ + 1.0, + 0.0, + 0.0, + 0.0 + ], + "scale": [ + 1.0, + 1.0, + 1.0 + ], + "physics": { + "mass": 0.35, + "friction": 0.25, + "type": "rigid" + }, + "visual": {} + }, + { + "category": "bowl", + "category_idx": 5, + "group": null, + "xlim": [ + -0.45, + 0.45 + ], + "ylim": [ + -0.25, + 0.07 + ], + "zlim": null, + "qpos": [ + 1, + 0, + 0, + 0 + ], + "rotate_deg": 0, + "rotate_rand": false, + "relative_plane": "Table", + "place_tag": null, + "margin": 0.01, + "check_mode": "bbox", + "need_check_stable": true, + "label": "bowl1", + "default_pos": [ + -0.356084482234274, + -0.04233904814131173, + 0.7951 + ], + "default_ori": [ + 1.0, + 0.0, + 0.0, + 0.0 + ], + "scale": [ + 1.0, + 1.0, + 1.0 + ], + "physics": { + "mass": 0.35, + "friction": 0.25, + "type": "rigid" + }, + "visual": {} + }, + { + "category": "bowl", + "category_idx": 5, + "group": null, + "xlim": [ + -0.45, + 0.45 + ], + "ylim": [ + -0.25, + 0.07 + ], + "zlim": null, + "qpos": [ + 1, + 0, + 0, + 0 + ], + "rotate_deg": 0, + "rotate_rand": false, + "relative_plane": "Table", + "place_tag": null, + "margin": 0.01, + "check_mode": "bbox", + "need_check_stable": true, + "label": "bowl2", + "default_pos": [ + 0.19465811901355873, + 0.0059677300610560535, + 0.7951 + ], + "default_ori": [ + 1.0, + 0.0, + 0.0, + 0.0 + ], + "scale": [ + 1.0, + 1.0, + 1.0 + ], + "physics": { + "mass": 0.35, + "friction": 0.25, + "type": "rigid" + }, + "visual": {} + } + ] + }, + "Geometry": { + "camera_stand": [ + { + "category": "camera_stand", + "category_idx": 0, + "group": null, + "xlim": [ + 0.0, + 0.0 + ], + "ylim": [ + -0.47, + -0.47 + ], + "zlim": [ + 0.715, + 0.715 + ], + "qpos": [ + 0.707, + -0.707, + 0.0, + 0.0 + ], + "rotate_deg": 0, + "rotate_rand": false, + "relative_plane": "Ground", + "place_tag": null, + "margin": 0.01, + "check_mode": "bbox", + "need_check_stable": true, + "label": "camera_stand", + "default_pos": [ + 0.0, + -0.47, + 0.765 + ], + "default_ori": [ + 0.707, + -0.707, + 0.0, + 0.0 + ], + "scale": [ + 1.0, + 1.0, + 1.0 + ], + "physics": { + "type": "geometry" + }, + "visual": {} + } + ] + }, + "Room": { + "default": "Simple_Room_nolight", + "default_pos": [ + 0.0, + 0.0, + 0.0 + ], + "default_rot": [ + 1.0, + 0.0, + 0.0, + 0.0 + ], + "scale": [ + 0.5, + 0.5, + 0.5 + ] + }, + "Table": { + "default": "material_0122", + "scale": [ + 1.4, + 1.1, + 0.05 + ], + "default_pos": [ + 0.0, + -0.05, + 0.74 + ], + "default_ori": [ + 1.0, + 0.0, + 0.0, + 0.0 + ] + }, + "Ground": { + "geometry": "cube", + "thickness": 0.1, + "axis": "Z", + "default_pos": [ + 0.0, + 0.0, + 0.0 + ], + "materials": { + "type": "mdl", + "default": "material_0564", + "random": false + }, + "physics_material": { + "static_friction": 1.0, + "dynamic_friction": 1.0, + "restitution": 0.0, + "friction_combine_mode": "multiply", + "restitution_combine_mode": "multiply", + "compliant_contact_stiffness": 0.0, + "compliant_contact_damping": 0.0 + } + }, + "Background": { + "intensity": 1000, + "category_name": "brown_photostudio_02_4k.hdr" + } +} diff --git a/Layouts/RoboDojo/stack_bowls/stack_bowls_5.json b/Layouts/RoboDojo/stack_bowls/stack_bowls_5.json new file mode 100644 index 0000000000000000000000000000000000000000..44ecb00ad452a8cfacd97fd35f177f54be6e444f --- /dev/null +++ b/Layouts/RoboDojo/stack_bowls/stack_bowls_5.json @@ -0,0 +1,277 @@ +{ + "Rigid": { + "bowl": [ + { + "category": "bowl", + "category_idx": 7, + "group": null, + "xlim": [ + -0.45, + 0.45 + ], + "ylim": [ + -0.25, + 0.07 + ], + "zlim": null, + "qpos": [ + 1, + 0, + 0, + 0 + ], + "rotate_deg": 0, + "rotate_rand": false, + "relative_plane": "Table", + "place_tag": null, + "margin": 0.01, + "check_mode": "bbox", + "need_check_stable": true, + "label": "bowl0", + "default_pos": [ + -0.03426504541963771, + -0.2112117852310999, + 0.7950002065998161 + ], + "default_ori": [ + 0.9999995550002969, + 0.0007999996440002375, + 0.0004999997775001485, + 0.0 + ], + "scale": [ + 1.0, + 1.0, + 1.0 + ], + "physics": { + "mass": 0.35, + "friction": 0.25, + "type": "rigid" + }, + "visual": {} + }, + { + "category": "bowl", + "category_idx": 7, + "group": null, + "xlim": [ + -0.45, + 0.45 + ], + "ylim": [ + -0.25, + 0.07 + ], + "zlim": null, + "qpos": [ + 1, + 0, + 0, + 0 + ], + "rotate_deg": 0, + "rotate_rand": false, + "relative_plane": "Table", + "place_tag": null, + "margin": 0.01, + "check_mode": "bbox", + "need_check_stable": true, + "label": "bowl1", + "default_pos": [ + -0.2502381978857299, + -0.10770390295689386, + 0.7950002065998161 + ], + "default_ori": [ + 0.9999995550002969, + 0.0007999996440002375, + 0.0004999997775001485, + 0.0 + ], + "scale": [ + 1.0, + 1.0, + 1.0 + ], + "physics": { + "mass": 0.35, + "friction": 0.25, + "type": "rigid" + }, + "visual": {} + }, + { + "category": "bowl", + "category_idx": 7, + "group": null, + "xlim": [ + -0.45, + 0.45 + ], + "ylim": [ + -0.25, + 0.07 + ], + "zlim": null, + "qpos": [ + 1, + 0, + 0, + 0 + ], + "rotate_deg": 0, + "rotate_rand": false, + "relative_plane": "Table", + "place_tag": null, + "margin": 0.01, + "check_mode": "bbox", + "need_check_stable": true, + "label": "bowl2", + "default_pos": [ + -0.38594993748692713, + 0.06071377897439755, + 0.7950002065998161 + ], + "default_ori": [ + 0.9999995550002969, + 0.0007999996440002375, + 0.0004999997775001485, + 0.0 + ], + "scale": [ + 1.0, + 1.0, + 1.0 + ], + "physics": { + "mass": 0.35, + "friction": 0.25, + "type": "rigid" + }, + "visual": {} + } + ] + }, + "Geometry": { + "camera_stand": [ + { + "category": "camera_stand", + "category_idx": 0, + "group": null, + "xlim": [ + 0.0, + 0.0 + ], + "ylim": [ + -0.47, + -0.47 + ], + "zlim": [ + 0.715, + 0.715 + ], + "qpos": [ + 0.707, + -0.707, + 0.0, + 0.0 + ], + "rotate_deg": 0, + "rotate_rand": false, + "relative_plane": "Ground", + "place_tag": null, + "margin": 0.01, + "check_mode": "bbox", + "need_check_stable": true, + "label": "camera_stand", + "default_pos": [ + 0.0, + -0.47, + 0.765 + ], + "default_ori": [ + 0.707, + -0.707, + 0.0, + 0.0 + ], + "scale": [ + 1.0, + 1.0, + 1.0 + ], + "physics": { + "type": "geometry" + }, + "visual": {} + } + ] + }, + "Room": { + "default": "Simple_Room_nolight", + "default_pos": [ + 0.0, + 0.0, + 0.0 + ], + "default_rot": [ + 1.0, + 0.0, + 0.0, + 0.0 + ], + "scale": [ + 0.5, + 0.5, + 0.5 + ] + }, + "Table": { + "default": "material_0122", + "scale": [ + 1.4, + 1.1, + 0.05 + ], + "default_pos": [ + 0.0, + -0.05, + 0.74 + ], + "default_ori": [ + 1.0, + 0.0, + 0.0, + 0.0 + ] + }, + "Ground": { + "geometry": "cube", + "thickness": 0.1, + "axis": "Z", + "default_pos": [ + 0.0, + 0.0, + 0.0 + ], + "materials": { + "type": "mdl", + "default": "material_0564", + "random": false + }, + "physics_material": { + "static_friction": 1.0, + "dynamic_friction": 1.0, + "restitution": 0.0, + "friction_combine_mode": "multiply", + "restitution_combine_mode": "multiply", + "compliant_contact_stiffness": 0.0, + "compliant_contact_damping": 0.0 + } + }, + "Background": { + "intensity": 1000, + "category_name": "brown_photostudio_02_4k.hdr" + } +} diff --git a/Material/material_0005/Carpet_Berber_Gray.mdl b/Material/material_0005/Carpet_Berber_Gray.mdl new file mode 100644 index 0000000000000000000000000000000000000000..78ace21610d6d36ea5c8fd44c3bb16818288596e --- /dev/null +++ b/Material/material_0005/Carpet_Berber_Gray.mdl @@ -0,0 +1,42 @@ +mdl 1.4; + +using ::OmniPBR import OmniPBR; +import ::tex::gamma_mode; +import ::state::normal; + +export material Carpet_Berber_Gray(*) + = OmniPBR( + diffuse_color_constant: color(1.0, 1.0, 1.0), + diffuse_texture: texture_2d("./Carpet_Berber_Gray_BaseColor.png", ::tex::gamma_srgb), + albedo_desaturation: 0.f, + albedo_add: 0.f, + albedo_brightness: 1.f, + diffuse_tint: color(1.f, 1.f, 1.f), + reflection_roughness_constant: 0.0, + reflection_roughness_texture_influence: 1.f, + reflectionroughness_texture: texture_2d(), + metallic_constant: 0.0, + metallic_texture_influence: 1.f, + metallic_texture: texture_2d(), + specular_level: 0.5f, + enable_ORM_texture: true, + ORM_texture: texture_2d("./Carpet_Berber_Gray_ORM.png", ::tex::gamma_linear), + ao_to_diffuse: 0.f, + ao_texture: texture_2d(), + enable_emission: false, + emissive_color: color(0.0, 0.0, 0.0), + emissive_mask_texture: texture_2d(), + emissive_intensity: 0.0, + bump_factor: 1.f, + normalmap_texture: texture_2d("./Carpet_Berber_Gray_Normal.png", ::tex::gamma_linear), + detail_bump_factor: 0.3f, + detail_normalmap_texture: texture_2d(), + project_uvw: false, + world_or_object: false, + uv_space_index: 0, + texture_translate: 0.f, + texture_rotate: 0.f, + texture_scale: 1.f, + detail_texture_translate: 0.f, + detail_texture_rotate: 0.f, + detail_texture_scale: 1.f); diff --git a/Material/material_0006/Carpet_Berber_Multi.mdl b/Material/material_0006/Carpet_Berber_Multi.mdl new file mode 100644 index 0000000000000000000000000000000000000000..decd2dea3cbe3d9dec256b71f72c1e1150b3a49d --- /dev/null +++ b/Material/material_0006/Carpet_Berber_Multi.mdl @@ -0,0 +1,42 @@ +mdl 1.4; + +using ::OmniPBR import OmniPBR; +import ::tex::gamma_mode; +import ::state::normal; + +export material Carpet_Berber_Multi(*) + = OmniPBR( + diffuse_color_constant: color(1.0, 1.0, 1.0), + diffuse_texture: texture_2d("./Carpet_Berber_Multi_BaseColor.png", ::tex::gamma_srgb), + albedo_desaturation: 0.f, + albedo_add: 0.f, + albedo_brightness: 1.f, + diffuse_tint: color(1.f, 1.f, 1.f), + reflection_roughness_constant: 0.0, + reflection_roughness_texture_influence: 1.f, + reflectionroughness_texture: texture_2d(), + metallic_constant: 0.0, + metallic_texture_influence: 1.f, + metallic_texture: texture_2d(), + specular_level: 0.5f, + enable_ORM_texture: true, + ORM_texture: texture_2d("./Carpet_Berber_Multi_ORM.png", ::tex::gamma_linear), + ao_to_diffuse: 0.f, + ao_texture: texture_2d(), + enable_emission: false, + emissive_color: color(0.0, 0.0, 0.0), + emissive_mask_texture: texture_2d(), + emissive_intensity: 0.0, + bump_factor: 1.f, + normalmap_texture: texture_2d("./Carpet_Berber_Multi_Normal.png", ::tex::gamma_linear), + detail_bump_factor: 0.3f, + detail_normalmap_texture: texture_2d(), + project_uvw: false, + world_or_object: false, + uv_space_index: 0, + texture_translate: 0.f, + texture_rotate: 0.f, + texture_scale: 1.f, + detail_texture_translate: 0.f, + detail_texture_rotate: 0.f, + detail_texture_scale: 1.f); diff --git a/Material/material_0021/Concrete_Formed.mdl b/Material/material_0021/Concrete_Formed.mdl new file mode 100644 index 0000000000000000000000000000000000000000..5d7eb8cf55f34887cf1e1068b08611e90a10ae6a --- /dev/null +++ b/Material/material_0021/Concrete_Formed.mdl @@ -0,0 +1,42 @@ +mdl 1.4; + +using ::OmniPBR import OmniPBR; +import ::tex::gamma_mode; +import ::state::normal; + +export material Concrete_Formed(*) + = OmniPBR( + diffuse_color_constant: color(1.0, 1.0, 1.0), + diffuse_texture: texture_2d("./Concrete_Formed_BaseColor.png", ::tex::gamma_srgb), + albedo_desaturation: 0.f, + albedo_add: 0.f, + albedo_brightness: 1.f, + diffuse_tint: color(1.f, 1.f, 1.f), + reflection_roughness_constant: 0.000000, + reflection_roughness_texture_influence: 1.f, + reflectionroughness_texture: texture_2d(), + metallic_constant: 0.000000, + metallic_texture_influence: 1.f, + metallic_texture: texture_2d(), + specular_level: 0.5f, + enable_ORM_texture: true, + ORM_texture: texture_2d("./Concrete_Formed_ORM.png", ::tex::gamma_linear), + ao_to_diffuse: 0.f, + ao_texture: texture_2d(), + enable_emission: false, + emissive_color: color(0.0, 0.0, 0.0), + emissive_mask_texture: texture_2d(), + emissive_intensity: 0.0, + bump_factor: 1.f, + normalmap_texture: texture_2d("./Concrete_Formed_Normal.png", ::tex::gamma_linear), + detail_bump_factor: 0.3f, + detail_normalmap_texture: texture_2d(), + project_uvw: false, + world_or_object: false, + uv_space_index: 0, + texture_translate: 0.f, + texture_rotate: 0.f, + texture_scale: 1.f, + detail_texture_translate: 0.f, + detail_texture_rotate: 0.f, + detail_texture_scale: 1.f); \ No newline at end of file diff --git a/Material/material_0042/Metal_Door.mdl b/Material/material_0042/Metal_Door.mdl new file mode 100644 index 0000000000000000000000000000000000000000..8f487cfc2c58a478eac4590d8afc78609a1caa85 --- /dev/null +++ b/Material/material_0042/Metal_Door.mdl @@ -0,0 +1,42 @@ +mdl 1.4; + +using ::OmniPBR import OmniPBR; +import ::tex::gamma_mode; +import ::state::normal; + +export material Metal_Door(*) + = OmniPBR( + diffuse_color_constant: color(0.439, 0.5, 0.561), + diffuse_texture: texture_2d(), //"./Metal_Door/Metal_Door_BaseColor.png", ::tex::gamma_srgb + albedo_desaturation: 0.f, + albedo_add: 0.f, + albedo_brightness: 1.f, + diffuse_tint: color(1.f, 1.f, 1.f), + reflection_roughness_constant: 0.5, + reflection_roughness_texture_influence: 0.f, + reflectionroughness_texture: texture_2d(), + metallic_constant: 1.0, + metallic_texture_influence: 0.f, + metallic_texture: texture_2d(), + specular_level: 0.5f, + enable_ORM_texture: false, + ORM_texture: texture_2d(), //"./Metal_Door/Metal_Door_ORM.png", ::tex::gamma_linear + ao_to_diffuse: 0.f, + ao_texture: texture_2d(), + enable_emission: false, + emissive_color: color(0.0, 0.0, 0.0), + emissive_mask_texture: texture_2d(), + emissive_intensity: 0.0, + bump_factor: 0.7f, + normalmap_texture: texture_2d("./Metal_Door_Normal.png", ::tex::gamma_linear), + detail_bump_factor: 0.3f, + detail_normalmap_texture: texture_2d(), + project_uvw: false, + world_or_object: false, + uv_space_index: 0, + texture_translate: 0.f, + texture_rotate: 0.f, + texture_scale: 1.f, + detail_texture_translate: 0.f, + detail_texture_rotate: 0.f, + detail_texture_scale: 1.f); diff --git a/Material/material_0043/Metal_Seamed_Roof.mdl b/Material/material_0043/Metal_Seamed_Roof.mdl new file mode 100644 index 0000000000000000000000000000000000000000..b1b31f96be6caf0747baeb85a0e14b2e55c07182 --- /dev/null +++ b/Material/material_0043/Metal_Seamed_Roof.mdl @@ -0,0 +1,43 @@ +mdl 1.4; + +using ::OmniPBR import OmniPBR; +import ::tex::gamma_mode; +import ::state::normal; + +export material Metal_Seamed_Roof(*) + = OmniPBR( + diffuse_color_constant: color(0.500000, 0.500000, 0.500000), + diffuse_texture: texture_2d("./Metal_Seamed_Roof_BaseColor.png", ::tex::gamma_srgb), + albedo_desaturation: 0.f, + albedo_add: 0.f, + albedo_brightness: 1.f, + diffuse_tint: color(0.4f, 0.05f, 0.03f), + reflection_roughness_constant: 0.000000, + reflection_roughness_texture_influence: 1.f, + reflectionroughness_texture: texture_2d(), + metallic_constant: 0.000000, + metallic_texture_influence: 1.f, + metallic_texture: texture_2d(), + specular_level: 0.5f, + enable_ORM_texture: true, + ORM_texture: texture_2d("./Metal_Seamed_Roof_ORM.png", ::tex::gamma_linear), + ao_to_diffuse: 0.f, + ao_texture: texture_2d(), + enable_emission: false, + emissive_color: color(1.000000, 1.000000, 1.000000), + emissive_mask_texture: texture_2d(), + emissive_intensity: 0.0, + bump_factor: 1.f, + normalmap_texture: texture_2d("./Metal_Seamed_Roof_Normal.png", ::tex::gamma_linear), + detail_bump_factor: 0.300000012f, + detail_normalmap_texture: texture_2d(), + project_uvw: false, + world_or_object: false, + uv_space_index: 0, + texture_translate: 0.f, + texture_rotate: 0.f, + texture_scale: 1.f, + detail_texture_translate: 0.f, + detail_texture_rotate: 0.f, + detail_texture_scale: 1.f); + diff --git a/Material/material_0051/Paint_Gloss.mdl b/Material/material_0051/Paint_Gloss.mdl new file mode 100644 index 0000000000000000000000000000000000000000..9aa015db690f2af2294d2e228de36cdf97e823b8 --- /dev/null +++ b/Material/material_0051/Paint_Gloss.mdl @@ -0,0 +1,42 @@ +mdl 1.4; + +import ::OmniPBR::OmniPBR; +import ::tex::gamma_mode; +import ::state::normal; + +export material Paint_Gloss(*) + = ::OmniPBR::OmniPBR( + diffuse_color_constant: color(0.200000003f, 0.200000003f, 0.200000003f), + diffuse_texture: texture_2d("./Paint_Gloss_Finish_BaseColor.png" /* tag 2107, version 608438266 */, ::tex::gamma_srgb), + albedo_desaturation: 0.f, + albedo_add: 0.f, + albedo_brightness: 1.f, + diffuse_tint: color(1.f, 1.f, 1.f), + reflection_roughness_constant: 0.5f, + reflection_roughness_texture_influence: 1.f, + reflectionroughness_texture: texture_2d(), + metallic_constant: 0.f, + metallic_texture_influence: 0.f, + metallic_texture: texture_2d(), + specular_level: 0.5f, + enable_ORM_texture: true, + ORM_texture: texture_2d("./Paint_Gloss_Finish_ORM.png" /* tag 2109, version 4089275038 */, ::tex::gamma_linear), + ao_to_diffuse: 0.f, + ao_texture: texture_2d(), + enable_emission: false, + emissive_color: color(1.f, 0.100000001f, 0.100000001f), + emissive_mask_texture: texture_2d(), + emissive_intensity: 40.f, + bump_factor: 1.f, + normalmap_texture: texture_2d("./Paint_Gloss_Finish_N.png" /* tag 2111, version 2879886466 */, ::tex::gamma_linear), + detail_bump_factor: 0.300000012f, + detail_normalmap_texture: texture_2d(), + project_uvw: false, + world_or_object: false, + uv_space_index: 0, + texture_translate: 0.f, + texture_rotate: 0.f, + texture_scale: 1.f, + detail_texture_translate: 0.f, + detail_texture_rotate: 0.f, + detail_texture_scale: 1.f); diff --git a/Material/material_0057/Asphalt.mdl b/Material/material_0057/Asphalt.mdl new file mode 100644 index 0000000000000000000000000000000000000000..80cff4d6191c541ea583dfb103a6b2a8eba848cd --- /dev/null +++ b/Material/material_0057/Asphalt.mdl @@ -0,0 +1,54 @@ +mdl 1.4; + +import ::OmniPBR::OmniPBR; +import ::anno::author; +import ::anno::description; +import ::anno::display_name; +import ::anno::key_words; +import ::anno::version; +import ::tex::gamma_mode; +import ::state::normal; + +export material Asphalt(*) +[[ + ::anno::display_name("Omni PBR "), + ::anno::description("Omni PBR, supports ORM textures"), + ::anno::version(1, 0, 0, ""), + ::anno::author("NVIDIA CORPORATION"), + ::anno::key_words(string[]("omni", "PBR", "omniverse", "generic")) +]] + = ::OmniPBR::OmniPBR( + diffuse_color_constant: color(0.200000003f, 0.200000003f, 0.200000003f), + diffuse_texture: texture_2d("./Asphalt_BaseColor.png" /* tag 2852, version 2204418729 */, ::tex::gamma_srgb), + albedo_desaturation: 0.f, + albedo_add: 0.f, + albedo_brightness: 0.75f, + diffuse_tint: color(1.f, 1.f, 1.f), + reflection_roughness_constant: 0.5f, + reflection_roughness_texture_influence: 0.f, + reflectionroughness_texture: texture_2d(), + metallic_constant: 0.f, + metallic_texture_influence: 0.f, + metallic_texture: texture_2d(), + specular_level: 0.5f, + enable_ORM_texture: true, + ORM_texture: texture_2d("./Asphalt_ORM.png" /* tag 2856, version 3899907150 */, ::tex::gamma_linear), + ao_to_diffuse: 0.f, + ao_texture: texture_2d(), + enable_emission: false, + emissive_color: color(1.f, 0.100000001f, 0.100000001f), + emissive_mask_texture: texture_2d(), + emissive_intensity: 40.f, + bump_factor: 0.5f, + normalmap_texture: texture_2d("./Asphalt_N.png" /* tag 2854, version 540269590 */, ::tex::gamma_linear), + detail_bump_factor: 0.300000012f, + detail_normalmap_texture: texture_2d(), + project_uvw: false, + world_or_object: false, + uv_space_index: 0, + texture_translate: 0.f, + texture_rotate: 0.f, + texture_scale: 1.f, + detail_texture_translate: 0.f, + detail_texture_rotate: 0.f, + detail_texture_scale: 1.f); diff --git a/Material/material_0059/Grass_Countryside.mdl b/Material/material_0059/Grass_Countryside.mdl new file mode 100644 index 0000000000000000000000000000000000000000..869a340a72acc81a7693cbc931bda196c4679be8 --- /dev/null +++ b/Material/material_0059/Grass_Countryside.mdl @@ -0,0 +1,42 @@ +mdl 1.4; + +using ::OmniPBR import OmniPBR; +import ::tex::gamma_mode; +import ::state::normal; + +export material Grass_Countryside(*) + = OmniPBR( + diffuse_color_constant: color(1.0, 1.0, 1.0), + diffuse_texture: texture_2d("./Grass_Countryside_BaseColor.png", ::tex::gamma_srgb), + albedo_desaturation: 0.f, + albedo_add: 0.f, + albedo_brightness: 1.f, + diffuse_tint: color(1.f, 1.f, 1.f), + reflection_roughness_constant: 1.0, + reflection_roughness_texture_influence: 1.f, + reflectionroughness_texture: texture_2d(), + metallic_constant: 0.0, + metallic_texture_influence: 1.f, + metallic_texture: texture_2d(), + specular_level: 0.5f, + enable_ORM_texture: true, + ORM_texture: texture_2d("./Grass_Countryside_ORM.png", ::tex::gamma_linear), + ao_to_diffuse: 0.f, + ao_texture: texture_2d(), + enable_emission: false, + emissive_color: color(0.0, 0.0, 0.0), + emissive_mask_texture: texture_2d(), + emissive_intensity: 0.0, + bump_factor: 1.f, + normalmap_texture: texture_2d("./Grass_Countryside_Normal.png", ::tex::gamma_linear), + detail_bump_factor: 0.3f, + detail_normalmap_texture: texture_2d(), + project_uvw: false, + world_or_object: false, + uv_space_index: 0, + texture_translate: 0.f, + texture_rotate: 0.f, + texture_scale: 1.f, + detail_texture_translate: 0.f, + detail_texture_rotate: 0.f, + detail_texture_scale: 1.f); diff --git a/Material/material_0060/Grass_Cut.mdl b/Material/material_0060/Grass_Cut.mdl new file mode 100644 index 0000000000000000000000000000000000000000..5cd11f2040745f8f71177c7a2573c8c609890375 --- /dev/null +++ b/Material/material_0060/Grass_Cut.mdl @@ -0,0 +1,42 @@ +mdl 1.4; + +using ::OmniPBR import OmniPBR; +import ::tex::gamma_mode; +import ::state::normal; + +export material Grass_Cut(*) + = OmniPBR( + diffuse_color_constant: color(1.0, 1.0, 1.0), + diffuse_texture: texture_2d("./Grass_Cut_BaseColor.png", ::tex::gamma_srgb), + albedo_desaturation: 0.f, + albedo_add: 0.f, + albedo_brightness: 1.f, + diffuse_tint: color(1.f, 1.f, 1.f), + reflection_roughness_constant: 1.0, + reflection_roughness_texture_influence: 1.f, + reflectionroughness_texture: texture_2d(), + metallic_constant: 0.0, + metallic_texture_influence: 1.f, + metallic_texture: texture_2d(), + specular_level: 0.5f, + enable_ORM_texture: true, + ORM_texture: texture_2d("./Grass_Cut_ORM.png", ::tex::gamma_linear), + ao_to_diffuse: 0.f, + ao_texture: texture_2d(), + enable_emission: false, + emissive_color: color(0.0, 0.0, 0.0), + emissive_mask_texture: texture_2d(), + emissive_intensity: 0.0, + bump_factor: 1.f, + normalmap_texture: texture_2d("./Grass_Cut_Normal.png", ::tex::gamma_linear), + detail_bump_factor: 0.3f, + detail_normalmap_texture: texture_2d(), + project_uvw: false, + world_or_object: false, + uv_space_index: 0, + texture_translate: 0.f, + texture_rotate: 0.f, + texture_scale: 1.f, + detail_texture_translate: 0.f, + detail_texture_rotate: 0.f, + detail_texture_scale: 1.f); diff --git a/Material/material_0073/Adobe_Octagon_Dots.mdl b/Material/material_0073/Adobe_Octagon_Dots.mdl new file mode 100644 index 0000000000000000000000000000000000000000..98a46e669c20c5554535a3fd7fe70ce5ad21836a --- /dev/null +++ b/Material/material_0073/Adobe_Octagon_Dots.mdl @@ -0,0 +1,54 @@ +mdl 1.4; + +import ::OmniPBR::OmniPBR; +import ::anno::author; +import ::anno::description; +import ::anno::display_name; +import ::anno::key_words; +import ::anno::version; +import ::tex::gamma_mode; +import ::state::normal; + +export material Adobe_Octagon_Dots(*) +[[ + ::anno::display_name("Omni PBR "), + ::anno::description("Omni PBR, supports ORM textures"), + ::anno::version(1, 0, 0, ""), + ::anno::author("NVIDIA CORPORATION"), + ::anno::key_words(string[]("omni", "PBR", "omniverse", "generic")) +]] + = ::OmniPBR::OmniPBR( + diffuse_color_constant: color(0.200000003f, 0.200000003f, 0.200000003f), + diffuse_texture: texture_2d("./Adobe_Octagon_Dots_BaseColor.png" /* tag 2875, version 38440193 */, ::tex::gamma_srgb), + albedo_desaturation: 0.f, + albedo_add: 0.f, + albedo_brightness: 1.f, + diffuse_tint: color(1.f, 1.f, 1.f), + reflection_roughness_constant: 0.5f, + reflection_roughness_texture_influence: 1.f, + reflectionroughness_texture: texture_2d(), + metallic_constant: 0.f, + metallic_texture_influence: 0.f, + metallic_texture: texture_2d(), + specular_level: 0.5f, + enable_ORM_texture: true, + ORM_texture: texture_2d("./Adobe_Octagon_Dots_ORM.png" /* tag 2879, version 4019933715 */, ::tex::gamma_linear), + ao_to_diffuse: 0.f, + ao_texture: texture_2d(), + enable_emission: false, + emissive_color: color(1.f, 0.100000001f, 0.100000001f), + emissive_mask_texture: texture_2d(), + emissive_intensity: 40.f, + bump_factor: 1.f, + normalmap_texture: texture_2d("./Adobe_Octagon_Dots_N.png" /* tag 2877, version 1086958958 */, ::tex::gamma_linear), + detail_bump_factor: 0.300000012f, + detail_normalmap_texture: texture_2d(), + project_uvw: false, + world_or_object: false, + uv_space_index: 0, + texture_translate: 0.f, + texture_rotate: 0.f, + texture_scale: 1.f, + detail_texture_translate: 0.f, + detail_texture_rotate: 0.f, + detail_texture_scale: 1.f); diff --git a/Material/material_0080/Granite_Light.mdl b/Material/material_0080/Granite_Light.mdl new file mode 100644 index 0000000000000000000000000000000000000000..9a483562c339e8a271d3a15021a8ecbc3667ef46 --- /dev/null +++ b/Material/material_0080/Granite_Light.mdl @@ -0,0 +1,54 @@ +mdl 1.4; + +import ::OmniPBR::OmniPBR; +import ::anno::author; +import ::anno::description; +import ::anno::display_name; +import ::anno::key_words; +import ::anno::version; +import ::tex::gamma_mode; +import ::state::normal; + +export material Granite_Light(*) +[[ + ::anno::display_name("Omni PBR "), + ::anno::description("Omni PBR, supports ORM textures"), + ::anno::version(1, 0, 0, ""), + ::anno::author("NVIDIA CORPORATION"), + ::anno::key_words(string[]("omni", "PBR", "omniverse", "generic")) +]] + = ::OmniPBR::OmniPBR( + diffuse_color_constant: color(0.200000003f, 0.200000003f, 0.200000003f), + diffuse_texture: texture_2d("./Granite_Light_BaseColor.png" /* tag 2805, version 2353977154 */, ::tex::gamma_srgb), + albedo_desaturation: 0.f, + albedo_add: 0.f, + albedo_brightness: 1.f, + diffuse_tint: color(1.f, 1.f, 1.f), + reflection_roughness_constant: 0.5f, + reflection_roughness_texture_influence: 1.f, + reflectionroughness_texture: texture_2d(), + metallic_constant: 0.f, + metallic_texture_influence: 1.f, + metallic_texture: texture_2d(), + specular_level: 0.5f, + enable_ORM_texture: true, + ORM_texture: texture_2d("./Granite_Light_ORM.png" /* tag 2807, version 4253227050 */, ::tex::gamma_linear), + ao_to_diffuse: 0.f, + ao_texture: texture_2d(), + enable_emission: false, + emissive_color: color(1.f, 0.100000001f, 0.100000001f), + emissive_mask_texture: texture_2d(), + emissive_intensity: 40.f, + bump_factor: 1.f, + normalmap_texture: texture_2d("./Granite_Light_N.png" /* tag 2809, version 3622057334 */, ::tex::gamma_linear), + detail_bump_factor: 0.300000012f, + detail_normalmap_texture: texture_2d(), + project_uvw: false, + world_or_object: false, + uv_space_index: 0, + texture_translate: 0.f, + texture_rotate: 0.f, + texture_scale: 1.f, + detail_texture_translate: 0.f, + detail_texture_rotate: 0.f, + detail_texture_scale: 1.f); diff --git a/Material/material_0081/Gravel.mdl b/Material/material_0081/Gravel.mdl new file mode 100644 index 0000000000000000000000000000000000000000..bee17aa43dccc427ec182fe5c97597d2f480ed09 --- /dev/null +++ b/Material/material_0081/Gravel.mdl @@ -0,0 +1,54 @@ +mdl 1.4; + +import ::OmniPBR::OmniPBR; +import ::anno::author; +import ::anno::description; +import ::anno::display_name; +import ::anno::key_words; +import ::anno::version; +import ::tex::gamma_mode; +import ::state::normal; + +export material Gravel(*) +[[ + ::anno::display_name("Omni PBR "), + ::anno::description("Omni PBR, supports ORM textures"), + ::anno::version(1, 0, 0, ""), + ::anno::author("NVIDIA CORPORATION"), + ::anno::key_words(string[]("omni", "PBR", "omniverse", "generic")) +]] + = ::OmniPBR::OmniPBR( + diffuse_color_constant: color(0.200000003f, 0.200000003f, 0.200000003f), + diffuse_texture: texture_2d("./Gravel_BaseColor.png" /* tag 2893, version 3900052180 */, ::tex::gamma_srgb), + albedo_desaturation: 0.f, + albedo_add: 0.f, + albedo_brightness: 1.f, + diffuse_tint: color(1.f, 1.f, 1.f), + reflection_roughness_constant: 0.5f, + reflection_roughness_texture_influence: 0.f, + reflectionroughness_texture: texture_2d(), + metallic_constant: 0.f, + metallic_texture_influence: 0.f, + metallic_texture: texture_2d(), + specular_level: 0.5f, + enable_ORM_texture: true, + ORM_texture: texture_2d("./Gravel_ORM.png" /* tag 2897, version 3853061844 */, ::tex::gamma_linear), + ao_to_diffuse: 0.f, + ao_texture: texture_2d(), + enable_emission: false, + emissive_color: color(1.f, 0.100000001f, 0.100000001f), + emissive_mask_texture: texture_2d(), + emissive_intensity: 40.f, + bump_factor: 1.f, + normalmap_texture: texture_2d("./Gravel_N.png" /* tag 2895, version 1411071343 */, ::tex::gamma_linear), + detail_bump_factor: 0.300000012f, + detail_normalmap_texture: texture_2d(), + project_uvw: false, + world_or_object: false, + uv_space_index: 0, + texture_translate: 0.f, + texture_rotate: 0.f, + texture_scale: 1.f, + detail_texture_translate: 0.f, + detail_texture_rotate: 0.f, + detail_texture_scale: 1.f); diff --git a/Material/material_0097/Terrazzo.mdl b/Material/material_0097/Terrazzo.mdl new file mode 100644 index 0000000000000000000000000000000000000000..a05ee0dba596e7b1ff48363e2dad2bd7362c45a7 --- /dev/null +++ b/Material/material_0097/Terrazzo.mdl @@ -0,0 +1,54 @@ +mdl 1.4; + +import ::OmniPBR::OmniPBR; +import ::anno::author; +import ::anno::description; +import ::anno::display_name; +import ::anno::key_words; +import ::anno::version; +import ::tex::gamma_mode; +import ::state::normal; + +export material Terrazzo(*) +[[ + ::anno::display_name("Omni PBR "), + ::anno::description("Omni PBR, supports ORM textures"), + ::anno::version(1, 0, 0, ""), + ::anno::author("NVIDIA CORPORATION"), + ::anno::key_words(string[]("omni", "PBR", "omniverse", "generic")) +]] + = ::OmniPBR::OmniPBR( + diffuse_color_constant: color(0.200000003f, 0.200000003f, 0.200000003f), + diffuse_texture: texture_2d("./Terrazzo_BaseColor.png" /* tag 2812, version 3722729693 */, ::tex::gamma_srgb), + albedo_desaturation: 0.f, + albedo_add: 0.f, + albedo_brightness: 1.f, + diffuse_tint: color(1.f, 1.f, 1.f), + reflection_roughness_constant: 0.5f, + reflection_roughness_texture_influence: 1.f, + reflectionroughness_texture: texture_2d(), + metallic_constant: 0.f, + metallic_texture_influence: 1.f, + metallic_texture: texture_2d(), + specular_level: 0.5f, + enable_ORM_texture: true, + ORM_texture: texture_2d("./Terrazzo_ORM.png" /* tag 2814, version 2737548837 */, ::tex::gamma_linear), + ao_to_diffuse: 0.f, + ao_texture: texture_2d(), + enable_emission: false, + emissive_color: color(1.f, 0.100000001f, 0.100000001f), + emissive_mask_texture: texture_2d(), + emissive_intensity: 40.f, + bump_factor: 1.f, + normalmap_texture: texture_2d("./Terrazzo_N.png" /* tag 2816, version 2084641571 */, ::tex::gamma_linear), + detail_bump_factor: 0.300000012f, + detail_normalmap_texture: texture_2d(), + project_uvw: false, + world_or_object: false, + uv_space_index: 0, + texture_translate: 0.f, + texture_rotate: 0.f, + texture_scale: 1.f, + detail_texture_translate: 0.f, + detail_texture_rotate: 0.f, + detail_texture_scale: 1.f); diff --git a/Material/material_0105/Linen_White.mdl b/Material/material_0105/Linen_White.mdl new file mode 100644 index 0000000000000000000000000000000000000000..f2b8dcf2e8140a550ec143020c8d40fa65a71d92 --- /dev/null +++ b/Material/material_0105/Linen_White.mdl @@ -0,0 +1,47 @@ +mdl 1.4; + +import ::OmniPBR::OmniPBR; +import ::anno::author; +import ::anno::description; +import ::anno::display_name; +import ::anno::key_words; +import ::anno::version; +import ::tex::gamma_mode; +import ::state::normal; + +export material Linen_White(*) + = ::OmniPBR::OmniPBR( + diffuse_color_constant: color(0.200000003f, 0.200000003f, 0.200000003f), + diffuse_texture: texture_2d("./Linen_White_BaseColor.png" /* tag 2956, version 3373013613 */, ::tex::gamma_srgb), + albedo_desaturation: 0.f, + albedo_add: 0.f, + albedo_brightness: 1.f, + diffuse_tint: color(1.f, 1.f, 1.f), + reflection_roughness_constant: 0.5f, + reflection_roughness_texture_influence: 1.f, + reflectionroughness_texture: texture_2d(), + metallic_constant: 0.f, + metallic_texture_influence: 1.f, + metallic_texture: texture_2d(), + specular_level: 0.5f, + enable_ORM_texture: true, + ORM_texture: texture_2d("./Linen_White_ORM.png", ::tex::gamma_linear), + ao_to_diffuse: 0.f, + ao_texture: texture_2d(), + enable_emission: false, + emissive_color: color(1.f, 0.100000001f, 0.100000001f), + emissive_mask_texture: texture_2d(), + emissive_intensity: 40.f, + bump_factor: 1.f, + normalmap_texture: texture_2d("./Linen_White_N.png", ::tex::gamma_linear), + detail_bump_factor: 1.0f, + detail_normalmap_texture: texture_2d("./Linen_White_DN.png", ::tex::gamma_linear), + project_uvw: false, + world_or_object: false, + uv_space_index: 0, + texture_translate: 0.f, + texture_rotate: 0.f, + texture_scale: 1.f, + detail_texture_translate: 0.f, + detail_texture_rotate: 0.f, + detail_texture_scale: float2(10.f,10.f)); diff --git a/Material/material_0108/MDF.mdl b/Material/material_0108/MDF.mdl new file mode 100644 index 0000000000000000000000000000000000000000..c3c79a09e6f005afc41df607ce987e0dd2f5e2bf --- /dev/null +++ b/Material/material_0108/MDF.mdl @@ -0,0 +1,42 @@ +mdl 1.4; + +import ::OmniPBR::OmniPBR; +import ::tex::gamma_mode; +import ::state::normal; + +export material MDF(*) + = ::OmniPBR::OmniPBR( + diffuse_color_constant: color(0.200000003f, 0.200000003f, 0.200000003f), + diffuse_texture: texture_2d("./MDF_BaseColor.png" /* tag 2156, version 3084118474 */, ::tex::gamma_srgb), + albedo_desaturation: 0.f, + albedo_add: 0.f, + albedo_brightness: 1.f, + diffuse_tint: color(1.f, 1.f, 1.f), + reflection_roughness_constant: 0.5f, + reflection_roughness_texture_influence: 1.f, + reflectionroughness_texture: texture_2d(), + metallic_constant: 0.5f, + metallic_texture_influence: 1.f, + metallic_texture: texture_2d(), + specular_level: 0.5f, + enable_ORM_texture: true, + ORM_texture: texture_2d("./MDF_ORM.png" /* tag 2158, version 356350774 */, ::tex::gamma_linear), + ao_to_diffuse: 0.f, + ao_texture: texture_2d(), + enable_emission: false, + emissive_color: color(1.f, 0.100000001f, 0.100000001f), + emissive_mask_texture: texture_2d(), + emissive_intensity: 40.f, + bump_factor: 1.f, + normalmap_texture: texture_2d("./MDF_N.png" /* tag 2160, version 818451772 */, ::tex::gamma_linear), + detail_bump_factor: 0.300000012f, + detail_normalmap_texture: texture_2d(), + project_uvw: false, + world_or_object: false, + uv_space_index: 0, + texture_translate: 0.f, + texture_rotate: 0.f, + texture_scale: 1.f, + detail_texture_translate: 0.f, + detail_texture_rotate: 0.f, + detail_texture_scale: 1.f); diff --git a/Material/material_0110/Plaster.mdl b/Material/material_0110/Plaster.mdl new file mode 100644 index 0000000000000000000000000000000000000000..48c361416b91fe3a23a1c7bcc7a4654ddc707cf8 --- /dev/null +++ b/Material/material_0110/Plaster.mdl @@ -0,0 +1,54 @@ +mdl 1.4; + +import ::OmniPBR::OmniPBR; +import ::anno::author; +import ::anno::description; +import ::anno::display_name; +import ::anno::key_words; +import ::anno::version; +import ::tex::gamma_mode; +import ::state::normal; + +export material Plaster(*) +[[ + ::anno::display_name("Omni PBR "), + ::anno::description("Omni PBR, supports ORM textures"), + ::anno::version(1, 0, 0, ""), + ::anno::author("NVIDIA CORPORATION"), + ::anno::key_words(string[]("omni", "PBR", "omniverse", "generic")) +]] + = ::OmniPBR::OmniPBR( + diffuse_color_constant: color(0.200000003f, 0.200000003f, 0.200000003f), + diffuse_texture: texture_2d("./Plaster_BaseColor.png" /* tag 2739, version 3703676365 */, ::tex::gamma_srgb), + albedo_desaturation: 0.f, + albedo_add: 0.f, + albedo_brightness: 1.f, + diffuse_tint: color(1.f, 1.f, 1.f), + reflection_roughness_constant: 0.5f, + reflection_roughness_texture_influence: 1.f, + reflectionroughness_texture: texture_2d(), + metallic_constant: 0.f, + metallic_texture_influence: 0.f, + metallic_texture: texture_2d(), + specular_level: 0.5f, + enable_ORM_texture: true, + ORM_texture: texture_2d("./Plaster_ORM.png" /* tag 2741, version 3733936840 */, ::tex::gamma_linear), + ao_to_diffuse: 0.f, + ao_texture: texture_2d(), + enable_emission: false, + emissive_color: color(1.f, 0.100000001f, 0.100000001f), + emissive_mask_texture: texture_2d(), + emissive_intensity: 40.f, + bump_factor: 1.f, + normalmap_texture: texture_2d("./Plaster_N.png" /* tag 2743, version 630160703 */, ::tex::gamma_linear), + detail_bump_factor: 0.300000012f, + detail_normalmap_texture: texture_2d(), + project_uvw: false, + world_or_object: false, + uv_space_index: 0, + texture_translate: 0.f, + texture_rotate: 0.f, + texture_scale: 1.f, + detail_texture_translate: 0.f, + detail_texture_rotate: 0.f, + detail_texture_scale: 1.f); diff --git a/Material/material_0117/Birch_Planks.mdl b/Material/material_0117/Birch_Planks.mdl new file mode 100644 index 0000000000000000000000000000000000000000..0d443c0345be41dbf9b46324cb595f51cdc459aa --- /dev/null +++ b/Material/material_0117/Birch_Planks.mdl @@ -0,0 +1,54 @@ +mdl 1.4; + +import ::OmniPBR::OmniPBR; +import ::anno::author; +import ::anno::description; +import ::anno::display_name; +import ::anno::key_words; +import ::anno::version; +import ::tex::gamma_mode; +import ::state::normal; + +export material Birch_Planks(*) +[[ + ::anno::display_name("Omni PBR "), + ::anno::description("Omni PBR, supports ORM textures"), + ::anno::version(1, 0, 0, ""), + ::anno::author("NVIDIA CORPORATION"), + ::anno::key_words(string[]("omni", "PBR", "omniverse", "generic")) +]] + = ::OmniPBR::OmniPBR( + diffuse_color_constant: color(0.200000003f, 0.200000003f, 0.200000003f), + diffuse_texture: texture_2d("./Birch_Planks_BaseColor.png" /* tag 2743, version 2730254677 */, ::tex::gamma_srgb), + albedo_desaturation: 0.f, + albedo_add: 0.f, + albedo_brightness: 1.f, + diffuse_tint: color(1.f, 1.f, 1.f), + reflection_roughness_constant: 0.5f, + reflection_roughness_texture_influence: 1.f, + reflectionroughness_texture: texture_2d(), + metallic_constant: 0.f, + metallic_texture_influence: 0.f, + metallic_texture: texture_2d(), + specular_level: 0.5f, + enable_ORM_texture: true, + ORM_texture: texture_2d("./Birch_Planks_ORM.png" /* tag 2739, version 900995322 */, ::tex::gamma_linear), + ao_to_diffuse: 0.f, + ao_texture: texture_2d(), + enable_emission: false, + emissive_color: color(1.f, 0.100000001f, 0.100000001f), + emissive_mask_texture: texture_2d(), + emissive_intensity: 40.f, + bump_factor: 1.f, + normalmap_texture: texture_2d("./Birch_Planks_N.png" /* tag 2741, version 282223068 */, ::tex::gamma_linear), + detail_bump_factor: 0.300000012f, + detail_normalmap_texture: texture_2d(), + project_uvw: false, + world_or_object: false, + uv_space_index: 0, + texture_translate: 0.f, + texture_rotate: 0.f, + texture_scale: 1.f, + detail_texture_translate: 0.f, + detail_texture_rotate: 0.f, + detail_texture_scale: 1.f); diff --git a/Material/material_0118/Cherry.mdl b/Material/material_0118/Cherry.mdl new file mode 100644 index 0000000000000000000000000000000000000000..fb596fc6ce38b6b4accb9a99418f086145334e6c --- /dev/null +++ b/Material/material_0118/Cherry.mdl @@ -0,0 +1,54 @@ +mdl 1.4; + +import ::OmniPBR::OmniPBR; +import ::anno::author; +import ::anno::description; +import ::anno::display_name; +import ::anno::key_words; +import ::anno::version; +import ::tex::gamma_mode; +import ::state::normal; + +export material Cherry(*) +[[ + ::anno::display_name("Omni PBR "), + ::anno::description("Omni PBR, supports ORM textures"), + ::anno::version(1, 0, 0, ""), + ::anno::author("NVIDIA CORPORATION"), + ::anno::key_words(string[]("omni", "PBR", "omniverse", "generic")) +]] + = ::OmniPBR::OmniPBR( + diffuse_color_constant: color(0.200000003f, 0.200000003f, 0.200000003f), + diffuse_texture: texture_2d("./Cherry_BaseColor.png" /* tag 2748, version 4095822192 */, ::tex::gamma_srgb), + albedo_desaturation: 0.f, + albedo_add: 0.f, + albedo_brightness: 1.f, + diffuse_tint: color(1.f, 1.f, 1.f), + reflection_roughness_constant: 0.5f, + reflection_roughness_texture_influence: 0.f, + reflectionroughness_texture: texture_2d(), + metallic_constant: 0.f, + metallic_texture_influence: 0.f, + metallic_texture: texture_2d(), + specular_level: 0.5f, + enable_ORM_texture: true, + ORM_texture: texture_2d("./Cherry_ORM.png" /* tag 2750, version 764486907 */, ::tex::gamma_linear), + ao_to_diffuse: 0.f, + ao_texture: texture_2d(), + enable_emission: false, + emissive_color: color(1.f, 0.100000001f, 0.100000001f), + emissive_mask_texture: texture_2d(), + emissive_intensity: 40.f, + bump_factor: 1.f, + normalmap_texture: texture_2d("./Cherry_N.png" /* tag 2752, version 697597338 */, ::tex::gamma_linear), + detail_bump_factor: 0.300000012f, + detail_normalmap_texture: texture_2d(), + project_uvw: false, + world_or_object: false, + uv_space_index: 0, + texture_translate: 0.f, + texture_rotate: 0.f, + texture_scale: 1.f, + detail_texture_translate: 0.f, + detail_texture_rotate: 0.f, + detail_texture_scale: 1.f); diff --git a/Material/material_0131/MDF.mdl b/Material/material_0131/MDF.mdl new file mode 100644 index 0000000000000000000000000000000000000000..c3c79a09e6f005afc41df607ce987e0dd2f5e2bf --- /dev/null +++ b/Material/material_0131/MDF.mdl @@ -0,0 +1,42 @@ +mdl 1.4; + +import ::OmniPBR::OmniPBR; +import ::tex::gamma_mode; +import ::state::normal; + +export material MDF(*) + = ::OmniPBR::OmniPBR( + diffuse_color_constant: color(0.200000003f, 0.200000003f, 0.200000003f), + diffuse_texture: texture_2d("./MDF_BaseColor.png" /* tag 2156, version 3084118474 */, ::tex::gamma_srgb), + albedo_desaturation: 0.f, + albedo_add: 0.f, + albedo_brightness: 1.f, + diffuse_tint: color(1.f, 1.f, 1.f), + reflection_roughness_constant: 0.5f, + reflection_roughness_texture_influence: 1.f, + reflectionroughness_texture: texture_2d(), + metallic_constant: 0.5f, + metallic_texture_influence: 1.f, + metallic_texture: texture_2d(), + specular_level: 0.5f, + enable_ORM_texture: true, + ORM_texture: texture_2d("./MDF_ORM.png" /* tag 2158, version 356350774 */, ::tex::gamma_linear), + ao_to_diffuse: 0.f, + ao_texture: texture_2d(), + enable_emission: false, + emissive_color: color(1.f, 0.100000001f, 0.100000001f), + emissive_mask_texture: texture_2d(), + emissive_intensity: 40.f, + bump_factor: 1.f, + normalmap_texture: texture_2d("./MDF_N.png" /* tag 2160, version 818451772 */, ::tex::gamma_linear), + detail_bump_factor: 0.300000012f, + detail_normalmap_texture: texture_2d(), + project_uvw: false, + world_or_object: false, + uv_space_index: 0, + texture_translate: 0.f, + texture_rotate: 0.f, + texture_scale: 1.f, + detail_texture_translate: 0.f, + detail_texture_rotate: 0.f, + detail_texture_scale: 1.f); diff --git a/Material/material_0132/Paper.mdl b/Material/material_0132/Paper.mdl new file mode 100644 index 0000000000000000000000000000000000000000..393add63cffdfa4bbcd7a3648797d100df8be58f --- /dev/null +++ b/Material/material_0132/Paper.mdl @@ -0,0 +1,42 @@ +mdl 1.4; + +import ::OmniPBR::OmniPBR; +import ::tex::gamma_mode; +import ::state::normal; + +export material Paper(*) + = ::OmniPBR::OmniPBR( + diffuse_color_constant: color(0.200000003f, 0.200000003f, 0.200000003f), + diffuse_texture: texture_2d("./Paper_BaseColor.png" /* tag 2156, version 3084118474 */, ::tex::gamma_srgb), + albedo_desaturation: 0.f, + albedo_add: 0.f, + albedo_brightness: 1.f, + diffuse_tint: color(1.f, 1.f, 1.f), + reflection_roughness_constant: 0.5f, + reflection_roughness_texture_influence: 1.f, + reflectionroughness_texture: texture_2d(), + metallic_constant: 0.5f, + metallic_texture_influence: 1.f, + metallic_texture: texture_2d(), + specular_level: 0.5f, + enable_ORM_texture: true, + ORM_texture: texture_2d("./Paper_ORM.png" /* tag 2158, version 356350774 */, ::tex::gamma_linear), + ao_to_diffuse: 0.f, + ao_texture: texture_2d(), + enable_emission: false, + emissive_color: color(1.f, 0.100000001f, 0.100000001f), + emissive_mask_texture: texture_2d(), + emissive_intensity: 40.f, + bump_factor: 1.f, + normalmap_texture: texture_2d("./Paper_N.png" /* tag 2160, version 818451772 */, ::tex::gamma_linear), + detail_bump_factor: 0.300000012f, + detail_normalmap_texture: texture_2d(), + project_uvw: false, + world_or_object: false, + uv_space_index: 0, + texture_translate: 0.f, + texture_rotate: 0.f, + texture_scale: 1.f, + detail_texture_translate: 0.f, + detail_texture_rotate: 0.f, + detail_texture_scale: 1.f); diff --git a/Material/material_0134/Walnut.mdl b/Material/material_0134/Walnut.mdl new file mode 100644 index 0000000000000000000000000000000000000000..38906cdc63fce5fec18002a4489c13aa07c66934 --- /dev/null +++ b/Material/material_0134/Walnut.mdl @@ -0,0 +1,54 @@ +mdl 1.4; + +import ::OmniPBR::OmniPBR; +import ::anno::author; +import ::anno::description; +import ::anno::display_name; +import ::anno::key_words; +import ::anno::version; +import ::tex::gamma_mode; +import ::state::normal; + +export material Walnut(*) +[[ + ::anno::display_name("Omni PBR "), + ::anno::description("Omni PBR, supports ORM textures"), + ::anno::version(1, 0, 0, ""), + ::anno::author("NVIDIA CORPORATION"), + ::anno::key_words(string[]("omni", "PBR", "omniverse", "generic")) +]] + = ::OmniPBR::OmniPBR( + diffuse_color_constant: color(0.200000003f, 0.200000003f, 0.200000003f), + diffuse_texture: texture_2d("./Walnut_BaseColor.png" /* tag 2767, version 2362837691 */, ::tex::gamma_srgb), + albedo_desaturation: 0.f, + albedo_add: 0.f, + albedo_brightness: 1.f, + diffuse_tint: color(1.f, 1.f, 1.f), + reflection_roughness_constant: 0.5f, + reflection_roughness_texture_influence: 1.f, + reflectionroughness_texture: texture_2d(), + metallic_constant: 0.f, + metallic_texture_influence: 0.f, + metallic_texture: texture_2d(), + specular_level: 0.5f, + enable_ORM_texture: true, + ORM_texture: texture_2d("./Walnut_ORM.png" /* tag 2769, version 2941301943 */, ::tex::gamma_linear), + ao_to_diffuse: 0.f, + ao_texture: texture_2d(), + enable_emission: false, + emissive_color: color(1.f, 0.100000001f, 0.100000001f), + emissive_mask_texture: texture_2d(), + emissive_intensity: 40.f, + bump_factor: 1.f, + normalmap_texture: texture_2d("./Walnut_N.png" /* tag 2771, version 1355386593 */, ::tex::gamma_linear), + detail_bump_factor: 0.300000012f, + detail_normalmap_texture: texture_2d(), + project_uvw: false, + world_or_object: false, + uv_space_index: 0, + texture_translate: 0.f, + texture_rotate: 0.f, + texture_scale: 1.f, + detail_texture_translate: 0.f, + detail_texture_rotate: 0.f, + detail_texture_scale: 1.f); diff --git a/Material/material_0135/Walnut_Planks.mdl b/Material/material_0135/Walnut_Planks.mdl new file mode 100644 index 0000000000000000000000000000000000000000..b2b1f8e994f141a5ddbc6d1db42fcb4b714e6237 --- /dev/null +++ b/Material/material_0135/Walnut_Planks.mdl @@ -0,0 +1,54 @@ +mdl 1.4; + +import ::OmniPBR::OmniPBR; +import ::anno::author; +import ::anno::description; +import ::anno::display_name; +import ::anno::key_words; +import ::anno::version; +import ::tex::gamma_mode; +import ::state::normal; + +export material Walnut_Planks(*) +[[ + ::anno::display_name("Omni PBR "), + ::anno::description("Omni PBR, supports ORM textures"), + ::anno::version(1, 0, 0, ""), + ::anno::author("NVIDIA CORPORATION"), + ::anno::key_words(string[]("omni", "PBR", "omniverse", "generic")) +]] + = ::OmniPBR::OmniPBR( + diffuse_color_constant: color(0.200000003f, 0.200000003f, 0.200000003f), + diffuse_texture: texture_2d("./Walnut_Planks_BaseColor.png" /* tag 2754, version 3523353144 */, ::tex::gamma_srgb), + albedo_desaturation: 0.f, + albedo_add: 0.f, + albedo_brightness: 1.f, + diffuse_tint: color(1.f, 1.f, 1.f), + reflection_roughness_constant: 0.5f, + reflection_roughness_texture_influence: 1.f, + reflectionroughness_texture: texture_2d(), + metallic_constant: 0.f, + metallic_texture_influence: 0.f, + metallic_texture: texture_2d(), + specular_level: 0.5f, + enable_ORM_texture: true, + ORM_texture: texture_2d("./Walnut_Planks_ORM.png" /* tag 2758, version 726523789 */, ::tex::gamma_linear), + ao_to_diffuse: 0.f, + ao_texture: texture_2d(), + enable_emission: false, + emissive_color: color(1.f, 0.100000001f, 0.100000001f), + emissive_mask_texture: texture_2d(), + emissive_intensity: 40.f, + bump_factor: 1.f, + normalmap_texture: texture_2d("./Walnut_Planks_N.png" /* tag 2788, version 2308929211 */, ::tex::gamma_linear), + detail_bump_factor: 0.300000012f, + detail_normalmap_texture: texture_2d(), + project_uvw: false, + world_or_object: false, + uv_space_index: 0, + texture_translate: 0.f, + texture_rotate: 0.f, + texture_scale: 1.f, + detail_texture_translate: 0.f, + detail_texture_rotate: 0.f, + detail_texture_scale: 1.f); diff --git a/Material/material_0143/Carpaint_04.mdl b/Material/material_0143/Carpaint_04.mdl new file mode 100644 index 0000000000000000000000000000000000000000..b7f92bdb5c0d2ed345507c4caeaddc0bc87ef0f9 --- /dev/null +++ b/Material/material_0143/Carpaint_04.mdl @@ -0,0 +1,177 @@ +mdl 1.8; + +import ::state::normal; +import ::OmniSurface::OmniShared::emission_mode; +import ..::Templates::OmniUber_Automotive::*; +import ::tex::gamma_mode; + +export material Carpaint_04(*) + = Templates::OmniUber_Automotive::OmniUber_Automotive( + uvs_mode_01: Templates::OmniUber_Automotive::triplanar, + uv_scale_01: float2(1.f), + uv_offset_01: float2(0.f), + uv_offset_time_01: float2(0.f), + uv_rotation_01: 0.f, + triplanar_blend_range_01: 0.5f, + uvs_mode_02: Templates::OmniUber_Automotive::triplanar, + uv_scale_02: float2(8.f), + uv_offset_02: float2(0.f), + uv_offset_time_02: float2(0.f), + uv_rotation_02: 0.f, + triplanar_blend_range_02: 0.5f, + uvs_mode_03: Templates::OmniUber_Automotive::triplanar, + uv_scale_03: float2(1.f), + uv_offset_03: float2(0.f), + uv_offset_time_03: float2(0.f), + uv_rotation_03: 0.f, + triplanar_blend_range_03: 0.5f, + uvs_mode_04: Templates::OmniUber_Automotive::triplanar, + uv_scale_04: float2(1.f), + uv_offset_04: float2(0.f), + uv_offset_time_04: float2(0.f), + uv_rotation_04: 0.f, + triplanar_blend_range_04: 0.5f, + enable_opacity: false, + uv_set_opacity: Templates::OmniUber_Automotive::uv_set_1, + opacity_image: texture_2d(), + opacity_channel: Templates::OmniUber_Automotive::a, + geometry_opacity_threshold: 0.150000006f, + uv_set_layer_0: Templates::OmniUber_Automotive::uv_set_1, + base_color_image: texture_2d(), + diffuse_reflection_color: color(0.012373521f, 0.0941696838f, 0.234323442f), + base_color_scale: 1.f, + base_color_offset: 0.f, + base_color_desaturation: 0.f, + metalness_image: texture_2d(), + metalness_channel: Templates::OmniUber_Automotive::b, + metalness: 0.f, + specular_reflection_weight: 1.f, + specular_reflection_color: color(1.f, 1.f, 1.f), + cavity_image: texture_2d(), + cavity_channel: Templates::OmniUber_Automotive::r, + roughness_image: texture_2d(), + roughness_channel: Templates::OmniUber_Automotive::g, + roughness_u: 1.f, + roughness_range_position: float2(1.f, 0.5f), + normal_image: texture_2d(), + normal_flip_green: true, + normal_scale: 1.f, + enable_layer_1: false, + layer_1_order: Templates::OmniUber_Automotive::above, + layer_1_blend_source: Templates::OmniUber_Automotive::texture, + layer_1_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_1, + layer_1_blend_splatmap: texture_2d(), + layer_1_blend_splatmap_channel: Templates::OmniUber_Automotive::r, + layer_1_blend_direction: float3(0.f, 1.f, 0.f), + layer_1_blend_axis: Templates::OmniUber_Automotive::y, + layer_1_blend_object_space: true, + layer_1_blend_scale: 1.f, + layer_1_blend_offset: 0.f, + layer_1_blend_primvar_name: "", + layer_1_uv_set_detail: Templates::OmniUber_Automotive::uv_set_1, + layer_1_blend_detail_image: texture_2d(), + layer_1_blend_detail_image_channel: Templates::OmniUber_Automotive::r, + layer_1_blend_threshold: 0.330000013f, + layer_1_blend_factor_override: 0.f, + uv_set_layer_1: Templates::OmniUber_Automotive::uv_set_1, + layer_1_base_color_image: texture_2d(), + layer_1_diffuse_reflection_color: color(1.f, 1.f, 1.f), + layer_1_base_color_offset: 0.f, + layer_1_base_color_scale: 1.f, + layer_1_base_color_desaturation: 0.f, + layer_1_metalness_image: texture_2d(), + layer_1_metalness_channel: Templates::OmniUber_Automotive::b, + layer_1_metalness: 1.f, + layer_1_specular_reflection_weight: 1.f, + layer_1_cavity_image: texture_2d(), + layer_1_cavity_channel: Templates::OmniUber_Automotive::r, + layer_1_roughness_image: texture_2d(), + layer_1_roughness_channel: Templates::OmniUber_Automotive::g, + layer_1_roughness_u: 1.f, + layer_1_roughness_range_position: float2(1.f, 0.5f), + layer_1_normal_image: texture_2d(), + layer_1_normal_flip_green: true, + layer_1_normal_scale: 1.f, + enable_layer_2: false, + layer_2_order: Templates::OmniUber_Automotive::above, + layer_2_blend_source: Templates::OmniUber_Automotive::texture, + layer_2_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_2, + layer_2_blend_splatmap: texture_2d(), + layer_2_blend_splatmap_channel: Templates::OmniUber_Automotive::r, + layer_2_blend_direction: float3(0.f, 1.f, 0.f), + layer_2_blend_axis: Templates::OmniUber_Automotive::y, + layer_2_blend_object_space: true, + layer_2_blend_scale: 1.f, + layer_2_blend_offset: 0.f, + layer_2_blend_primvar_name: "", + layer_2_uv_set_detail: Templates::OmniUber_Automotive::uv_set_2, + layer_2_blend_detail_image: texture_2d(), + layer_2_blend_detail_image_channel: Templates::OmniUber_Automotive::r, + layer_2_blend_threshold: 0.330000013f, + layer_2_blend_factor_override: 0.f, + uv_set_layer_2: Templates::OmniUber_Automotive::uv_set_2, + layer_2_base_color_image: texture_2d(), + layer_2_diffuse_reflection_color: color(1.f, 1.f, 1.f), + layer_2_base_color_offset: 0.f, + layer_2_base_color_scale: 1.f, + layer_2_base_color_desaturation: 0.f, + layer_2_metalness_image: texture_2d(), + layer_2_metalness_channel: Templates::OmniUber_Automotive::b, + layer_2_metalness: 1.f, + layer_2_specular_reflection_weight: 1.f, + layer_2_cavity_image: texture_2d(), + layer_2_cavity_channel: Templates::OmniUber_Automotive::r, + layer_2_roughness_image: texture_2d(), + layer_2_roughness_channel: Templates::OmniUber_Automotive::g, + layer_2_roughness_u: 1.f, + layer_2_roughness_range_position: float2(1.f, 0.5f), + layer_2_normal_image: texture_2d(), + layer_2_normal_flip_green: true, + layer_2_normal_scale: 1.f, + enable_anisotropy: false, + uv_set_anisotropy: Templates::OmniUber_Automotive::uv_set_1, + anisotropic_roughness_u: 1.f, + anisotropic_roughness_v: 0.25f, + anisotropic_direction_image: texture_2d(), + anisotropic_direction_channel: Templates::OmniUber_Automotive::r, + anisotropic_direction: 0.f, + enable_detail_normal: false, + uv_set_detail_normal: Templates::OmniUber_Automotive::uv_set_1, + uv_set_detail_weight: Templates::OmniUber_Automotive::uv_set_1, + detail_normal_image: texture_2d(), + detail_normal_flip_green: true, + detail_normal_scale: 1.f, + detail_normal_weight_image: texture_2d(), + detail_normal_weight_channel: Templates::OmniUber_Automotive::r, + enable_emission: false, + uv_set_emission: Templates::OmniUber_Automotive::uv_set_1, + uv_set_emission_mask: Templates::OmniUber_Automotive::uv_set_1, + emission_image: texture_2d(), + emission_mask_image: texture_2d(), + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: 1.f, + emission_color: color(1.f, 1.f, 1.f), + emission_use_temperature: false, + emission_temperature: 6500.f, + enable_coat: true, + coat_color: color(0.499994993f, 0.49999705f, 0.5f), + coat_mask_image: texture_2d(), + coat_mask_channel: Templates::OmniUber_Automotive::r, + coat_roughness_image: texture_2d("./noise_scratch2.png", ::tex::gamma_default, ""), + coat_roughness_channel: Templates::OmniUber_Automotive::r, + coat_roughness: 0.0599999987f, + coat_ior: 1.60000002f, + coat_anisotropy: 0.f, + coat_anisotropy_rotation: 0.f, + coat_affect_color: 0.f, + coat_affect_roughness: 0.f, + coat_normal_image: texture_2d(), + coat_normal_flip_green: true, + uv_set_coat_roughness_normal: Templates::OmniUber_Automotive::uv_set_1, + uv_set_coat_mask: Templates::OmniUber_Automotive::uv_set_2, + enable_flakes: true, + flake_color: color(1.f, 0.999989986f, 0.999989986f), + flake_size: 0.0899999961f, + flakes_density: 0.280000001f, + flakes_spread: 0.150000006f, + flake_roughness: 0.25f); diff --git a/Material/material_0153/Carpaint_Metallic_04.mdl b/Material/material_0153/Carpaint_Metallic_04.mdl new file mode 100644 index 0000000000000000000000000000000000000000..65da8fcb71af79bd3cca49f3ee332a30277368fc --- /dev/null +++ b/Material/material_0153/Carpaint_Metallic_04.mdl @@ -0,0 +1,177 @@ +mdl 1.8; + +import ::state::normal; +import ::OmniSurface::OmniShared::emission_mode; +import ..::Templates::OmniUber_Automotive::*; +import ::tex::gamma_mode; + +export material Carpaint_Metallic_04(*) + = Templates::OmniUber_Automotive::OmniUber_Automotive( + uvs_mode_01: Templates::OmniUber_Automotive::triplanar, + uv_scale_01: float2(1.f), + uv_offset_01: float2(0.f), + uv_offset_time_01: float2(0.f), + uv_rotation_01: 0.f, + triplanar_blend_range_01: 0.5f, + uvs_mode_02: Templates::OmniUber_Automotive::triplanar, + uv_scale_02: float2(8.f), + uv_offset_02: float2(0.f), + uv_offset_time_02: float2(0.f), + uv_rotation_02: 0.f, + triplanar_blend_range_02: 0.5f, + uvs_mode_03: Templates::OmniUber_Automotive::triplanar, + uv_scale_03: float2(1.f), + uv_offset_03: float2(0.f), + uv_offset_time_03: float2(0.f), + uv_rotation_03: 0.f, + triplanar_blend_range_03: 0.5f, + uvs_mode_04: Templates::OmniUber_Automotive::triplanar, + uv_scale_04: float2(1.f), + uv_offset_04: float2(0.f), + uv_offset_time_04: float2(0.f), + uv_rotation_04: 0.f, + triplanar_blend_range_04: 0.5f, + enable_opacity: false, + uv_set_opacity: Templates::OmniUber_Automotive::uv_set_1, + opacity_image: texture_2d(), + opacity_channel: Templates::OmniUber_Automotive::a, + geometry_opacity_threshold: 0.150000006f, + uv_set_layer_0: Templates::OmniUber_Automotive::uv_set_1, + base_color_image: texture_2d(), + diffuse_reflection_color: color(0.999989986f, 1.f, 0.999998987f), + base_color_scale: 1.f, + base_color_offset: 0.f, + base_color_desaturation: 0.f, + metalness_image: texture_2d(), + metalness_channel: Templates::OmniUber_Automotive::b, + metalness: 1.f, + specular_reflection_weight: 1.f, + specular_reflection_color: color(1.f, 1.f, 1.f), + cavity_image: texture_2d(), + cavity_channel: Templates::OmniUber_Automotive::r, + roughness_image: texture_2d(), + roughness_channel: Templates::OmniUber_Automotive::g, + roughness_u: 1.f, + roughness_range_position: float2(0.f, 0.400000006f), + normal_image: texture_2d(), + normal_flip_green: true, + normal_scale: 1.f, + enable_layer_1: false, + layer_1_order: Templates::OmniUber_Automotive::above, + layer_1_blend_source: Templates::OmniUber_Automotive::texture, + layer_1_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_1, + layer_1_blend_splatmap: texture_2d(), + layer_1_blend_splatmap_channel: Templates::OmniUber_Automotive::r, + layer_1_blend_direction: float3(0.f, 1.f, 0.f), + layer_1_blend_axis: Templates::OmniUber_Automotive::y, + layer_1_blend_object_space: true, + layer_1_blend_scale: 1.f, + layer_1_blend_offset: 0.f, + layer_1_blend_primvar_name: "", + layer_1_uv_set_detail: Templates::OmniUber_Automotive::uv_set_1, + layer_1_blend_detail_image: texture_2d(), + layer_1_blend_detail_image_channel: Templates::OmniUber_Automotive::r, + layer_1_blend_threshold: 0.330000013f, + layer_1_blend_factor_override: 0.f, + uv_set_layer_1: Templates::OmniUber_Automotive::uv_set_1, + layer_1_base_color_image: texture_2d(), + layer_1_diffuse_reflection_color: color(1.f, 1.f, 1.f), + layer_1_base_color_offset: 0.f, + layer_1_base_color_scale: 1.f, + layer_1_base_color_desaturation: 0.f, + layer_1_metalness_image: texture_2d(), + layer_1_metalness_channel: Templates::OmniUber_Automotive::b, + layer_1_metalness: 1.f, + layer_1_specular_reflection_weight: 1.f, + layer_1_cavity_image: texture_2d(), + layer_1_cavity_channel: Templates::OmniUber_Automotive::r, + layer_1_roughness_image: texture_2d(), + layer_1_roughness_channel: Templates::OmniUber_Automotive::g, + layer_1_roughness_u: 1.f, + layer_1_roughness_range_position: float2(1.f, 0.5f), + layer_1_normal_image: texture_2d(), + layer_1_normal_flip_green: true, + layer_1_normal_scale: 1.f, + enable_layer_2: false, + layer_2_order: Templates::OmniUber_Automotive::above, + layer_2_blend_source: Templates::OmniUber_Automotive::texture, + layer_2_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_2, + layer_2_blend_splatmap: texture_2d(), + layer_2_blend_splatmap_channel: Templates::OmniUber_Automotive::r, + layer_2_blend_direction: float3(0.f, 1.f, 0.f), + layer_2_blend_axis: Templates::OmniUber_Automotive::y, + layer_2_blend_object_space: true, + layer_2_blend_scale: 1.f, + layer_2_blend_offset: 0.f, + layer_2_blend_primvar_name: "", + layer_2_uv_set_detail: Templates::OmniUber_Automotive::uv_set_2, + layer_2_blend_detail_image: texture_2d(), + layer_2_blend_detail_image_channel: Templates::OmniUber_Automotive::r, + layer_2_blend_threshold: 0.330000013f, + layer_2_blend_factor_override: 0.f, + uv_set_layer_2: Templates::OmniUber_Automotive::uv_set_2, + layer_2_base_color_image: texture_2d(), + layer_2_diffuse_reflection_color: color(1.f, 1.f, 1.f), + layer_2_base_color_offset: 0.f, + layer_2_base_color_scale: 1.f, + layer_2_base_color_desaturation: 0.f, + layer_2_metalness_image: texture_2d(), + layer_2_metalness_channel: Templates::OmniUber_Automotive::b, + layer_2_metalness: 1.f, + layer_2_specular_reflection_weight: 1.f, + layer_2_cavity_image: texture_2d(), + layer_2_cavity_channel: Templates::OmniUber_Automotive::r, + layer_2_roughness_image: texture_2d(), + layer_2_roughness_channel: Templates::OmniUber_Automotive::g, + layer_2_roughness_u: 1.f, + layer_2_roughness_range_position: float2(1.f, 0.5f), + layer_2_normal_image: texture_2d(), + layer_2_normal_flip_green: true, + layer_2_normal_scale: 1.f, + enable_anisotropy: false, + uv_set_anisotropy: Templates::OmniUber_Automotive::uv_set_1, + anisotropic_roughness_u: 1.f, + anisotropic_roughness_v: 0.25f, + anisotropic_direction_image: texture_2d(), + anisotropic_direction_channel: Templates::OmniUber_Automotive::r, + anisotropic_direction: 0.f, + enable_detail_normal: false, + uv_set_detail_normal: Templates::OmniUber_Automotive::uv_set_1, + uv_set_detail_weight: Templates::OmniUber_Automotive::uv_set_1, + detail_normal_image: texture_2d(), + detail_normal_flip_green: true, + detail_normal_scale: 1.f, + detail_normal_weight_image: texture_2d(), + detail_normal_weight_channel: Templates::OmniUber_Automotive::r, + enable_emission: false, + uv_set_emission: Templates::OmniUber_Automotive::uv_set_1, + uv_set_emission_mask: Templates::OmniUber_Automotive::uv_set_1, + emission_image: texture_2d(), + emission_mask_image: texture_2d(), + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: 1.f, + emission_color: color(1.f, 1.f, 1.f), + emission_use_temperature: false, + emission_temperature: 6500.f, + enable_coat: true, + coat_color: color(0.257425725f, 0.25722149f, 0.256576151f), + coat_mask_image: texture_2d(), + coat_mask_channel: Templates::OmniUber_Automotive::r, + coat_roughness_image: texture_2d("./noise_scratch2.png", ::tex::gamma_default, ""), + coat_roughness_channel: Templates::OmniUber_Automotive::r, + coat_roughness: 0.0599999987f, + coat_ior: 1.60000002f, + coat_anisotropy: 0.f, + coat_anisotropy_rotation: 0.f, + coat_affect_color: 0.f, + coat_affect_roughness: 0.f, + coat_normal_image: texture_2d(), + coat_normal_flip_green: true, + uv_set_coat_roughness_normal: Templates::OmniUber_Automotive::uv_set_1, + uv_set_coat_mask: Templates::OmniUber_Automotive::uv_set_2, + enable_flakes: true, + flake_color: color(1.f, 0.999989986f, 0.999989986f), + flake_size: 0.0899999961f, + flakes_density: 0.280000001f, + flakes_spread: 0.150000006f, + flake_roughness: 0.25f); diff --git a/Material/material_0156/Carpaint_Metallic_07.mdl b/Material/material_0156/Carpaint_Metallic_07.mdl new file mode 100644 index 0000000000000000000000000000000000000000..4ae445febb07d633f001738bce1d9295f1c08820 --- /dev/null +++ b/Material/material_0156/Carpaint_Metallic_07.mdl @@ -0,0 +1,177 @@ +mdl 1.8; + +import ::state::normal; +import ::OmniSurface::OmniShared::emission_mode; +import ..::Templates::OmniUber_Automotive::*; +import ::tex::gamma_mode; + +export material Carpaint_Metallic_07(*) + = Templates::OmniUber_Automotive::OmniUber_Automotive( + uvs_mode_01: Templates::OmniUber_Automotive::triplanar, + uv_scale_01: float2(1.f), + uv_offset_01: float2(0.f), + uv_offset_time_01: float2(0.f), + uv_rotation_01: 0.f, + triplanar_blend_range_01: 0.5f, + uvs_mode_02: Templates::OmniUber_Automotive::triplanar, + uv_scale_02: float2(8.f), + uv_offset_02: float2(0.f), + uv_offset_time_02: float2(0.f), + uv_rotation_02: 0.f, + triplanar_blend_range_02: 0.5f, + uvs_mode_03: Templates::OmniUber_Automotive::triplanar, + uv_scale_03: float2(1.f), + uv_offset_03: float2(0.f), + uv_offset_time_03: float2(0.f), + uv_rotation_03: 0.f, + triplanar_blend_range_03: 0.5f, + uvs_mode_04: Templates::OmniUber_Automotive::triplanar, + uv_scale_04: float2(1.f), + uv_offset_04: float2(0.f), + uv_offset_time_04: float2(0.f), + uv_rotation_04: 0.f, + triplanar_blend_range_04: 0.5f, + enable_opacity: false, + uv_set_opacity: Templates::OmniUber_Automotive::uv_set_1, + opacity_image: texture_2d(), + opacity_channel: Templates::OmniUber_Automotive::a, + geometry_opacity_threshold: 0.150000006f, + uv_set_layer_0: Templates::OmniUber_Automotive::uv_set_1, + base_color_image: texture_2d(), + diffuse_reflection_color: color(0.999989986f, 1.f, 0.999998987f), + base_color_scale: 1.f, + base_color_offset: 0.f, + base_color_desaturation: 0.f, + metalness_image: texture_2d(), + metalness_channel: Templates::OmniUber_Automotive::b, + metalness: 1.f, + specular_reflection_weight: 1.f, + specular_reflection_color: color(1.f, 1.f, 1.f), + cavity_image: texture_2d(), + cavity_channel: Templates::OmniUber_Automotive::r, + roughness_image: texture_2d(), + roughness_channel: Templates::OmniUber_Automotive::g, + roughness_u: 1.f, + roughness_range_position: float2(0.f, 0.400000006f), + normal_image: texture_2d(), + normal_flip_green: true, + normal_scale: 1.f, + enable_layer_1: false, + layer_1_order: Templates::OmniUber_Automotive::above, + layer_1_blend_source: Templates::OmniUber_Automotive::texture, + layer_1_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_1, + layer_1_blend_splatmap: texture_2d(), + layer_1_blend_splatmap_channel: Templates::OmniUber_Automotive::r, + layer_1_blend_direction: float3(0.f, 1.f, 0.f), + layer_1_blend_axis: Templates::OmniUber_Automotive::y, + layer_1_blend_object_space: true, + layer_1_blend_scale: 1.f, + layer_1_blend_offset: 0.f, + layer_1_blend_primvar_name: "", + layer_1_uv_set_detail: Templates::OmniUber_Automotive::uv_set_1, + layer_1_blend_detail_image: texture_2d(), + layer_1_blend_detail_image_channel: Templates::OmniUber_Automotive::r, + layer_1_blend_threshold: 0.330000013f, + layer_1_blend_factor_override: 0.f, + uv_set_layer_1: Templates::OmniUber_Automotive::uv_set_1, + layer_1_base_color_image: texture_2d(), + layer_1_diffuse_reflection_color: color(1.f, 1.f, 1.f), + layer_1_base_color_offset: 0.f, + layer_1_base_color_scale: 1.f, + layer_1_base_color_desaturation: 0.f, + layer_1_metalness_image: texture_2d(), + layer_1_metalness_channel: Templates::OmniUber_Automotive::b, + layer_1_metalness: 1.f, + layer_1_specular_reflection_weight: 1.f, + layer_1_cavity_image: texture_2d(), + layer_1_cavity_channel: Templates::OmniUber_Automotive::r, + layer_1_roughness_image: texture_2d(), + layer_1_roughness_channel: Templates::OmniUber_Automotive::g, + layer_1_roughness_u: 1.f, + layer_1_roughness_range_position: float2(1.f, 0.5f), + layer_1_normal_image: texture_2d(), + layer_1_normal_flip_green: true, + layer_1_normal_scale: 1.f, + enable_layer_2: false, + layer_2_order: Templates::OmniUber_Automotive::above, + layer_2_blend_source: Templates::OmniUber_Automotive::texture, + layer_2_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_2, + layer_2_blend_splatmap: texture_2d(), + layer_2_blend_splatmap_channel: Templates::OmniUber_Automotive::r, + layer_2_blend_direction: float3(0.f, 1.f, 0.f), + layer_2_blend_axis: Templates::OmniUber_Automotive::y, + layer_2_blend_object_space: true, + layer_2_blend_scale: 1.f, + layer_2_blend_offset: 0.f, + layer_2_blend_primvar_name: "", + layer_2_uv_set_detail: Templates::OmniUber_Automotive::uv_set_2, + layer_2_blend_detail_image: texture_2d(), + layer_2_blend_detail_image_channel: Templates::OmniUber_Automotive::r, + layer_2_blend_threshold: 0.330000013f, + layer_2_blend_factor_override: 0.f, + uv_set_layer_2: Templates::OmniUber_Automotive::uv_set_2, + layer_2_base_color_image: texture_2d(), + layer_2_diffuse_reflection_color: color(1.f, 1.f, 1.f), + layer_2_base_color_offset: 0.f, + layer_2_base_color_scale: 1.f, + layer_2_base_color_desaturation: 0.f, + layer_2_metalness_image: texture_2d(), + layer_2_metalness_channel: Templates::OmniUber_Automotive::b, + layer_2_metalness: 1.f, + layer_2_specular_reflection_weight: 1.f, + layer_2_cavity_image: texture_2d(), + layer_2_cavity_channel: Templates::OmniUber_Automotive::r, + layer_2_roughness_image: texture_2d(), + layer_2_roughness_channel: Templates::OmniUber_Automotive::g, + layer_2_roughness_u: 1.f, + layer_2_roughness_range_position: float2(1.f, 0.5f), + layer_2_normal_image: texture_2d(), + layer_2_normal_flip_green: true, + layer_2_normal_scale: 1.f, + enable_anisotropy: false, + uv_set_anisotropy: Templates::OmniUber_Automotive::uv_set_1, + anisotropic_roughness_u: 1.f, + anisotropic_roughness_v: 0.25f, + anisotropic_direction_image: texture_2d(), + anisotropic_direction_channel: Templates::OmniUber_Automotive::r, + anisotropic_direction: 0.f, + enable_detail_normal: false, + uv_set_detail_normal: Templates::OmniUber_Automotive::uv_set_1, + uv_set_detail_weight: Templates::OmniUber_Automotive::uv_set_1, + detail_normal_image: texture_2d(), + detail_normal_flip_green: true, + detail_normal_scale: 1.f, + detail_normal_weight_image: texture_2d(), + detail_normal_weight_channel: Templates::OmniUber_Automotive::r, + enable_emission: false, + uv_set_emission: Templates::OmniUber_Automotive::uv_set_1, + uv_set_emission_mask: Templates::OmniUber_Automotive::uv_set_1, + emission_image: texture_2d(), + emission_mask_image: texture_2d(), + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: 1.f, + emission_color: color(1.f, 1.f, 1.f), + emission_use_temperature: false, + emission_temperature: 6500.f, + enable_coat: true, + coat_color: color(0.518146634f, 0.51815182f, 0.518151462f), + coat_mask_image: texture_2d(), + coat_mask_channel: Templates::OmniUber_Automotive::r, + coat_roughness_image: texture_2d("./noise_scratch2.png", ::tex::gamma_default, ""), + coat_roughness_channel: Templates::OmniUber_Automotive::r, + coat_roughness: 0.0599999987f, + coat_ior: 1.60000002f, + coat_anisotropy: 0.f, + coat_anisotropy_rotation: 0.f, + coat_affect_color: 0.f, + coat_affect_roughness: 0.f, + coat_normal_image: texture_2d(), + coat_normal_flip_green: true, + uv_set_coat_roughness_normal: Templates::OmniUber_Automotive::uv_set_1, + uv_set_coat_mask: Templates::OmniUber_Automotive::uv_set_2, + enable_flakes: true, + flake_color: color(1.f, 0.999989986f, 0.999989986f), + flake_size: 0.0899999961f, + flakes_density: 0.280000001f, + flakes_spread: 0.150000006f, + flake_roughness: 0.25f); diff --git a/Material/material_0169/Fabric_Polyester_04.mdl b/Material/material_0169/Fabric_Polyester_04.mdl new file mode 100644 index 0000000000000000000000000000000000000000..2ccab42861ae02fc5f16371a428edad9249147c7 --- /dev/null +++ b/Material/material_0169/Fabric_Polyester_04.mdl @@ -0,0 +1,177 @@ +mdl 1.8; + +import ::state::normal; +import ::OmniSurface::OmniShared::emission_mode; +import ..::Templates::OmniUber_Automotive::*; +import ::tex::gamma_mode; + +export material Fabric_Polyester_04(*) + = Templates::OmniUber_Automotive::OmniUber_Automotive( + uvs_mode_01: Templates::OmniUber_Automotive::triplanar, + uv_scale_01: float2(2.f), + uv_offset_01: float2(0.f), + uv_offset_time_01: float2(0.f), + uv_rotation_01: 0.f, + triplanar_blend_range_01: 0.5f, + uvs_mode_02: Templates::OmniUber_Automotive::triplanar, + uv_scale_02: float2(1.f), + uv_offset_02: float2(0.f), + uv_offset_time_02: float2(0.f), + uv_rotation_02: 0.f, + triplanar_blend_range_02: 0.5f, + uvs_mode_03: Templates::OmniUber_Automotive::triplanar, + uv_scale_03: float2(0.200000003f), + uv_offset_03: float2(0.f), + uv_offset_time_03: float2(0.f), + uv_rotation_03: 0.f, + triplanar_blend_range_03: 0.5f, + uvs_mode_04: Templates::OmniUber_Automotive::triplanar, + uv_scale_04: float2(1.f), + uv_offset_04: float2(0.f), + uv_offset_time_04: float2(0.f), + uv_rotation_04: 0.f, + triplanar_blend_range_04: 0.5f, + enable_opacity: false, + uv_set_opacity: Templates::OmniUber_Automotive::uv_set_1, + opacity_image: texture_2d(), + opacity_channel: Templates::OmniUber_Automotive::a, + geometry_opacity_threshold: 0.150000006f, + uv_set_layer_0: Templates::OmniUber_Automotive::uv_set_1, + base_color_image: texture_2d("./ov_fabric_polyester_04_basecolor.png", ::tex::gamma_default, ""), + diffuse_reflection_color: color(0.26990819f, 0.300504714f, 0.389438927f), + base_color_scale: 1.f, + base_color_offset: 0.f, + base_color_desaturation: 0.f, + metalness_image: texture_2d("./ov_fabric_polyester_04_orm.png", ::tex::gamma_linear, ""), + metalness_channel: Templates::OmniUber_Automotive::b, + metalness: 0.f, + specular_reflection_weight: 1.f, + specular_reflection_color: color(1.f, 1.f, 1.f), + cavity_image: texture_2d("./ov_fabric_polyester_04_orm.png", ::tex::gamma_linear, ""), + cavity_channel: Templates::OmniUber_Automotive::r, + roughness_image: texture_2d("./ov_fabric_polyester_04_orm.png", ::tex::gamma_default, ""), + roughness_channel: Templates::OmniUber_Automotive::g, + roughness_u: 1.f, + roughness_range_position: float2(1.f, 0.75f), + normal_image: texture_2d("./ov_fabric_polyester_04_normal.png", ::tex::gamma_linear, ""), + normal_flip_green: true, + normal_scale: 1.f, + enable_layer_1: false, + layer_1_order: Templates::OmniUber_Automotive::above, + layer_1_blend_source: Templates::OmniUber_Automotive::texture, + layer_1_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_3, + layer_1_blend_splatmap: texture_2d("./leather_blend_mask_04.png", ::tex::gamma_linear, ""), + layer_1_blend_splatmap_channel: Templates::OmniUber_Automotive::r, + layer_1_blend_direction: float3(0.f, 1.f, 0.f), + layer_1_blend_axis: Templates::OmniUber_Automotive::y, + layer_1_blend_object_space: true, + layer_1_blend_scale: 1.f, + layer_1_blend_offset: 0.f, + layer_1_blend_primvar_name: "", + layer_1_uv_set_detail: Templates::OmniUber_Automotive::uv_set_1, + layer_1_blend_detail_image: texture_2d(), + layer_1_blend_detail_image_channel: Templates::OmniUber_Automotive::r, + layer_1_blend_threshold: 1.f, + layer_1_blend_factor_override: 0.f, + uv_set_layer_1: Templates::OmniUber_Automotive::uv_set_1, + layer_1_base_color_image: texture_2d(), + layer_1_diffuse_reflection_color: color(1.f, 1.f, 1.f), + layer_1_base_color_offset: 0.f, + layer_1_base_color_scale: 1.f, + layer_1_base_color_desaturation: 0.f, + layer_1_metalness_image: texture_2d(), + layer_1_metalness_channel: Templates::OmniUber_Automotive::b, + layer_1_metalness: 1.f, + layer_1_specular_reflection_weight: 1.f, + layer_1_cavity_image: texture_2d(), + layer_1_cavity_channel: Templates::OmniUber_Automotive::r, + layer_1_roughness_image: texture_2d(), + layer_1_roughness_channel: Templates::OmniUber_Automotive::g, + layer_1_roughness_u: 1.f, + layer_1_roughness_range_position: float2(1.f, 0.5f), + layer_1_normal_image: texture_2d(), + layer_1_normal_flip_green: true, + layer_1_normal_scale: 1.f, + enable_layer_2: false, + layer_2_order: Templates::OmniUber_Automotive::above, + layer_2_blend_source: Templates::OmniUber_Automotive::texture, + layer_2_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_2, + layer_2_blend_splatmap: texture_2d(), + layer_2_blend_splatmap_channel: Templates::OmniUber_Automotive::r, + layer_2_blend_direction: float3(0.f, 1.f, 0.f), + layer_2_blend_axis: Templates::OmniUber_Automotive::y, + layer_2_blend_object_space: true, + layer_2_blend_scale: 1.f, + layer_2_blend_offset: 0.f, + layer_2_blend_primvar_name: "", + layer_2_uv_set_detail: Templates::OmniUber_Automotive::uv_set_2, + layer_2_blend_detail_image: texture_2d(), + layer_2_blend_detail_image_channel: Templates::OmniUber_Automotive::r, + layer_2_blend_threshold: 0.330000013f, + layer_2_blend_factor_override: 0.f, + uv_set_layer_2: Templates::OmniUber_Automotive::uv_set_2, + layer_2_base_color_image: texture_2d(), + layer_2_diffuse_reflection_color: color(1.f, 1.f, 1.f), + layer_2_base_color_offset: 0.f, + layer_2_base_color_scale: 1.f, + layer_2_base_color_desaturation: 0.f, + layer_2_metalness_image: texture_2d(), + layer_2_metalness_channel: Templates::OmniUber_Automotive::b, + layer_2_metalness: 1.f, + layer_2_specular_reflection_weight: 1.f, + layer_2_cavity_image: texture_2d(), + layer_2_cavity_channel: Templates::OmniUber_Automotive::r, + layer_2_roughness_image: texture_2d(), + layer_2_roughness_channel: Templates::OmniUber_Automotive::g, + layer_2_roughness_u: 1.f, + layer_2_roughness_range_position: float2(1.f, 0.5f), + layer_2_normal_image: texture_2d(), + layer_2_normal_flip_green: true, + layer_2_normal_scale: 1.f, + enable_anisotropy: false, + uv_set_anisotropy: Templates::OmniUber_Automotive::uv_set_1, + anisotropic_roughness_u: 1.f, + anisotropic_roughness_v: 0.25f, + anisotropic_direction_image: texture_2d(), + anisotropic_direction_channel: Templates::OmniUber_Automotive::r, + anisotropic_direction: 0.f, + enable_detail_normal: true, + uv_set_detail_normal: Templates::OmniUber_Automotive::uv_set_2, + uv_set_detail_weight: Templates::OmniUber_Automotive::uv_set_1, + detail_normal_image: texture_2d("./ov_clouds_01_normal.png", ::tex::gamma_linear, ""), + detail_normal_flip_green: true, + detail_normal_scale: 1.f, + detail_normal_weight_image: texture_2d(), + detail_normal_weight_channel: Templates::OmniUber_Automotive::r, + enable_emission: false, + uv_set_emission: Templates::OmniUber_Automotive::uv_set_1, + uv_set_emission_mask: Templates::OmniUber_Automotive::uv_set_1, + emission_image: texture_2d(), + emission_mask_image: texture_2d(), + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: 1.f, + emission_color: color(1.f, 1.f, 1.f), + emission_use_temperature: false, + emission_temperature: 6500.f, + enable_coat: false, + coat_color: color(1.f, 1.f, 1.f), + coat_mask_image: texture_2d(), + coat_mask_channel: Templates::OmniUber_Automotive::r, + coat_roughness_image: texture_2d(), + coat_roughness_channel: Templates::OmniUber_Automotive::r, + coat_roughness: 0.f, + coat_ior: 1.60000002f, + coat_anisotropy: 0.f, + coat_anisotropy_rotation: 0.f, + coat_affect_color: 0.f, + coat_affect_roughness: 0.f, + coat_normal_image: texture_2d(), + coat_normal_flip_green: true, + uv_set_coat_roughness_normal: Templates::OmniUber_Automotive::uv_set_1, + uv_set_coat_mask: Templates::OmniUber_Automotive::uv_set_1, + enable_flakes: false, + flake_color: color(1.f, 1.f, 1.f), + flake_size: 0.125f, + flakes_density: 0.25f, + flakes_spread: 0.150000006f, + flake_roughness: 0.0500000007f); diff --git a/Material/material_0172/Netting_Thread_01.mdl b/Material/material_0172/Netting_Thread_01.mdl new file mode 100644 index 0000000000000000000000000000000000000000..66fbf5bef57a34d3868521a2dc5b9ef601056d6e --- /dev/null +++ b/Material/material_0172/Netting_Thread_01.mdl @@ -0,0 +1,177 @@ +mdl 1.8; + +import ::state::normal; +import ::OmniSurface::OmniShared::emission_mode; +import ..::Templates::OmniUber_Automotive::*; +import ::tex::gamma_mode; + +export material Netting_Thread_01(*) + = Templates::OmniUber_Automotive::OmniUber_Automotive( + uvs_mode_01: Templates::OmniUber_Automotive::texture_coord_0, + uv_scale_01: float2(1.f), + uv_offset_01: float2(0.f), + uv_offset_time_01: float2(0.f), + uv_rotation_01: 0.f, + triplanar_blend_range_01: 0.5f, + uvs_mode_02: Templates::OmniUber_Automotive::texture_coord_0, + uv_scale_02: float2(1.f), + uv_offset_02: float2(0.f), + uv_offset_time_02: float2(0.f), + uv_rotation_02: 0.f, + triplanar_blend_range_02: 0.5f, + uvs_mode_03: Templates::OmniUber_Automotive::texture_coord_0, + uv_scale_03: float2(0.200000003f), + uv_offset_03: float2(0.f), + uv_offset_time_03: float2(0.f), + uv_rotation_03: 0.f, + triplanar_blend_range_03: 0.5f, + uvs_mode_04: Templates::OmniUber_Automotive::texture_coord_0, + uv_scale_04: float2(1.f), + uv_offset_04: float2(0.f), + uv_offset_time_04: float2(0.f), + uv_rotation_04: 0.f, + triplanar_blend_range_04: 0.5f, + enable_opacity: true, + uv_set_opacity: Templates::OmniUber_Automotive::uv_set_1, + opacity_image: texture_2d("./ov_fabric_netting_01_opacity.png", ::tex::gamma_default, ""), + opacity_channel: Templates::OmniUber_Automotive::r, + geometry_opacity_threshold: 0.5f, + uv_set_layer_0: Templates::OmniUber_Automotive::uv_set_1, + base_color_image: texture_2d("./ov_fabric_netting_01_basecolor.png", ::tex::gamma_default, ""), + diffuse_reflection_color: color(0.0858085752f, 0.0858077183f, 0.0858077183f), + base_color_scale: 1.5999999f, + base_color_offset: -0.170000002f, + base_color_desaturation: 0.f, + metalness_image: texture_2d("./ov_fabric_netting_01_orm.png", ::tex::gamma_linear, ""), + metalness_channel: Templates::OmniUber_Automotive::b, + metalness: 0.f, + specular_reflection_weight: 1.f, + specular_reflection_color: color(1.f, 1.f, 1.f), + cavity_image: texture_2d("./ov_fabric_netting_01_orm.png", ::tex::gamma_linear, ""), + cavity_channel: Templates::OmniUber_Automotive::r, + roughness_image: texture_2d("./ov_fabric_netting_01_orm.png", ::tex::gamma_default, ""), + roughness_channel: Templates::OmniUber_Automotive::g, + roughness_u: 1.f, + roughness_range_position: float2(0.75f, 0.649999976f), + normal_image: texture_2d("./ov_fabric_netting_01_normal.png", ::tex::gamma_linear, ""), + normal_flip_green: true, + normal_scale: 1.f, + enable_layer_1: false, + layer_1_order: Templates::OmniUber_Automotive::above, + layer_1_blend_source: Templates::OmniUber_Automotive::texture, + layer_1_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_3, + layer_1_blend_splatmap: texture_2d("./leather_blend_mask_04.png", ::tex::gamma_linear, ""), + layer_1_blend_splatmap_channel: Templates::OmniUber_Automotive::r, + layer_1_blend_direction: float3(0.f, 1.f, 0.f), + layer_1_blend_axis: Templates::OmniUber_Automotive::y, + layer_1_blend_object_space: true, + layer_1_blend_scale: 1.f, + layer_1_blend_offset: 0.f, + layer_1_blend_primvar_name: "", + layer_1_uv_set_detail: Templates::OmniUber_Automotive::uv_set_1, + layer_1_blend_detail_image: texture_2d(), + layer_1_blend_detail_image_channel: Templates::OmniUber_Automotive::r, + layer_1_blend_threshold: 1.f, + layer_1_blend_factor_override: 0.f, + uv_set_layer_1: Templates::OmniUber_Automotive::uv_set_1, + layer_1_base_color_image: texture_2d(), + layer_1_diffuse_reflection_color: color(1.f, 1.f, 1.f), + layer_1_base_color_offset: 0.f, + layer_1_base_color_scale: 1.f, + layer_1_base_color_desaturation: 0.f, + layer_1_metalness_image: texture_2d(), + layer_1_metalness_channel: Templates::OmniUber_Automotive::b, + layer_1_metalness: 1.f, + layer_1_specular_reflection_weight: 1.f, + layer_1_cavity_image: texture_2d(), + layer_1_cavity_channel: Templates::OmniUber_Automotive::r, + layer_1_roughness_image: texture_2d(), + layer_1_roughness_channel: Templates::OmniUber_Automotive::g, + layer_1_roughness_u: 1.f, + layer_1_roughness_range_position: float2(1.f, 0.5f), + layer_1_normal_image: texture_2d(), + layer_1_normal_flip_green: true, + layer_1_normal_scale: 1.f, + enable_layer_2: false, + layer_2_order: Templates::OmniUber_Automotive::above, + layer_2_blend_source: Templates::OmniUber_Automotive::texture, + layer_2_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_2, + layer_2_blend_splatmap: texture_2d(), + layer_2_blend_splatmap_channel: Templates::OmniUber_Automotive::r, + layer_2_blend_direction: float3(0.f, 1.f, 0.f), + layer_2_blend_axis: Templates::OmniUber_Automotive::y, + layer_2_blend_object_space: true, + layer_2_blend_scale: 1.f, + layer_2_blend_offset: 0.f, + layer_2_blend_primvar_name: "", + layer_2_uv_set_detail: Templates::OmniUber_Automotive::uv_set_2, + layer_2_blend_detail_image: texture_2d(), + layer_2_blend_detail_image_channel: Templates::OmniUber_Automotive::r, + layer_2_blend_threshold: 0.330000013f, + layer_2_blend_factor_override: 0.f, + uv_set_layer_2: Templates::OmniUber_Automotive::uv_set_2, + layer_2_base_color_image: texture_2d(), + layer_2_diffuse_reflection_color: color(1.f, 1.f, 1.f), + layer_2_base_color_offset: 0.f, + layer_2_base_color_scale: 1.f, + layer_2_base_color_desaturation: 0.f, + layer_2_metalness_image: texture_2d(), + layer_2_metalness_channel: Templates::OmniUber_Automotive::b, + layer_2_metalness: 1.f, + layer_2_specular_reflection_weight: 1.f, + layer_2_cavity_image: texture_2d(), + layer_2_cavity_channel: Templates::OmniUber_Automotive::r, + layer_2_roughness_image: texture_2d(), + layer_2_roughness_channel: Templates::OmniUber_Automotive::g, + layer_2_roughness_u: 1.f, + layer_2_roughness_range_position: float2(1.f, 0.5f), + layer_2_normal_image: texture_2d(), + layer_2_normal_flip_green: true, + layer_2_normal_scale: 1.f, + enable_anisotropy: false, + uv_set_anisotropy: Templates::OmniUber_Automotive::uv_set_1, + anisotropic_roughness_u: 1.f, + anisotropic_roughness_v: 0.25f, + anisotropic_direction_image: texture_2d(), + anisotropic_direction_channel: Templates::OmniUber_Automotive::r, + anisotropic_direction: 0.f, + enable_detail_normal: true, + uv_set_detail_normal: Templates::OmniUber_Automotive::uv_set_2, + uv_set_detail_weight: Templates::OmniUber_Automotive::uv_set_1, + detail_normal_image: texture_2d("./ov_clouds_01_normal.png", ::tex::gamma_linear, ""), + detail_normal_flip_green: true, + detail_normal_scale: 1.f, + detail_normal_weight_image: texture_2d(), + detail_normal_weight_channel: Templates::OmniUber_Automotive::r, + enable_emission: false, + uv_set_emission: Templates::OmniUber_Automotive::uv_set_1, + uv_set_emission_mask: Templates::OmniUber_Automotive::uv_set_1, + emission_image: texture_2d(), + emission_mask_image: texture_2d(), + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: 1.f, + emission_color: color(1.f, 1.f, 1.f), + emission_use_temperature: false, + emission_temperature: 6500.f, + enable_coat: false, + coat_color: color(1.f, 1.f, 1.f), + coat_mask_image: texture_2d(), + coat_mask_channel: Templates::OmniUber_Automotive::r, + coat_roughness_image: texture_2d(), + coat_roughness_channel: Templates::OmniUber_Automotive::r, + coat_roughness: 0.f, + coat_ior: 1.60000002f, + coat_anisotropy: 0.f, + coat_anisotropy_rotation: 0.f, + coat_affect_color: 0.f, + coat_affect_roughness: 0.f, + coat_normal_image: texture_2d(), + coat_normal_flip_green: true, + uv_set_coat_roughness_normal: Templates::OmniUber_Automotive::uv_set_1, + uv_set_coat_mask: Templates::OmniUber_Automotive::uv_set_1, + enable_flakes: false, + flake_color: color(1.f, 1.f, 1.f), + flake_size: 0.125f, + flakes_density: 0.25f, + flakes_spread: 0.150000006f, + flake_roughness: 0.0500000007f); diff --git a/Material/material_0190/Leather_Grain_03.mdl b/Material/material_0190/Leather_Grain_03.mdl new file mode 100644 index 0000000000000000000000000000000000000000..2843373284ce72470a1ca7ae9f483bb5ac6b8fc4 --- /dev/null +++ b/Material/material_0190/Leather_Grain_03.mdl @@ -0,0 +1,177 @@ +mdl 1.8; + +import ::state::normal; +import ::OmniSurface::OmniShared::emission_mode; +import ..::Templates::OmniUber_Automotive::*; +import ::tex::gamma_mode; + +export material Leather_Grain_03(*) + = Templates::OmniUber_Automotive::OmniUber_Automotive( + uvs_mode_01: Templates::OmniUber_Automotive::triplanar, + uv_scale_01: float2(2.f), + uv_offset_01: float2(0.f), + uv_offset_time_01: float2(0.f), + uv_rotation_01: 0.f, + triplanar_blend_range_01: 0.5f, + uvs_mode_02: Templates::OmniUber_Automotive::triplanar, + uv_scale_02: float2(0.075000003f), + uv_offset_02: float2(0.f), + uv_offset_time_02: float2(0.f), + uv_rotation_02: 0.f, + triplanar_blend_range_02: 0.5f, + uvs_mode_03: Templates::OmniUber_Automotive::triplanar, + uv_scale_03: float2(0.5f), + uv_offset_03: float2(0.f), + uv_offset_time_03: float2(0.f), + uv_rotation_03: 0.f, + triplanar_blend_range_03: 0.5f, + uvs_mode_04: Templates::OmniUber_Automotive::triplanar, + uv_scale_04: float2(1.f), + uv_offset_04: float2(0.f), + uv_offset_time_04: float2(0.f), + uv_rotation_04: 0.f, + triplanar_blend_range_04: 0.5f, + enable_opacity: false, + uv_set_opacity: Templates::OmniUber_Automotive::uv_set_1, + opacity_image: texture_2d(), + opacity_channel: Templates::OmniUber_Automotive::a, + geometry_opacity_threshold: 0.150000006f, + uv_set_layer_0: Templates::OmniUber_Automotive::uv_set_1, + base_color_image: texture_2d("./ov_leather_f_01_basecolor.png", ::tex::gamma_default, ""), + diffuse_reflection_color: color(0.320132017f, 0.0729430765f, 0.0264135376f), + base_color_scale: 1.f, + base_color_offset: 0.f, + base_color_desaturation: 0.f, + metalness_image: texture_2d("./ov_leather_f_01_orm.png", ::tex::gamma_linear, ""), + metalness_channel: Templates::OmniUber_Automotive::b, + metalness: 0.f, + specular_reflection_weight: 1.f, + specular_reflection_color: color(1.f, 1.f, 1.f), + cavity_image: texture_2d("./ov_leather_f_01_orm.png", ::tex::gamma_linear, ""), + cavity_channel: Templates::OmniUber_Automotive::r, + roughness_image: texture_2d("./ov_leather_f_01_orm.png", ::tex::gamma_default, ""), + roughness_channel: Templates::OmniUber_Automotive::g, + roughness_u: 1.f, + roughness_range_position: float2(0.800000012f, 0.680000007f), + normal_image: texture_2d("./ov_leather_f_01_normal.png", ::tex::gamma_linear, ""), + normal_flip_green: true, + normal_scale: 2.f, + enable_layer_1: true, + layer_1_order: Templates::OmniUber_Automotive::above, + layer_1_blend_source: Templates::OmniUber_Automotive::texture, + layer_1_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_1, + layer_1_blend_splatmap: texture_2d("./ov_leather_f_01_roughvar.png", ::tex::gamma_linear, ""), + layer_1_blend_splatmap_channel: Templates::OmniUber_Automotive::rgb, + layer_1_blend_direction: float3(0.f, 1.f, 0.f), + layer_1_blend_axis: Templates::OmniUber_Automotive::y, + layer_1_blend_object_space: true, + layer_1_blend_scale: 1.f, + layer_1_blend_offset: 0.f, + layer_1_blend_primvar_name: "", + layer_1_uv_set_detail: Templates::OmniUber_Automotive::uv_set_1, + layer_1_blend_detail_image: texture_2d("./ov_leather_f_01_roughvar.png", ::tex::gamma_default, ""), + layer_1_blend_detail_image_channel: Templates::OmniUber_Automotive::rgb, + layer_1_blend_threshold: 0.569999993f, + layer_1_blend_factor_override: 0.f, + uv_set_layer_1: Templates::OmniUber_Automotive::uv_set_1, + layer_1_base_color_image: texture_2d("./ov_leather_f_01_basecolor.png", ::tex::gamma_default, ""), + layer_1_diffuse_reflection_color: color(0.293729365f, 0.0742696449f, 0.0329597332f), + layer_1_base_color_offset: 0.f, + layer_1_base_color_scale: 1.f, + layer_1_base_color_desaturation: 0.f, + layer_1_metalness_image: texture_2d("./ov_leather_f_01_orm.png", ::tex::gamma_default, ""), + layer_1_metalness_channel: Templates::OmniUber_Automotive::b, + layer_1_metalness: 1.f, + layer_1_specular_reflection_weight: 1.f, + layer_1_cavity_image: texture_2d("./ov_leather_f_01_orm.png", ::tex::gamma_default, ""), + layer_1_cavity_channel: Templates::OmniUber_Automotive::r, + layer_1_roughness_image: texture_2d("./ov_leather_f_01_orm.png", ::tex::gamma_default, ""), + layer_1_roughness_channel: Templates::OmniUber_Automotive::g, + layer_1_roughness_u: 1.f, + layer_1_roughness_range_position: float2(0.850000024f, 0.699999988f), + layer_1_normal_image: texture_2d("./ov_leather_f_01_normal.png", ::tex::gamma_linear, ""), + layer_1_normal_flip_green: true, + layer_1_normal_scale: 1.f, + enable_layer_2: false, + layer_2_order: Templates::OmniUber_Automotive::above, + layer_2_blend_source: Templates::OmniUber_Automotive::texture, + layer_2_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_2, + layer_2_blend_splatmap: texture_2d(), + layer_2_blend_splatmap_channel: Templates::OmniUber_Automotive::r, + layer_2_blend_direction: float3(0.f, 1.f, 0.f), + layer_2_blend_axis: Templates::OmniUber_Automotive::y, + layer_2_blend_object_space: true, + layer_2_blend_scale: 1.f, + layer_2_blend_offset: 0.f, + layer_2_blend_primvar_name: "", + layer_2_uv_set_detail: Templates::OmniUber_Automotive::uv_set_2, + layer_2_blend_detail_image: texture_2d(), + layer_2_blend_detail_image_channel: Templates::OmniUber_Automotive::r, + layer_2_blend_threshold: 0.330000013f, + layer_2_blend_factor_override: 0.f, + uv_set_layer_2: Templates::OmniUber_Automotive::uv_set_2, + layer_2_base_color_image: texture_2d(), + layer_2_diffuse_reflection_color: color(1.f, 1.f, 1.f), + layer_2_base_color_offset: 0.f, + layer_2_base_color_scale: 1.f, + layer_2_base_color_desaturation: 0.f, + layer_2_metalness_image: texture_2d(), + layer_2_metalness_channel: Templates::OmniUber_Automotive::b, + layer_2_metalness: 1.f, + layer_2_specular_reflection_weight: 1.f, + layer_2_cavity_image: texture_2d(), + layer_2_cavity_channel: Templates::OmniUber_Automotive::r, + layer_2_roughness_image: texture_2d(), + layer_2_roughness_channel: Templates::OmniUber_Automotive::g, + layer_2_roughness_u: 1.f, + layer_2_roughness_range_position: float2(1.f, 0.5f), + layer_2_normal_image: texture_2d(), + layer_2_normal_flip_green: true, + layer_2_normal_scale: 1.f, + enable_anisotropy: false, + uv_set_anisotropy: Templates::OmniUber_Automotive::uv_set_1, + anisotropic_roughness_u: 1.f, + anisotropic_roughness_v: 0.25f, + anisotropic_direction_image: texture_2d(), + anisotropic_direction_channel: Templates::OmniUber_Automotive::r, + anisotropic_direction: 0.f, + enable_detail_normal: true, + uv_set_detail_normal: Templates::OmniUber_Automotive::uv_set_2, + uv_set_detail_weight: Templates::OmniUber_Automotive::uv_set_1, + detail_normal_image: texture_2d("./ov_clouds_01_normal.png", ::tex::gamma_linear, ""), + detail_normal_flip_green: true, + detail_normal_scale: 1.f, + detail_normal_weight_image: texture_2d(), + detail_normal_weight_channel: Templates::OmniUber_Automotive::r, + enable_emission: false, + uv_set_emission: Templates::OmniUber_Automotive::uv_set_1, + uv_set_emission_mask: Templates::OmniUber_Automotive::uv_set_1, + emission_image: texture_2d(), + emission_mask_image: texture_2d(), + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: 1.f, + emission_color: color(1.f, 1.f, 1.f), + emission_use_temperature: false, + emission_temperature: 6500.f, + enable_coat: false, + coat_color: color(1.f, 1.f, 1.f), + coat_mask_image: texture_2d(), + coat_mask_channel: Templates::OmniUber_Automotive::r, + coat_roughness_image: texture_2d(), + coat_roughness_channel: Templates::OmniUber_Automotive::r, + coat_roughness: 0.f, + coat_ior: 1.60000002f, + coat_anisotropy: 0.f, + coat_anisotropy_rotation: 0.f, + coat_affect_color: 0.f, + coat_affect_roughness: 0.f, + coat_normal_image: texture_2d(), + coat_normal_flip_green: true, + uv_set_coat_roughness_normal: Templates::OmniUber_Automotive::uv_set_1, + uv_set_coat_mask: Templates::OmniUber_Automotive::uv_set_1, + enable_flakes: false, + flake_color: color(1.f, 1.f, 1.f), + flake_size: 0.125f, + flakes_density: 0.25f, + flakes_spread: 0.150000006f, + flake_roughness: 0.0500000007f); diff --git a/Material/material_0201/Suede_06.mdl b/Material/material_0201/Suede_06.mdl new file mode 100644 index 0000000000000000000000000000000000000000..815e94a6710e585e1b15107b75dc43b7d6a7a014 --- /dev/null +++ b/Material/material_0201/Suede_06.mdl @@ -0,0 +1,177 @@ +mdl 1.8; + +import ::state::normal; +import ::OmniSurface::OmniShared::emission_mode; +import ..::Templates::OmniUber_Automotive::*; +import ::tex::gamma_mode; + +export material Suede_06(*) + = Templates::OmniUber_Automotive::OmniUber_Automotive( + uvs_mode_01: Templates::OmniUber_Automotive::triplanar, + uv_scale_01: float2(1.5f), + uv_offset_01: float2(0.f), + uv_offset_time_01: float2(0.f), + uv_rotation_01: 0.f, + triplanar_blend_range_01: 0.5f, + uvs_mode_02: Templates::OmniUber_Automotive::triplanar, + uv_scale_02: float2(0.0500000007f), + uv_offset_02: float2(0.f), + uv_offset_time_02: float2(0.f), + uv_rotation_02: 0.f, + triplanar_blend_range_02: 0.5f, + uvs_mode_03: Templates::OmniUber_Automotive::triplanar, + uv_scale_03: float2(1.f), + uv_offset_03: float2(0.f), + uv_offset_time_03: float2(0.f), + uv_rotation_03: 0.f, + triplanar_blend_range_03: 0.5f, + uvs_mode_04: Templates::OmniUber_Automotive::triplanar, + uv_scale_04: float2(1.f), + uv_offset_04: float2(0.f), + uv_offset_time_04: float2(0.f), + uv_rotation_04: 0.f, + triplanar_blend_range_04: 0.5f, + enable_opacity: false, + uv_set_opacity: Templates::OmniUber_Automotive::uv_set_1, + opacity_image: texture_2d(), + opacity_channel: Templates::OmniUber_Automotive::a, + geometry_opacity_threshold: 0.150000006f, + uv_set_layer_0: Templates::OmniUber_Automotive::uv_set_1, + base_color_image: texture_2d("./ov_suede_02_basecolor.png", ::tex::gamma_default, ""), + diffuse_reflection_color: color(0.0363036394f, 0.0297323614f, 0.0221655872f), + base_color_scale: 1.f, + base_color_offset: 0.f, + base_color_desaturation: 0.f, + metalness_image: texture_2d("./ov_suede_02_orm.png", ::tex::gamma_linear, ""), + metalness_channel: Templates::OmniUber_Automotive::b, + metalness: 0.f, + specular_reflection_weight: 1.f, + specular_reflection_color: color(1.f, 1.f, 1.f), + cavity_image: texture_2d("./ov_suede_02_orm.png", ::tex::gamma_linear, ""), + cavity_channel: Templates::OmniUber_Automotive::r, + roughness_image: texture_2d("./ov_suede_02_orm.png", ::tex::gamma_default, ""), + roughness_channel: Templates::OmniUber_Automotive::g, + roughness_u: 1.f, + roughness_range_position: float2(0.949999988f, 0.850000024f), + normal_image: texture_2d("./ov_suede_02_normal.png", ::tex::gamma_linear, ""), + normal_flip_green: true, + normal_scale: 1.f, + enable_layer_1: true, + layer_1_order: Templates::OmniUber_Automotive::above, + layer_1_blend_source: Templates::OmniUber_Automotive::texture, + layer_1_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_1, + layer_1_blend_splatmap: texture_2d("./leather_blend_mask_04.png", ::tex::gamma_linear, ""), + layer_1_blend_splatmap_channel: Templates::OmniUber_Automotive::r, + layer_1_blend_direction: float3(0.f, 1.f, 0.f), + layer_1_blend_axis: Templates::OmniUber_Automotive::y, + layer_1_blend_object_space: true, + layer_1_blend_scale: 1.f, + layer_1_blend_offset: 0.f, + layer_1_blend_primvar_name: "", + layer_1_uv_set_detail: Templates::OmniUber_Automotive::uv_set_1, + layer_1_blend_detail_image: texture_2d("./leather_blend_mask_02.png", ::tex::gamma_default, ""), + layer_1_blend_detail_image_channel: Templates::OmniUber_Automotive::r, + layer_1_blend_threshold: 0.599999964f, + layer_1_blend_factor_override: 0.f, + uv_set_layer_1: Templates::OmniUber_Automotive::uv_set_1, + layer_1_base_color_image: texture_2d("./ov_suede_02_basecolor.png", ::tex::gamma_default, ""), + layer_1_diffuse_reflection_color: color(0.075907588f, 0.0682130978f, 0.0523586981f), + layer_1_base_color_offset: 0.0899999961f, + layer_1_base_color_scale: 0.319999993f, + layer_1_base_color_desaturation: 0.f, + layer_1_metalness_image: texture_2d("./ov_suede_02_orm.png", ::tex::gamma_default, ""), + layer_1_metalness_channel: Templates::OmniUber_Automotive::b, + layer_1_metalness: 1.f, + layer_1_specular_reflection_weight: 1.f, + layer_1_cavity_image: texture_2d("./ov_suede_02_orm.png", ::tex::gamma_default, ""), + layer_1_cavity_channel: Templates::OmniUber_Automotive::r, + layer_1_roughness_image: texture_2d("./ov_suede_02_orm.png", ::tex::gamma_default, ""), + layer_1_roughness_channel: Templates::OmniUber_Automotive::g, + layer_1_roughness_u: 1.f, + layer_1_roughness_range_position: float2(0.850000024f, 0.75f), + layer_1_normal_image: texture_2d("./ov_suede_02_normal.png", ::tex::gamma_linear, ""), + layer_1_normal_flip_green: true, + layer_1_normal_scale: 1.f, + enable_layer_2: false, + layer_2_order: Templates::OmniUber_Automotive::above, + layer_2_blend_source: Templates::OmniUber_Automotive::texture, + layer_2_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_2, + layer_2_blend_splatmap: texture_2d(), + layer_2_blend_splatmap_channel: Templates::OmniUber_Automotive::r, + layer_2_blend_direction: float3(0.f, 1.f, 0.f), + layer_2_blend_axis: Templates::OmniUber_Automotive::y, + layer_2_blend_object_space: true, + layer_2_blend_scale: 1.f, + layer_2_blend_offset: 0.f, + layer_2_blend_primvar_name: "", + layer_2_uv_set_detail: Templates::OmniUber_Automotive::uv_set_2, + layer_2_blend_detail_image: texture_2d(), + layer_2_blend_detail_image_channel: Templates::OmniUber_Automotive::r, + layer_2_blend_threshold: 0.330000013f, + layer_2_blend_factor_override: 0.f, + uv_set_layer_2: Templates::OmniUber_Automotive::uv_set_2, + layer_2_base_color_image: texture_2d(), + layer_2_diffuse_reflection_color: color(1.f, 1.f, 1.f), + layer_2_base_color_offset: 0.f, + layer_2_base_color_scale: 1.f, + layer_2_base_color_desaturation: 0.f, + layer_2_metalness_image: texture_2d(), + layer_2_metalness_channel: Templates::OmniUber_Automotive::b, + layer_2_metalness: 1.f, + layer_2_specular_reflection_weight: 1.f, + layer_2_cavity_image: texture_2d(), + layer_2_cavity_channel: Templates::OmniUber_Automotive::r, + layer_2_roughness_image: texture_2d(), + layer_2_roughness_channel: Templates::OmniUber_Automotive::g, + layer_2_roughness_u: 1.f, + layer_2_roughness_range_position: float2(1.f, 0.5f), + layer_2_normal_image: texture_2d(), + layer_2_normal_flip_green: true, + layer_2_normal_scale: 1.f, + enable_anisotropy: false, + uv_set_anisotropy: Templates::OmniUber_Automotive::uv_set_1, + anisotropic_roughness_u: 1.f, + anisotropic_roughness_v: 0.25f, + anisotropic_direction_image: texture_2d(), + anisotropic_direction_channel: Templates::OmniUber_Automotive::r, + anisotropic_direction: 0.f, + enable_detail_normal: true, + uv_set_detail_normal: Templates::OmniUber_Automotive::uv_set_2, + uv_set_detail_weight: Templates::OmniUber_Automotive::uv_set_1, + detail_normal_image: texture_2d("./ov_clouds_01_normal.png", ::tex::gamma_linear, ""), + detail_normal_flip_green: true, + detail_normal_scale: 0.5f, + detail_normal_weight_image: texture_2d(), + detail_normal_weight_channel: Templates::OmniUber_Automotive::r, + enable_emission: false, + uv_set_emission: Templates::OmniUber_Automotive::uv_set_1, + uv_set_emission_mask: Templates::OmniUber_Automotive::uv_set_1, + emission_image: texture_2d(), + emission_mask_image: texture_2d(), + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: 1.f, + emission_color: color(1.f, 1.f, 1.f), + emission_use_temperature: false, + emission_temperature: 6500.f, + enable_coat: false, + coat_color: color(1.f, 1.f, 1.f), + coat_mask_image: texture_2d(), + coat_mask_channel: Templates::OmniUber_Automotive::r, + coat_roughness_image: texture_2d(), + coat_roughness_channel: Templates::OmniUber_Automotive::r, + coat_roughness: 0.f, + coat_ior: 1.60000002f, + coat_anisotropy: 0.f, + coat_anisotropy_rotation: 0.f, + coat_affect_color: 0.f, + coat_affect_roughness: 0.f, + coat_normal_image: texture_2d(), + coat_normal_flip_green: true, + uv_set_coat_roughness_normal: Templates::OmniUber_Automotive::uv_set_1, + uv_set_coat_mask: Templates::OmniUber_Automotive::uv_set_1, + enable_flakes: false, + flake_color: color(1.f, 1.f, 1.f), + flake_size: 0.125f, + flakes_density: 0.25f, + flakes_spread: 0.150000006f, + flake_roughness: 0.0500000007f); diff --git a/Material/material_0203/Suede_08.mdl b/Material/material_0203/Suede_08.mdl new file mode 100644 index 0000000000000000000000000000000000000000..59c545c76402c9a48f468a1d976f3b4900982e0a --- /dev/null +++ b/Material/material_0203/Suede_08.mdl @@ -0,0 +1,177 @@ +mdl 1.8; + +import ::state::normal; +import ::OmniSurface::OmniShared::emission_mode; +import ..::Templates::OmniUber_Automotive::*; +import ::tex::gamma_mode; + +export material Suede_08(*) + = Templates::OmniUber_Automotive::OmniUber_Automotive( + uvs_mode_01: Templates::OmniUber_Automotive::triplanar, + uv_scale_01: float2(1.5f), + uv_offset_01: float2(0.f), + uv_offset_time_01: float2(0.f), + uv_rotation_01: 0.f, + triplanar_blend_range_01: 0.5f, + uvs_mode_02: Templates::OmniUber_Automotive::triplanar, + uv_scale_02: float2(0.0500000007f), + uv_offset_02: float2(0.f), + uv_offset_time_02: float2(0.f), + uv_rotation_02: 0.f, + triplanar_blend_range_02: 0.5f, + uvs_mode_03: Templates::OmniUber_Automotive::triplanar, + uv_scale_03: float2(1.f), + uv_offset_03: float2(0.f), + uv_offset_time_03: float2(0.f), + uv_rotation_03: 0.f, + triplanar_blend_range_03: 0.5f, + uvs_mode_04: Templates::OmniUber_Automotive::triplanar, + uv_scale_04: float2(1.f), + uv_offset_04: float2(0.f), + uv_offset_time_04: float2(0.f), + uv_rotation_04: 0.f, + triplanar_blend_range_04: 0.5f, + enable_opacity: false, + uv_set_opacity: Templates::OmniUber_Automotive::uv_set_1, + opacity_image: texture_2d(), + opacity_channel: Templates::OmniUber_Automotive::a, + geometry_opacity_threshold: 0.150000006f, + uv_set_layer_0: Templates::OmniUber_Automotive::uv_set_1, + base_color_image: texture_2d("./ov_suede_02_basecolor.png", ::tex::gamma_default, ""), + diffuse_reflection_color: color(0.178119794f, 0.417350799f, 0.782178223f), + base_color_scale: 1.f, + base_color_offset: 0.f, + base_color_desaturation: 0.f, + metalness_image: texture_2d("./ov_suede_02_orm.png", ::tex::gamma_linear, ""), + metalness_channel: Templates::OmniUber_Automotive::b, + metalness: 0.f, + specular_reflection_weight: 1.f, + specular_reflection_color: color(1.f, 1.f, 1.f), + cavity_image: texture_2d("./ov_suede_02_orm.png", ::tex::gamma_linear, ""), + cavity_channel: Templates::OmniUber_Automotive::r, + roughness_image: texture_2d("./ov_suede_02_orm.png", ::tex::gamma_default, ""), + roughness_channel: Templates::OmniUber_Automotive::g, + roughness_u: 1.f, + roughness_range_position: float2(0.949999988f, 0.850000024f), + normal_image: texture_2d("./ov_suede_02_normal.png", ::tex::gamma_linear, ""), + normal_flip_green: true, + normal_scale: 1.f, + enable_layer_1: true, + layer_1_order: Templates::OmniUber_Automotive::above, + layer_1_blend_source: Templates::OmniUber_Automotive::texture, + layer_1_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_1, + layer_1_blend_splatmap: texture_2d("./leather_blend_mask_04.png", ::tex::gamma_linear, ""), + layer_1_blend_splatmap_channel: Templates::OmniUber_Automotive::r, + layer_1_blend_direction: float3(0.f, 1.f, 0.f), + layer_1_blend_axis: Templates::OmniUber_Automotive::y, + layer_1_blend_object_space: true, + layer_1_blend_scale: 1.f, + layer_1_blend_offset: 0.f, + layer_1_blend_primvar_name: "", + layer_1_uv_set_detail: Templates::OmniUber_Automotive::uv_set_1, + layer_1_blend_detail_image: texture_2d("./leather_blend_mask_02.png", ::tex::gamma_default, ""), + layer_1_blend_detail_image_channel: Templates::OmniUber_Automotive::r, + layer_1_blend_threshold: 0.599999964f, + layer_1_blend_factor_override: 0.f, + uv_set_layer_1: Templates::OmniUber_Automotive::uv_set_1, + layer_1_base_color_image: texture_2d("./ov_suede_02_basecolor.png", ::tex::gamma_default, ""), + layer_1_diffuse_reflection_color: color(0.164983824f, 0.31729731f, 0.617161751f), + layer_1_base_color_offset: 0.0899999961f, + layer_1_base_color_scale: 1.09000003f, + layer_1_base_color_desaturation: 0.f, + layer_1_metalness_image: texture_2d("./ov_suede_02_orm.png", ::tex::gamma_default, ""), + layer_1_metalness_channel: Templates::OmniUber_Automotive::b, + layer_1_metalness: 1.f, + layer_1_specular_reflection_weight: 1.f, + layer_1_cavity_image: texture_2d("./ov_suede_02_orm.png", ::tex::gamma_default, ""), + layer_1_cavity_channel: Templates::OmniUber_Automotive::r, + layer_1_roughness_image: texture_2d("./ov_suede_02_orm.png", ::tex::gamma_default, ""), + layer_1_roughness_channel: Templates::OmniUber_Automotive::g, + layer_1_roughness_u: 1.f, + layer_1_roughness_range_position: float2(0.850000024f, 0.75f), + layer_1_normal_image: texture_2d("./ov_suede_02_normal.png", ::tex::gamma_linear, ""), + layer_1_normal_flip_green: true, + layer_1_normal_scale: 1.f, + enable_layer_2: false, + layer_2_order: Templates::OmniUber_Automotive::above, + layer_2_blend_source: Templates::OmniUber_Automotive::texture, + layer_2_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_2, + layer_2_blend_splatmap: texture_2d(), + layer_2_blend_splatmap_channel: Templates::OmniUber_Automotive::r, + layer_2_blend_direction: float3(0.f, 1.f, 0.f), + layer_2_blend_axis: Templates::OmniUber_Automotive::y, + layer_2_blend_object_space: true, + layer_2_blend_scale: 1.f, + layer_2_blend_offset: 0.f, + layer_2_blend_primvar_name: "", + layer_2_uv_set_detail: Templates::OmniUber_Automotive::uv_set_2, + layer_2_blend_detail_image: texture_2d(), + layer_2_blend_detail_image_channel: Templates::OmniUber_Automotive::r, + layer_2_blend_threshold: 0.330000013f, + layer_2_blend_factor_override: 0.f, + uv_set_layer_2: Templates::OmniUber_Automotive::uv_set_2, + layer_2_base_color_image: texture_2d(), + layer_2_diffuse_reflection_color: color(1.f, 1.f, 1.f), + layer_2_base_color_offset: 0.f, + layer_2_base_color_scale: 1.f, + layer_2_base_color_desaturation: 0.f, + layer_2_metalness_image: texture_2d(), + layer_2_metalness_channel: Templates::OmniUber_Automotive::b, + layer_2_metalness: 1.f, + layer_2_specular_reflection_weight: 1.f, + layer_2_cavity_image: texture_2d(), + layer_2_cavity_channel: Templates::OmniUber_Automotive::r, + layer_2_roughness_image: texture_2d(), + layer_2_roughness_channel: Templates::OmniUber_Automotive::g, + layer_2_roughness_u: 1.f, + layer_2_roughness_range_position: float2(1.f, 0.5f), + layer_2_normal_image: texture_2d(), + layer_2_normal_flip_green: true, + layer_2_normal_scale: 1.f, + enable_anisotropy: false, + uv_set_anisotropy: Templates::OmniUber_Automotive::uv_set_1, + anisotropic_roughness_u: 1.f, + anisotropic_roughness_v: 0.25f, + anisotropic_direction_image: texture_2d(), + anisotropic_direction_channel: Templates::OmniUber_Automotive::r, + anisotropic_direction: 0.f, + enable_detail_normal: true, + uv_set_detail_normal: Templates::OmniUber_Automotive::uv_set_2, + uv_set_detail_weight: Templates::OmniUber_Automotive::uv_set_1, + detail_normal_image: texture_2d("./ov_clouds_01_normal.png", ::tex::gamma_linear, ""), + detail_normal_flip_green: true, + detail_normal_scale: 0.5f, + detail_normal_weight_image: texture_2d(), + detail_normal_weight_channel: Templates::OmniUber_Automotive::r, + enable_emission: false, + uv_set_emission: Templates::OmniUber_Automotive::uv_set_1, + uv_set_emission_mask: Templates::OmniUber_Automotive::uv_set_1, + emission_image: texture_2d(), + emission_mask_image: texture_2d(), + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: 1.f, + emission_color: color(1.f, 1.f, 1.f), + emission_use_temperature: false, + emission_temperature: 6500.f, + enable_coat: false, + coat_color: color(1.f, 1.f, 1.f), + coat_mask_image: texture_2d(), + coat_mask_channel: Templates::OmniUber_Automotive::r, + coat_roughness_image: texture_2d(), + coat_roughness_channel: Templates::OmniUber_Automotive::r, + coat_roughness: 0.f, + coat_ior: 1.60000002f, + coat_anisotropy: 0.f, + coat_anisotropy_rotation: 0.f, + coat_affect_color: 0.f, + coat_affect_roughness: 0.f, + coat_normal_image: texture_2d(), + coat_normal_flip_green: true, + uv_set_coat_roughness_normal: Templates::OmniUber_Automotive::uv_set_1, + uv_set_coat_mask: Templates::OmniUber_Automotive::uv_set_1, + enable_flakes: false, + flake_color: color(1.f, 1.f, 1.f), + flake_size: 0.125f, + flakes_density: 0.25f, + flakes_spread: 0.150000006f, + flake_roughness: 0.0500000007f); diff --git a/Material/material_0205/Suede_10.mdl b/Material/material_0205/Suede_10.mdl new file mode 100644 index 0000000000000000000000000000000000000000..656ed8474fcc703505b118fa92276b29bed507be --- /dev/null +++ b/Material/material_0205/Suede_10.mdl @@ -0,0 +1,177 @@ +mdl 1.8; + +import ::state::normal; +import ::OmniSurface::OmniShared::emission_mode; +import ..::Templates::OmniUber_Automotive::*; +import ::tex::gamma_mode; + +export material Suede_10(*) + = Templates::OmniUber_Automotive::OmniUber_Automotive( + uvs_mode_01: Templates::OmniUber_Automotive::triplanar, + uv_scale_01: float2(1.5f), + uv_offset_01: float2(0.f), + uv_offset_time_01: float2(0.f), + uv_rotation_01: 0.f, + triplanar_blend_range_01: 0.5f, + uvs_mode_02: Templates::OmniUber_Automotive::triplanar, + uv_scale_02: float2(0.0500000007f), + uv_offset_02: float2(0.f), + uv_offset_time_02: float2(0.f), + uv_rotation_02: 0.f, + triplanar_blend_range_02: 0.5f, + uvs_mode_03: Templates::OmniUber_Automotive::triplanar, + uv_scale_03: float2(1.f), + uv_offset_03: float2(0.f), + uv_offset_time_03: float2(0.f), + uv_rotation_03: 0.f, + triplanar_blend_range_03: 0.5f, + uvs_mode_04: Templates::OmniUber_Automotive::triplanar, + uv_scale_04: float2(1.f), + uv_offset_04: float2(0.f), + uv_offset_time_04: float2(0.f), + uv_rotation_04: 0.f, + triplanar_blend_range_04: 0.5f, + enable_opacity: false, + uv_set_opacity: Templates::OmniUber_Automotive::uv_set_1, + opacity_image: texture_2d(), + opacity_channel: Templates::OmniUber_Automotive::a, + geometry_opacity_threshold: 0.150000006f, + uv_set_layer_0: Templates::OmniUber_Automotive::uv_set_1, + base_color_image: texture_2d("./ov_suede_01_basecolor.png", ::tex::gamma_default, ""), + diffuse_reflection_color: color(0.312298089f, 0.44884491f, 0.0548094474f), + base_color_scale: 1.f, + base_color_offset: 0.459999979f, + base_color_desaturation: 0.f, + metalness_image: texture_2d("./ov_suede_01_orm.png", ::tex::gamma_linear, ""), + metalness_channel: Templates::OmniUber_Automotive::b, + metalness: 0.f, + specular_reflection_weight: 1.f, + specular_reflection_color: color(1.f, 1.f, 1.f), + cavity_image: texture_2d("./ov_suede_01_orm.png", ::tex::gamma_linear, ""), + cavity_channel: Templates::OmniUber_Automotive::r, + roughness_image: texture_2d("./ov_suede_01_orm.png", ::tex::gamma_default, ""), + roughness_channel: Templates::OmniUber_Automotive::g, + roughness_u: 1.f, + roughness_range_position: float2(0.769999981f, 0.730000019f), + normal_image: texture_2d("./ov_suede_01_normal.png", ::tex::gamma_linear, ""), + normal_flip_green: true, + normal_scale: 1.f, + enable_layer_1: true, + layer_1_order: Templates::OmniUber_Automotive::above, + layer_1_blend_source: Templates::OmniUber_Automotive::texture, + layer_1_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_1, + layer_1_blend_splatmap: texture_2d("./leather_blend_mask_02.png", ::tex::gamma_linear, ""), + layer_1_blend_splatmap_channel: Templates::OmniUber_Automotive::r, + layer_1_blend_direction: float3(0.f, 1.f, 0.f), + layer_1_blend_axis: Templates::OmniUber_Automotive::y, + layer_1_blend_object_space: true, + layer_1_blend_scale: 1.f, + layer_1_blend_offset: 0.f, + layer_1_blend_primvar_name: "", + layer_1_uv_set_detail: Templates::OmniUber_Automotive::uv_set_1, + layer_1_blend_detail_image: texture_2d(), + layer_1_blend_detail_image_channel: Templates::OmniUber_Automotive::r, + layer_1_blend_threshold: 1.f, + layer_1_blend_factor_override: 0.f, + uv_set_layer_1: Templates::OmniUber_Automotive::uv_set_1, + layer_1_base_color_image: texture_2d("./ov_suede_01_basecolor.png", ::tex::gamma_default, ""), + layer_1_diffuse_reflection_color: color(0.463262737f, 0.679867983f, 0.118920818f), + layer_1_base_color_offset: 0.189999998f, + layer_1_base_color_scale: 1.f, + layer_1_base_color_desaturation: 0.f, + layer_1_metalness_image: texture_2d("./ov_suede_01_orm.png", ::tex::gamma_default, ""), + layer_1_metalness_channel: Templates::OmniUber_Automotive::b, + layer_1_metalness: 1.f, + layer_1_specular_reflection_weight: 1.f, + layer_1_cavity_image: texture_2d("./ov_suede_01_orm.png", ::tex::gamma_default, ""), + layer_1_cavity_channel: Templates::OmniUber_Automotive::r, + layer_1_roughness_image: texture_2d("./ov_suede_01_orm.png", ::tex::gamma_default, ""), + layer_1_roughness_channel: Templates::OmniUber_Automotive::g, + layer_1_roughness_u: 1.f, + layer_1_roughness_range_position: float2(0.75f, 0.649999976f), + layer_1_normal_image: texture_2d("./ov_suede_01_normal.png", ::tex::gamma_linear, ""), + layer_1_normal_flip_green: true, + layer_1_normal_scale: 2.f, + enable_layer_2: false, + layer_2_order: Templates::OmniUber_Automotive::above, + layer_2_blend_source: Templates::OmniUber_Automotive::texture, + layer_2_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_2, + layer_2_blend_splatmap: texture_2d(), + layer_2_blend_splatmap_channel: Templates::OmniUber_Automotive::r, + layer_2_blend_direction: float3(0.f, 1.f, 0.f), + layer_2_blend_axis: Templates::OmniUber_Automotive::y, + layer_2_blend_object_space: true, + layer_2_blend_scale: 1.f, + layer_2_blend_offset: 0.f, + layer_2_blend_primvar_name: "", + layer_2_uv_set_detail: Templates::OmniUber_Automotive::uv_set_2, + layer_2_blend_detail_image: texture_2d(), + layer_2_blend_detail_image_channel: Templates::OmniUber_Automotive::r, + layer_2_blend_threshold: 0.330000013f, + layer_2_blend_factor_override: 0.f, + uv_set_layer_2: Templates::OmniUber_Automotive::uv_set_2, + layer_2_base_color_image: texture_2d(), + layer_2_diffuse_reflection_color: color(1.f, 1.f, 1.f), + layer_2_base_color_offset: 0.f, + layer_2_base_color_scale: 1.f, + layer_2_base_color_desaturation: 0.f, + layer_2_metalness_image: texture_2d(), + layer_2_metalness_channel: Templates::OmniUber_Automotive::b, + layer_2_metalness: 1.f, + layer_2_specular_reflection_weight: 1.f, + layer_2_cavity_image: texture_2d(), + layer_2_cavity_channel: Templates::OmniUber_Automotive::r, + layer_2_roughness_image: texture_2d(), + layer_2_roughness_channel: Templates::OmniUber_Automotive::g, + layer_2_roughness_u: 1.f, + layer_2_roughness_range_position: float2(1.f, 0.5f), + layer_2_normal_image: texture_2d(), + layer_2_normal_flip_green: true, + layer_2_normal_scale: 1.f, + enable_anisotropy: false, + uv_set_anisotropy: Templates::OmniUber_Automotive::uv_set_1, + anisotropic_roughness_u: 1.f, + anisotropic_roughness_v: 0.25f, + anisotropic_direction_image: texture_2d(), + anisotropic_direction_channel: Templates::OmniUber_Automotive::r, + anisotropic_direction: 0.f, + enable_detail_normal: true, + uv_set_detail_normal: Templates::OmniUber_Automotive::uv_set_2, + uv_set_detail_weight: Templates::OmniUber_Automotive::uv_set_1, + detail_normal_image: texture_2d("./ov_clouds_01_normal.png", ::tex::gamma_linear, ""), + detail_normal_flip_green: true, + detail_normal_scale: 0.5f, + detail_normal_weight_image: texture_2d(), + detail_normal_weight_channel: Templates::OmniUber_Automotive::r, + enable_emission: false, + uv_set_emission: Templates::OmniUber_Automotive::uv_set_1, + uv_set_emission_mask: Templates::OmniUber_Automotive::uv_set_1, + emission_image: texture_2d(), + emission_mask_image: texture_2d(), + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: 1.f, + emission_color: color(1.f, 1.f, 1.f), + emission_use_temperature: false, + emission_temperature: 6500.f, + enable_coat: false, + coat_color: color(1.f, 1.f, 1.f), + coat_mask_image: texture_2d(), + coat_mask_channel: Templates::OmniUber_Automotive::r, + coat_roughness_image: texture_2d(), + coat_roughness_channel: Templates::OmniUber_Automotive::r, + coat_roughness: 0.f, + coat_ior: 1.60000002f, + coat_anisotropy: 0.f, + coat_anisotropy_rotation: 0.f, + coat_affect_color: 0.f, + coat_affect_roughness: 0.f, + coat_normal_image: texture_2d(), + coat_normal_flip_green: true, + uv_set_coat_roughness_normal: Templates::OmniUber_Automotive::uv_set_1, + uv_set_coat_mask: Templates::OmniUber_Automotive::uv_set_1, + enable_flakes: false, + flake_color: color(1.f, 1.f, 1.f), + flake_size: 0.125f, + flakes_density: 0.25f, + flakes_spread: 0.150000006f, + flake_roughness: 0.0500000007f); diff --git a/Material/material_0206/Metal_Black_Paint.mdl b/Material/material_0206/Metal_Black_Paint.mdl new file mode 100644 index 0000000000000000000000000000000000000000..a8561080d9d3eae08a4e14515443445e4a5fdf8f --- /dev/null +++ b/Material/material_0206/Metal_Black_Paint.mdl @@ -0,0 +1,177 @@ +mdl 1.8; + +import ::state::normal; +import ::OmniSurface::OmniShared::emission_mode; +import ..::Templates::OmniUber_Automotive::*; +import ::tex::gamma_mode; + +export material Metal_Black_Paint(*) + = Templates::OmniUber_Automotive::OmniUber_Automotive( + uvs_mode_01: Templates::OmniUber_Automotive::triplanar, + uv_scale_01: float2(1.f), + uv_offset_01: float2(0.f), + uv_offset_time_01: float2(0.f), + uv_rotation_01: 0.f, + triplanar_blend_range_01: 0.5f, + uvs_mode_02: Templates::OmniUber_Automotive::triplanar, + uv_scale_02: float2(1.f), + uv_offset_02: float2(0.f), + uv_offset_time_02: float2(0.f), + uv_rotation_02: 0.f, + triplanar_blend_range_02: 0.5f, + uvs_mode_03: Templates::OmniUber_Automotive::triplanar, + uv_scale_03: float2(1.f), + uv_offset_03: float2(0.f), + uv_offset_time_03: float2(0.f), + uv_rotation_03: 0.f, + triplanar_blend_range_03: 0.5f, + uvs_mode_04: Templates::OmniUber_Automotive::triplanar, + uv_scale_04: float2(1.f), + uv_offset_04: float2(0.f), + uv_offset_time_04: float2(0.f), + uv_rotation_04: 0.f, + triplanar_blend_range_04: 0.5f, + enable_opacity: false, + uv_set_opacity: Templates::OmniUber_Automotive::uv_set_1, + opacity_image: texture_2d(), + opacity_channel: Templates::OmniUber_Automotive::a, + geometry_opacity_threshold: 0.150000006f, + uv_set_layer_0: Templates::OmniUber_Automotive::uv_set_1, + base_color_image: texture_2d("./ov_metal_a_01_basecolor.png", ::tex::gamma_default, ""), + diffuse_reflection_color: color(0.06930691f, 0.0693062171f, 0.0693062171f), + base_color_scale: 1.f, + base_color_offset: 0.f, + base_color_desaturation: 0.f, + metalness_image: texture_2d("./ov_metal_a_01_orm.png", ::tex::gamma_linear, ""), + metalness_channel: Templates::OmniUber_Automotive::b, + metalness: 0.f, + specular_reflection_weight: 1.f, + specular_reflection_color: color(1.f, 1.f, 1.f), + cavity_image: texture_2d("./ov_metal_a_01_orm.png", ::tex::gamma_linear, ""), + cavity_channel: Templates::OmniUber_Automotive::r, + roughness_image: texture_2d("./ov_metal_a_01_orm.png", ::tex::gamma_default, ""), + roughness_channel: Templates::OmniUber_Automotive::g, + roughness_u: 1.f, + roughness_range_position: float2(0.349999994f, 0.25f), + normal_image: texture_2d("./ov_metal_a_01_normal.png", ::tex::gamma_linear, ""), + normal_flip_green: true, + normal_scale: 1.f, + enable_layer_1: false, + layer_1_order: Templates::OmniUber_Automotive::above, + layer_1_blend_source: Templates::OmniUber_Automotive::texture, + layer_1_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_1, + layer_1_blend_splatmap: texture_2d(), + layer_1_blend_splatmap_channel: Templates::OmniUber_Automotive::r, + layer_1_blend_direction: float3(0.f, 1.f, 0.f), + layer_1_blend_axis: Templates::OmniUber_Automotive::y, + layer_1_blend_object_space: true, + layer_1_blend_scale: 1.f, + layer_1_blend_offset: 0.f, + layer_1_blend_primvar_name: "", + layer_1_uv_set_detail: Templates::OmniUber_Automotive::uv_set_1, + layer_1_blend_detail_image: texture_2d(), + layer_1_blend_detail_image_channel: Templates::OmniUber_Automotive::r, + layer_1_blend_threshold: 0.330000013f, + layer_1_blend_factor_override: 0.f, + uv_set_layer_1: Templates::OmniUber_Automotive::uv_set_1, + layer_1_base_color_image: texture_2d(), + layer_1_diffuse_reflection_color: color(1.f, 1.f, 1.f), + layer_1_base_color_offset: 0.f, + layer_1_base_color_scale: 1.f, + layer_1_base_color_desaturation: 0.f, + layer_1_metalness_image: texture_2d(), + layer_1_metalness_channel: Templates::OmniUber_Automotive::b, + layer_1_metalness: 1.f, + layer_1_specular_reflection_weight: 1.f, + layer_1_cavity_image: texture_2d(), + layer_1_cavity_channel: Templates::OmniUber_Automotive::r, + layer_1_roughness_image: texture_2d(), + layer_1_roughness_channel: Templates::OmniUber_Automotive::g, + layer_1_roughness_u: 1.f, + layer_1_roughness_range_position: float2(0.949999988f, 0.5f), + layer_1_normal_image: texture_2d(), + layer_1_normal_flip_green: true, + layer_1_normal_scale: 1.f, + enable_layer_2: false, + layer_2_order: Templates::OmniUber_Automotive::above, + layer_2_blend_source: Templates::OmniUber_Automotive::texture, + layer_2_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_2, + layer_2_blend_splatmap: texture_2d(), + layer_2_blend_splatmap_channel: Templates::OmniUber_Automotive::r, + layer_2_blend_direction: float3(0.f, 1.f, 0.f), + layer_2_blend_axis: Templates::OmniUber_Automotive::y, + layer_2_blend_object_space: true, + layer_2_blend_scale: 1.f, + layer_2_blend_offset: 0.f, + layer_2_blend_primvar_name: "", + layer_2_uv_set_detail: Templates::OmniUber_Automotive::uv_set_2, + layer_2_blend_detail_image: texture_2d(), + layer_2_blend_detail_image_channel: Templates::OmniUber_Automotive::r, + layer_2_blend_threshold: 0.330000013f, + layer_2_blend_factor_override: 0.f, + uv_set_layer_2: Templates::OmniUber_Automotive::uv_set_2, + layer_2_base_color_image: texture_2d(), + layer_2_diffuse_reflection_color: color(1.f, 1.f, 1.f), + layer_2_base_color_offset: 0.f, + layer_2_base_color_scale: 1.f, + layer_2_base_color_desaturation: 0.f, + layer_2_metalness_image: texture_2d(), + layer_2_metalness_channel: Templates::OmniUber_Automotive::b, + layer_2_metalness: 1.f, + layer_2_specular_reflection_weight: 1.f, + layer_2_cavity_image: texture_2d(), + layer_2_cavity_channel: Templates::OmniUber_Automotive::r, + layer_2_roughness_image: texture_2d(), + layer_2_roughness_channel: Templates::OmniUber_Automotive::g, + layer_2_roughness_u: 1.f, + layer_2_roughness_range_position: float2(1.f, 0.5f), + layer_2_normal_image: texture_2d(), + layer_2_normal_flip_green: true, + layer_2_normal_scale: 1.f, + enable_anisotropy: false, + uv_set_anisotropy: Templates::OmniUber_Automotive::uv_set_1, + anisotropic_roughness_u: 1.f, + anisotropic_roughness_v: 0.25f, + anisotropic_direction_image: texture_2d(), + anisotropic_direction_channel: Templates::OmniUber_Automotive::r, + anisotropic_direction: 0.f, + enable_detail_normal: false, + uv_set_detail_normal: Templates::OmniUber_Automotive::uv_set_1, + uv_set_detail_weight: Templates::OmniUber_Automotive::uv_set_1, + detail_normal_image: texture_2d(), + detail_normal_flip_green: true, + detail_normal_scale: 1.f, + detail_normal_weight_image: texture_2d(), + detail_normal_weight_channel: Templates::OmniUber_Automotive::r, + enable_emission: false, + uv_set_emission: Templates::OmniUber_Automotive::uv_set_1, + uv_set_emission_mask: Templates::OmniUber_Automotive::uv_set_1, + emission_image: texture_2d(), + emission_mask_image: texture_2d(), + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: 1.f, + emission_color: color(1.f, 1.f, 1.f), + emission_use_temperature: false, + emission_temperature: 6500.f, + enable_coat: false, + coat_color: color(1.f, 1.f, 1.f), + coat_mask_image: texture_2d(), + coat_mask_channel: Templates::OmniUber_Automotive::r, + coat_roughness_image: texture_2d(), + coat_roughness_channel: Templates::OmniUber_Automotive::r, + coat_roughness: 0.f, + coat_ior: 1.60000002f, + coat_anisotropy: 0.f, + coat_anisotropy_rotation: 0.f, + coat_affect_color: 0.f, + coat_affect_roughness: 0.f, + coat_normal_image: texture_2d(), + coat_normal_flip_green: true, + uv_set_coat_roughness_normal: Templates::OmniUber_Automotive::uv_set_1, + uv_set_coat_mask: Templates::OmniUber_Automotive::uv_set_1, + enable_flakes: false, + flake_color: color(1.f, 1.f, 1.f), + flake_size: 0.125f, + flakes_density: 0.25f, + flakes_spread: 0.150000006f, + flake_roughness: 0.0500000007f); diff --git a/Material/material_0215/Metal_Polished_01.mdl b/Material/material_0215/Metal_Polished_01.mdl new file mode 100644 index 0000000000000000000000000000000000000000..c1a2d7e361adc5d6caa85b7c32907b6a9259509d --- /dev/null +++ b/Material/material_0215/Metal_Polished_01.mdl @@ -0,0 +1,177 @@ +mdl 1.8; + +import ::state::normal; +import ::OmniSurface::OmniShared::emission_mode; +import ..::Templates::OmniUber_Automotive::*; +import ::tex::gamma_mode; + +export material Metal_Polished_01(*) + = Templates::OmniUber_Automotive::OmniUber_Automotive( + uvs_mode_01: Templates::OmniUber_Automotive::triplanar, + uv_scale_01: float2(1.f), + uv_offset_01: float2(0.f), + uv_offset_time_01: float2(0.f), + uv_rotation_01: 0.f, + triplanar_blend_range_01: 0.f, + uvs_mode_02: Templates::OmniUber_Automotive::triplanar, + uv_scale_02: float2(1.f), + uv_offset_02: float2(0.f), + uv_offset_time_02: float2(0.f), + uv_rotation_02: 0.f, + triplanar_blend_range_02: 0.5f, + uvs_mode_03: Templates::OmniUber_Automotive::triplanar, + uv_scale_03: float2(1.f), + uv_offset_03: float2(0.f), + uv_offset_time_03: float2(0.f), + uv_rotation_03: 0.f, + triplanar_blend_range_03: 0.5f, + uvs_mode_04: Templates::OmniUber_Automotive::triplanar, + uv_scale_04: float2(1.f), + uv_offset_04: float2(0.f), + uv_offset_time_04: float2(0.f), + uv_rotation_04: 0.f, + triplanar_blend_range_04: 0.5f, + enable_opacity: false, + uv_set_opacity: Templates::OmniUber_Automotive::uv_set_1, + opacity_image: texture_2d(), + opacity_channel: Templates::OmniUber_Automotive::a, + geometry_opacity_threshold: 0.150000006f, + uv_set_layer_0: Templates::OmniUber_Automotive::uv_set_1, + base_color_image: texture_2d("./ov_metal_machine_polished_01_basecolor.png", ::tex::gamma_default, ""), + diffuse_reflection_color: color(0.894389451f, 0.89438051f, 0.89438051f), + base_color_scale: 1.f, + base_color_offset: 0.f, + base_color_desaturation: 0.f, + metalness_image: texture_2d("./ov_metal_machine_polished_01_orm.png", ::tex::gamma_linear, ""), + metalness_channel: Templates::OmniUber_Automotive::b, + metalness: 1.f, + specular_reflection_weight: 1.f, + specular_reflection_color: color(1.f, 1.f, 1.f), + cavity_image: texture_2d("./ov_metal_machine_polished_01_orm.png", ::tex::gamma_linear, ""), + cavity_channel: Templates::OmniUber_Automotive::r, + roughness_image: texture_2d("./ov_metal_machine_polished_01_orm.png", ::tex::gamma_default, ""), + roughness_channel: Templates::OmniUber_Automotive::g, + roughness_u: 1.f, + roughness_range_position: float2(0.449999988f, 0.349999994f), + normal_image: texture_2d("./ov_metal_machine_polished_01_normal.png", ::tex::gamma_linear, ""), + normal_flip_green: true, + normal_scale: 3.f, + enable_layer_1: false, + layer_1_order: Templates::OmniUber_Automotive::above, + layer_1_blend_source: Templates::OmniUber_Automotive::texture, + layer_1_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_1, + layer_1_blend_splatmap: texture_2d(), + layer_1_blend_splatmap_channel: Templates::OmniUber_Automotive::r, + layer_1_blend_direction: float3(0.f, 1.f, 0.f), + layer_1_blend_axis: Templates::OmniUber_Automotive::y, + layer_1_blend_object_space: true, + layer_1_blend_scale: 1.f, + layer_1_blend_offset: 0.f, + layer_1_blend_primvar_name: "", + layer_1_uv_set_detail: Templates::OmniUber_Automotive::uv_set_1, + layer_1_blend_detail_image: texture_2d(), + layer_1_blend_detail_image_channel: Templates::OmniUber_Automotive::r, + layer_1_blend_threshold: 0.330000013f, + layer_1_blend_factor_override: 0.f, + uv_set_layer_1: Templates::OmniUber_Automotive::uv_set_1, + layer_1_base_color_image: texture_2d(), + layer_1_diffuse_reflection_color: color(1.f, 1.f, 1.f), + layer_1_base_color_offset: 0.f, + layer_1_base_color_scale: 1.f, + layer_1_base_color_desaturation: 0.f, + layer_1_metalness_image: texture_2d(), + layer_1_metalness_channel: Templates::OmniUber_Automotive::b, + layer_1_metalness: 1.f, + layer_1_specular_reflection_weight: 1.f, + layer_1_cavity_image: texture_2d(), + layer_1_cavity_channel: Templates::OmniUber_Automotive::r, + layer_1_roughness_image: texture_2d(), + layer_1_roughness_channel: Templates::OmniUber_Automotive::g, + layer_1_roughness_u: 1.f, + layer_1_roughness_range_position: float2(0.949999988f, 0.5f), + layer_1_normal_image: texture_2d(), + layer_1_normal_flip_green: true, + layer_1_normal_scale: 1.f, + enable_layer_2: false, + layer_2_order: Templates::OmniUber_Automotive::above, + layer_2_blend_source: Templates::OmniUber_Automotive::texture, + layer_2_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_2, + layer_2_blend_splatmap: texture_2d(), + layer_2_blend_splatmap_channel: Templates::OmniUber_Automotive::r, + layer_2_blend_direction: float3(0.f, 1.f, 0.f), + layer_2_blend_axis: Templates::OmniUber_Automotive::y, + layer_2_blend_object_space: true, + layer_2_blend_scale: 1.f, + layer_2_blend_offset: 0.f, + layer_2_blend_primvar_name: "", + layer_2_uv_set_detail: Templates::OmniUber_Automotive::uv_set_2, + layer_2_blend_detail_image: texture_2d(), + layer_2_blend_detail_image_channel: Templates::OmniUber_Automotive::r, + layer_2_blend_threshold: 0.330000013f, + layer_2_blend_factor_override: 0.f, + uv_set_layer_2: Templates::OmniUber_Automotive::uv_set_2, + layer_2_base_color_image: texture_2d(), + layer_2_diffuse_reflection_color: color(1.f, 1.f, 1.f), + layer_2_base_color_offset: 0.f, + layer_2_base_color_scale: 1.f, + layer_2_base_color_desaturation: 0.f, + layer_2_metalness_image: texture_2d(), + layer_2_metalness_channel: Templates::OmniUber_Automotive::b, + layer_2_metalness: 1.f, + layer_2_specular_reflection_weight: 1.f, + layer_2_cavity_image: texture_2d(), + layer_2_cavity_channel: Templates::OmniUber_Automotive::r, + layer_2_roughness_image: texture_2d(), + layer_2_roughness_channel: Templates::OmniUber_Automotive::g, + layer_2_roughness_u: 1.f, + layer_2_roughness_range_position: float2(1.f, 0.5f), + layer_2_normal_image: texture_2d(), + layer_2_normal_flip_green: true, + layer_2_normal_scale: 1.f, + enable_anisotropy: true, + uv_set_anisotropy: Templates::OmniUber_Automotive::uv_set_1, + anisotropic_roughness_u: 0.0599999987f, + anisotropic_roughness_v: 0.0599999987f, + anisotropic_direction_image: texture_2d("./ov_metal_machine_polished_01_anisotropy_level.png", ::tex::gamma_default, ""), + anisotropic_direction_channel: Templates::OmniUber_Automotive::r, + anisotropic_direction: 0.f, + enable_detail_normal: false, + uv_set_detail_normal: Templates::OmniUber_Automotive::uv_set_1, + uv_set_detail_weight: Templates::OmniUber_Automotive::uv_set_1, + detail_normal_image: texture_2d(), + detail_normal_flip_green: true, + detail_normal_scale: 1.f, + detail_normal_weight_image: texture_2d(), + detail_normal_weight_channel: Templates::OmniUber_Automotive::r, + enable_emission: false, + uv_set_emission: Templates::OmniUber_Automotive::uv_set_1, + uv_set_emission_mask: Templates::OmniUber_Automotive::uv_set_1, + emission_image: texture_2d(), + emission_mask_image: texture_2d(), + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: 1.f, + emission_color: color(1.f, 1.f, 1.f), + emission_use_temperature: false, + emission_temperature: 6500.f, + enable_coat: false, + coat_color: color(1.f, 1.f, 1.f), + coat_mask_image: texture_2d(), + coat_mask_channel: Templates::OmniUber_Automotive::r, + coat_roughness_image: texture_2d(), + coat_roughness_channel: Templates::OmniUber_Automotive::r, + coat_roughness: 0.f, + coat_ior: 1.60000002f, + coat_anisotropy: 0.f, + coat_anisotropy_rotation: 0.f, + coat_affect_color: 0.f, + coat_affect_roughness: 0.f, + coat_normal_image: texture_2d(), + coat_normal_flip_green: true, + uv_set_coat_roughness_normal: Templates::OmniUber_Automotive::uv_set_1, + uv_set_coat_mask: Templates::OmniUber_Automotive::uv_set_1, + enable_flakes: false, + flake_color: color(1.f, 1.f, 1.f), + flake_size: 0.125f, + flakes_density: 0.25f, + flakes_spread: 0.150000006f, + flake_roughness: 0.0500000007f); diff --git a/Material/material_0222/Metal_White_Paint.mdl b/Material/material_0222/Metal_White_Paint.mdl new file mode 100644 index 0000000000000000000000000000000000000000..239d8211cda63eec63afbd686c0c805f44595b71 --- /dev/null +++ b/Material/material_0222/Metal_White_Paint.mdl @@ -0,0 +1,177 @@ +mdl 1.8; + +import ::state::normal; +import ::OmniSurface::OmniShared::emission_mode; +import ..::Templates::OmniUber_Automotive::*; +import ::tex::gamma_mode; + +export material Metal_White_Paint(*) + = Templates::OmniUber_Automotive::OmniUber_Automotive( + uvs_mode_01: Templates::OmniUber_Automotive::triplanar, + uv_scale_01: float2(1.f), + uv_offset_01: float2(0.f), + uv_offset_time_01: float2(0.f), + uv_rotation_01: 0.f, + triplanar_blend_range_01: 0.5f, + uvs_mode_02: Templates::OmniUber_Automotive::triplanar, + uv_scale_02: float2(1.f), + uv_offset_02: float2(0.f), + uv_offset_time_02: float2(0.f), + uv_rotation_02: 0.f, + triplanar_blend_range_02: 0.5f, + uvs_mode_03: Templates::OmniUber_Automotive::triplanar, + uv_scale_03: float2(1.f), + uv_offset_03: float2(0.f), + uv_offset_time_03: float2(0.f), + uv_rotation_03: 0.f, + triplanar_blend_range_03: 0.5f, + uvs_mode_04: Templates::OmniUber_Automotive::triplanar, + uv_scale_04: float2(1.f), + uv_offset_04: float2(0.f), + uv_offset_time_04: float2(0.f), + uv_rotation_04: 0.f, + triplanar_blend_range_04: 0.5f, + enable_opacity: false, + uv_set_opacity: Templates::OmniUber_Automotive::uv_set_1, + opacity_image: texture_2d(), + opacity_channel: Templates::OmniUber_Automotive::a, + geometry_opacity_threshold: 0.150000006f, + uv_set_layer_0: Templates::OmniUber_Automotive::uv_set_1, + base_color_image: texture_2d("./ov_metal_a_01_basecolor.png", ::tex::gamma_default, ""), + diffuse_reflection_color: color(0.960386455f, 0.960389495f, 0.960396051f), + base_color_scale: 1.f, + base_color_offset: 0.f, + base_color_desaturation: 0.f, + metalness_image: texture_2d("./ov_metal_a_01_orm.png", ::tex::gamma_linear, ""), + metalness_channel: Templates::OmniUber_Automotive::b, + metalness: 0.f, + specular_reflection_weight: 1.f, + specular_reflection_color: color(1.f, 1.f, 1.f), + cavity_image: texture_2d("./ov_metal_a_01_orm.png", ::tex::gamma_linear, ""), + cavity_channel: Templates::OmniUber_Automotive::r, + roughness_image: texture_2d("./ov_metal_a_01_orm.png", ::tex::gamma_default, ""), + roughness_channel: Templates::OmniUber_Automotive::g, + roughness_u: 1.f, + roughness_range_position: float2(0.349999994f, 0.25f), + normal_image: texture_2d("./ov_metal_a_01_normal.png", ::tex::gamma_linear, ""), + normal_flip_green: true, + normal_scale: 1.f, + enable_layer_1: false, + layer_1_order: Templates::OmniUber_Automotive::above, + layer_1_blend_source: Templates::OmniUber_Automotive::texture, + layer_1_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_1, + layer_1_blend_splatmap: texture_2d(), + layer_1_blend_splatmap_channel: Templates::OmniUber_Automotive::r, + layer_1_blend_direction: float3(0.f, 1.f, 0.f), + layer_1_blend_axis: Templates::OmniUber_Automotive::y, + layer_1_blend_object_space: true, + layer_1_blend_scale: 1.f, + layer_1_blend_offset: 0.f, + layer_1_blend_primvar_name: "", + layer_1_uv_set_detail: Templates::OmniUber_Automotive::uv_set_1, + layer_1_blend_detail_image: texture_2d(), + layer_1_blend_detail_image_channel: Templates::OmniUber_Automotive::r, + layer_1_blend_threshold: 0.330000013f, + layer_1_blend_factor_override: 0.f, + uv_set_layer_1: Templates::OmniUber_Automotive::uv_set_1, + layer_1_base_color_image: texture_2d(), + layer_1_diffuse_reflection_color: color(1.f, 1.f, 1.f), + layer_1_base_color_offset: 0.f, + layer_1_base_color_scale: 1.f, + layer_1_base_color_desaturation: 0.f, + layer_1_metalness_image: texture_2d(), + layer_1_metalness_channel: Templates::OmniUber_Automotive::b, + layer_1_metalness: 1.f, + layer_1_specular_reflection_weight: 1.f, + layer_1_cavity_image: texture_2d(), + layer_1_cavity_channel: Templates::OmniUber_Automotive::r, + layer_1_roughness_image: texture_2d(), + layer_1_roughness_channel: Templates::OmniUber_Automotive::g, + layer_1_roughness_u: 1.f, + layer_1_roughness_range_position: float2(0.949999988f, 0.5f), + layer_1_normal_image: texture_2d(), + layer_1_normal_flip_green: true, + layer_1_normal_scale: 1.f, + enable_layer_2: false, + layer_2_order: Templates::OmniUber_Automotive::above, + layer_2_blend_source: Templates::OmniUber_Automotive::texture, + layer_2_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_2, + layer_2_blend_splatmap: texture_2d(), + layer_2_blend_splatmap_channel: Templates::OmniUber_Automotive::r, + layer_2_blend_direction: float3(0.f, 1.f, 0.f), + layer_2_blend_axis: Templates::OmniUber_Automotive::y, + layer_2_blend_object_space: true, + layer_2_blend_scale: 1.f, + layer_2_blend_offset: 0.f, + layer_2_blend_primvar_name: "", + layer_2_uv_set_detail: Templates::OmniUber_Automotive::uv_set_2, + layer_2_blend_detail_image: texture_2d(), + layer_2_blend_detail_image_channel: Templates::OmniUber_Automotive::r, + layer_2_blend_threshold: 0.330000013f, + layer_2_blend_factor_override: 0.f, + uv_set_layer_2: Templates::OmniUber_Automotive::uv_set_2, + layer_2_base_color_image: texture_2d(), + layer_2_diffuse_reflection_color: color(1.f, 1.f, 1.f), + layer_2_base_color_offset: 0.f, + layer_2_base_color_scale: 1.f, + layer_2_base_color_desaturation: 0.f, + layer_2_metalness_image: texture_2d(), + layer_2_metalness_channel: Templates::OmniUber_Automotive::b, + layer_2_metalness: 1.f, + layer_2_specular_reflection_weight: 1.f, + layer_2_cavity_image: texture_2d(), + layer_2_cavity_channel: Templates::OmniUber_Automotive::r, + layer_2_roughness_image: texture_2d(), + layer_2_roughness_channel: Templates::OmniUber_Automotive::g, + layer_2_roughness_u: 1.f, + layer_2_roughness_range_position: float2(1.f, 0.5f), + layer_2_normal_image: texture_2d(), + layer_2_normal_flip_green: true, + layer_2_normal_scale: 1.f, + enable_anisotropy: false, + uv_set_anisotropy: Templates::OmniUber_Automotive::uv_set_1, + anisotropic_roughness_u: 1.f, + anisotropic_roughness_v: 0.25f, + anisotropic_direction_image: texture_2d(), + anisotropic_direction_channel: Templates::OmniUber_Automotive::r, + anisotropic_direction: 0.f, + enable_detail_normal: false, + uv_set_detail_normal: Templates::OmniUber_Automotive::uv_set_1, + uv_set_detail_weight: Templates::OmniUber_Automotive::uv_set_1, + detail_normal_image: texture_2d(), + detail_normal_flip_green: true, + detail_normal_scale: 1.f, + detail_normal_weight_image: texture_2d(), + detail_normal_weight_channel: Templates::OmniUber_Automotive::r, + enable_emission: false, + uv_set_emission: Templates::OmniUber_Automotive::uv_set_1, + uv_set_emission_mask: Templates::OmniUber_Automotive::uv_set_1, + emission_image: texture_2d(), + emission_mask_image: texture_2d(), + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: 1.f, + emission_color: color(1.f, 1.f, 1.f), + emission_use_temperature: false, + emission_temperature: 6500.f, + enable_coat: false, + coat_color: color(1.f, 1.f, 1.f), + coat_mask_image: texture_2d(), + coat_mask_channel: Templates::OmniUber_Automotive::r, + coat_roughness_image: texture_2d(), + coat_roughness_channel: Templates::OmniUber_Automotive::r, + coat_roughness: 0.f, + coat_ior: 1.60000002f, + coat_anisotropy: 0.f, + coat_anisotropy_rotation: 0.f, + coat_affect_color: 0.f, + coat_affect_roughness: 0.f, + coat_normal_image: texture_2d(), + coat_normal_flip_green: true, + uv_set_coat_roughness_normal: Templates::OmniUber_Automotive::uv_set_1, + uv_set_coat_mask: Templates::OmniUber_Automotive::uv_set_1, + enable_flakes: false, + flake_color: color(1.f, 1.f, 1.f), + flake_size: 0.125f, + flakes_density: 0.25f, + flakes_spread: 0.150000006f, + flake_roughness: 0.0500000007f); diff --git a/Material/material_0240/Plastic_Pattern_Lrg_Dot_03.mdl b/Material/material_0240/Plastic_Pattern_Lrg_Dot_03.mdl new file mode 100644 index 0000000000000000000000000000000000000000..632e2063b2ae6db3213a587778ea572774a5474c --- /dev/null +++ b/Material/material_0240/Plastic_Pattern_Lrg_Dot_03.mdl @@ -0,0 +1,177 @@ +mdl 1.8; + +import ::state::normal; +import ::OmniSurface::OmniShared::emission_mode; +import ..::Templates::OmniUber_Automotive::*; +import ::tex::gamma_mode; + +export material Plastic_Pattern_Lrg_Dot_03(*) + = Templates::OmniUber_Automotive::OmniUber_Automotive( + uvs_mode_01: Templates::OmniUber_Automotive::triplanar, + uv_scale_01: float2(2.f), + uv_offset_01: float2(0.f), + uv_offset_time_01: float2(0.f), + uv_rotation_01: 0.f, + triplanar_blend_range_01: 0.f, + uvs_mode_02: Templates::OmniUber_Automotive::triplanar, + uv_scale_02: float2(0.0500000007f), + uv_offset_02: float2(0.f), + uv_offset_time_02: float2(0.f), + uv_rotation_02: 0.f, + triplanar_blend_range_02: 0.5f, + uvs_mode_03: Templates::OmniUber_Automotive::triplanar, + uv_scale_03: float2(0.5f), + uv_offset_03: float2(0.f), + uv_offset_time_03: float2(0.f), + uv_rotation_03: 0.f, + triplanar_blend_range_03: 0.5f, + uvs_mode_04: Templates::OmniUber_Automotive::triplanar, + uv_scale_04: float2(1.f), + uv_offset_04: float2(0.f), + uv_offset_time_04: float2(0.f), + uv_rotation_04: 0.f, + triplanar_blend_range_04: 0.5f, + enable_opacity: false, + uv_set_opacity: Templates::OmniUber_Automotive::uv_set_1, + opacity_image: texture_2d(), + opacity_channel: Templates::OmniUber_Automotive::a, + geometry_opacity_threshold: 0.150000006f, + uv_set_layer_0: Templates::OmniUber_Automotive::uv_set_1, + base_color_image: texture_2d("./ov_plastic_pattern_03_basecolor.png", ::tex::gamma_default, ""), + diffuse_reflection_color: color(0.0941176489f, 0.0941176489f, 0.0941176489f), + base_color_scale: 1.f, + base_color_offset: 0.170000002f, + base_color_desaturation: 0.f, + metalness_image: texture_2d("./ov_plastic_pattern_03_orm.png", ::tex::gamma_linear, ""), + metalness_channel: Templates::OmniUber_Automotive::b, + metalness: 0.f, + specular_reflection_weight: 1.f, + specular_reflection_color: color(1.f, 1.f, 1.f), + cavity_image: texture_2d("./ov_plastic_pattern_03_orm.png", ::tex::gamma_linear, ""), + cavity_channel: Templates::OmniUber_Automotive::r, + roughness_image: texture_2d("./ov_plastic_pattern_03_orm.png", ::tex::gamma_linear, ""), + roughness_channel: Templates::OmniUber_Automotive::g, + roughness_u: 1.f, + roughness_range_position: float2(0.850000024f, 0.699999988f), + normal_image: texture_2d("./ov_plastic_pattern_03_normal.png", ::tex::gamma_linear, ""), + normal_flip_green: true, + normal_scale: 1.f, + enable_layer_1: true, + layer_1_order: Templates::OmniUber_Automotive::above, + layer_1_blend_source: Templates::OmniUber_Automotive::texture, + layer_1_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_3, + layer_1_blend_splatmap: texture_2d("./leather_blend_mask_04.png", ::tex::gamma_linear, ""), + layer_1_blend_splatmap_channel: Templates::OmniUber_Automotive::r, + layer_1_blend_direction: float3(0.f, 1.f, 0.f), + layer_1_blend_axis: Templates::OmniUber_Automotive::y, + layer_1_blend_object_space: true, + layer_1_blend_scale: 1.f, + layer_1_blend_offset: 0.f, + layer_1_blend_primvar_name: "", + layer_1_uv_set_detail: Templates::OmniUber_Automotive::uv_set_1, + layer_1_blend_detail_image: texture_2d(), + layer_1_blend_detail_image_channel: Templates::OmniUber_Automotive::r, + layer_1_blend_threshold: 1.f, + layer_1_blend_factor_override: 0.f, + uv_set_layer_1: Templates::OmniUber_Automotive::uv_set_1, + layer_1_base_color_image: texture_2d("./ov_plastic_pattern_03_basecolor.png", ::tex::gamma_default, ""), + layer_1_diffuse_reflection_color: color(0.0924092531f, 0.092408672f, 0.0924083292f), + layer_1_base_color_offset: 0.189999998f, + layer_1_base_color_scale: 1.f, + layer_1_base_color_desaturation: 0.f, + layer_1_metalness_image: texture_2d("./ov_plastic_pattern_03_orm.png", ::tex::gamma_default, ""), + layer_1_metalness_channel: Templates::OmniUber_Automotive::b, + layer_1_metalness: 1.f, + layer_1_specular_reflection_weight: 1.f, + layer_1_cavity_image: texture_2d("./ov_plastic_pattern_03_orm.png", ::tex::gamma_default, ""), + layer_1_cavity_channel: Templates::OmniUber_Automotive::r, + layer_1_roughness_image: texture_2d("./ov_plastic_pattern_03_orm.png", ::tex::gamma_default, ""), + layer_1_roughness_channel: Templates::OmniUber_Automotive::g, + layer_1_roughness_u: 1.f, + layer_1_roughness_range_position: float2(0.850000024f, 0.75f), + layer_1_normal_image: texture_2d("./ov_plastic_pattern_03_normal.png", ::tex::gamma_linear, ""), + layer_1_normal_flip_green: true, + layer_1_normal_scale: 1.f, + enable_layer_2: false, + layer_2_order: Templates::OmniUber_Automotive::above, + layer_2_blend_source: Templates::OmniUber_Automotive::texture, + layer_2_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_2, + layer_2_blend_splatmap: texture_2d(), + layer_2_blend_splatmap_channel: Templates::OmniUber_Automotive::r, + layer_2_blend_direction: float3(0.f, 1.f, 0.f), + layer_2_blend_axis: Templates::OmniUber_Automotive::y, + layer_2_blend_object_space: true, + layer_2_blend_scale: 1.f, + layer_2_blend_offset: 0.f, + layer_2_blend_primvar_name: "", + layer_2_uv_set_detail: Templates::OmniUber_Automotive::uv_set_2, + layer_2_blend_detail_image: texture_2d(), + layer_2_blend_detail_image_channel: Templates::OmniUber_Automotive::r, + layer_2_blend_threshold: 0.330000013f, + layer_2_blend_factor_override: 0.f, + uv_set_layer_2: Templates::OmniUber_Automotive::uv_set_2, + layer_2_base_color_image: texture_2d(), + layer_2_diffuse_reflection_color: color(1.f, 1.f, 1.f), + layer_2_base_color_offset: 0.f, + layer_2_base_color_scale: 1.f, + layer_2_base_color_desaturation: 0.f, + layer_2_metalness_image: texture_2d(), + layer_2_metalness_channel: Templates::OmniUber_Automotive::b, + layer_2_metalness: 1.f, + layer_2_specular_reflection_weight: 1.f, + layer_2_cavity_image: texture_2d(), + layer_2_cavity_channel: Templates::OmniUber_Automotive::r, + layer_2_roughness_image: texture_2d(), + layer_2_roughness_channel: Templates::OmniUber_Automotive::g, + layer_2_roughness_u: 1.f, + layer_2_roughness_range_position: float2(1.f, 0.5f), + layer_2_normal_image: texture_2d(), + layer_2_normal_flip_green: true, + layer_2_normal_scale: 1.f, + enable_anisotropy: false, + uv_set_anisotropy: Templates::OmniUber_Automotive::uv_set_1, + anisotropic_roughness_u: 1.f, + anisotropic_roughness_v: 0.25f, + anisotropic_direction_image: texture_2d(), + anisotropic_direction_channel: Templates::OmniUber_Automotive::r, + anisotropic_direction: 0.f, + enable_detail_normal: true, + uv_set_detail_normal: Templates::OmniUber_Automotive::uv_set_2, + uv_set_detail_weight: Templates::OmniUber_Automotive::uv_set_1, + detail_normal_image: texture_2d("./ov_clouds_01_normal.png", ::tex::gamma_linear, ""), + detail_normal_flip_green: true, + detail_normal_scale: 1.f, + detail_normal_weight_image: texture_2d(), + detail_normal_weight_channel: Templates::OmniUber_Automotive::r, + enable_emission: false, + uv_set_emission: Templates::OmniUber_Automotive::uv_set_1, + uv_set_emission_mask: Templates::OmniUber_Automotive::uv_set_1, + emission_image: texture_2d(), + emission_mask_image: texture_2d(), + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: 1.f, + emission_color: color(1.f, 1.f, 1.f), + emission_use_temperature: false, + emission_temperature: 6500.f, + enable_coat: false, + coat_color: color(1.f, 1.f, 1.f), + coat_mask_image: texture_2d(), + coat_mask_channel: Templates::OmniUber_Automotive::r, + coat_roughness_image: texture_2d(), + coat_roughness_channel: Templates::OmniUber_Automotive::r, + coat_roughness: 0.f, + coat_ior: 1.60000002f, + coat_anisotropy: 0.f, + coat_anisotropy_rotation: 0.f, + coat_affect_color: 0.f, + coat_affect_roughness: 0.f, + coat_normal_image: texture_2d(), + coat_normal_flip_green: true, + uv_set_coat_roughness_normal: Templates::OmniUber_Automotive::uv_set_1, + uv_set_coat_mask: Templates::OmniUber_Automotive::uv_set_1, + enable_flakes: false, + flake_color: color(1.f, 1.f, 1.f), + flake_size: 0.125f, + flakes_density: 0.25f, + flakes_spread: 0.150000006f, + flake_roughness: 0.0500000007f); diff --git a/Material/material_0242/Reflectors_01_Glow_Red.mdl b/Material/material_0242/Reflectors_01_Glow_Red.mdl new file mode 100644 index 0000000000000000000000000000000000000000..b45ac03232e3f2bcb4e0a9ee33d394b6295b48ef --- /dev/null +++ b/Material/material_0242/Reflectors_01_Glow_Red.mdl @@ -0,0 +1,177 @@ +mdl 1.8; + +import ::state::normal; +import ::OmniSurface::OmniShared::emission_mode; +import ..::Templates::OmniUber_Automotive::*; +import ::tex::gamma_mode; + +export material Reflectors_01_Glow_Red(*) + = Templates::OmniUber_Automotive::OmniUber_Automotive( + uvs_mode_01: Templates::OmniUber_Automotive::texture_coord_0, + uv_scale_01: float2(1.f), + uv_offset_01: float2(0.f), + uv_offset_time_01: float2(0.f), + uv_rotation_01: 0.f, + triplanar_blend_range_01: 0.5f, + uvs_mode_02: Templates::OmniUber_Automotive::texture_coord_0, + uv_scale_02: float2(1.f), + uv_offset_02: float2(0.f), + uv_offset_time_02: float2(0.f), + uv_rotation_02: 0.f, + triplanar_blend_range_02: 0.5f, + uvs_mode_03: Templates::OmniUber_Automotive::texture_coord_0, + uv_scale_03: float2(1.f), + uv_offset_03: float2(0.f), + uv_offset_time_03: float2(0.f), + uv_rotation_03: 0.f, + triplanar_blend_range_03: 0.5f, + uvs_mode_04: Templates::OmniUber_Automotive::texture_coord_0, + uv_scale_04: float2(1.f), + uv_offset_04: float2(0.f), + uv_offset_time_04: float2(0.f), + uv_rotation_04: 0.f, + triplanar_blend_range_04: 0.5f, + enable_opacity: false, + uv_set_opacity: Templates::OmniUber_Automotive::uv_set_1, + opacity_image: texture_2d(), + opacity_channel: Templates::OmniUber_Automotive::a, + geometry_opacity_threshold: 0.150000006f, + uv_set_layer_0: Templates::OmniUber_Automotive::uv_set_1, + base_color_image: texture_2d("./ov_reflectors_pattern_01_basecolor.png", ::tex::gamma_default, ""), + diffuse_reflection_color: color(0.488448858f, 0.135411531f, 0.f), + base_color_scale: 1.f, + base_color_offset: 0.f, + base_color_desaturation: 0.f, + metalness_image: texture_2d("./ov_reflectors_pattern_01_orm.png", ::tex::gamma_linear, ""), + metalness_channel: Templates::OmniUber_Automotive::b, + metalness: 0.5f, + specular_reflection_weight: 1.f, + specular_reflection_color: color(1.f, 1.f, 1.f), + cavity_image: texture_2d("./ov_reflectors_pattern_01_orm.png", ::tex::gamma_linear, ""), + cavity_channel: Templates::OmniUber_Automotive::r, + roughness_image: texture_2d("./ov_reflectors_pattern_01_orm.png", ::tex::gamma_default, ""), + roughness_channel: Templates::OmniUber_Automotive::g, + roughness_u: 1.f, + roughness_range_position: float2(0.f, 0.125f), + normal_image: texture_2d("./ov_reflectors_pattern_01_normal.png", ::tex::gamma_linear, ""), + normal_flip_green: true, + normal_scale: 1.f, + enable_layer_1: false, + layer_1_order: Templates::OmniUber_Automotive::above, + layer_1_blend_source: Templates::OmniUber_Automotive::texture, + layer_1_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_1, + layer_1_blend_splatmap: texture_2d(), + layer_1_blend_splatmap_channel: Templates::OmniUber_Automotive::r, + layer_1_blend_direction: float3(0.f, 1.f, 0.f), + layer_1_blend_axis: Templates::OmniUber_Automotive::y, + layer_1_blend_object_space: true, + layer_1_blend_scale: 1.f, + layer_1_blend_offset: 0.f, + layer_1_blend_primvar_name: "", + layer_1_uv_set_detail: Templates::OmniUber_Automotive::uv_set_1, + layer_1_blend_detail_image: texture_2d(), + layer_1_blend_detail_image_channel: Templates::OmniUber_Automotive::r, + layer_1_blend_threshold: 0.330000013f, + layer_1_blend_factor_override: 0.f, + uv_set_layer_1: Templates::OmniUber_Automotive::uv_set_1, + layer_1_base_color_image: texture_2d(), + layer_1_diffuse_reflection_color: color(1.f, 1.f, 1.f), + layer_1_base_color_offset: 0.f, + layer_1_base_color_scale: 1.f, + layer_1_base_color_desaturation: 0.f, + layer_1_metalness_image: texture_2d(), + layer_1_metalness_channel: Templates::OmniUber_Automotive::b, + layer_1_metalness: 1.f, + layer_1_specular_reflection_weight: 1.f, + layer_1_cavity_image: texture_2d(), + layer_1_cavity_channel: Templates::OmniUber_Automotive::r, + layer_1_roughness_image: texture_2d(), + layer_1_roughness_channel: Templates::OmniUber_Automotive::g, + layer_1_roughness_u: 1.f, + layer_1_roughness_range_position: float2(0.949999988f, 0.5f), + layer_1_normal_image: texture_2d(), + layer_1_normal_flip_green: true, + layer_1_normal_scale: 1.f, + enable_layer_2: false, + layer_2_order: Templates::OmniUber_Automotive::above, + layer_2_blend_source: Templates::OmniUber_Automotive::texture, + layer_2_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_2, + layer_2_blend_splatmap: texture_2d(), + layer_2_blend_splatmap_channel: Templates::OmniUber_Automotive::r, + layer_2_blend_direction: float3(0.f, 1.f, 0.f), + layer_2_blend_axis: Templates::OmniUber_Automotive::y, + layer_2_blend_object_space: true, + layer_2_blend_scale: 1.f, + layer_2_blend_offset: 0.f, + layer_2_blend_primvar_name: "", + layer_2_uv_set_detail: Templates::OmniUber_Automotive::uv_set_2, + layer_2_blend_detail_image: texture_2d(), + layer_2_blend_detail_image_channel: Templates::OmniUber_Automotive::r, + layer_2_blend_threshold: 0.330000013f, + layer_2_blend_factor_override: 0.f, + uv_set_layer_2: Templates::OmniUber_Automotive::uv_set_2, + layer_2_base_color_image: texture_2d(), + layer_2_diffuse_reflection_color: color(1.f, 1.f, 1.f), + layer_2_base_color_offset: 0.f, + layer_2_base_color_scale: 1.f, + layer_2_base_color_desaturation: 0.f, + layer_2_metalness_image: texture_2d(), + layer_2_metalness_channel: Templates::OmniUber_Automotive::b, + layer_2_metalness: 1.f, + layer_2_specular_reflection_weight: 1.f, + layer_2_cavity_image: texture_2d(), + layer_2_cavity_channel: Templates::OmniUber_Automotive::r, + layer_2_roughness_image: texture_2d(), + layer_2_roughness_channel: Templates::OmniUber_Automotive::g, + layer_2_roughness_u: 1.f, + layer_2_roughness_range_position: float2(1.f, 0.5f), + layer_2_normal_image: texture_2d(), + layer_2_normal_flip_green: true, + layer_2_normal_scale: 1.f, + enable_anisotropy: false, + uv_set_anisotropy: Templates::OmniUber_Automotive::uv_set_1, + anisotropic_roughness_u: 1.f, + anisotropic_roughness_v: 0.25f, + anisotropic_direction_image: texture_2d(), + anisotropic_direction_channel: Templates::OmniUber_Automotive::r, + anisotropic_direction: 0.f, + enable_detail_normal: false, + uv_set_detail_normal: Templates::OmniUber_Automotive::uv_set_1, + uv_set_detail_weight: Templates::OmniUber_Automotive::uv_set_1, + detail_normal_image: texture_2d(), + detail_normal_flip_green: true, + detail_normal_scale: 1.f, + detail_normal_weight_image: texture_2d(), + detail_normal_weight_channel: Templates::OmniUber_Automotive::r, + enable_emission: true, + uv_set_emission: Templates::OmniUber_Automotive::uv_set_1, + uv_set_emission_mask: Templates::OmniUber_Automotive::uv_set_1, + emission_image: texture_2d("./ov_reflectors_pattern_01_mask.png", ::tex::gamma_srgb, ""), + emission_mask_image: texture_2d(), + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: 60000.f, + emission_color: color(1.f, 0.0396039486f, 0.f), + emission_use_temperature: false, + emission_temperature: 6500.f, + enable_coat: false, + coat_color: color(1.f, 1.f, 1.f), + coat_mask_image: texture_2d(), + coat_mask_channel: Templates::OmniUber_Automotive::r, + coat_roughness_image: texture_2d(), + coat_roughness_channel: Templates::OmniUber_Automotive::r, + coat_roughness: 0.f, + coat_ior: 1.60000002f, + coat_anisotropy: 0.f, + coat_anisotropy_rotation: 0.f, + coat_affect_color: 0.f, + coat_affect_roughness: 0.f, + coat_normal_image: texture_2d(), + coat_normal_flip_green: true, + uv_set_coat_roughness_normal: Templates::OmniUber_Automotive::uv_set_1, + uv_set_coat_mask: Templates::OmniUber_Automotive::uv_set_1, + enable_flakes: false, + flake_color: color(1.f, 1.f, 1.f), + flake_size: 0.125f, + flakes_density: 0.25f, + flakes_spread: 0.150000006f, + flake_roughness: 0.0500000007f); diff --git a/Material/material_0264/UI_Screen_02.mdl b/Material/material_0264/UI_Screen_02.mdl new file mode 100644 index 0000000000000000000000000000000000000000..e6930b40f7a3573a2723dc09a193517f7cf02254 --- /dev/null +++ b/Material/material_0264/UI_Screen_02.mdl @@ -0,0 +1,177 @@ +mdl 1.8; + +import ::state::normal; +import ::OmniSurface::OmniShared::emission_mode; +import ..::Templates::OmniUber_Automotive::*; +import ::tex::gamma_mode; + +export material UI_Screen_02(*) + = Templates::OmniUber_Automotive::OmniUber_Automotive( + uvs_mode_01: Templates::OmniUber_Automotive::texture_coord_0, + uv_scale_01: float2(1.f), + uv_offset_01: float2(0.f), + uv_offset_time_01: float2(0.f), + uv_rotation_01: 0.f, + triplanar_blend_range_01: 0.5f, + uvs_mode_02: Templates::OmniUber_Automotive::triplanar, + uv_scale_02: float2(1.f), + uv_offset_02: float2(0.f), + uv_offset_time_02: float2(0.f), + uv_rotation_02: 0.f, + triplanar_blend_range_02: 0.5f, + uvs_mode_03: Templates::OmniUber_Automotive::triplanar, + uv_scale_03: float2(1.f), + uv_offset_03: float2(0.f), + uv_offset_time_03: float2(0.f), + uv_rotation_03: 0.f, + triplanar_blend_range_03: 0.5f, + uvs_mode_04: Templates::OmniUber_Automotive::triplanar, + uv_scale_04: float2(1.f), + uv_offset_04: float2(0.f), + uv_offset_time_04: float2(0.f), + uv_rotation_04: 0.f, + triplanar_blend_range_04: 0.5f, + enable_opacity: false, + uv_set_opacity: Templates::OmniUber_Automotive::uv_set_1, + opacity_image: texture_2d(), + opacity_channel: Templates::OmniUber_Automotive::a, + geometry_opacity_threshold: 0.150000006f, + uv_set_layer_0: Templates::OmniUber_Automotive::uv_set_1, + base_color_image: texture_2d(), + diffuse_reflection_color: color(9.99999997e-07f, 9.99989993e-07f, 9.99989993e-07f), + base_color_scale: 1.f, + base_color_offset: 0.f, + base_color_desaturation: 0.f, + metalness_image: texture_2d(), + metalness_channel: Templates::OmniUber_Automotive::b, + metalness: 1.f, + specular_reflection_weight: 1.f, + specular_reflection_color: color(1.f, 1.f, 1.f), + cavity_image: texture_2d(), + cavity_channel: Templates::OmniUber_Automotive::r, + roughness_image: texture_2d("./dust1.png", ::tex::gamma_default, ""), + roughness_channel: Templates::OmniUber_Automotive::g, + roughness_u: 1.f, + roughness_range_position: float2(0.f, 0.0274999999f), + normal_image: texture_2d(), + normal_flip_green: true, + normal_scale: 1.f, + enable_layer_1: false, + layer_1_order: Templates::OmniUber_Automotive::above, + layer_1_blend_source: Templates::OmniUber_Automotive::texture, + layer_1_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_1, + layer_1_blend_splatmap: texture_2d(), + layer_1_blend_splatmap_channel: Templates::OmniUber_Automotive::r, + layer_1_blend_direction: float3(0.f, 1.f, 0.f), + layer_1_blend_axis: Templates::OmniUber_Automotive::y, + layer_1_blend_object_space: true, + layer_1_blend_scale: 1.f, + layer_1_blend_offset: 0.f, + layer_1_blend_primvar_name: "", + layer_1_uv_set_detail: Templates::OmniUber_Automotive::uv_set_1, + layer_1_blend_detail_image: texture_2d(), + layer_1_blend_detail_image_channel: Templates::OmniUber_Automotive::r, + layer_1_blend_threshold: 0.330000013f, + layer_1_blend_factor_override: 0.f, + uv_set_layer_1: Templates::OmniUber_Automotive::uv_set_1, + layer_1_base_color_image: texture_2d(), + layer_1_diffuse_reflection_color: color(1.f, 1.f, 1.f), + layer_1_base_color_offset: 0.f, + layer_1_base_color_scale: 1.f, + layer_1_base_color_desaturation: 0.f, + layer_1_metalness_image: texture_2d(), + layer_1_metalness_channel: Templates::OmniUber_Automotive::b, + layer_1_metalness: 1.f, + layer_1_specular_reflection_weight: 1.f, + layer_1_cavity_image: texture_2d(), + layer_1_cavity_channel: Templates::OmniUber_Automotive::r, + layer_1_roughness_image: texture_2d(), + layer_1_roughness_channel: Templates::OmniUber_Automotive::g, + layer_1_roughness_u: 1.f, + layer_1_roughness_range_position: float2(1.f, 0.5f), + layer_1_normal_image: texture_2d(), + layer_1_normal_flip_green: true, + layer_1_normal_scale: 1.f, + enable_layer_2: false, + layer_2_order: Templates::OmniUber_Automotive::above, + layer_2_blend_source: Templates::OmniUber_Automotive::texture, + layer_2_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_2, + layer_2_blend_splatmap: texture_2d(), + layer_2_blend_splatmap_channel: Templates::OmniUber_Automotive::r, + layer_2_blend_direction: float3(0.f, 1.f, 0.f), + layer_2_blend_axis: Templates::OmniUber_Automotive::y, + layer_2_blend_object_space: true, + layer_2_blend_scale: 1.f, + layer_2_blend_offset: 0.f, + layer_2_blend_primvar_name: "", + layer_2_uv_set_detail: Templates::OmniUber_Automotive::uv_set_2, + layer_2_blend_detail_image: texture_2d(), + layer_2_blend_detail_image_channel: Templates::OmniUber_Automotive::r, + layer_2_blend_threshold: 0.330000013f, + layer_2_blend_factor_override: 0.f, + uv_set_layer_2: Templates::OmniUber_Automotive::uv_set_1, + layer_2_base_color_image: texture_2d(), + layer_2_diffuse_reflection_color: color(1.f, 1.f, 1.f), + layer_2_base_color_offset: 0.f, + layer_2_base_color_scale: 1.f, + layer_2_base_color_desaturation: 0.f, + layer_2_metalness_image: texture_2d(), + layer_2_metalness_channel: Templates::OmniUber_Automotive::b, + layer_2_metalness: 1.f, + layer_2_specular_reflection_weight: 1.f, + layer_2_cavity_image: texture_2d(), + layer_2_cavity_channel: Templates::OmniUber_Automotive::r, + layer_2_roughness_image: texture_2d(), + layer_2_roughness_channel: Templates::OmniUber_Automotive::g, + layer_2_roughness_u: 1.f, + layer_2_roughness_range_position: float2(1.f, 0.5f), + layer_2_normal_image: texture_2d(), + layer_2_normal_flip_green: true, + layer_2_normal_scale: 1.f, + enable_anisotropy: false, + uv_set_anisotropy: Templates::OmniUber_Automotive::uv_set_1, + anisotropic_roughness_u: 1.f, + anisotropic_roughness_v: 0.25f, + anisotropic_direction_image: texture_2d(), + anisotropic_direction_channel: Templates::OmniUber_Automotive::r, + anisotropic_direction: 0.f, + enable_detail_normal: false, + uv_set_detail_normal: Templates::OmniUber_Automotive::uv_set_1, + uv_set_detail_weight: Templates::OmniUber_Automotive::uv_set_1, + detail_normal_image: texture_2d(), + detail_normal_flip_green: true, + detail_normal_scale: 1.f, + detail_normal_weight_image: texture_2d(), + detail_normal_weight_channel: Templates::OmniUber_Automotive::r, + enable_emission: true, + uv_set_emission: Templates::OmniUber_Automotive::uv_set_1, + uv_set_emission_mask: Templates::OmniUber_Automotive::uv_set_1, + emission_image: texture_2d("./screen_dash2.png", ::tex::gamma_default, ""), + emission_mask_image: texture_2d(), + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: 600.f, + emission_color: color(1.f, 1.f, 1.f), + emission_use_temperature: false, + emission_temperature: 6500.f, + enable_coat: false, + coat_color: color(1.f, 1.f, 1.f), + coat_mask_image: texture_2d(), + coat_mask_channel: Templates::OmniUber_Automotive::r, + coat_roughness_image: texture_2d(), + coat_roughness_channel: Templates::OmniUber_Automotive::r, + coat_roughness: 0.f, + coat_ior: 1.60000002f, + coat_anisotropy: 0.f, + coat_anisotropy_rotation: 0.f, + coat_affect_color: 0.f, + coat_affect_roughness: 0.f, + coat_normal_image: texture_2d(), + coat_normal_flip_green: true, + uv_set_coat_roughness_normal: Templates::OmniUber_Automotive::uv_set_1, + uv_set_coat_mask: Templates::OmniUber_Automotive::uv_set_1, + enable_flakes: false, + flake_color: color(1.f, 1.f, 1.f), + flake_size: 0.125f, + flakes_density: 0.25f, + flakes_spread: 0.150000006f, + flake_roughness: 0.0500000007f); diff --git a/Material/material_0277/Tire_Truck_Jeep_03.mdl b/Material/material_0277/Tire_Truck_Jeep_03.mdl new file mode 100644 index 0000000000000000000000000000000000000000..ed7148e90104f89b2a646a3e45f4d28ae4574081 --- /dev/null +++ b/Material/material_0277/Tire_Truck_Jeep_03.mdl @@ -0,0 +1,177 @@ +mdl 1.8; + +import ::state::normal; +import ::OmniSurface::OmniShared::emission_mode; +import ..::Templates::OmniUber_Automotive::*; +import ::tex::gamma_mode; + +export material Tire_Truck_Jeep_03(*) + = Templates::OmniUber_Automotive::OmniUber_Automotive( + uvs_mode_01: Templates::OmniUber_Automotive::texture_coord_0, + uv_scale_01: float2(1.f), + uv_offset_01: float2(0.f), + uv_offset_time_01: float2(0.f), + uv_rotation_01: 0.f, + triplanar_blend_range_01: 0.5f, + uvs_mode_02: Templates::OmniUber_Automotive::triplanar, + uv_scale_02: float2(1.f), + uv_offset_02: float2(0.f), + uv_offset_time_02: float2(0.f), + uv_rotation_02: 0.f, + triplanar_blend_range_02: 0.5f, + uvs_mode_03: Templates::OmniUber_Automotive::triplanar, + uv_scale_03: float2(1.f), + uv_offset_03: float2(0.f), + uv_offset_time_03: float2(0.f), + uv_rotation_03: 0.f, + triplanar_blend_range_03: 0.5f, + uvs_mode_04: Templates::OmniUber_Automotive::triplanar, + uv_scale_04: float2(1.f), + uv_offset_04: float2(0.f), + uv_offset_time_04: float2(0.f), + uv_rotation_04: 0.f, + triplanar_blend_range_04: 0.5f, + enable_opacity: false, + uv_set_opacity: Templates::OmniUber_Automotive::uv_set_1, + opacity_image: texture_2d(), + opacity_channel: Templates::OmniUber_Automotive::a, + geometry_opacity_threshold: 0.150000006f, + uv_set_layer_0: Templates::OmniUber_Automotive::uv_set_1, + base_color_image: texture_2d("./ov_tire_rubber_trim_truck_04_basecolor.png", ::tex::gamma_srgb, ""), + diffuse_reflection_color: color(0.999996841f, 1.f, 0.999989986f), + base_color_scale: 1.f, + base_color_offset: 0.f, + base_color_desaturation: 0.f, + metalness_image: texture_2d("./ov_tire_rubber_trim_truck_04_orm.png", ::tex::gamma_linear, ""), + metalness_channel: Templates::OmniUber_Automotive::b, + metalness: 0.f, + specular_reflection_weight: 1.f, + specular_reflection_color: color(1.f, 1.f, 1.f), + cavity_image: texture_2d("./ov_tire_rubber_trim_truck_04_orm.png", ::tex::gamma_linear, ""), + cavity_channel: Templates::OmniUber_Automotive::r, + roughness_image: texture_2d("./ov_tire_rubber_trim_truck_04_orm.png", ::tex::gamma_default, ""), + roughness_channel: Templates::OmniUber_Automotive::g, + roughness_u: 1.f, + roughness_range_position: float2(0.75f, 0.550000012f), + normal_image: texture_2d("./ov_tire_rubber_trim_truck_04_normal.png", ::tex::gamma_linear, ""), + normal_flip_green: true, + normal_scale: 1.f, + enable_layer_1: false, + layer_1_order: Templates::OmniUber_Automotive::above, + layer_1_blend_source: Templates::OmniUber_Automotive::texture, + layer_1_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_1, + layer_1_blend_splatmap: texture_2d(), + layer_1_blend_splatmap_channel: Templates::OmniUber_Automotive::r, + layer_1_blend_direction: float3(0.f, 1.f, 0.f), + layer_1_blend_axis: Templates::OmniUber_Automotive::y, + layer_1_blend_object_space: true, + layer_1_blend_scale: 1.f, + layer_1_blend_offset: 0.f, + layer_1_blend_primvar_name: "", + layer_1_uv_set_detail: Templates::OmniUber_Automotive::uv_set_1, + layer_1_blend_detail_image: texture_2d(), + layer_1_blend_detail_image_channel: Templates::OmniUber_Automotive::r, + layer_1_blend_threshold: 0.330000013f, + layer_1_blend_factor_override: 0.f, + uv_set_layer_1: Templates::OmniUber_Automotive::uv_set_1, + layer_1_base_color_image: texture_2d(), + layer_1_diffuse_reflection_color: color(1.f, 1.f, 1.f), + layer_1_base_color_offset: 0.f, + layer_1_base_color_scale: 1.f, + layer_1_base_color_desaturation: 0.f, + layer_1_metalness_image: texture_2d(), + layer_1_metalness_channel: Templates::OmniUber_Automotive::b, + layer_1_metalness: 1.f, + layer_1_specular_reflection_weight: 1.f, + layer_1_cavity_image: texture_2d(), + layer_1_cavity_channel: Templates::OmniUber_Automotive::r, + layer_1_roughness_image: texture_2d(), + layer_1_roughness_channel: Templates::OmniUber_Automotive::g, + layer_1_roughness_u: 1.f, + layer_1_roughness_range_position: float2(0.949999988f, 0.5f), + layer_1_normal_image: texture_2d(), + layer_1_normal_flip_green: true, + layer_1_normal_scale: 1.f, + enable_layer_2: false, + layer_2_order: Templates::OmniUber_Automotive::above, + layer_2_blend_source: Templates::OmniUber_Automotive::texture, + layer_2_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_2, + layer_2_blend_splatmap: texture_2d(), + layer_2_blend_splatmap_channel: Templates::OmniUber_Automotive::r, + layer_2_blend_direction: float3(0.f, 1.f, 0.f), + layer_2_blend_axis: Templates::OmniUber_Automotive::y, + layer_2_blend_object_space: true, + layer_2_blend_scale: 1.f, + layer_2_blend_offset: 0.f, + layer_2_blend_primvar_name: "", + layer_2_uv_set_detail: Templates::OmniUber_Automotive::uv_set_2, + layer_2_blend_detail_image: texture_2d(), + layer_2_blend_detail_image_channel: Templates::OmniUber_Automotive::r, + layer_2_blend_threshold: 0.330000013f, + layer_2_blend_factor_override: 0.f, + uv_set_layer_2: Templates::OmniUber_Automotive::uv_set_2, + layer_2_base_color_image: texture_2d(), + layer_2_diffuse_reflection_color: color(1.f, 1.f, 1.f), + layer_2_base_color_offset: 0.f, + layer_2_base_color_scale: 1.f, + layer_2_base_color_desaturation: 0.f, + layer_2_metalness_image: texture_2d(), + layer_2_metalness_channel: Templates::OmniUber_Automotive::b, + layer_2_metalness: 1.f, + layer_2_specular_reflection_weight: 1.f, + layer_2_cavity_image: texture_2d(), + layer_2_cavity_channel: Templates::OmniUber_Automotive::r, + layer_2_roughness_image: texture_2d(), + layer_2_roughness_channel: Templates::OmniUber_Automotive::g, + layer_2_roughness_u: 1.f, + layer_2_roughness_range_position: float2(1.f, 0.5f), + layer_2_normal_image: texture_2d(), + layer_2_normal_flip_green: true, + layer_2_normal_scale: 1.f, + enable_anisotropy: false, + uv_set_anisotropy: Templates::OmniUber_Automotive::uv_set_1, + anisotropic_roughness_u: 1.f, + anisotropic_roughness_v: 0.25f, + anisotropic_direction_image: texture_2d(), + anisotropic_direction_channel: Templates::OmniUber_Automotive::r, + anisotropic_direction: 0.f, + enable_detail_normal: true, + uv_set_detail_normal: Templates::OmniUber_Automotive::uv_set_2, + uv_set_detail_weight: Templates::OmniUber_Automotive::uv_set_1, + detail_normal_image: texture_2d("./ov_clouds_01_normal.png", ::tex::gamma_linear, ""), + detail_normal_flip_green: true, + detail_normal_scale: 0.5f, + detail_normal_weight_image: texture_2d(), + detail_normal_weight_channel: Templates::OmniUber_Automotive::r, + enable_emission: false, + uv_set_emission: Templates::OmniUber_Automotive::uv_set_1, + uv_set_emission_mask: Templates::OmniUber_Automotive::uv_set_1, + emission_image: texture_2d(), + emission_mask_image: texture_2d(), + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: 1.f, + emission_color: color(1.f, 1.f, 1.f), + emission_use_temperature: false, + emission_temperature: 6500.f, + enable_coat: false, + coat_color: color(1.f, 1.f, 1.f), + coat_mask_image: texture_2d(), + coat_mask_channel: Templates::OmniUber_Automotive::r, + coat_roughness_image: texture_2d(), + coat_roughness_channel: Templates::OmniUber_Automotive::r, + coat_roughness: 0.f, + coat_ior: 1.60000002f, + coat_anisotropy: 0.f, + coat_anisotropy_rotation: 0.f, + coat_affect_color: 0.f, + coat_affect_roughness: 0.f, + coat_normal_image: texture_2d(), + coat_normal_flip_green: true, + uv_set_coat_roughness_normal: Templates::OmniUber_Automotive::uv_set_1, + uv_set_coat_mask: Templates::OmniUber_Automotive::uv_set_1, + enable_flakes: false, + flake_color: color(1.f, 1.f, 1.f), + flake_size: 0.125f, + flakes_density: 0.25f, + flakes_spread: 0.150000006f, + flake_roughness: 0.0500000007f); diff --git a/Material/material_0279/Wood_Grain_Raw_01.mdl b/Material/material_0279/Wood_Grain_Raw_01.mdl new file mode 100644 index 0000000000000000000000000000000000000000..9e6f71f33af7ce4703543fd5982fb755979f4fad --- /dev/null +++ b/Material/material_0279/Wood_Grain_Raw_01.mdl @@ -0,0 +1,177 @@ +mdl 1.8; + +import ::state::normal; +import ::OmniSurface::OmniShared::emission_mode; +import ..::Templates::OmniUber_Automotive::*; +import ::tex::gamma_mode; + +export material Wood_Grain_Raw_01(*) + = Templates::OmniUber_Automotive::OmniUber_Automotive( + uvs_mode_01: Templates::OmniUber_Automotive::triplanar, + uv_scale_01: float2(2.5f), + uv_offset_01: float2(0.f), + uv_offset_time_01: float2(0.f), + uv_rotation_01: 0.f, + triplanar_blend_range_01: 0.f, + uvs_mode_02: Templates::OmniUber_Automotive::triplanar, + uv_scale_02: float2(0.0500000007f), + uv_offset_02: float2(0.f), + uv_offset_time_02: float2(0.f), + uv_rotation_02: 0.f, + triplanar_blend_range_02: 0.5f, + uvs_mode_03: Templates::OmniUber_Automotive::triplanar, + uv_scale_03: float2(1.f), + uv_offset_03: float2(0.f), + uv_offset_time_03: float2(0.f), + uv_rotation_03: 0.f, + triplanar_blend_range_03: 0.5f, + uvs_mode_04: Templates::OmniUber_Automotive::triplanar, + uv_scale_04: float2(1.f), + uv_offset_04: float2(0.f), + uv_offset_time_04: float2(0.f), + uv_rotation_04: 0.f, + triplanar_blend_range_04: 0.5f, + enable_opacity: false, + uv_set_opacity: Templates::OmniUber_Automotive::uv_set_1, + opacity_image: texture_2d(), + opacity_channel: Templates::OmniUber_Automotive::a, + geometry_opacity_threshold: 0.150000006f, + uv_set_layer_0: Templates::OmniUber_Automotive::uv_set_1, + base_color_image: texture_2d("./ov_wood_grain_a_01_basecolor.png", ::tex::gamma_default, ""), + diffuse_reflection_color: color(1.f, 0.999989986f, 0.999989986f), + base_color_scale: 1.44999993f, + base_color_offset: 0.f, + base_color_desaturation: 0.f, + metalness_image: texture_2d("./ov_wood_grain_a_01_orm.png", ::tex::gamma_linear, ""), + metalness_channel: Templates::OmniUber_Automotive::b, + metalness: 0.f, + specular_reflection_weight: 1.f, + specular_reflection_color: color(1.f, 1.f, 1.f), + cavity_image: texture_2d("./ov_wood_grain_a_01_orm.png", ::tex::gamma_linear, ""), + cavity_channel: Templates::OmniUber_Automotive::r, + roughness_image: texture_2d("./ov_wood_grain_a_01_orm.png", ::tex::gamma_default, ""), + roughness_channel: Templates::OmniUber_Automotive::g, + roughness_u: 1.f, + roughness_range_position: float2(0.850000024f, 0.649999976f), + normal_image: texture_2d("./ov_wood_grain_a_01_normal.png", ::tex::gamma_linear, ""), + normal_flip_green: true, + normal_scale: 1.f, + enable_layer_1: false, + layer_1_order: Templates::OmniUber_Automotive::above, + layer_1_blend_source: Templates::OmniUber_Automotive::texture, + layer_1_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_1, + layer_1_blend_splatmap: texture_2d(), + layer_1_blend_splatmap_channel: Templates::OmniUber_Automotive::r, + layer_1_blend_direction: float3(0.f, 1.f, 0.f), + layer_1_blend_axis: Templates::OmniUber_Automotive::y, + layer_1_blend_object_space: true, + layer_1_blend_scale: 1.f, + layer_1_blend_offset: 0.f, + layer_1_blend_primvar_name: "", + layer_1_uv_set_detail: Templates::OmniUber_Automotive::uv_set_1, + layer_1_blend_detail_image: texture_2d(), + layer_1_blend_detail_image_channel: Templates::OmniUber_Automotive::r, + layer_1_blend_threshold: 0.330000013f, + layer_1_blend_factor_override: 0.f, + uv_set_layer_1: Templates::OmniUber_Automotive::uv_set_1, + layer_1_base_color_image: texture_2d(), + layer_1_diffuse_reflection_color: color(1.f, 1.f, 1.f), + layer_1_base_color_offset: 0.f, + layer_1_base_color_scale: 1.f, + layer_1_base_color_desaturation: 0.f, + layer_1_metalness_image: texture_2d(), + layer_1_metalness_channel: Templates::OmniUber_Automotive::b, + layer_1_metalness: 1.f, + layer_1_specular_reflection_weight: 1.f, + layer_1_cavity_image: texture_2d(), + layer_1_cavity_channel: Templates::OmniUber_Automotive::r, + layer_1_roughness_image: texture_2d(), + layer_1_roughness_channel: Templates::OmniUber_Automotive::g, + layer_1_roughness_u: 1.f, + layer_1_roughness_range_position: float2(0.949999988f, 0.5f), + layer_1_normal_image: texture_2d(), + layer_1_normal_flip_green: true, + layer_1_normal_scale: 1.f, + enable_layer_2: false, + layer_2_order: Templates::OmniUber_Automotive::above, + layer_2_blend_source: Templates::OmniUber_Automotive::texture, + layer_2_uv_set_blend_factor: Templates::OmniUber_Automotive::uv_set_2, + layer_2_blend_splatmap: texture_2d(), + layer_2_blend_splatmap_channel: Templates::OmniUber_Automotive::r, + layer_2_blend_direction: float3(0.f, 1.f, 0.f), + layer_2_blend_axis: Templates::OmniUber_Automotive::y, + layer_2_blend_object_space: true, + layer_2_blend_scale: 1.f, + layer_2_blend_offset: 0.f, + layer_2_blend_primvar_name: "", + layer_2_uv_set_detail: Templates::OmniUber_Automotive::uv_set_2, + layer_2_blend_detail_image: texture_2d(), + layer_2_blend_detail_image_channel: Templates::OmniUber_Automotive::r, + layer_2_blend_threshold: 0.330000013f, + layer_2_blend_factor_override: 0.f, + uv_set_layer_2: Templates::OmniUber_Automotive::uv_set_2, + layer_2_base_color_image: texture_2d(), + layer_2_diffuse_reflection_color: color(1.f, 1.f, 1.f), + layer_2_base_color_offset: 0.f, + layer_2_base_color_scale: 1.f, + layer_2_base_color_desaturation: 0.f, + layer_2_metalness_image: texture_2d(), + layer_2_metalness_channel: Templates::OmniUber_Automotive::b, + layer_2_metalness: 1.f, + layer_2_specular_reflection_weight: 1.f, + layer_2_cavity_image: texture_2d(), + layer_2_cavity_channel: Templates::OmniUber_Automotive::r, + layer_2_roughness_image: texture_2d(), + layer_2_roughness_channel: Templates::OmniUber_Automotive::g, + layer_2_roughness_u: 1.f, + layer_2_roughness_range_position: float2(1.f, 0.5f), + layer_2_normal_image: texture_2d(), + layer_2_normal_flip_green: true, + layer_2_normal_scale: 1.f, + enable_anisotropy: false, + uv_set_anisotropy: Templates::OmniUber_Automotive::uv_set_1, + anisotropic_roughness_u: 1.f, + anisotropic_roughness_v: 0.25f, + anisotropic_direction_image: texture_2d(), + anisotropic_direction_channel: Templates::OmniUber_Automotive::r, + anisotropic_direction: 0.f, + enable_detail_normal: true, + uv_set_detail_normal: Templates::OmniUber_Automotive::uv_set_2, + uv_set_detail_weight: Templates::OmniUber_Automotive::uv_set_1, + detail_normal_image: texture_2d("./ov_clouds_01_normal.png", ::tex::gamma_linear, ""), + detail_normal_flip_green: true, + detail_normal_scale: 0.5f, + detail_normal_weight_image: texture_2d(), + detail_normal_weight_channel: Templates::OmniUber_Automotive::r, + enable_emission: false, + uv_set_emission: Templates::OmniUber_Automotive::uv_set_1, + uv_set_emission_mask: Templates::OmniUber_Automotive::uv_set_1, + emission_image: texture_2d(), + emission_mask_image: texture_2d(), + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: 1.f, + emission_color: color(1.f, 1.f, 1.f), + emission_use_temperature: false, + emission_temperature: 6500.f, + enable_coat: false, + coat_color: color(1.f, 1.f, 1.f), + coat_mask_image: texture_2d(), + coat_mask_channel: Templates::OmniUber_Automotive::r, + coat_roughness_image: texture_2d(), + coat_roughness_channel: Templates::OmniUber_Automotive::r, + coat_roughness: 0.f, + coat_ior: 1.60000002f, + coat_anisotropy: 0.f, + coat_anisotropy_rotation: 0.f, + coat_affect_color: 0.f, + coat_affect_roughness: 0.f, + coat_normal_image: texture_2d(), + coat_normal_flip_green: true, + uv_set_coat_roughness_normal: Templates::OmniUber_Automotive::uv_set_1, + uv_set_coat_mask: Templates::OmniUber_Automotive::uv_set_1, + enable_flakes: false, + flake_color: color(1.f, 1.f, 1.f), + flake_size: 0.125f, + flakes_density: 0.25f, + flakes_spread: 0.150000006f, + flake_roughness: 0.0500000007f); diff --git a/Material/material_0291/Rug_Carpet.mdl b/Material/material_0291/Rug_Carpet.mdl new file mode 100644 index 0000000000000000000000000000000000000000..5df540464f3bbd43f4746a78f1c5c85b4c30e3ca --- /dev/null +++ b/Material/material_0291/Rug_Carpet.mdl @@ -0,0 +1,698 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. * + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + +mdl 1.6; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + + +float remap(float input, float low, float high) +{ + //return low + input * (high - low); + return ::math::lerp(low, high, input); +} + +float3 normalmap_normal( + uniform texture_2d texture, + float factor = 1.0, + ::base::texture_coordinate_info uvw = ::base::texture_coordinate_info() +) +{ + float3 lookup = (::tex::lookup_float3(texture, float2(uvw.position.x, uvw.position.y)) - float3(0.5)) * (factor * 2.0); + return ::math::normalize(uvw.tangent_u * lookup.x + uvw.tangent_v * lookup.y + ::state::normal() * (lookup.z + (1.0 - factor))); +} + + +::base::texture_coordinate_info transform_coordinate_2( + float4x4 transform + [[ anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix.") ]], + ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info() + [[ anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection.") ]] +) [[ + ::anno::description("Transform a texture coordinate by a matrix.") , + ::anno::noinline() + ]] +{ + // Version 2 + float4 r_position = transform * float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1); + //try aproximating it for the case that the rotation is only aroud z and assuming the texture layout is nice and z is ~constant. + //just pretend there is no other rotation happening + //get rid of scaling and translation. Then extract fields where sin and cos would be in a simple 2d transform around z. + float4 u = transform[0]; + float3 ru = ::math::normalize(float3(u.x,u.y,u.z)); + float cos = ru.x; + float sin = -ru.y; + + + return ::base::texture_coordinate_info( + float3(r_position.x,r_position.y,r_position.z), + math::normalize(cos * coordinate.tangent_u - sin * coordinate.tangent_v), + math::normalize(cos * coordinate.tangent_v + sin * coordinate.tangent_u)); +} + +// Takes the standard input that every material has. It combines a couple of +// functions in one convenience function. +::base::texture_coordinate_info vmat_transform( + float2 translation = float2(0.0, 0.0), + float rotation = 0.0, // rotation in degrees + float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation_rad); + float c = ::math::cos(rotation_rad); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return transform_coordinate_2(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + +::base::texture_coordinate_info vmat_transform_post_scale( + ::base::texture_coordinate_info uvw, + float2 scale = 1.0f +) +{ + return ::base::texture_coordinate_info( + position: float3(uvw.position.x / scale.x, + uvw.position.y / scale.y, + uvw.position.z), + tangent_u: uvw.tangent_u, + tangent_v: uvw.tangent_v + ); +} + + +float3 rgb2hsl(float3 c) +[[ + ::anno::description("Converts a color value to HSL. The function outputs the hue to \n" + "lie in the range from 0.0-1.0."), + ::anno::author("NVIDIA vMaterials") +]] +{ + float3 hsl; + float cMax = ::math::max(::math::max(c.x, c.y), c.z); + float cMin = ::math::min(::math::min(c.x, c.y), c.z); + float delta = cMax - cMin; + + hsl.z = (cMax + cMin) / 2.0; + hsl.x = ((cMax == cMin) ? 0 : + (cMax == c.x) ? (c.y - c.z) / delta + ((c.z > c.y) ? 6.0f : 0.0f): + (cMax == c.y) ? (c.z - c.x) / delta + 2.0 : (c.x - c.y) / delta + 4.0) / 6.0f; + hsl.y = (hsl.z == 0.0 || hsl.z == 1.0) ? 0.0 : delta / (1.0 - ::math::abs(2.0 * hsl.z - 1.0)); + return hsl; +} + + +// converts a HSL value back to a color +// The Hue is expected to lie in the range +float f_n(float n, float a, float h, float l) { + float k = ::math::fmod(n + h * 12.f, 12.f); + + return l - a * ::math::max(-1.0f, ::math::min(::math::min(k-3.0f, 9.0f-k), 1.0f)); +} + +color hsl2rgb(float3 hsl) +[[ + ::anno::description("Converts a HSL value back to a color. Note that the hue is expected to \n" + "lie in the range from 0.0-1.0."), + ::anno::author("NVIDIA vMaterials") +]] +{ + float h = hsl.x, s = hsl.y, l = hsl.z; + float a = s * ::math::min(l, 1.0f - l); + return color(f_n(0.0, a, h, l), + f_n(8.0, a, h, l), + f_n(4.0, a, h, l)); +} + +float histogram_range(float input, float range = 1.0f, float position = 0.5f) +{ + float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); + float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); + return ::math::lerp(low, high, input); +} + +base::anisotropy_return anisotropy_conversion( + float roughness = 0.0 , + float anisotropy = 0.0 , + float anisotropy_rotation = 0.0 , + float3 tangent_u = state::texture_tangent_u(0) +) +{ + base::anisotropy_return return_value( + roughness_u: roughness * roughness, + roughness_v: roughness * roughness, + tangent_u: tangent_u + ); + if (anisotropy > 0.f) { + // Allows for infinite anisotropy when roughness==0, full roughness when anisotropy==0 (saturated later on) + return_value.roughness_u += math::pow(anisotropy,4); + + if (anisotropy_rotation > 0.f && anisotropy_rotation < 1.f) { + float3 tangent_v = math::cross(state::normal(), tangent_u); // assumed these are normalized already + float rotation_angle = 2.f * math::PI * anisotropy_rotation; + return_value.tangent_u = tangent_u * math::cos(rotation_angle) - tangent_v * math::sin(rotation_angle); + } + } + return_value.roughness_u = math::min(1.f, return_value.roughness_u); + return_value.roughness_v = math::min(1.f, return_value.roughness_v); + + return return_value; +} + +export material Rug_Carpet_Base( + color carpet_color = color(0.139f, 0.139f, 0.139f) [[ + ::anno::description("Adjusts the color of the rug while keeping bright fibers well visible."), + ::anno::display_name("Carpet Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + float roughness = 0.48f [[ + ::anno::description("Higher values lead to a less shiny appearance of the carpet."), + ::anno::display_name("Reflection Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float roughness_variation = 0.04f [[ + ::anno::description("Adds variation to the roughness of the rug."), + ::anno::display_name("Roughness Variation"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float pattern_AO = 0.59f [[ + ::anno::description("Adds darkening around the pattern of the rug."), + ::anno::display_name("Pattern Visibility"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float bump_strength = 1.f [[ + ::anno::description("Adjusts the bumpiness of the pattern."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 2.f), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + uniform float2 texture_translate = 0.f [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform"), + ::anno::ui_order(5) + ]], + uniform float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f), + ::anno::ui_order(6) + ]], + uniform float2 texture_scale = 1.f [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::anno::ui_order(7) + ]], + uniform bool roundcorners_enable = false [[ + ::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."), + ::anno::display_name("Enable Round Corners"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(8) + ]], + uniform float roundcorners_radius_mm = 1.5f [[ + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::display_name("Round Corner Radius (mm)"), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f), + ::anno::ui_order(9) + ]], + uniform bool roundcorners_across_materials = false [[ + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::display_name("Across Materials"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(10) + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Uses selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Transform"), + ::anno::ui_order(11) + ]], + // the exchangeable textures + uniform texture_2d rug_fibers = texture_2d("./rug_carpet_multi_fibers.jpg", ::tex::gamma_linear), + uniform texture_2d rug_aniso = texture_2d("./rug_carpet_anisotropy.jpg", ::tex::gamma_linear), + uniform texture_2d rug_multi_R_rough_G_ao_B_patternao = texture_2d("./rug_carpet_01_multi_R_rough_G_ao_B_bumpao.jpg", ::tex::gamma_linear), + uniform texture_2d rug_normal = texture_2d("./rug_carpet_01_norm.jpg", ::tex::gamma_linear) + ) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Rug Carpet Template"), + ::anno::description("Template for Rug Carpet Material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Rug_Carpet.Rug_Carpet_Base.png"), + ::anno::key_words(string[]("carpet", "fabric", "design", "automotive", "architecture", "interior", "new", "rough", "bumped", "gray")), + ::anno::hidden() +]] + = + let { + + + bool tmp0 = false; + material_surface tmp1(::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(anisotropy_conversion(remap(roughness, 0.370000005f, 0.229999989f) * roughness_variation * ::base::file_texture(rug_aniso, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).mono + histogram_range(float3(::base::file_texture(rug_multi_R_rough_G_ao_B_patternao, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, 1.f, remap(roughness, 0.370000005f, 0.680000007f)), 0.680000007f, ::base::file_texture(rug_aniso, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).mono, ::state::texture_tangent_u(0)).roughness_u, anisotropy_conversion(remap(roughness, 0.370000005f, 0.229999989f) * roughness_variation * ::base::file_texture(rug_aniso, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).mono + histogram_range(float3(::base::file_texture(rug_multi_R_rough_G_ao_B_patternao, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, 1.f, remap(roughness, 0.370000005f, 0.680000007f)), 0.680000007f, ::base::file_texture(rug_aniso, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).mono, ::state::texture_tangent_u(0)).roughness_v, color(::math::lerp(1.f, float3(::base::file_texture(rug_multi_R_rough_G_ao_B_patternao, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).y, 0.310000002f) * float3(::base::file_texture(rug_multi_R_rough_G_ao_B_patternao, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).z), color(0.f, 0.f, 0.f), anisotropy_conversion(remap(roughness, 0.370000005f, 0.229999989f) * roughness_variation * ::base::file_texture(rug_aniso, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).mono + histogram_range(float3(::base::file_texture(rug_multi_R_rough_G_ao_B_patternao, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, 1.f, remap(roughness, 0.370000005f, 0.680000007f)), 0.680000007f, ::base::file_texture(rug_aniso, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).mono, ::state::texture_tangent_u(0)).tangent_u, ::df::scatter_reflect), ::df::weighted_layer(0.5f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(hsl2rgb(rgb2hsl(float3(carpet_color)) * float3(1.f, 1.f, 0.519999981f)), carpet_color, ::base::color_layer_blend, float3(::math::pow(::base::file_texture(rug_fibers, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index), 1.f), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint, 2.20000005f)).x, true).tint, hsl2rgb(float3(rgb2hsl(float3(carpet_color)).x, rgb2hsl(float3(carpet_color)).y * 0.5f, remap(rgb2hsl(float3(carpet_color)).z, 0.519999981f, 1.f))), ::base::color_layer_blend, float3(::math::pow(::base::file_texture(rug_fibers, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index), 1.f), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint, 2.20000005f)).y, true).tint, hsl2rgb(float3(rgb2hsl(float3(carpet_color)).x, rgb2hsl(float3(carpet_color)).y, remap(rgb2hsl(float3(carpet_color)).z, 0.5f, 1.f))), ::base::color_layer_blend, float3(::math::pow(::base::file_texture(rug_fibers, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index), 1.f), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint, 2.20000005f)).z, true).tint, color(float3(::base::file_texture(rug_multi_R_rough_G_ao_B_patternao, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).z), ::base::color_layer_multiply, pattern_AO, true).tint, color(float3(::base::file_texture(rug_multi_R_rough_G_ao_B_patternao, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).y), ::base::color_layer_multiply, 0.550000012f, true).tint, 0.f), bsdf(), normalmap_normal(rug_normal, bump_strength, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index))), normalmap_normal(rug_normal, bump_strength, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index))), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + 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)); + 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()); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + +// 1 +export material Rug_Carpet_Lines( + color carpet_color = color(0.139f, 0.139f, 0.139f) [[ + ::anno::description("Adjusts the color of the rug while keeping bright fibers well visible."), + ::anno::display_name("Carpet Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + float roughness = 0.48f [[ + ::anno::description("Higher values lead to a less shiny appearance of the carpet."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float roughness_variation = 0.04f [[ + ::anno::description("Adds variation to the roughness of the rug."), + ::anno::display_name("Roughness Variation"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float pattern_AO = 0.59f [[ + ::anno::description("Adds darkening around the pattern of the rug."), + ::anno::display_name("Pattern Visibility"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float bump_strength = 1.f [[ + ::anno::description("Adjusts the bumpiness of the pattern."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 2.f), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + uniform float2 texture_translate = 0.f [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform"), + ::anno::ui_order(5) + ]], + uniform float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f), + ::anno::ui_order(6) + ]], + uniform float2 texture_scale = 1.f [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::anno::ui_order(7) + ]], + uniform bool roundcorners_enable = false [[ + ::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."), + ::anno::display_name("Enable Round Corners"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(8) + ]], + uniform float roundcorners_radius_mm = 1.5f [[ + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::display_name("Round Corner Radius (mm)"), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f), + ::anno::ui_order(9) + ]], + uniform bool roundcorners_across_materials = false [[ + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::display_name("Across Materials"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(10) + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Uses selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Transform"), + ::anno::ui_order(11) + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Rug Carpet - Lines Pattern"), + ::anno::description("Rug Carpet Material with line pattern."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Rug_Carpet.Rug_Carpet_Lines.png"), + ::anno::key_words(string[]("carpet", "fabric", "design", "automotive", "architecture", "pattern", "lines", "interior", "new", "rough", "bumped", "gray")) +]] = Rug_Carpet_Base( + carpet_color: carpet_color, + roughness: roughness, + roughness_variation: roughness_variation, + pattern_AO: pattern_AO, + bump_strength: bump_strength, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + roundcorners_enable: roundcorners_enable, + roundcorners_radius_mm: roundcorners_radius_mm, + roundcorners_across_materials: roundcorners_across_materials, + uv_space_index: uv_space_index, + rug_fibers: texture_2d("./rug_carpet_multi_fibers.jpg", ::tex::gamma_linear), + rug_aniso: texture_2d("./rug_carpet_anisotropy.jpg", ::tex::gamma_linear), + rug_multi_R_rough_G_ao_B_patternao: texture_2d("./rug_carpet_01_multi_R_rough_G_ao_B_bumpao.jpg", ::tex::gamma_linear), + rug_normal: texture_2d("./rug_carpet_01_norm.jpg", ::tex::gamma_linear) +); + + +// 2 +export material Rug_Carpet_Hexagonal( + color carpet_color = color(0.139f, 0.139f, 0.139f) [[ + ::anno::description("Adjusts the color of the rug while keeping bright fibers well visible."), + ::anno::display_name("Carpet Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + float roughness = 0.48f [[ + ::anno::description("Higher values lead to a less shiny appearance of the carpet."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float roughness_variation = 0.04f [[ + ::anno::description("Adds variation to the roughness of the rug."), + ::anno::display_name("Roughness Variation"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float pattern_AO = 0.59f [[ + ::anno::description("Adds darkening around the pattern of the rug."), + ::anno::display_name("Pattern Visibility"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float bump_strength = 1.f [[ + ::anno::description("Adjusts the bumpiness of the pattern."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 2.f), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + uniform float2 texture_translate = 0.f [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform"), + ::anno::ui_order(5) + ]], + uniform float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f), + ::anno::ui_order(6) + ]], + uniform float2 texture_scale = 1.f [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::anno::ui_order(7) + ]], + uniform bool roundcorners_enable = false [[ + ::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."), + ::anno::display_name("Enable Round Corners"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(8) + ]], + uniform float roundcorners_radius_mm = 1.5f [[ + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::display_name("Round Corner Radius (mm)"), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f), + ::anno::ui_order(9) + ]], + uniform bool roundcorners_across_materials = false [[ + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::display_name("Across Materials"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(10) + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Uses selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Transform"), + ::anno::ui_order(11) + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Rug Carpet - Hexagonal Pattern"), + ::anno::description("Rug carpet material with hexagonal pattern."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Rug_Carpet.Rug_Carpet_Hexagonal.png"), + ::anno::key_words(string[]("carpet", "fabric", "design", "automotive", "architecture", "pattern", "hexagonal", "interior", "new", "rough", "bumped", "gray")) +]] = Rug_Carpet_Base( + carpet_color: carpet_color, + roughness: roughness, + roughness_variation: roughness_variation, + pattern_AO: pattern_AO, + bump_strength: bump_strength, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + roundcorners_enable: roundcorners_enable, + roundcorners_radius_mm: roundcorners_radius_mm, + roundcorners_across_materials: roundcorners_across_materials, + uv_space_index: uv_space_index, + rug_fibers: texture_2d("./rug_carpet_multi_fibers.jpg", ::tex::gamma_linear), + rug_aniso: texture_2d("./rug_carpet_anisotropy.jpg", ::tex::gamma_linear), + rug_multi_R_rough_G_ao_B_patternao: texture_2d("./rug_carpet_02_multi_R_rough_G_ao_B_bumpao.jpg", ::tex::gamma_linear), + rug_normal: texture_2d("./rug_carpet_02_norm.jpg", ::tex::gamma_linear) +); + + +// 3 +export material Rug_Carpet_Honeycomb( + color carpet_color = color(0.139f, 0.139f, 0.139f) [[ + ::anno::description("Adjusts the color of the rug while keeping bright fibers well visible."), + ::anno::display_name("Carpet Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + float roughness = 0.48f [[ + ::anno::description("Higher values lead to a less shiny appearance of the carpet."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float roughness_variation = 0.04f [[ + ::anno::description("Adds variation to the roughness of the rug."), + ::anno::display_name("Roughness Variation"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float pattern_AO = 0.59f [[ + ::anno::description("Adds darkening around the pattern of the rug."), + ::anno::display_name("Pattern Visibility"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float bump_strength = 1.f [[ + ::anno::description("Adjusts the bumpiness of the pattern."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 2.f), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + uniform float2 texture_translate = 0.f [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform"), + ::anno::ui_order(5) + ]], + uniform float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f), + ::anno::ui_order(6) + ]], + uniform float2 texture_scale = 1.f [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::anno::ui_order(7) + ]], + uniform bool roundcorners_enable = false [[ + ::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."), + ::anno::display_name("Enable Round Corners"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(8) + ]], + uniform float roundcorners_radius_mm = 1.5f [[ + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::display_name("Round Corner Radius (mm)"), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f), + ::anno::ui_order(9) + ]], + uniform bool roundcorners_across_materials = false [[ + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::display_name("Across Materials"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(10) + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Uses selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Transform"), + ::anno::ui_order(11) + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Rug Carpet - Honeycomb"), + ::anno::description("Rug carpet material with stylized honeycomb pattern."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Rug_Carpet.Rug_Carpet_Honeycomb.png"), + ::anno::key_words(string[]("carpet", "fabric", "design", "automotive", "architecture", "pattern", "honeycomb", "modern", "hexagonal", "interior", "new", "rough", "bumped", "gray")) +]] = Rug_Carpet_Base( + carpet_color: carpet_color, + roughness: roughness, + roughness_variation: roughness_variation, + pattern_AO: pattern_AO, + bump_strength: bump_strength, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + roundcorners_enable: roundcorners_enable, + roundcorners_radius_mm: roundcorners_radius_mm, + roundcorners_across_materials: roundcorners_across_materials, + uv_space_index: uv_space_index, + rug_fibers: texture_2d("./rug_carpet_multi_fibers.jpg", ::tex::gamma_linear), + rug_aniso: texture_2d("./rug_carpet_anisotropy.jpg", ::tex::gamma_linear), + rug_multi_R_rough_G_ao_B_patternao: texture_2d("./rug_carpet_03_multi_R_rough_G_ao_B_bumpao.jpg", ::tex::gamma_linear), + rug_normal: texture_2d("./rug_carpet_03_norm.jpg", ::tex::gamma_linear) +); + + + + + + + + + + + + + + + + + + + + diff --git a/Material/material_0293/Ceramic_Tiles_Glazed_Diamond_Offset.mdl b/Material/material_0293/Ceramic_Tiles_Glazed_Diamond_Offset.mdl new file mode 100644 index 0000000000000000000000000000000000000000..a6bccd94f451aca7fefdef6f8eb3082338c7a432 --- /dev/null +++ b/Material/material_0293/Ceramic_Tiles_Glazed_Diamond_Offset.mdl @@ -0,0 +1,2547 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. * + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA’s Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + + +mdl 1.6; +import ::base::*; +import ::state::*; +import ::math::*; +import ::anno::*; +import ::tex::*; +import ::df::*; +import ::nvidia::core_definitions::*; + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + +float histogram_range(float input, float range = 1.0f, float position = 0.5f) +{ + float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); + float high = ::math::clamp(math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); + return ::math::lerp(low, high, input); +} + +// Returns the normal n in tangent space, given n is in internal space. +float3 transform_internal_to_tangent(float3 n) +[[ + anno::hidden() +]] +{ + return + n.x* float3(state::texture_tangent_u(0).x,state::texture_tangent_v(0).x,state::normal().x)+ + n.y* float3(state::texture_tangent_u(0).y,state::texture_tangent_v(0).y,state::normal().y)+ + n.z* float3(state::texture_tangent_u(0).z,state::texture_tangent_v(0).z,state::normal().z); +} + +// Returns the normal n in internal space, given n is in tangent space. +float3 transform_tangent_to_internal(float3 n) +[[ + anno::hidden() +]] +{ + return state::texture_tangent_u(0) * n.x + + state::texture_tangent_v(0) * n.y + + state::normal() * n.z ; +} + +// https://nullprogram.com/blog/2018/07/31/ +//bias: 0.17353355999581582 ( very probably the best of its kind ) +// NOTE: To turn this back to a float, one must divide the value by 4294967296.f +// which corresponds to 0xffffffff, however MDL seems to turn this into -1. +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + +float2 rnd22(int2 p, int seed = 0) { + float2 ret_val = float2( + uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f, + uint2float(lowbias32(p[0] + seed + lowbias32(p[1]))) / 4294967296.f + ); + return ret_val; +} + +float2x2 invert_2x2(float2x2 M) +{ + float det = M[0][0]*M[1][1] - M[0][1]*M[1][0]; + //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/ + return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]); +} + + +float3 rgb2srgb(float3 val) [[ anno::unused() ]] { + return ::math::pow( ::math::max(val, float3(0.f)), float3(1./2.2) ); +} + +float3 nonrepeat_lookup( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float2 texture_scale = 1.0, + float3 average_color = float3(0.5), + float patch_size = 8.0, + int seed = 0 +) +{ + + float2 uv_in = float2(uvw.position[0], uvw.position[1]) / texture_scale; + float Z = patch_size; // patch scale inside example texture + + float3 O = float3(0.f); + float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); + float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space + + float2 U = uv_in; + float2 V = M * uv_in; //pre-tilted hexa coordinates + int2 I = int2(::math::floor(V)); // hexa-tile id + //I = int2((I.x), (I.y)); // hexa-tile id + + // The mean color needs to be determined in Photoshop then to make the + // average color work out, take the float value and calculate the apropriate + // mean value as (value^(1/2.2)) + + float3 m = average_color; + + float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; + F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates + + if( F[2] > 0.f ) + O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I, seed))) - m) + + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1), seed))) - m) + + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0), seed))) - m); + else + O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1), seed))) - m) + + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0), seed))) - m) + + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1), seed))) - m); + O = m + O/::math::length(W); + O = ::math::clamp( (O), 0.0, 1.0); + + return float3(O); +} + +::base::texture_coordinate_info transform_coordinate_2( + float4x4 transform + [[ anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix.") ]], + ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info() + [[ anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection.") ]] +) [[ + ::anno::description("Transform a texture coordinate by a matrix.") , + ::anno::noinline() + ]] +{ + float4 r_position = transform * float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1); + float4 u = transform[0]; + float3 ru = ::math::normalize(float3(u.x,u.y,u.z)); + float cos = ru.x; + float sin = -ru.y; + + return ::base::texture_coordinate_info( + float3(r_position.x,r_position.y,r_position.z), + math::normalize(cos * coordinate.tangent_u - sin * coordinate.tangent_v), + math::normalize(cos * coordinate.tangent_v + sin * coordinate.tangent_u)); +} + + +::base::texture_coordinate_info vmat_transform( + float2 translation = float2(0.0, 0.0), + float rotation = 0.0, // rotation in degrees + float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation_rad); + float c = ::math::cos(rotation_rad); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return transform_coordinate_2(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + + +struct ceramic_tiles_return { + color diffuse; + float dirt; + float tiles_isotropic_rough_squared; + float glazing_roughness; + float3 normal; + float4 randvals; + ::base::texture_coordinate_info tiles_uvw; +}; + +ceramic_tiles_return Ceramic_Tiles_Glazed_Generator( + + // Ceramic textures + // *** MAPS *** + // *** Special multimaps for tiles *** // + uniform texture_2d tex_lin_tiles_id_offset_color_tex // R - Random ID per tile + = texture_2d() [[ // G - Offset (for the tiling algorithm to work) + ::anno::description("Tiles texture that contains the tile ids," // B - Height texture for each tile for compositing the grout + " the offsets and the rotation for the tiles."), + ::anno::display_name("Tiles ID Offset Rotation Texture"), + ::anno::in_group("Textures"), + ::anno::ui_order(0) + ]], + uniform texture_2d tex_tiles_multi_R_noise1_G_noise2_B_craquelure // R - Diffuse color mix noise 1 + = texture_2d() [[ // G - finish_roughness + ::anno::description("Tiles texture that contains the textures " // B - Craquelure + "for diffuse color mixing, the roughness and the craquelure."), + ::anno::display_name("Tiles Noise1 Roughness Craquelure"), + ::anno::in_group("Textures"), + ::anno::ui_order(1) + ]], + uniform texture_2d tex_tiles_multi_R_rough_G_thickness_B_drops // R - Diffuse color mix noise 2 + = texture_2d()[[ // G - Glazing Thickness + ::anno::description("Tiles texture that contains the textures " // B - Drops (roughness) + "for diffuse color mixing, glazing thickness and drops."), + ::anno::display_name("Tiles Noise2 Thickness Drops"), + ::anno::in_group("Textures"), + ::anno::ui_order(2) + ]], + + uniform texture_2d tex_tiles_multi_R_height_G_edgefade_B_ao // R - Height + = texture_2d() [[ // B - AO + ::anno::description("Tiles texture that contains the textures " // G - Edgefade (diffuse) + "for the tiles height, the edge fade and AO."), + ::anno::display_name("Tiles Height Edgefade AO"), + ::anno::in_group("Textures"), + ::anno::ui_order(3) + ]], + + uniform texture_2d tex_lin_tiles_norm = texture_2d() // Normal texture for the tiles + [[ + ::anno::description("The normal texture to be used for the ceramic tiles."), + ::anno::display_name("Tiles Normal"), + ::anno::in_group("Textures"), + ::anno::ui_order(4) + ]], + // uniform texture_2d tex_lin_orange_peel_norm = texture_2d(), // Orange Peel Texture + + // Grout + uniform texture_2d tex_srgb_grout_diffuse_tex = texture_2d() // Diffuse Grout texture + [[ + ::anno::description("The diffuse texture for the grout."), + ::anno::display_name("Grout Diffuse"), + ::anno::in_group("Textures"), + ::anno::ui_order(5) + ]], + uniform texture_2d tex_lin_grout_normal = texture_2d() // texture with normal for the grout + [[ + ::anno::description("The normal texture for the grout."), + ::anno::display_name("Grout Normal"), + ::anno::in_group("Textures"), + ::anno::ui_order(6) + ]], + + // OTHER TEXTURE REQUIRED + // OPTIONAL: Diffuse texture for the ceramix underneath the glazing. Probably not very visible + + color tiles_color_1 = color(0.6f) + [[ + ::anno::description("Mixing color 1 for the ceramic tiles."), + ::anno::display_name("Tiles Color 1"), + ::anno::in_group("Appearance"), + ::anno::ui_order(7) + ]], + color tiles_color_2 = color(0.7f) + [[ + ::anno::description("Mixing color 2 for the ceramic tiles."), + ::anno::display_name("Tiles Color 2"), + ::anno::in_group("Appearance"), + ::anno::ui_order(8) + ]], + color tiles_color_3 = color(0.8f) + [[ + ::anno::description("Mixing color 3 for the tiles."), + ::anno::display_name("Tiles Color 3"), + ::anno::in_group("Appearance"), + ::anno::ui_order(9) + ]], + color tiles_color_diamond = color(0.246201f, 0.434154f, 0.479320f) + [[ + ::anno::description("Color for the diamond."), + ::anno::display_name("Diamond Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(10) + ]], + float tiles_diamond_texture_amount = 0.0f + [[ + ::anno::description("The amount of dark texture to be applied to the diamond."), + ::anno::display_name("Diamond Texture Amount"), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance"), + ::anno::ui_order(11) + ]], + float tiles_random_brightness = 0.0f + [[ + ::anno::description("Randomly modifies the brightness of the tiles."), + ::anno::display_name("Tiles Random Brightness"), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance"), + ::anno::ui_order(12) + ]], + int tiles_random_seed = 0 + [[ + ::anno::description("Choose a different seed number to obtain a different randomization pattern."), + ::anno::display_name("Tiles Random Seed"), + ::anno::in_group("Tiles"), + ::anno::ui_order(13) + ]], + + uniform float tiles_bump_strength = 1.0f + [[ + ::anno::description("Adjusts the strength of the tiles bump map."), + ::anno::display_name("Tiles Bump Strength"), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.0f, 1.0f), + ::anno::ui_order(14) + ]], + float tiles_random_slope_orientation = 0.03f + [[ + ::anno::description("When increasing this value, tiles are slanted in random directions. " + "This breaks up the even look and gives the appearance that the tiles work was done by hand."), + ::anno::display_name("Tiles Random Slope Orientation"), + ::anno::soft_range(0.0f, 1.0f), + ::anno::hard_range(0.0f, 5.0f), + ::anno::in_group("Tiles"), + ::anno::ui_order(15) + ]], + + float tiles_rotate = 0.0f // global rotation of texture in the tiles + [[ + ::anno::description("Global rotation of the texture lookup for the tiles textures in degrees."), + ::anno::display_name("Tiles Texture Rotate"), + ::anno::soft_range(-360.0f, 360.0f), + ::anno::in_group("Tiles"), + ::anno::ui_order(16) + ]], + float tiles_random_rotation = 1.0f // random rotation amount in degrees + [[ + ::anno::description("Random rotation of the textures for the tiles in degrees."), + ::anno::display_name("Tiles Random Rotation"), + ::anno::soft_range(0.0f, 360.0f), + ::anno::in_group("Tiles"), + ::anno::ui_order(17) + ]], + float tiles_scale = 1.0f + [[ + ::anno::description("Scales the texture in the tiles."), + ::anno::display_name("Tiles Texture Scale"), + ::anno::in_group("Tiles"), + ::anno::soft_range(0.0f, 2.0f), + ::anno::ui_order(18) + ]], + float tiles_random_scale = 0.0f + [[ + ::anno::description("Adds random variation to the scaling of the texture lookup for the tiles."), + ::anno::display_name("Tiles Random Texture Scale"), + ::anno::soft_range(0.0f, 1.0f), + ::anno::in_group("Tiles"), + ::anno::ui_order(19) + ]], + + float glazing_varying_thickness_weight = 0.0f + [[ + ::anno::description("Adds a varying thickness to the glazing which makes the underlying " + "ceramic color shine through."), + ::anno::display_name("Glazing Varying Thickness Weight"), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Glazing"), + ::anno::ui_order(20) + ]], + float glazing_edgefade_weight = 0.0f + [[ + ::anno::description("Adds a fading effect so that the glazing is thinner at the edges " + "of the tiles. This revelas the ceramic color which will begin to shine through."), + ::anno::display_name("Glazing Edgefade Weight"), + ::anno::in_group("Glazing"), + ::anno::hard_range(0.0f, 1.0f), + ::anno::ui_order(21) + ]], + float glazing_edgefade_randomness = 0.0f + [[ + ::anno::description("Adds Randomness to the edgefade effect, so that tiles have varying edgefading effect."), + ::anno::display_name("Glazing Edgefade Randomness"), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance"), + ::anno::ui_order(22) + ]], + float glazing_craquelure_weight = 0.0f + [[ + ::anno::description("Adds craquelure to the tiles to give them a more antique appearance."), + ::anno::display_name("Glazing Craquelure Weight"), + ::anno::in_group("Glazing"), + ::anno::hard_range(0.0f, 1.0f), + ::anno::ui_order(23) + ]], + uniform float glazing_orange_peel_bump = 1.0f + [[ + ::anno::description("Adds an unevenness to the glazing so that it appears more natural."), + ::anno::display_name("Glazing Orange Peel Bump"), + ::anno::soft_range(0.0f, 1.0f), + ::anno::hard_range(0.0f, 3.0f), + ::anno::in_group("Glazing"), + ::anno::ui_order(24) + ]], + uniform float glazing_orangepeel_size = 1.0f + [[ + ::anno::description("Adjusts the size of the orangepeel on the glazing."), + ::anno::display_name("Glazing Orange Peel Size"), + ::anno::soft_range(0.0f, 1.0f), + ::anno::in_group("Glazing"), + ::anno::ui_order(25) + ]], + uniform int glazing_orangepeel_noise_levels = 3 + [[ + ::anno::description("A higher number of levels makes the glazing layer to appear noisier " + "while a low level gives the glazing a realtively smooth appearance."), + ::anno::display_name("Glazing Orange Peel Noise Levels"), + ::anno::hard_range(0, 6), + ::anno::in_group("Glazing"), + ::anno::ui_order(26) + ]], + uniform float3 glazing_orangepeel_distortion = float3(0.0f) + [[ + ::anno::description("An optional input to add distortion to the glazing orange peel."), + ::anno::display_name("Glazing Orange Peel Distortion"), + ::anno::in_group("Glazing"), + ::anno::ui_order(27) + ]], + + // Roughness + float tiles_roughness = 0.04f + [[ + ::anno::description("The basic roughness of the tiles."), + ::anno::display_name("Tiles Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(28) + ]], + float tiles_roughness_range = 0.5f + [[ + ::anno::description("The amount how much the roughness is varying around its base roughness value."), + ::anno::display_name("Tiles Roughness Range"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(29) + ]], + float drops_amount = 0.5f + [[ + ::anno::description("Adds residue of dried drops on the tiles which can be seen in the specular highlight."), + ::anno::display_name("Drops Amount"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(30) + ]], + float grout_brightness = 0.5f + [[ + ::anno::description("Adjusts the brightness of the grout."), + ::anno::display_name("Grout Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(31) + ]], + float grout_roughness = 0.8f + [[ + ::anno::description("The roughness of the grout."), + ::anno::display_name("Grout Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(32) + ]], + + float grout_height = 0.1f + [[ + ::anno::description("The height of the grout."), + ::anno::display_name("Grout Height"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(33) + ]], + float grout_softness = 0.1f + [[ + ::anno::description("The softness of the transition between the grout and the tiles."), + ::anno::display_name("Grout Transition Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(34) + ]], + uniform float grout_bump_strength = 1.0f + [[ + ::anno::description("The strength of the grout bumpmap."), + ::anno::display_name("Grout Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(35) + ]], + uniform float grout_scale = 1.0f + [[ + ::anno::description("Scales the texture lookup for the grout independently from the tiles."), + ::anno::display_name("Grout Scale"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 2.f) + ]], + float ao_amount = 0.5f + [[ + ::anno::description("The amount of ambient occlusion to convey more depth of grout. Used for artistical tweaking."), + ::anno::display_name("Ambient Occlusion Amount"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float2 texture_translate = 0.f [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform") + ]], + uniform float texture_rotate = 0.f [[ + ::anno::description("Rotation angle of the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(-360.f, 360.f) + ]], + uniform float2 texture_scale = 1.f [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::nvidia::core_definitions::dimension(float2(1.0, 1.0)), + ::anno::in_group("Transform") + ]], + uniform int uv_space_index = 0 + [[ + ::anno::description("The UV texture space to be used."), + ::anno::display_name("Texture Space"), + ::anno::in_group("Advanced"), + ::anno::ui_order(10) + ]] +) +[[ + ::anno::description("Glazed Ceramic Tiles Master material. This material should be hidden as it has all of its " + "parameters exposed. This material is only useful for hardcore-fans of fine grained tweaking and not necessary " + "if the user uses the tiles materials that are derived from it."), + ::anno::in_group("Tiles"), + ::anno::display_name("Glazed Ceramic Tiles - Penny"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Glazed_Diamond.png"), + ::anno::key_words(string[]("tiles", "tiled", "ceramic", "glazed", "bathroom", "sanitary", "kitchen", "floor", "wall", "interior", "exterior", "architecture", "diamond", "round")), + ::anno::hidden(), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] +{ + texture_scale *= float2(0.666666666666f, 0.6666666666666f); + color ceramic_color = color(1.0f); + ::base::texture_coordinate_info base_uv = vmat_transform( + translation:texture_translate, + rotation: texture_rotate , + scaling: texture_scale , + system: ::base::texture_coordinate_uvw, + uv_space: uv_space_index + ); + ::base::texture_coordinate_info grout_uv = ::base::texture_coordinate_info( + position: base_uv.position / grout_scale, + tangent_u: base_uv.tangent_u, + tangent_v: base_uv.tangent_v + + ); + + // Optimization for the texture tex_lin_tiles_id_offset_color_tex: + // We just need a fraction of the texture since it is repeating and + // can make it consume 4 times less memory + float2 tile_id_uv = float2(base_uv.position.x, base_uv.position.y)*2.0f; + +// --------------------------- Rand Tiles Routine ------------------------------------------------------- + + // rand_tiles_return rand_tiles_ret = rand_tiles( + // tex_lin_tiles_id_offset_color_tex: tex_lin_tiles_id_offset_color_tex, + // base_uv: base_uv, + // texture_space: uv_space_index, + // scale: scale, + // tiles_rotate: tiles_rotate, + // tiles_random_rotation: tiles_random_rotation, + // tiles_scale: tiles_scale, + // tiles_random_scale: tiles_random_scale + // ); + + // 1. Get UVs for tex_lin_tiles_id_offset_color_tex lookup plus the according cell indices + // 2. Perform lookup, correct tiles borders and generate the random values for the tiles + // 3. Use random values to generate random values for the randomized UVs + // - random scale (1 floats) + // - random rotation (1 float) + // - random offset (2 floats) + // - random brightness (1 float) + // 4. Do the random UV generation using 'vmat_transform'-function + + int rand_val_1, rand_val_2, rand_val_3, rand_val_4, rand_val_5, rand_val_6; + float rnd1, rnd2, rnd3, rnd4, rnd5, rnd6; + int offset_x, offset_y; + + // the rand tiles texture must be sampled exactly, so texel lookup is the function we will be using here + int2 texel_coord = int2(int(::math::frac(tile_id_uv.x) * ::tex::width(tex_lin_tiles_id_offset_color_tex)), + int(::math::frac(tile_id_uv.y) * ::tex::height(tex_lin_tiles_id_offset_color_tex))); + float3 tiles_ids = ::tex::texel_float3(tex_lin_tiles_id_offset_color_tex, texel_coord); + + int rand_id = int(tiles_ids.x * 254.f); // Random tile ID's are stored in R-channel., 255 produces visual errors sometimes. 254 seems to work + // We are assuming 8bit values and generate integers from 0-255 + float offset_id = tiles_ids.y; // Offset of overlapping tiles stored in G-channel + // [0 - 0.25[ : ( 0/ 0) Grayscale value: 0.1 + // [0.25 - 0.5 [ : (-1/ 0) Grayscale value: 0.37 + // [0.5 - 0.75[ : (-1/-1) Grayscale value: 0.62 + // [0.75 - 1.0 [ : ( 0/-1) Grayscale value: 0.87 + offset_x = offset_id < 0.25f ? 0 : (offset_id < .75f) ? 1 : 0; + offset_y = offset_id < 0.5 ? 0 : 1; + + int2 cell_id = int2(int(::math::floor(tile_id_uv.x) - offset_x), int(::math::floor(tile_id_uv.y) - offset_y)); + + rand_val_1 = lowbias32(tiles_random_seed + rand_id + lowbias32(cell_id.x + lowbias32(cell_id.y))); + rand_val_2 = lowbias32(rand_val_1); + rand_val_3 = lowbias32(rand_val_2); + rand_val_4 = lowbias32(rand_val_3); + rand_val_5 = lowbias32(rand_val_4); + rand_val_6 = lowbias32(rand_val_5); + + rnd1 = uint2float(rand_val_1)/4294967296.f; + rnd2 = uint2float(rand_val_2)/4294967296.f; + rnd3 = uint2float(rand_val_3)/4294967296.f; + rnd4 = uint2float(rand_val_4)/4294967296.f; + rnd5 = uint2float(rand_val_5)/4294967296.f; + rnd6 = uint2float(rand_val_6)/4294967296.f; + + // Generate 2 different sets of lookups. Re-Using random numbers between functions at different positions. + // Hoping that this little save does not leave an impression on the eye + ::base::texture_coordinate_info tiles_lookup_uvw_1 = + vmat_transform( + translation:texture_translate + (float2(rnd1, rnd2)) * 17.77, + rotation: texture_rotate + (tiles_rotate + (rnd3 - 0.5f) * tiles_random_rotation) , + scaling: texture_scale * (float2(tiles_scale) + tiles_scale* float2(rnd4) * tiles_random_scale), + system: ::base::texture_coordinate_uvw, + uv_space: uv_space_index + ); + +// ---------------------------------------------------------------------------------- + color tiles_diff = color(1.0f, 0.0, 0.0f); + color grout_diff_lookup = color(0.5f, 1.5f, 0.5f); + + // Lookup for Edgefade and tiles height, using the non-shifted original UV coordinates + float3 R_height_G_edgefade_B_ao = ::tex::lookup_float3( + tex: tex_tiles_multi_R_height_G_edgefade_B_ao, + coord: float2(base_uv.position.x, base_uv.position.y) + ); + + // Lookup for Noise 1, Noise 2 and Craquelure + float3 R_noise1_G_noise2_B_craquelure = ::tex::lookup_float3( + tex: tex_tiles_multi_R_noise1_G_noise2_B_craquelure, + coord: float2(tiles_lookup_uvw_1.position.x, tiles_lookup_uvw_1.position.y) + ); + + + float3 R_frough_G_thickness_B_drops = nonrepeat_lookup( + texture: tex_tiles_multi_R_rough_G_thickness_B_drops, + uvw: base_uv, + average_color: float3(0.499f, 0.365f, 0.015f), + texture_scale: texture_scale * .3f, + patch_size: 6.0, + seed: tiles_random_seed + ); + + float grout_mask = ::math::smoothstep(grout_height, grout_height + grout_softness, R_height_G_edgefade_B_ao.x); + + if (grout_mask < 0.999f) + { + // Grout Diffuse + grout_diff_lookup = ::base::file_texture( + texture: tex_srgb_grout_diffuse_tex, + uvw: grout_uv).tint; + grout_diff_lookup = ::nvidia::core_definitions::blend_colors( + color_1: grout_diff_lookup, + color_2: color(grout_brightness), + mode: ::base::color_layer_overlay, + weight: 1.0f).tint; + } + + if (grout_mask >= 0.001f) + { + // Compositing the diffuse color + + // Diamond Tiles Color + ::base::color_layer layer_1 = ::base::color_layer( + layer_color: tiles_color_diamond, + weight: tiles_ids.z, + mode: ::base::color_layer_blend + ); + ::base::color_layer layer_2 = ::base::color_layer( + layer_color: tiles_color_2, + weight: R_noise1_G_noise2_B_craquelure.x * (1.0f - tiles_ids.z), + mode: ::base::color_layer_blend + ); + // Color 3 + ::base::color_layer layer_3 = ::base::color_layer( + layer_color: tiles_color_3, + weight: R_noise1_G_noise2_B_craquelure.y * (1.0f - tiles_ids.z), + mode: ::base::color_layer_blend + ); + // Color 4 + ::base::color_layer layer_4 = ::base::color_layer( + layer_color: color(0.0f), + weight: R_noise1_G_noise2_B_craquelure.y * (tiles_ids.z) * tiles_diamond_texture_amount, + mode: ::base::color_layer_overlay + ); + // Varying brightness + ::base::color_layer layer_5 = ::base::color_layer( + layer_color: color(rnd6), + weight: tiles_random_brightness, + mode: ::base::color_layer_overlay + ); + // Varying glazing thickness + ::base::color_layer layer_6 = ::base::color_layer( + layer_color: ceramic_color, + weight: R_frough_G_thickness_B_drops.y * glazing_varying_thickness_weight * .15f, + mode: ::base::color_layer_blend + ); + // Edge Fade + ::base::color_layer layer_7 = ::base::color_layer( + layer_color: ceramic_color, + weight: glazing_edgefade_weight * (R_height_G_edgefade_B_ao.y + (0.5 - rnd3) * glazing_edgefade_randomness), + mode: ::base::color_layer_blend + ); + // Craquelure + ::base::color_layer layer_8 = ::base::color_layer( + layer_color: color(::math::pow(R_noise1_G_noise2_B_craquelure.z, 2.2f)), + weight: glazing_craquelure_weight, + mode: ::base::color_layer_overlay + ); + + ::base::color_layer[] tile_layers = ::base::color_layer[]( + layer_1, layer_2, layer_3, layer_4, layer_5, layer_6, layer_7, layer_8 + ); + + tiles_diff = ::base::blend_color_layers( + layers: tile_layers, + base: tiles_color_1 + ).tint; + } + + ::base::texture_return tiles_diff_final = ::nvidia::core_definitions::blend_colors( + color_1: grout_diff_lookup, + color_2: tiles_diff, + mode: ::nvidia::core_definitions::color_layer_blend, + weight: grout_mask + ); + + tiles_diff_final = (ao_amount > 0.0) ? ::nvidia::core_definitions::blend_colors( + color_1: tiles_diff_final.tint, + color_2: color(R_height_G_edgefade_B_ao.z), + mode: ::nvidia::core_definitions::color_layer_multiply, + weight: (1.0f - grout_height) * ao_amount + ) : tiles_diff_final; + + +// ******** COAT Roughness ******** + + float glazing_roughness = histogram_range(R_frough_G_thickness_B_drops.x, tiles_roughness_range, tiles_roughness); + glazing_roughness += R_frough_G_thickness_B_drops.z * drops_amount; + glazing_roughness = ::math::lerp(grout_roughness, glazing_roughness, grout_mask); + + +// ******** NORMALS ******** + // Tiles normal + float3 tiles_normal = ::base::tangent_space_normal_texture( + texture: tex_lin_tiles_norm, + factor: tiles_bump_strength, + uvw: base_uv + ); + + // Grout Normal + float3 grout_normal = ::base::tangent_space_normal_texture( + texture: tex_lin_grout_normal, + factor: grout_bump_strength, + uvw: grout_uv + ); + + float3 orange_peel_normal = ::base::perlin_noise_bump_texture( + uvw: base_uv, + factor: glazing_orange_peel_bump * .2f, + size: glazing_orangepeel_size * ::state::scene_units_per_meter(), + apply_marble: false, + apply_dent: false, + noise_phase: 0.0f, + noise_levels: glazing_orangepeel_noise_levels, + absolute_noise: false, + ridged_noise: false, + noise_distortion: glazing_orangepeel_distortion, + noise_threshold_high: 1.0f, + noise_threshold_low: 0.0f, + noise_bands: 1.0f, + normal: ::state::normal() + ); + + // Randomized Tiles normals - This needs to be probably rotated with the normal of the uv-tiles + float slope_amount = 0.07 * tiles_random_slope_orientation; + float3 slope = ::math::normalize( + ::state::texture_tangent_u(0) * (rnd5 - 0.5) * slope_amount + + ::state::texture_tangent_v(0) * (rnd6 - 0.5) * slope_amount + + ::state::normal() * ((1.0f - slope_amount) + 1.0f) + ); + + // http://blog.selfshadow.com/publications/blending-in-detail/ + float3 n_t = transform_internal_to_tangent(slope); + float3 tiles_normal_t = transform_internal_to_tangent(tiles_normal); + float3 orange_peel_normal_t = transform_internal_to_tangent(orange_peel_normal); + + // 1st detail normal + n_t=n_t + float3(0.,0.,1.); + tiles_normal_t = tiles_normal_t * float3(-1.,-1.,1.); + float3 n = n_t*math::dot(n_t, tiles_normal_t)/n_t.z - tiles_normal_t; + + // 2nd detail normal + n_t = n + float3(0.,0.,1.); + orange_peel_normal_t = orange_peel_normal_t * float3(-1.,-1.,1.); + n = n_t*math::dot(n_t, orange_peel_normal_t)/n_t.z - orange_peel_normal_t; + + float3 normal_final = ::math::normalize(transform_tangent_to_internal(n)); + normal_final = ::math::lerp(grout_normal, normal_final, grout_mask); + + return ceramic_tiles_return( + diffuse: tiles_diff_final.tint, + dirt: R_frough_G_thickness_B_drops.x, + tiles_isotropic_rough_squared: 0.2, + glazing_roughness: glazing_roughness * glazing_roughness, + normal: normal_final, + randvals: float4(rnd1, rnd2, rnd3, rnd4), + tiles_uvw: tiles_lookup_uvw_1 + ); +} + + +export material Ceramic_Tiles_Glazed_Diamond_Offset( + + // Main Tweaks + int tiles_random_seed = 0 + [[ + ::anno::description("Choose a different seed number to obtain a different randomization pattern."), + ::anno::display_name("Tiles Random Seed"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + color tiles_color_1 = color(0.014444f, 0.034340f, 0.215861f) + [[ + ::anno::description("Mixing color 1 for the ceramic tiles."), + ::anno::display_name("Tiles Color 1"), + ::anno::in_group("Appearance"), + ::anno::ui_order(1) + ]], + color tiles_color_2 = color(0.017642f, 0.039546f, 0.219526f) + [[ + ::anno::description("Mixing color 2 for the ceramic tiles."), + ::anno::display_name("Tiles Color 2"), + ::anno::in_group("Appearance"), + ::anno::ui_order(2) + ]], + color tiles_color_3 = color(0.014444f, 0.018500f, 0.219526f) + [[ + ::anno::description("Mixing color 3 for the tiles."), + ::anno::display_name("Tiles Color 3"), + ::anno::in_group("Appearance"), + ::anno::ui_order(3) + ]], + color tiles_color_diamond = color(0.586f, 0.759f, 0.774f) + [[ + ::anno::description("Color for the diamond."), + ::anno::display_name("Diamond Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(4) + ]], + float tiles_diamond_texture_amount = 0.2f + [[ + ::anno::description("The amount of dark texture to be applied to the diamond."), + ::anno::display_name("Diamond Texture Amound"), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance"), + ::anno::ui_order(5) + ]], + float tiles_random_brightness = 0.015f + [[ + ::anno::description("Randomly modifies the brightness of the tiles."), + ::anno::display_name("Tiles Random Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.0f, 1.0f), + ::anno::ui_order(6) + ]], + float tiles_roughness = 0.039f + [[ + ::anno::description("The basic roughness of the tiles."), + ::anno::display_name("Tiles Roughness"), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Appearance"), + ::anno::ui_order(7) + ]], + float tiles_roughness_range = 0.003f + [[ + ::anno::description("The amount how much the roughness is varying around its base roughness value."), + ::anno::display_name("Tiles Roughness Range"), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Appearance"), + ::anno::ui_order(8) + ]], + float tiles_random_slope_orientation = 0.04f + [[ + ::anno::description("When increasing this value, tiles are slanted in random directions. " + "This breaks up the even look and gives the appearance that the tiles work was done by hand."), + ::anno::display_name("Tiles Random Slope Orientation"), + ::anno::soft_range(0.0f, 1.0f), + ::anno::hard_range(0.0f, 5.0f), + ::anno::in_group("Appearance"), + ::anno::ui_order(9) + ]], + uniform float glazing_orange_peel_bump = 0.03f + [[ + ::anno::description("Adds an unevenness to the glazing so that it appears more natural."), + ::anno::display_name("Glazing Orange Peel Bump"), + ::anno::soft_range(0.0f, 1.0f), + ::anno::hard_range(0.0f, 5.0f), + ::anno::in_group("Appearance"), + ::anno::ui_order(10) + ]], + float glazing_edgefade_weight = 0.0f + [[ + ::anno::description("Adds a fading effect so that the glazing is thinner at the edges " + "of the tiles. This revelas the ceramic color which will begin to shine through."), + ::anno::display_name("Glazing Edgefade Weight"), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance"), + ::anno::ui_order(11) + ]], + float glazing_edgefade_randomness = 0.0f + [[ + ::anno::description("Adds Randomness to the edgefade effect, so that tiles have varying edgefading effect."), + ::anno::display_name("Glazing Edgefade Randomness"), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance"), + ::anno::ui_order(12) + ]], + float glazing_craquelure_weight = 0.05f + [[ + ::anno::description("Adds craquelure to the tiles to give them a more antique appearance."), + ::anno::display_name("Glazing Craquelure Weight"), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance"), + ::anno::ui_order(13) + ]], + float drops_amount = 0.05f + [[ + ::anno::description("Adds residue of dried drops on the tiles which can be seen in the specular highlight."), + ::anno::display_name("Drops Amount"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(14) + ]], + float grout_brightness = 0.7f + [[ + ::anno::description("Adjusts the brightness of the grout."), + ::anno::display_name("Grout Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(15) + ]], + float grout_height = 0.05f + [[ + ::anno::description("The height of the grout."), + ::anno::display_name("Grout Height"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(16) + ]], + uniform float tiles_bump_strength = 1.0f + [[ + ::anno::description("Adjusts the strength of the tiles bump map."), + ::anno::display_name("Tiles Bump Strength"), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance"), + ::anno::ui_order(17) + ]], + color dirt_color = color(0.0582f, 0.037f, 0.0265f) + [[ + ::anno::description("Sets the color of the dirt layer."), + ::anno::display_name("Dirt Layer Color"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::ui_order(18) + ]], + float dirt_weight = 0.0f + [[ + ::anno::description("The weight of the dirt layer."), + ::anno::display_name("Dirt Weight"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(19) + ]], + + uniform float grout_scale = 1.0f + [[ + ::anno::description("Scales the texture lookup for the grout independently from the tiles."), + ::anno::display_name("Grout Scale"), + ::anno::in_group("Advanced", "Grout"), + ::anno::soft_range(0.f, 2.f), + ::anno::ui_order(20) + ]], + + uniform float2 texture_translate = 0.f [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform"), + ::anno::ui_order(21) + ]], + uniform float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(-360.f, 360.f), + ::anno::ui_order(22) + ]], + uniform float2 texture_scale = 1.f [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::nvidia::core_definitions::dimension(float2(1.0, 1.0)), + ::anno::in_group("Transform"), + ::anno::ui_order(23) + ]], + + + float tiles_rotate = 0.0f // global rotation of texture in the tiles + [[ + ::anno::description("Globally rotates the texture lookup for the tiles textures."), + ::anno::display_name("Tiles Texture Rotate"), + ::anno::in_group("Advanced", "Tiles"), + ::anno::ui_order(24) + ]], + float tiles_random_rotation = 1.0f // random rotation amount in degrees + [[ + ::anno::description("Randomly rotates the textures for the tiles."), + ::anno::display_name("Tiles Random Rotation"), + ::anno::soft_range(0.f, 360.f), + ::anno::in_group("Advanced", "Tiles"), + ::anno::ui_order(25) + ]], + float tiles_scale = 1.0f + [[ + ::anno::description("Scales the texture in the tiles."), + ::anno::display_name("Tiles Texture Scale"), + ::anno::soft_range(0.0f, 2.0f), + ::anno::in_group("Advanced", "Tiles"), + ::anno::ui_order(26) + ]], + float tiles_random_scale = 0.0f + [[ + ::anno::description("Adds random variation to the scaling of the texture lookup for the tiles."), + ::anno::display_name("Tiles Random Texture Scale"), + ::anno::soft_range(0.0f, 1.0f), + ::anno::in_group("Advanced", "Tiles"), + ::anno::ui_order(27) + ]], + + float glazing_varying_thickness_weight = 0.00f + [[ + ::anno::description("Adds a varying thickness to the glazing which makes the underlying " + "ceramic color shine through."), + ::anno::display_name("Glazing Varying Thickness Weight"), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Advanced", "Glazing"), + ::anno::ui_order(28) + ]], + uniform float glazing_orangepeel_size = 0.05f + [[ + ::anno::description("Adjusts the size of the orangepeel on the glazing."), + ::anno::display_name("Glazing Orange Peel Size"), + ::anno::soft_range(0.0f, 1.0f), + ::anno::in_group("Advanced", "Glazing"), + ::anno::ui_order(29) + ]], + uniform int glazing_orangepeel_noise_levels = 4 + [[ + ::anno::description("A higher number of levels makes the glazing layer to appear noisier " + "while a low level gives the glazing a realtively smooth appearance."), + ::anno::display_name("Glazing Orange Peel Noise Levels"), + ::anno::soft_range(0, 6), + ::anno::in_group("Advanced", "Glazing"), + ::anno::ui_order(30) + ]], + + float grout_roughness = 0.8f + [[ + ::anno::description("The roughness of the grout."), + ::anno::display_name("Grout Roughness"), + ::anno::in_group("Advanced", "Grout"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(31) + ]], + float grout_softness = 0.05f + [[ + ::anno::description("The softness of the transition between the grout and the tiles."), + ::anno::display_name("Grout Transition Roughness"), + ::anno::in_group("Advanced", "Grout"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(32) + ]], + uniform float grout_bump_strength = 1.0f + [[ + ::anno::description("The strength of the grout bumpmap."), + ::anno::display_name("Grout Bump Strength"), + ::anno::in_group("Advanced", "Grout"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(33) + ]], + float ao_amount = 0.5f + [[ + ::anno::description("The amount of ambient occlusion to convey more depth of grout. Used for artistical tweaking."), + ::anno::display_name("Ambient Occlusion Amount"), + ::anno::in_group("Advanced"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(34) + ]], + uniform int uv_space_index = 0 + [[ + ::anno::description("The UV texture space to be used."), + ::anno::display_name("Texture Space"), + ::anno::in_group("Advanced"), + ::anno::ui_order(35) + ]] + +) +[[ + ::anno::description("Glazed ceramic tiles material with tweakable tile color, grout and glazing."), + ::anno::in_group("Tiles"), + ::anno::display_name("Glazed Offset Diamond Tiles - Dark Blue"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Glazed_Diamond_Offset.png"), + ::anno::key_words(string[]("tiles", "tiled", "ceramic", "glazed", "bathroom", "sanitary", "kitchen", "floor", "wall", "interior", "exterior", "architecture", "diamond", "new", "shiny", "blue", "dark", "saturated")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] = +let { + texture_2d tex_lin_tiles_id_offset_color_tex = texture_2d("./diamond_alternated_R_id_G_offs_B_color.png", ::tex::gamma_linear); + texture_2d tex_lin_tiles_norm = texture_2d("./diamond_alternated_norm.jpg", ::tex::gamma_linear); + texture_2d tex_tiles_multi_R_height_G_edgefade_B_ao = texture_2d("./diamond_alternated_multi_R_height_G_edgefade_B_ao.jpg", ::tex::gamma_linear); + texture_2d tex_tiles_multi_R_noise1_G_noise2_B_craquelure = texture_2d("./diamond_multi_R_noise1_G_noise2_B_craquelure.jpg", ::tex::gamma_linear); + texture_2d tex_tiles_multi_R_rough_G_thickness_B_drops = texture_2d("./diamond_multi_R_rough_G_thickness_B_drops.jpg", ::tex::gamma_linear); + texture_2d tex_srgb_grout_diffuse_tex = texture_2d("./mortar_diff.jpg", ::tex::gamma_srgb); + texture_2d tex_lin_grout_normal = texture_2d("./mortar_norm.jpg", ::tex::gamma_linear); + + + ceramic_tiles_return ret = Ceramic_Tiles_Glazed_Generator( + tex_lin_tiles_id_offset_color_tex: tex_lin_tiles_id_offset_color_tex, + tex_tiles_multi_R_noise1_G_noise2_B_craquelure: tex_tiles_multi_R_noise1_G_noise2_B_craquelure, + tex_tiles_multi_R_rough_G_thickness_B_drops: tex_tiles_multi_R_rough_G_thickness_B_drops, + tex_tiles_multi_R_height_G_edgefade_B_ao: tex_tiles_multi_R_height_G_edgefade_B_ao, + tex_lin_tiles_norm: tex_lin_tiles_norm, + tex_srgb_grout_diffuse_tex: tex_srgb_grout_diffuse_tex, + tex_lin_grout_normal: tex_lin_grout_normal, + + tiles_random_seed: tiles_random_seed, + tiles_color_1: tiles_color_1, + tiles_color_2: tiles_color_2, + tiles_color_3: tiles_color_3, + tiles_color_diamond: tiles_color_diamond, + tiles_diamond_texture_amount: tiles_diamond_texture_amount, + tiles_random_brightness: tiles_random_brightness, + tiles_bump_strength: tiles_bump_strength, + tiles_random_slope_orientation: tiles_random_slope_orientation, + tiles_rotate: tiles_rotate, + tiles_random_rotation : tiles_random_rotation, + tiles_scale : tiles_scale, + tiles_random_scale: tiles_random_scale, + + glazing_varying_thickness_weight: glazing_varying_thickness_weight, + glazing_edgefade_weight: glazing_edgefade_weight, + glazing_edgefade_randomness: glazing_edgefade_randomness, + glazing_craquelure_weight: glazing_craquelure_weight, + glazing_orange_peel_bump: glazing_orange_peel_bump, + glazing_orangepeel_size: glazing_orangepeel_size, + glazing_orangepeel_noise_levels: glazing_orangepeel_noise_levels, + + tiles_roughness: tiles_roughness, + tiles_roughness_range: tiles_roughness_range, + drops_amount: drops_amount, + grout_roughness: grout_roughness, + + grout_brightness: grout_brightness, + grout_height: grout_height, + grout_softness: grout_softness, + grout_bump_strength: grout_bump_strength, + grout_scale: grout_scale, + ao_amount: ao_amount, + + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + + uv_space_index: uv_space_index + ); + + bsdf diff = ::df::diffuse_reflection_bsdf( + tint: ret.diffuse + ); + + + + +} in material ( + surface : material_surface ( + scattering : + ::df::weighted_layer( + weight: dirt_weight * ret.dirt, + layer: ::df::diffuse_reflection_bsdf ( tint: dirt_color), + base: df::fresnel_layer ( + ior : 1.5, + layer : df::microfacet_ggx_smith_bsdf( + roughness_u: ret.glazing_roughness, + roughness_v: ret.glazing_roughness, + tint : color(1.), + mode : df::scatter_reflect), + base : diff + ) + ) + ), + geometry: material_geometry( + normal: ret.normal + ) +); + +export material Ceramic_Tiles_Offset_Diamond_Dark_Blue_New_Matte(*) +[[ + ::anno::description("Glazed ceramic tiles material with tweakable tile color, grout and glazing."), + ::anno::in_group("Tiles"), + ::anno::display_name("Glazed Offset Diamond Tiles - Dark Blue Matte"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Dark_Blue_New_Matte.png"), + ::anno::key_words(string[]("tiles", "tiled", "ceramic", "glazed", "bathroom", "sanitary", "kitchen", "floor", "wall", "interior", "exterior", "architecture", "diamond", "new", "matte", "blue", "dark", "cool", "saturated")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] = Ceramic_Tiles_Glazed_Diamond_Offset( + tiles_random_seed: 0, + tiles_color_1: color(0.014444f, 0.034340f, 0.215861f), + tiles_color_2: color(0.017642f, 0.039546f, 0.219526f), + tiles_color_3: color(0.014444f, 0.018500f, 0.219526f), + tiles_color_diamond: color(0.774f, 0.73f, 0.592f), + tiles_diamond_texture_amount: 0.2f, + tiles_random_brightness: 0.015f, + tiles_roughness: 0.32f, + tiles_roughness_range: 0.2f, + tiles_random_slope_orientation: 0.15f, + glazing_orange_peel_bump: 0.03f, + glazing_edgefade_weight: 0.00f, + glazing_edgefade_randomness: 0.00f, + glazing_craquelure_weight: 0.00f, + drops_amount: 0.00f, + grout_brightness: 0.70f, + grout_height: 0.05f, + grout_scale: 0.52f, + tiles_bump_strength: 1.00f, + dirt_color: color(0.0582f, 0.037f, 0.0265f), + dirt_weight: 0.0f, + texture_translate: 0.0f, + texture_rotate: 0.00f, + texture_scale: 1.00f, + tiles_rotate: 0.00f, + tiles_random_rotation: 0.00f, + tiles_scale: 1.00f, + tiles_random_scale: 0.00f, + glazing_varying_thickness_weight: 0.00f, + glazing_orangepeel_size: 0.05f, + glazing_orangepeel_noise_levels: 4, + grout_roughness: 0.8f, + grout_softness: 0.1f, + grout_bump_strength: 1.0f, + ao_amount: 0.5f, + uv_space_index: 0 +); + +export material Ceramic_Tiles_Offset_Diamond_Dark_Blue_Varied_New(*) +[[ + ::anno::description("Glazed ceramic tiles material with tweakable tile color, grout and glazing."), + ::anno::in_group("Tiles"), + ::anno::display_name("Glazed Offset Diamond Tiles - Dark Blue Varied"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Dark_Blue_Varied_New.png"), + ::anno::key_words(string[]("tiles", "tiled", "ceramic", "glazed", "bathroom", "sanitary", "kitchen", "floor", "wall", "interior", "exterior", "architecture", "diamond", "new", "shiny", "blue", "dark", "cool", "saturated", "random")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] = Ceramic_Tiles_Glazed_Diamond_Offset( + tiles_random_seed: 1, + tiles_color_1: color(0.014444f, 0.034340f, 0.215861f), + tiles_color_2: color(0.017642f, 0.039546f, 0.219526f), + tiles_color_3: color(0.014444f, 0.018500f, 0.219526f), + tiles_color_diamond: color(0.774f, 0.73f, 0.592f), + tiles_diamond_texture_amount: 0.2f, + tiles_random_brightness: 1.0f, + tiles_roughness: 0.039f, + tiles_roughness_range: 0.003f, + tiles_random_slope_orientation: 0.15f, + glazing_orange_peel_bump: 0.03f, + glazing_edgefade_weight: 0.07f, + glazing_edgefade_randomness: 0.77f, + glazing_craquelure_weight: 0.7f, + drops_amount: 0.00f, + grout_brightness: 0.70f, + grout_height: 0.05f, + grout_scale: 0.52f, + tiles_bump_strength: 1.00f, + dirt_color: color(0.0582f, 0.037f, 0.0265f), + dirt_weight: 0.0f, + texture_translate: 0.0f, + texture_rotate: 0.00f, + texture_scale: 1.00f, + tiles_rotate: 0.00f, + tiles_random_rotation: 0.00f, + tiles_scale: 1.00f, + tiles_random_scale: 0.00f, + glazing_varying_thickness_weight: 0.00f, + glazing_orangepeel_size: 0.05f, + glazing_orangepeel_noise_levels: 4, + grout_roughness: 0.8f, + grout_softness: 0.1f, + grout_bump_strength: 1.0f, + ao_amount: 0.5f, + uv_space_index: 0 +); + + +export material Ceramic_Tiles_Offset_Diamond_Antique_White(*) +[[ + ::anno::description("Glazed ceramic tiles material with tweakable tile color, grout and glazing."), + ::anno::in_group("Tiles"), + ::anno::display_name("Glazed Offset Diamond Tiles - Antique White"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Antique_White.png"), + ::anno::key_words(string[]("tiles", "tiled", "ceramic", "glazed", "bathroom", "sanitary", "kitchen", "floor", "wall", "interior", "exterior", "architecture", "diamond", "round", "old", "antique", "shiny", "white", "light", "neutral")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] = Ceramic_Tiles_Glazed_Diamond_Offset( + tiles_random_seed: 2, + tiles_color_1: color(0.603827f, 0.533276f, 0.473531f), + tiles_color_2: color(0.496933f, 0.445201f, 0.401978f), + tiles_color_3: color(0.571125f, 0.539479f, 0.462077f), + tiles_color_diamond: color(0.036889f, 0.035601f, 0.023153f), + tiles_diamond_texture_amount: 0.2f, + tiles_random_brightness: 0.02f, + tiles_roughness: 0.039f, + tiles_roughness_range: 0.008f, + tiles_random_slope_orientation: 0.1f, + glazing_orange_peel_bump: 0.18f, + glazing_edgefade_weight: 0.17f, + glazing_edgefade_randomness: 0.50f, + glazing_craquelure_weight: 0.66f, + drops_amount: 0.20f, + grout_brightness: 0.09f, + grout_height: 0.05f, + grout_scale: 0.52f, + tiles_bump_strength: 1.00f, + dirt_color: color(0.0582f, 0.037f, 0.0265f), + dirt_weight: 0.0f, + texture_translate: 0.0f, + texture_rotate: 0.00f, + texture_scale: 1.00f, + tiles_rotate: 0.00f, + tiles_random_rotation: 360.0f, + tiles_scale: 1.00f, + tiles_random_scale: 0.25f, + glazing_varying_thickness_weight: 0.00f, + glazing_orangepeel_size: 0.05f, + glazing_orangepeel_noise_levels: 4, + grout_roughness: 0.8f, + grout_softness: 0.1f, + grout_bump_strength: 1.0f, + ao_amount: 1.00f, + uv_space_index: 0 +); + + + +export material Ceramic_Tiles_Offset_Diamond_White_Matte(*) +[[ + ::anno::description("Glazed ceramic tiles material with tweakable tile color, grout and glazing."), + ::anno::in_group("Tiles"), + ::anno::display_name("Glazed Offset Diamond Tiles - White Matte"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_White_Matte.png"), + ::anno::key_words(string[]("tiles", "tiled", "ceramic", "glazed", "bathroom", "sanitary", "kitchen", "floor", "wall", "interior", "exterior", "architecture", "diamond", "new", "matte", "white", "light", "neutral")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] = Ceramic_Tiles_Glazed_Diamond_Offset( + tiles_random_seed: 0, + tiles_color_1: color(0.651406f, 0.651406f, 0.651406f), + tiles_color_2: color(0.651406f, 0.651406f, 0.597202f), + tiles_color_3: color(0.623960f, 0.623960f, 0.623960f), + tiles_color_diamond: color(0.036889f, 0.035601f, 0.023153f), + tiles_diamond_texture_amount: 0.2f, + tiles_random_brightness: 0.02f, + tiles_roughness: 0.32f, + tiles_roughness_range: 0.07f, + tiles_random_slope_orientation: 0.71f, + glazing_orange_peel_bump: 0.2f, + glazing_edgefade_weight: 0.00f, + glazing_edgefade_randomness: 0.00f, + glazing_craquelure_weight: 0.20f, + drops_amount: 0.23f, + grout_brightness: 0.11f, + grout_height: 0.05f, + grout_scale: 0.52f, + tiles_bump_strength: 1.00f, + dirt_color: color(0.0582f, 0.037f, 0.0265f), + dirt_weight: 0.0f, + texture_translate: 0.0f, + texture_rotate: 0.00f, + texture_scale: 1.00f, + tiles_rotate: 0.00f, + tiles_random_rotation: 0.00f, + tiles_scale: 1.00f, + tiles_random_scale: 0.00f, + glazing_varying_thickness_weight: 0.00f, + glazing_orangepeel_size: 0.05f, + glazing_orangepeel_noise_levels: 4, + grout_roughness: 0.8f, + grout_softness: 0.1f, + grout_bump_strength: 1.0f, + ao_amount: 1.0f, + uv_space_index: 0 +); + + +export material Ceramic_Tiles_Offset_Diamond_Antique_White_Dirty(*) +[[ + ::anno::description("Glazed ceramic tiles material with tweakable tile color, grout and glazing."), + ::anno::in_group("Tiles"), + ::anno::display_name("Glazed Offset Diamond Tiles - Antique White Dirty"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Antique_White_Dirty.png"), + ::anno::key_words(string[]("tiles", "tiled", "ceramic", "glazed", "bathroom", "sanitary", "kitchen", "floor", "wall", "interior", "exterior", "architecture", "diamond", "round", "worn", "old", "antique", "matte", "dirty", "white", "light")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] = Ceramic_Tiles_Glazed_Diamond_Offset( + tiles_random_seed: 3, + tiles_color_1: color(0.603827f, 0.533276f, 0.473531f), + tiles_color_2: color(0.496933f, 0.445201f, 0.401978f), + tiles_color_3: color(0.571125f, 0.539479f, 0.462077f), + tiles_color_diamond: color(0.036889f, 0.035601f, 0.023153f), + tiles_diamond_texture_amount: 0.2f, + tiles_random_brightness: 0.02f, + tiles_roughness: 0.5f, + tiles_roughness_range: 0.6f, + tiles_random_slope_orientation: 0.1f, + glazing_orange_peel_bump: 0.18f, + glazing_edgefade_weight: 0.17f, + glazing_edgefade_randomness: 0.50f, + glazing_craquelure_weight: 0.66f, + drops_amount: 0.20f, + grout_brightness: 0.09f, + grout_height: 0.05f, + grout_scale: 0.52f, + tiles_bump_strength: 1.00f, + dirt_color: color(0.0582f, 0.037f, 0.0265f), + dirt_weight: 0.6f, + texture_translate: 0.0f, + texture_rotate: 0.00f, + texture_scale: 1.00f, + tiles_rotate: 0.00f, + tiles_random_rotation: 360.0f, + tiles_scale: 1.00f, + tiles_random_scale: 0.25f, + glazing_varying_thickness_weight: 0.00f, + glazing_orangepeel_size: 0.05f, + glazing_orangepeel_noise_levels: 4, + grout_roughness: 0.8f, + grout_softness: 0.1f, + grout_bump_strength: 1.0f, + ao_amount: 1.00f, + uv_space_index: 0 +); + + +export material Ceramic_Tiles_Offset_Diamond_Black(*) +[[ + ::anno::description("Glazed ceramic tiles material with tweakable tile color, grout and glazing."), + ::anno::in_group("Tiles"), + ::anno::display_name("Glazed Offset Diamond Tiles - Black"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Black.png"), + ::anno::key_words(string[]("tiles", "tiled", "ceramic", "glazed", "bathroom", "sanitary", "kitchen", "floor", "wall", "interior", "exterior", "architecture", "diamond", "new", "shiny", "black", "dark", "neutral")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] = Ceramic_Tiles_Glazed_Diamond_Offset( + tiles_random_seed: 0, + tiles_color_1: color(0.012983f, 0.012983f, 0.012983f), + tiles_color_2: color(0.012983f, 0.012983f, 0.012983f), + tiles_color_3: color(0.009721f, 0.009721f, 0.009721f), + tiles_color_diamond: color(0.73f, 0.68f, 0.567f), + tiles_diamond_texture_amount: 0.2f, + tiles_random_brightness: 0.015f, + tiles_roughness: 0.039f, + tiles_roughness_range: 0.008f, + tiles_random_slope_orientation: 0.2f, + glazing_orange_peel_bump: 0.03f, + glazing_edgefade_weight: 0.00f, + glazing_edgefade_randomness: 0.00f, + glazing_craquelure_weight: 0.00f, + drops_amount: 0.00f, + grout_brightness: 0.70f, + grout_height: 0.05f, + grout_scale: 0.52f, + tiles_bump_strength: 1.00f, + dirt_color: color(0.0582f, 0.037f, 0.0265f), + dirt_weight: 0.0f, + texture_translate: 0.0f, + texture_rotate: 0.00f, + texture_scale: 1.00f, + tiles_rotate: 0.00f, + tiles_random_rotation: 0.00f, + tiles_scale: 1.00f, + tiles_random_scale: 0.00f, + glazing_varying_thickness_weight: 0.00f, + glazing_orangepeel_size: 0.05f, + glazing_orangepeel_noise_levels: 4, + grout_roughness: 0.8f, + grout_softness: 0.1f, + grout_bump_strength: 1.0f, + ao_amount: 0.5f, + uv_space_index: 0 + ); + + +export material Ceramic_Tiles_Offset_Diamond_Black_Matte(*) +[[ + ::anno::description("Glazed ceramic tiles material with tweakable tile color, grout and glazing."), + ::anno::in_group("Tiles"), + ::anno::display_name("Glazed Offset Diamond Tiles - Black Matte"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Black_Matte.png"), + ::anno::key_words(string[]("tiles", "tiled", "ceramic", "glazed", "bathroom", "sanitary", "kitchen", "floor", "wall", "interior", "exterior", "architecture", "diamond", "new", "matte", "black", "dark", "neutral")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] = Ceramic_Tiles_Glazed_Diamond_Offset( + tiles_random_seed: 0, + tiles_color_1: color(0.012983f, 0.012983f, 0.012983f), + tiles_color_2: color(0.012983f, 0.012983f, 0.012983f), + tiles_color_3: color(0.009721f, 0.009721f, 0.009721f), + tiles_color_diamond: color(0.73f, 0.68f, 0.567f), + tiles_diamond_texture_amount: 0.2f, + tiles_random_brightness: 0.015f, + tiles_roughness: 0.32f, + tiles_roughness_range: 0.38f, + tiles_random_slope_orientation: 0.20f, + glazing_orange_peel_bump: 0.03f, + glazing_edgefade_weight: 0.00f, + glazing_edgefade_randomness: 0.00f, + glazing_craquelure_weight: 0.00f, + drops_amount: 0.15f, + grout_brightness: 0.70f, + grout_height: 0.05f, + grout_scale: 0.52f, + tiles_bump_strength: 1.00f, + dirt_color: color(0.0582f, 0.037f, 0.0265f), + dirt_weight: 0.0f, + texture_translate: 0.0f, + texture_rotate: 0.00f, + texture_scale: 1.00f, + tiles_rotate: 0.00f, + tiles_random_rotation: 0.00f, + tiles_scale: 1.00f, + tiles_random_scale: 0.00f, + glazing_varying_thickness_weight: 0.00f, + glazing_orangepeel_size: 0.05f, + glazing_orangepeel_noise_levels: 4, + grout_roughness: 0.8f, + grout_softness: 0.1f, + grout_bump_strength: 1.0f, + ao_amount: 0.5f, + uv_space_index: 0 +); + + + + +export material Ceramic_Tiles_Offset_Diamond_Graphite(*) +[[ + ::anno::description("Glazed ceramic tiles material with tweakable tile color, grout and glazing."), + ::anno::in_group("Tiles"), + ::anno::display_name("Glazed Offset Diamond Tiles - Graphite"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Graphite.png"), + ::anno::key_words(string[]("tiles", "tiled", "ceramic", "glazed", "bathroom", "sanitary", "kitchen", "floor", "wall", "interior", "exterior", "architecture", "diamond", "new", "shiny", "gray", "graphite", "neutral")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] = Ceramic_Tiles_Glazed_Diamond_Offset( + tiles_random_seed: 0, + tiles_color_1: color(0.187821f, 0.187821f, 0.162029f), + tiles_color_2: color(0.187821f, 0.187821f, 0.162029f), + tiles_color_3: color(0.187821f, 0.187821f, 0.187821f), + tiles_color_diamond: color(0.723f, 0.715f, 0.673f), + tiles_diamond_texture_amount: 0.2f, + tiles_random_brightness: 0.1f, + tiles_roughness: 0.039f, + tiles_roughness_range: 0.008f, + tiles_random_slope_orientation: 0.15f, + glazing_orange_peel_bump: 0.03f, + glazing_edgefade_weight: 0.00f, + glazing_edgefade_randomness: 0.00f, + glazing_craquelure_weight: 0.00f, + drops_amount: 0.14f, + grout_brightness: 0.70f, + grout_height: 0.05f, + grout_scale: 0.52f, + tiles_bump_strength: 1.00f, + dirt_color: color(0.0582f, 0.037f, 0.0265f), + dirt_weight: 0.0f, + texture_translate: 0.0f, + texture_rotate: 0.00f, + texture_scale: 1.00f, + tiles_rotate: 0.00f, + tiles_random_rotation: 0.00f, + tiles_scale: 1.00f, + tiles_random_scale: 0.00f, + glazing_varying_thickness_weight: 0.00f, + glazing_orangepeel_size: 0.05f, + glazing_orangepeel_noise_levels: 4, + grout_roughness: 0.8f, + grout_softness: 0.1f, + grout_bump_strength: 1.0f, + ao_amount: 1.0f, + uv_space_index: 0 +); + + +export material Ceramic_Tiles_Offset_Diamond_Graphite_Varied(*) +[[ + ::anno::description("Glazed ceramic tiles material with tweakable tile color, grout and glazing."), + ::anno::in_group("Tiles"), + ::anno::display_name("Glazed Offset Diamond Tiles - Graphite Varied"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Graphite_Varied.png"), + ::anno::key_words(string[]("tiles", "tiled", "ceramic", "glazed", "bathroom", "sanitary", "kitchen", "floor", "wall", "interior", "exterior", "architecture", "diamond", "new", "shiny", "gray", "graphite", "neutral", "random")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] = Ceramic_Tiles_Glazed_Diamond_Offset( + tiles_random_seed: 0, + tiles_color_1: color(0.187821f, 0.187821f, 0.162029f), + tiles_color_2: color(0.187821f, 0.187821f, 0.162029f), + tiles_color_3: color(0.187821f, 0.187821f, 0.187821f), + tiles_color_diamond: color(0.036889f, 0.035601f, 0.023153f), + tiles_diamond_texture_amount: 0.2f, + tiles_random_brightness: 0.78f, + tiles_roughness: 0.039f, + tiles_roughness_range: 0.008f, + tiles_random_slope_orientation: 0.15f, + glazing_orange_peel_bump: 0.03f, + glazing_edgefade_weight: 0.00f, + glazing_edgefade_randomness: 0.00f, + glazing_craquelure_weight: 0.00f, + drops_amount: 0.09f, + grout_brightness: 0.70f, + grout_height: 0.05f, + grout_scale: 0.52f, + tiles_bump_strength: 1.00f, + dirt_color: color(0.0582f, 0.037f, 0.0265f), + dirt_weight: 0.0f, + texture_translate: 0.0f, + texture_rotate: 0.00f, + texture_scale: 1.00f, + tiles_rotate: 0.00f, + tiles_random_rotation: 0.00f, + tiles_scale: 1.00f, + tiles_random_scale: 0.00f, + glazing_varying_thickness_weight: 0.00f, + glazing_orangepeel_size: 0.05f, + glazing_orangepeel_noise_levels: 4, + grout_roughness: 0.8f, + grout_softness: 0.1f, + grout_bump_strength: 1.0f, + ao_amount: 1.0f, + uv_space_index: 0 +); + + +export material Ceramic_Tiles_Offset_Diamond_Graphite_Matte(*) +[[ + ::anno::description("Glazed ceramic tiles material with tweakable tile color, grout and glazing."), + ::anno::in_group("Tiles"), + ::anno::display_name("Glazed Offset Diamond Tiles - Graphite Matte"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Graphite_Matte.png"), + ::anno::key_words(string[]("tiles", "tiled", "ceramic", "glazed", "bathroom", "sanitary", "kitchen", "floor", "wall", "interior", "exterior", "architecture", "diamond", "new", "matte", "gray", "graphite", "neutral")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] = Ceramic_Tiles_Glazed_Diamond_Offset( + tiles_random_seed: 0, + tiles_color_1: color(0.187821f, 0.187821f, 0.162029f), + tiles_color_2: color(0.187821f, 0.187821f, 0.162029f), + tiles_color_3: color(0.187821f, 0.187821f, 0.187821f), + tiles_color_diamond: color(0.723f, 0.715f, 0.673f), + tiles_diamond_texture_amount: 0.2f, + tiles_random_brightness: 0.1f, + tiles_roughness: 0.32f, + tiles_roughness_range: 0.1f, + tiles_random_slope_orientation: 0.15f, + glazing_orange_peel_bump: 0.03f, + glazing_edgefade_weight: 0.00f, + glazing_edgefade_randomness: 0.00f, + glazing_craquelure_weight: 0.00f, + drops_amount: 0.14f, + grout_brightness: 0.70f, + grout_height: 0.05f, + grout_scale: 0.52f, + tiles_bump_strength: 1.00f, + dirt_color: color(0.0582f, 0.037f, 0.0265f), + dirt_weight: 0.0f, + texture_translate: 0.0f, + texture_rotate: 0.00f, + texture_scale: 1.00f, + tiles_rotate: 0.00f, + tiles_random_rotation: 0.00f, + tiles_scale: 1.00f, + tiles_random_scale: 0.00f, + glazing_varying_thickness_weight: 0.00f, + glazing_orangepeel_size: 0.05f, + glazing_orangepeel_noise_levels: 4, + grout_roughness: 0.8f, + grout_softness: 0.1f, + grout_bump_strength: 1.0f, + ao_amount: 1.0f, + uv_space_index: 0 +); + +export material Ceramic_Tiles_Offset_Diamond_Green(*) +[[ + ::anno::description("Glazed ceramic tiles material with tweakable tile color, grout and glazing."), + ::anno::in_group("Tiles"), + ::anno::display_name("Glazed Offset Diamond Tiles - Green"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Green.png"), + ::anno::key_words(string[]("tiles", "tiled", "ceramic", "glazed", "bathroom", "sanitary", "kitchen", "floor", "wall", "interior", "exterior", "architecture", "diamond", "new", "green", "saturated")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] = Ceramic_Tiles_Glazed_Diamond_Offset( + tiles_random_seed: 0, + tiles_color_1: color(0.099899f, 0.246201f, 0.008568f), + tiles_color_2: color(0.155926f, 0.242281f, 0.049707f), + tiles_color_3: color(0.012286f, 0.084376f, 0.033105f), + tiles_color_diamond: color(0.73f, 0.673f, 0.243f), + tiles_diamond_texture_amount: 0.2f, + tiles_random_brightness: 0.12f, + tiles_roughness: 0.039f, + tiles_roughness_range: 0.003f, + tiles_random_slope_orientation: 0.2f, + glazing_orange_peel_bump: 0.11f, + glazing_edgefade_weight: 0.07f, + glazing_edgefade_randomness: 0.71f, + glazing_craquelure_weight: 1.00f, + drops_amount: 0.00f, + grout_brightness: 0.48f, + grout_height: 0.05f, + grout_scale: 0.52f, + tiles_bump_strength: 1.00f, + dirt_color: color(0.0582f, 0.037f, 0.0265f), + dirt_weight: 0.0f, + texture_translate: 0.0f, + texture_rotate: 0.00f, + texture_scale: 1.00f, + tiles_rotate: 0.00f, + tiles_random_rotation: 0.00f, + tiles_scale: 1.00f, + tiles_random_scale: 0.00f, + glazing_varying_thickness_weight: 0.00f, + glazing_orangepeel_size: 0.05f, + glazing_orangepeel_noise_levels: 4, + grout_roughness: 0.8f, + grout_softness: 0.1f, + grout_bump_strength: 1.0f, + ao_amount: 0.85f, + uv_space_index: 0 +); + +export material Ceramic_Tiles_Offset_Diamond_Green_Matte(*) +[[ + ::anno::description("Glazed ceramic tiles material with tweakable tile color, grout and glazing."), + ::anno::in_group("Tiles"), + ::anno::display_name("Glazed Offset Diamond Tiles - Green Matte"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Green_Matte.png"), + ::anno::key_words(string[]("tiles", "tiled", "ceramic", "glazed", "bathroom", "sanitary", "kitchen", "floor", "wall", "interior", "exterior", "architecture", "diamond", "round", "matte", "green", "saturated")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] = Ceramic_Tiles_Glazed_Diamond_Offset( + tiles_random_seed: 0, + tiles_color_1: color(0.099899f, 0.246201f, 0.008568f), + tiles_color_2: color(0.155926f, 0.242281f, 0.049707f), + tiles_color_3: color(0.012286f, 0.084376f, 0.033105f), + tiles_color_diamond: color(0.701f, 0.73f, 0.612f), + tiles_diamond_texture_amount: 0.2f, + tiles_random_brightness: 0.12f, + tiles_roughness: 0.37f, + tiles_roughness_range: 0.11f, + tiles_random_slope_orientation: 0.2f, + glazing_orange_peel_bump: 0.11f, + glazing_edgefade_weight: 0.07f, + glazing_edgefade_randomness: 0.71f, + glazing_craquelure_weight: 1.00f, + drops_amount: 0.00f, + grout_brightness: 0.48f, + grout_height: 0.05f, + grout_scale: 0.52f, + tiles_bump_strength: 1.00f, + dirt_color: color(0.0582f, 0.037f, 0.0265f), + dirt_weight: 0.0f, + texture_translate: 0.0f, + texture_rotate: 0.00f, + texture_scale: 1.00f, + tiles_rotate: 0.00f, + tiles_random_rotation: 0.00f, + tiles_scale: 1.00f, + tiles_random_scale: 0.00f, + glazing_varying_thickness_weight: 0.00f, + glazing_orangepeel_size: 0.05f, + glazing_orangepeel_noise_levels: 4, + grout_roughness: 0.8f, + grout_softness: 0.1f, + grout_bump_strength: 1.0f, + ao_amount: 0.85f, + uv_space_index: 0 +); + + +export material Ceramic_Tiles_Offset_Diamond_Green_Varied(*) +[[ + ::anno::description("Glazed ceramic tiles material with tweakable tile color, grout and glazing."), + ::anno::in_group("Tiles"), + ::anno::display_name("Glazed Offset Diamond Tiles - Dark Green Varied"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Green_Varied.png"), + ::anno::key_words(string[]("tiles", "tiled", "ceramic", "glazed", "bathroom", "sanitary", "kitchen", "floor", "wall", "interior", "exterior", "architecture", "diamond", "new", "matte", "green", "dark", "saturated", "random")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] = Ceramic_Tiles_Glazed_Diamond_Offset( + tiles_random_seed: 1, + tiles_color_1: color(0.099899f, 0.246201f, 0.008568f), + tiles_color_2: color(0.155926f, 0.242281f, 0.049707f), + tiles_color_3: color(0.012286f, 0.084376f, 0.033105f), + tiles_color_diamond: color(0.73f, 0.673f, 0.243f), + tiles_diamond_texture_amount: 0.2f, + tiles_random_brightness: 0.79f, + tiles_roughness: 0.039f, + tiles_roughness_range: 0.003f, + tiles_random_slope_orientation: 0.2f, + glazing_orange_peel_bump: 0.11f, + glazing_edgefade_weight: 0.07f, + glazing_edgefade_randomness: 0.71f, + glazing_craquelure_weight: 1.00f, + drops_amount: 0.00f, + grout_brightness: 0.48f, + grout_height: 0.05f, + grout_scale: 0.52f, + tiles_bump_strength: 1.00f, + dirt_color: color(0.0582f, 0.037f, 0.0265f), + dirt_weight: 0.0f, + texture_translate: 0.0f, + texture_rotate: 0.00f, + texture_scale: 1.00f, + tiles_rotate: 0.00f, + tiles_random_rotation: 0.00f, + tiles_scale: 1.00f, + tiles_random_scale: 0.00f, + glazing_varying_thickness_weight: 0.00f, + glazing_orangepeel_size: 0.05f, + glazing_orangepeel_noise_levels: 4, + grout_roughness: 0.8f, + grout_softness: 0.1f, + grout_bump_strength: 1.0f, + ao_amount: 0.85f, + uv_space_index: 0 +); + + +export material Ceramic_Tiles_Offset_Diamond_Vintage_Green_Bathroom(*) +[[ + ::anno::description("Glazed ceramic tiles material with tweakable tile color, grout and glazing."), + ::anno::in_group("Tiles"), + ::anno::display_name("Glazed Offset Diamond Tiles - Vintage Green"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Vintage_Green_Bathroom.png"), + ::anno::key_words(string[]("tiles", "tiled", "ceramic", "glazed", "bathroom", "sanitary", "kitchen", "floor", "wall", "interior", "exterior", "architecture", "diamond", "round", "antique", "old", "matte", "green", "multicolor", "random")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] = Ceramic_Tiles_Glazed_Diamond_Offset( + tiles_random_seed: 9, + tiles_color_1: color(0.012286f, 0.361307f, 0.130136f), + tiles_color_2: color(0.488f, 0.431f, 0.0478f), + tiles_color_3: color(0.003347f, 0.034340f, 0.003035f), + tiles_color_diamond: color(0.036889f, 0.035601f, 0.023153f), + tiles_diamond_texture_amount: 0.2f, + tiles_random_brightness: 0.63f, + tiles_roughness: 0.1f, + tiles_roughness_range: 0.21f, + tiles_random_slope_orientation: 0.3f, + glazing_orange_peel_bump: 0.09f, + glazing_edgefade_weight: 0.29f, + glazing_edgefade_randomness: 0.00f, + glazing_craquelure_weight: 0.00f, + drops_amount: 0.6f, + grout_brightness: 0.70f, + grout_height: 0.05f, + tiles_bump_strength: 1.00f, + dirt_color: color(0.0582f, 0.037f, 0.0265f), + dirt_weight: 0.0f, + texture_translate: 0.0f, + texture_rotate: 0.00f, + texture_scale: 1.00f, + tiles_rotate: 0.00f, + tiles_random_rotation: 0.00f, + tiles_scale: 1.00f, + tiles_random_scale: 0.00f, + glazing_varying_thickness_weight: 0.00f, + glazing_orangepeel_size: 0.05f, + glazing_orangepeel_noise_levels: 4, + grout_roughness: 0.8f, + grout_softness: 0.1f, + grout_bump_strength: 1.0f, + ao_amount: 0.5f, + uv_space_index: 0 + ); + + +export material Ceramic_Tiles_Offset_Diamond_Mint(*) +[[ + ::anno::description("Glazed ceramic tiles material with tweakable tile color, grout and glazing."), + ::anno::in_group("Tiles"), + ::anno::display_name("Glazed Offset Diamond Tiles - Mint Green"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Mint.png"), + ::anno::key_words(string[]("tiles", "tiled", "ceramic", "glazed", "bathroom", "sanitary", "kitchen", "floor", "wall", "interior", "exterior", "architecture", "diamond", "new", "shiny", "mint", "green", "light")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] = Ceramic_Tiles_Glazed_Diamond_Offset( + tiles_random_seed: 0, + tiles_color_1: color(0.208637f, 0.309469f, 0.130136f), + tiles_color_2: color(0.205079f, 0.304987f, 0.130136f), + tiles_color_3: color(0.201556f, 0.300544f, 0.124772f), + tiles_color_diamond: color(0.036889f, 0.035601f, 0.023153f), + tiles_diamond_texture_amount: 0.2f, + tiles_random_brightness: 0.04f, + tiles_roughness: 0.039f, + tiles_roughness_range: 0.008f, + tiles_random_slope_orientation: 0.2f, + glazing_orange_peel_bump: 0.05f, + glazing_edgefade_weight: 0.00f, + glazing_edgefade_randomness: 0.00f, + glazing_craquelure_weight: 0.00f, + drops_amount: 0.00f, + grout_brightness: 0.70f, + grout_height: 0.05f, + grout_scale: 0.52f, + tiles_bump_strength: 1.00f, + dirt_color: color(0.0582f, 0.037f, 0.0265f), + dirt_weight: 0.0f, + texture_translate: 0.0f, + texture_rotate: 0.00f, + texture_scale: 1.00f, + tiles_rotate: 0.00f, + tiles_random_rotation: 360.00f, + tiles_scale: 1.00f, + tiles_random_scale: 0.00f, + glazing_varying_thickness_weight: 0.00f, + glazing_orangepeel_size: 0.05f, + glazing_orangepeel_noise_levels: 4, + grout_roughness: 0.8f, + grout_softness: 0.1f, + grout_bump_strength: 1.0f, + ao_amount: 0.85f, + uv_space_index: 0 +); + + +export material Ceramic_Tiles_Offset_Diamond_Mint_Varied(*) +[[ + ::anno::description("Glazed ceramic tiles material with tweakable tile color, grout and glazing."), + ::anno::in_group("Tiles"), + ::anno::display_name("Glazed Offset Diamond Tiles - Mint Green Varied"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Mint_Varied.png"), + ::anno::key_words(string[]("tiles", "tiled", "ceramic", "glazed", "bathroom", "sanitary", "kitchen", "floor", "wall", "interior", "exterior", "architecture", "diamond", "new", "shiny", "mint", "green", "random")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] = Ceramic_Tiles_Glazed_Diamond_Offset( + tiles_random_seed: 0, + tiles_color_1: color(0.208637f, 0.309469f, 0.130136f), + tiles_color_2: color(0.205079f, 0.304987f, 0.130136f), + tiles_color_3: color(0.201556f, 0.300544f, 0.124772f), + tiles_color_diamond: color(0.036889f, 0.035601f, 0.023153f), + tiles_diamond_texture_amount: 0.2f, + tiles_random_brightness: 0.48f, + tiles_roughness: 0.039f, + tiles_roughness_range: 0.008f, + tiles_random_slope_orientation: 0.2f, + glazing_orange_peel_bump: 0.05f, + glazing_edgefade_weight: 0.00f, + glazing_edgefade_randomness: 0.00f, + glazing_craquelure_weight: 0.00f, + drops_amount: 0.00f, + grout_brightness: 0.70f, + grout_height: 0.05f, + grout_scale: 0.52f, + tiles_bump_strength: 1.00f, + dirt_color: color(0.0582f, 0.037f, 0.0265f), + dirt_weight: 0.0f, + texture_translate: 0.0f, + texture_rotate: 0.00f, + texture_scale: 1.00f, + tiles_rotate: 0.00f, + tiles_random_rotation: 360.00f, + tiles_scale: 1.00f, + tiles_random_scale: 0.00f, + glazing_varying_thickness_weight: 0.00f, + glazing_orangepeel_size: 0.05f, + glazing_orangepeel_noise_levels: 4, + grout_roughness: 0.8f, + grout_softness: 0.1f, + grout_bump_strength: 1.0f, + ao_amount: 0.85f, + uv_space_index: 0 +); + + +export material Ceramic_Tiles_Offset_Diamond_Lime_Green(*) +[[ + ::anno::description("Glazed ceramic tiles material with tweakable tile color, grout and glazing."), + ::anno::in_group("Tiles"), + ::anno::display_name("Glazed Offset Diamond Tiles - Lime Green"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Lime_Green.png"), + ::anno::key_words(string[]("tiles", "tiled", "ceramic", "glazed", "bathroom", "sanitary", "kitchen", "floor", "wall", "interior", "exterior", "architecture", "diamond", "new", "shiny", "lime", "green", "light")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] = Ceramic_Tiles_Glazed_Diamond_Offset( + tiles_random_seed: 0, + tiles_color_1: color(0.313989f, 0.361307f, 0.027321f), + tiles_color_2: color(0.309469f, 0.356400f, 0.027321f), + tiles_color_3: color(0.304987f, 0.351533f, 0.027321f), + tiles_color_diamond: color(0.0415f, 0.0892f, 0.0265f), + tiles_diamond_texture_amount: 0.2f, + tiles_random_brightness: 0.03f, + tiles_roughness: 0.039f, + tiles_roughness_range: 0.008f, + tiles_random_slope_orientation: 0.2f, + glazing_orange_peel_bump: 0.04f, + glazing_edgefade_weight: 0.12f, + glazing_edgefade_randomness: 0.37f, + glazing_craquelure_weight: 0.32f, + drops_amount: 0.22f, + grout_brightness: 0.70f, + grout_height: 0.05f, + grout_scale: 0.52f, + tiles_bump_strength: 1.00f, + dirt_color: color(0.0582f, 0.037f, 0.0265f), + dirt_weight: 0.0f, + texture_translate: 0.0f, + texture_rotate: 0.00f, + texture_scale: 1.00f, + tiles_rotate: 0.00f, + tiles_random_rotation: 360.00f, + tiles_scale: 1.00f, + tiles_random_scale: 0.00f, + glazing_varying_thickness_weight: 0.00f, + glazing_orangepeel_size: 0.05f, + glazing_orangepeel_noise_levels: 4, + grout_roughness: 0.8f, + grout_softness: 0.1f, + grout_bump_strength: 1.0f, + ao_amount: 0.85f, + uv_space_index: 0 +); + + +export material Ceramic_Tiles_Offset_Diamond_Lime_Green_Varied(*) +[[ + ::anno::description("Glazed ceramic tiles material with tweakable tile color, grout and glazing."), + ::anno::in_group("Tiles"), + ::anno::display_name("Glazed Offset Diamond Tiles - Lime Green Varied"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Lime_Green_Varied.png"), + ::anno::key_words(string[]("tiles", "tiled", "ceramic", "glazed", "bathroom", "sanitary", "kitchen", "floor", "wall", "interior", "exterior", "architecture", "diamond", "new", "shiny", "lime", "green", "light", "random")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] = Ceramic_Tiles_Glazed_Diamond_Offset( + tiles_random_seed: 0, + tiles_color_1: color(0.309469f, 0.361307f, 0.015996f), + tiles_color_2: color(0.304987f, 0.356400f, 0.016807f), + tiles_color_3: color(0.300544f, 0.351533f, 0.017642f), + tiles_color_diamond: color(0.0415f, 0.0892f, 0.0265f), + tiles_diamond_texture_amount: 0.2f, + tiles_random_brightness: 0.56f, + tiles_roughness: 0.039f, + tiles_roughness_range: 0.008f, + tiles_random_slope_orientation: 0.2f, + glazing_orange_peel_bump: 0.04f, + glazing_edgefade_weight: 0.12f, + glazing_edgefade_randomness: 0.37f, + glazing_craquelure_weight: 0.32f, + drops_amount: 0.22f, + grout_brightness: 0.70f, + grout_height: 0.05f, + grout_scale: 0.52f, + tiles_bump_strength: 1.00f, + dirt_color: color(0.0582f, 0.037f, 0.0265f), + dirt_weight: 0.0f, + texture_translate: 0.0f, + texture_rotate: 0.00f, + texture_scale: 1.00f, + tiles_rotate: 0.00f, + tiles_random_rotation: 360.00f, + tiles_scale: 1.00f, + tiles_random_scale: 0.00f, + glazing_varying_thickness_weight: 0.00f, + glazing_orangepeel_size: 0.05f, + glazing_orangepeel_noise_levels: 4, + grout_roughness: 0.8f, + grout_softness: 0.1f, + grout_bump_strength: 1.0f, + ao_amount: 0.85f, + uv_space_index: 0 +); + + +export material Ceramic_Tiles_Offset_Diamond_Yellow(*) +[[ + ::anno::description("Glazed ceramic tiles material with tweakable tile color, grout and glazing."), + ::anno::in_group("Tiles"), + ::anno::display_name("Glazed Offset Diamond Tiles - Yellow"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Yellow.png"), + ::anno::key_words(string[]("tiles", "tiled", "ceramic", "glazed", "bathroom", "sanitary", "kitchen", "floor", "wall", "interior", "exterior", "architecture", "diamond", "new", "shiny", "yellow", "warm", "saturated", "light")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] = Ceramic_Tiles_Glazed_Diamond_Offset( + tiles_random_seed: 0, + tiles_color_1: color(0.590619f, 0.371238f, 0.033105f), + tiles_color_2: color(0.584078f, 0.366253f, 0.033105f), + tiles_color_3: color(0.577580f, 0.361307f, 0.033105f), + tiles_color_diamond: color(0.0824f, 0.0781f, 0.0697f), + tiles_diamond_texture_amount: 0.2f, + tiles_random_brightness: 0.02f, + tiles_roughness: 0.039f, + tiles_roughness_range: 0.008f, + tiles_random_slope_orientation: 0.2f, + glazing_orange_peel_bump: 0.03f, + glazing_edgefade_weight: 0.11f, + glazing_edgefade_randomness: 0.48f, + glazing_craquelure_weight: 0.42f, + drops_amount: 0.20f, + grout_brightness: 0.70f, + grout_height: 0.05f, + grout_scale: 0.52f, + tiles_bump_strength: 1.00f, + dirt_color: color(0.0582f, 0.037f, 0.0265f), + dirt_weight: 0.0f, + texture_translate: 0.0f, + texture_rotate: 0.00f, + texture_scale: 1.00f, + tiles_rotate: 0.00f, + tiles_random_rotation: 360.00f, + tiles_scale: 1.00f, + tiles_random_scale: 0.00f, + glazing_varying_thickness_weight: 0.00f, + glazing_orangepeel_size: 0.05f, + glazing_orangepeel_noise_levels: 4, + grout_roughness: 0.8f, + grout_softness: 0.1f, + grout_bump_strength: 1.0f, + ao_amount: 0.85f, + uv_space_index: 0 +); + + +export material Ceramic_Tiles_Offset_Diamond_Yellow_Varied(*) +[[ + ::anno::description("Glazed ceramic tiles material with tweakable tile color, grout and glazing."), + ::anno::in_group("Tiles"), + ::anno::display_name("Glazed Offset Diamond Tiles - Yellow Varied"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Yellow_Varied.png"), + ::anno::key_words(string[]("tiles", "tiled", "ceramic", "glazed", "bathroom", "sanitary", "kitchen", "floor", "wall", "interior", "exterior", "architecture", "diamond", "new", "shiny", "yellow", "warm", "saturated", "light", "random")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] = Ceramic_Tiles_Glazed_Diamond_Offset( + tiles_random_seed: 0, + tiles_color_1: color(0.590619f, 0.361307f, 0.023153f), + tiles_color_2: color(0.584078f, 0.356400f, 0.023153f), + tiles_color_3: color(0.577580f, 0.351533f, 0.024158f), + tiles_color_diamond: color(0.0824f, 0.0781f, 0.0697f), + tiles_diamond_texture_amount: 0.2f, + tiles_random_brightness: 0.49f, + tiles_roughness: 0.039f, + tiles_roughness_range: 0.008f, + tiles_random_slope_orientation: 0.2f, + glazing_orange_peel_bump: 0.03f, + glazing_edgefade_weight: 0.11f, + glazing_edgefade_randomness: 0.48f, + glazing_craquelure_weight: 0.42f, + drops_amount: 0.20f, + grout_brightness: 0.70f, + grout_height: 0.05f, + grout_scale: 0.52f, + tiles_bump_strength: 1.00f, + dirt_color: color(0.0582f, 0.037f, 0.0265f), + dirt_weight: 0.0f, + texture_translate: 0.0f, + texture_rotate: 0.00f, + texture_scale: 1.00f, + tiles_rotate: 0.00f, + tiles_random_rotation: 360.00f, + tiles_scale: 1.00f, + tiles_random_scale: 0.00f, + glazing_varying_thickness_weight: 0.00f, + glazing_orangepeel_size: 0.05f, + glazing_orangepeel_noise_levels: 4, + grout_roughness: 0.8f, + grout_softness: 0.1f, + grout_bump_strength: 1.0f, + ao_amount: 0.85f, + uv_space_index: 0 +); + + + + +export material Ceramic_Tiles_Offset_Diamond_Petrol(*) +[[ + ::anno::description("Glazed ceramic tiles material with tweakable tile color, grout and glazing."), + ::anno::in_group("Tiles"), + ::anno::display_name("Glazed Offset Diamond Tiles - Petrol"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Petrol.png"), + ::anno::key_words(string[]("tiles", "tiled", "ceramic", "glazed", "bathroom", "sanitary", "kitchen", "floor", "wall", "interior", "exterior", "architecture", "diamond", "new", "shiny", "petrol", "cool")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] = Ceramic_Tiles_Glazed_Diamond_Offset( + tiles_random_seed: 13, + tiles_color_1: color(0.029557f, 0.107023f, 0.135633f), + tiles_color_2: color(0.029557f, 0.104616f, 0.132868f), + tiles_color_3: color(0.028426f, 0.102242f, 0.130136f), + tiles_color_diamond: color(0.272f, 0.415f, 0.415f), + tiles_diamond_texture_amount: 0.2f, + tiles_random_brightness: 0.03f, + tiles_roughness: 0.039f, + tiles_roughness_range: 0.008f, + tiles_random_slope_orientation: 0.2f, + glazing_orange_peel_bump: 0.04f, + glazing_edgefade_weight: 0.1f, + glazing_edgefade_randomness: 0.46f, + glazing_craquelure_weight: 0.00f, + drops_amount: 0.00f, + grout_brightness: 0.70f, + grout_height: 0.05f, + grout_scale: 0.52f, + tiles_bump_strength: 1.00f, + dirt_color: color(0.0582f, 0.037f, 0.0265f), + dirt_weight: 0.0f, + texture_translate: 0.0f, + texture_rotate: 0.00f, + texture_scale: 1.00f, + tiles_rotate: 0.00f, + tiles_random_rotation: 360.00f, + tiles_scale: 1.00f, + tiles_random_scale: 0.25f, + glazing_varying_thickness_weight: 0.00f, + glazing_orangepeel_size: 0.05f, + glazing_orangepeel_noise_levels: 4, + grout_roughness: 0.8f, + grout_softness: 0.1f, + grout_bump_strength: 1.0f, + ao_amount: 0.85f, + uv_space_index: 0 +); + + + +export material Ceramic_Tiles_Offset_Diamond_Petrol_Varied(*) +[[ + ::anno::description("Glazed ceramic tiles material with tweakable tile color, grout and glazing."), + ::anno::in_group("Tiles"), + ::anno::display_name("Glazed Offset Diamond Tiles - Petrol Varied"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Petrol_Varied.png"), + ::anno::key_words(string[]("tiles", "tiled", "ceramic", "glazed", "bathroom", "sanitary", "kitchen", "floor", "wall", "interior", "exterior", "architecture", "diamond", "new", "shiny", "petrol", "cool", "random")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] = Ceramic_Tiles_Glazed_Diamond_Offset( + tiles_random_seed: 14, + tiles_color_1: color(0.029557f, 0.107023f, 0.135633f), + tiles_color_2: color(0.029557f, 0.104616f, 0.132868f), + tiles_color_3: color(0.028426f, 0.102242f, 0.130136f), + tiles_color_diamond: color(0.272f, 0.415f, 0.415f), + tiles_diamond_texture_amount: 0.2f, + tiles_random_brightness: 0.6f, + tiles_roughness: 0.039f, + tiles_roughness_range: 0.008f, + tiles_random_slope_orientation: 0.2f, + glazing_orange_peel_bump: 0.04f, + glazing_edgefade_weight: 0.1f, + glazing_edgefade_randomness: 0.46f, + glazing_craquelure_weight: 0.00f, + drops_amount: 0.00f, + grout_brightness: 0.70f, + grout_height: 0.05f, + grout_scale: 0.52f, + tiles_bump_strength: 1.00f, + dirt_color: color(0.0582f, 0.037f, 0.0265f), + dirt_weight: 0.0f, + texture_translate: 0.0f, + texture_rotate: 0.00f, + texture_scale: 1.00f, + tiles_rotate: 0.00f, + tiles_random_rotation: 360.00f, + tiles_scale: 1.00f, + tiles_random_scale: 0.25f, + glazing_varying_thickness_weight: 0.00f, + glazing_orangepeel_size: 0.05f, + glazing_orangepeel_noise_levels: 4, + grout_roughness: 0.8f, + grout_softness: 0.1f, + grout_bump_strength: 1.0f, + ao_amount: 0.85f, + uv_space_index: 0 +); + +export material Ceramic_Tiles_Offset_Diamond_Sky(*) +[[ + ::anno::description("Glazed ceramic tiles material with tweakable tile color, grout and glazing."), + ::anno::in_group("Tiles"), + ::anno::display_name("Glazed Offset Diamond Tiles - Sky"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Sky.png"), + ::anno::key_words(string[]("tiles", "tiled", "ceramic", "glazed", "bathroom", "sanitary", "kitchen", "floor", "wall", "interior", "exterior", "architecture", "diamond", "new", "shiny", "blue", "sky", "cool")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] = Ceramic_Tiles_Glazed_Diamond_Offset( + tiles_random_seed: 0, + tiles_color_1: color(0.130136f, 0.644480f, 0.693872f), + tiles_color_2: color(0.135633f, 0.491021f, 0.644480f), + tiles_color_3: color(0.023153f, 0.135633f, 0.212231f), + tiles_color_diamond: color(0.774f, 0.759f, 0.708f), + tiles_diamond_texture_amount: 0.2f, + tiles_random_brightness: 0.03f, + tiles_roughness: 0.05f, + tiles_roughness_range: 0.02f, + tiles_random_slope_orientation: 0.23f, + glazing_orange_peel_bump: 0.15f, + glazing_edgefade_weight: 0.19f, + glazing_edgefade_randomness: 0.34f, + glazing_craquelure_weight: 0.42f, + drops_amount: 0.40f, + grout_brightness: 0.71f, + grout_height: 0.05f, + grout_scale: 0.52f, + tiles_bump_strength: 1.00f, + dirt_color: color(0.0582f, 0.037f, 0.0265f), + dirt_weight: 0.0f, + texture_translate: 0.0f, + texture_rotate: 0.00f, + texture_scale: 1.00f, + tiles_rotate: 0.00f, + tiles_random_rotation: 360.00f, + tiles_scale: 1.00f, + tiles_random_scale: 0.25f, + glazing_varying_thickness_weight: 0.00f, + glazing_orangepeel_size: 0.05f, + glazing_orangepeel_noise_levels: 4, + grout_roughness: 0.8f, + grout_softness: 0.1f, + grout_bump_strength: 1.0f, + ao_amount: 1.00f, + uv_space_index: 0 +); + + +export material Ceramic_Tiles_Offset_Diamond_Red(*) +[[ + ::anno::description("Glazed ceramic tiles material with tweakable tile color, grout and glazing."), + ::anno::in_group("Tiles"), + ::anno::display_name("Glazed Offset Diamond Tiles - Red"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Red.png"), + ::anno::key_words(string[]("tiles", "tiled", "ceramic", "glazed", "bathroom", "sanitary", "kitchen", "floor", "wall", "interior", "exterior", "architecture", "diamond", "new", "shiny", "red", "warm", "saturated")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] = Ceramic_Tiles_Glazed_Diamond_Offset( + tiles_random_seed: 0, + tiles_color_1: color(0.327778f, 0.021219f, 0.020289f), + tiles_color_2: color(0.327778f, 0.021219f, 0.017642f), + tiles_color_3: color(0.274677f, 0.018500f, 0.017642f), + tiles_color_diamond: color(0.036889f, 0.035601f, 0.023153f), + tiles_diamond_texture_amount: 0.2f, + tiles_random_brightness: 0.015f, + tiles_roughness: 0.039f, + tiles_roughness_range: 0.003f, + tiles_random_slope_orientation: 0.10f, + glazing_orange_peel_bump: 0.03f, + glazing_edgefade_weight: 0.00f, + glazing_edgefade_randomness: 0.00f, + glazing_craquelure_weight: 0.00f, + drops_amount: 0.09f, + grout_brightness: 0.09f, + grout_height: 0.05f, + grout_scale: 0.52f, + tiles_bump_strength: 1.00f, + dirt_color: color(0.0582f, 0.037f, 0.0265f), + dirt_weight: 0.0f, + texture_translate: 0.0f, + texture_rotate: 0.00f, + texture_scale: 1.00f, + tiles_rotate: 0.00f, + tiles_random_rotation: 360.00f, + tiles_scale: 1.00f, + tiles_random_scale: 0.25f, + glazing_varying_thickness_weight: 0.00f, + glazing_orangepeel_size: 0.05f, + glazing_orangepeel_noise_levels: 4, + grout_roughness: 0.8f, + grout_softness: 0.1f, + grout_bump_strength: 1.0f, + ao_amount: 0.85f, + uv_space_index: 0 +); + + +export material Ceramic_Tiles_Offset_Diamond_Red_Varied(*) +[[ + ::anno::description("Glazed ceramic tiles material with tweakable tile color, grout and glazing."), + ::anno::in_group("Tiles"), + ::anno::display_name("Glazed Offset Diamond Tiles - Red Varied"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Ceramic_Tiles_Glazed_Diamond_Offset.Ceramic_Tiles_Offset_Diamond_Red_Varied.png"), + ::anno::key_words(string[]("tiles", "tiled", "ceramic", "glazed", "bathroom", "sanitary", "kitchen", "floor", "wall", "interior", "exterior", "architecture", "diamond", "new", "shiny", "red", "warm", "saturated", "random")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] = Ceramic_Tiles_Glazed_Diamond_Offset( + tiles_random_seed: 0, + tiles_color_1: color(0.327778f, 0.021219f, 0.020289f), + tiles_color_2: color(0.327778f, 0.021219f, 0.017642f), + tiles_color_3: color(0.274677f, 0.018500f, 0.017642f), + tiles_color_diamond: color(0.036889f, 0.035601f, 0.023153f), + tiles_diamond_texture_amount: 0.2f, + tiles_random_brightness: 0.6f, + tiles_roughness: 0.039f, + tiles_roughness_range: 0.003f, + tiles_random_slope_orientation: 0.2f, + glazing_orange_peel_bump: 0.03f, + glazing_edgefade_weight: 0.00f, + glazing_edgefade_randomness: 0.00f, + glazing_craquelure_weight: 0.00f, + drops_amount: 0.19f, + grout_brightness: 0.09f, + grout_height: 0.05f, + grout_scale: 0.52f, + tiles_bump_strength: 1.00f, + dirt_color: color(0.0582f, 0.037f, 0.0265f), + dirt_weight: 0.0f, + texture_translate: 0.0f, + texture_rotate: 0.00f, + texture_scale: 1.00f, + tiles_rotate: 0.00f, + tiles_random_rotation: 360.00f, + tiles_scale: 1.00f, + tiles_random_scale: 0.25f, + glazing_varying_thickness_weight: 0.00f, + glazing_orangepeel_size: 0.05f, + glazing_orangepeel_noise_levels: 4, + grout_roughness: 0.8f, + grout_softness: 0.1f, + grout_bump_strength: 1.0f, + ao_amount: 0.85f, + uv_space_index: 0 +); + + + + + \ No newline at end of file diff --git a/Material/material_0317/Stone_Pores_Weathered.mdl b/Material/material_0317/Stone_Pores_Weathered.mdl new file mode 100644 index 0000000000000000000000000000000000000000..9e7ebd58c17b5b7b396c1d5308159977ab03ce7f --- /dev/null +++ b/Material/material_0317/Stone_Pores_Weathered.mdl @@ -0,0 +1,706 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. * + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + + +mdl 1.5; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + +const string DESCRIPTION = "A stone wall material"; + + + +float remap(float input, float low_1, float high_1, float low_2, float high_2) +{ + return low_2 + ((input - low_1) * (high_2 - low_2))/(high_1 - low_1); +} + + +float3 transform_internal_to_tangent(float3 n) +[[ + ::anno::hidden() +]] +{ + return + n.x* float3(::state::texture_tangent_u(0).x,::state::texture_tangent_v(0).x,::state::normal().x)+ + n.y* float3(::state::texture_tangent_u(0).y,::state::texture_tangent_v(0).y,::state::normal().y)+ + n.z* float3(::state::texture_tangent_u(0).z,::state::texture_tangent_v(0).z,::state::normal().z); +} + +// Returns the normal n in internal space, given n is in tangent space. +float3 transform_tangent_to_internal(float3 n) +[[ + ::anno::hidden() +]] +{ + return ::state::texture_tangent_u(0) * n.x + + ::state::texture_tangent_v(0) * n.y + + ::state::normal() * n.z ; +} +::base::texture_coordinate_info transform_coordinate_2( + float4x4 transform + [[ ::anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix.") ]], + ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info() + [[ ::anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection.") ]] +) [[ + ::anno::description("Transform a texture coordinate by a matrix.") , + ::anno::noinline() + ]] +{ + + // Version 2 + float4 r_position = transform * float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1); + //Try aproximating it for the case that the rotation is only aroud z and assuming the texture layout is nice and z is ~constant. + //just pretend there is no other rotation happening + //get rid of scaling and translation. Then extract fields where sin and cos would be in a simple 2d transform around z. + float4 u = transform[0]; + float3 ru = ::math::normalize(float3(u.x,u.y,u.z)); + float cos = ru.x; + float sin = -ru.y; + + + return ::base::texture_coordinate_info( + float3(r_position.x,r_position.y,r_position.z), + ::math::normalize(cos * coordinate.tangent_u - sin * coordinate.tangent_v), + ::math::normalize(cos * coordinate.tangent_v + sin * coordinate.tangent_u)); +} + + +::base::texture_coordinate_info vmat_transform( + float2 translation = float2(0.0, 0.0), + float rotation = 0.0, // rotation in degrees + float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation_rad); + float c = ::math::cos(rotation_rad); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return transform_coordinate_2(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + + +float3 add_detail_normal(float3 nd = ::state::normal(), float3 n = ::state::normal()) +{ + // http://blog.selfshadow.com/publications/blending-in-detail/ + float3 n_t = transform_internal_to_tangent(n); + float3 nd_t = transform_internal_to_tangent(nd); + + n_t=n_t + float3(0.,0.,1.); + nd_t = nd_t * float3(-1.,-1.,1.); + + n = n_t*::math::dot(n_t, nd_t)/n_t.z - nd_t; + return ::math::normalize(transform_tangent_to_internal(n)); +} + +float remap_xy_to_0_1(float input, float x, float y) +{ + return (input - x)/(y - x); +} + +float histogram_scan_small(float input, float width, float position) +{ + return ::math::clamp( + remap_xy_to_0_1(input, + ::math::lerp(0.0, 1.0 - width, position), + ::math::lerp(width, 1.0 , position)), + 0.0, + 1.0); +} + + + +float histogram_scan_big(float input, float width, float position) +{ + return ::math::clamp( + remap_xy_to_0_1(input, + ::math::lerp(-width, 1.0, position), + ::math::lerp(0.0, 1.0 + width, position)), + 0.0, + 1.0); +} + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + +float histogram_range(float input, float range = 1.0f, float position = 0.5f) +{ + float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); + float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); + return ::math::lerp(low, high, input); +} + + + +float2 rnd22(int2 p) { + float2 ret_val = float2( + uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f, + uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f + ); + return ret_val; +} + +float2x2 invert_2x2(float2x2 M) +{ + float det = M[0][0]*M[1][1] - M[0][1]*M[1][0]; + //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/ + return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]); +} + +color hue_shift( + color input = color(1.0, 0.0, 0.0), + float hue_adjust = 0.0f +) +{ + float3 in_color = float3(input); + float3 kRGBToYPrime = float3 (0.299, 0.587, 0.114); + float3 kRGBToI = float3 (0.596, -0.275, -0.321); + float3 kRGBToQ = float3 (0.212, -0.523, 0.311); + + + //color converted = color(kRGBToQ); + float3 kYIQToR = float3 (1.0, 0.956, 0.621); + float3 kYIQToG = float3 (1.0, -0.272, -0.647); + float3 kYIQToB = float3 (1.0, -1.107, 1.704); + + float YPrime = ::math::dot(in_color, kRGBToYPrime); + float I = ::math::dot(in_color, kRGBToI); + float Q = ::math::dot(in_color, kRGBToQ); + float hue = ::math::atan2(Q, I); + float chroma = ::math::sqrt(I * I + Q * Q); + + hue += hue_adjust; + + Q = chroma * ::math::sin(hue); + I = chroma * ::math::cos(hue); + + float3 yIQ = float3 (YPrime, I, Q); + + return color(::math::dot (yIQ, kYIQToR),::math::dot (yIQ, kYIQToG), ::math::dot (yIQ, kYIQToB) ); +} + +// Taken from https://www.shadertoy.com/view/4tlBWB +float3 hsv2rgb(float3 c) +{ + float4 K = float4(1.0, 2.0/3.0, 1.0/3.0, 3.0); + float3 p = ::math::abs(::math::frac(float3(c.x) + float3(K.x, K.y, K.z)) * 6.0 - float3(K.w)); + return c.z * ::math::lerp(float3(K.x), ::math::clamp(p - float3(K.x), 0.0, 1.0), c.y); +} + + +float3 srgb2rgb(float3 val) +{ + return ::math::pow(::math::max(val, float3(0.0f)), 2.2); +} +float3 nonrepeat_lookup( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5), + float patch_size = 8.0 +) +{ + + float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale; + float Z = patch_size; // patch scale inside example texture + float CON = 1.0f; + + float3 O = float3(0.f); + float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); + float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space + + float2 U = uv_in; + float2 V = M * uv_in; //pre-tilted hexa coordinates + int2 I = int2(::math::floor(V)); // hexa-tile id + + // The mean color needs to be determined in Photoshop then to make the + // average color work out, take the float value and calculate the apropriate + // mean value as (value^(1/2.2)) + + float3 m = average_color; + + float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; + F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates + + if( F[2] > 0.f ) + + O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON)) + + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON)) + + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON)); + else + O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON)) + + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON)) + + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON)); + O = m + O/::math::length(W); + O = ::math::clamp( (O), 0.0, 1.0); + + return float3(O); +} +color endless_texture( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 10.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0, + bool gamma_correct_lookup = true +) +{ + return gamma_correct_lookup ? color(srgb2rgb( + nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )) + ) : color(nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )); +} + + + +float3 endless_normal( + uniform texture_2d texture = texture_2d(), + float factor = 1.0, + bool flip_tangent_u = false, + bool flip_tangent_v = false, + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0 + //bool srgb2rgb = false, + //bool rgb2srgb = false +) +{ + float3 transformed_tangent_u = flip_tangent_u ? uvw.tangent_u : - uvw.tangent_u; + float3 transformed_tangent_v = flip_tangent_v ? uvw.tangent_v : - uvw.tangent_v; + + if (flip_tangent_u) + transformed_tangent_u=-transformed_tangent_u; + if (flip_tangent_v) + transformed_tangent_v=-transformed_tangent_v; + + // normalized Lookup + float3 tangent_space_normal = + (nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + ) - 0.5) * (2.0 * factor); + + + return ::math::normalize(uvw.tangent_u * tangent_space_normal.x + + uvw.tangent_v * tangent_space_normal.y + + ::state::normal()*1.0); + //return ::state::normal(); +} + +export material Stone_Pores_Weathered( + uniform bool infinite_tiling = true [[ + ::anno::description("Enables infinite tiling feature which removes repeating texture patterns. Note that depending on the material this feature changes the appearance of the material slightly.\t."), + ::anno::display_name("Infinite Tiling"), + ::anno::in_group("Appearance") + ]], + float stone_diffuse_brightness = 0.8f [[ + ::anno::description("Adjusts the lightness of the stones and pebbles."), + ::anno::display_name("Brightness"), + ::anno::in_group("Appearance", "Stone"), + ::anno::hard_range(0.f, 1.f) + ]], + float reflection_roughness = 1.f [[ + ::anno::description("Controls the roughness appearance. Smaller areas are highlighted."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance", "Stone"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float stones_bump_strength = 1.f [[ + ::anno::description("Drives the bumpiness of the stones."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance", "Stone"), + ::anno::hard_range(0.f, 1.f) + ]], + float moss_brightness = 0.6f [[ + ::anno::description("Adjusts the brightness of the moss."), + ::anno::display_name("Brightness"), + ::anno::in_group("Appearance", "Moss"), + ::anno::hard_range(0.f, 1.f) + ]], + float moss_saturation = 0.79f [[ + ::anno::description("Controls the saturation of the moss."), + ::anno::display_name("Saturation"), + ::anno::in_group("Appearance", "Moss"), + ::anno::hard_range(0.f, 1.f) + ]], + float moss_distribution_amount = 0.f [[ + ::anno::description("A lower value makes the moss grow more unevenly across the surface."), + ::anno::display_name("Coverage"), + ::anno::in_group("Appearance", "Moss"), + ::anno::hard_range(0.f, 1.f) + ]], + float moss_height_growth = 1.f [[ + ::anno::description("Controls the growth of the moss material."), + ::anno::display_name("Growth"), + ::anno::in_group("Appearance", "Moss"), + ::anno::hard_range(0.f, 1.f) + ]], + float moss_weight = 1.f [[ + ::anno::description("Decreasing this parameter makes the moss layer more transparent."), + ::anno::display_name("Weight"), + ::anno::in_group("Appearance", "Moss"), + ::anno::hard_range(0.f, 1.f) + ]], + float moss_moisture = 1.f [[ + ::anno::description("Makes mossy areas more reflectivy to give them a wet appearance."), + ::anno::display_name("Moisture"), + ::anno::in_group("Appearance", "Moss"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float moss_bump_factor = 1.f [[ + ::anno::description("Determines the degree of bumpiness of the moss."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance", "Moss"), + ::anno::hard_range(0.f, 1.f) + ]], + float2 texture_translate = 0.f [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Translate"), + ::anno::in_group("Transform") + ]], + float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Rotate"), + ::anno::in_group("Transform") + ]], + float2 texture_scale = 0.5f [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Scale"), + ::nvidia::core_definitions::dimension(float2(1.2f, 1.2f)), + ::anno::in_group("Transform") + ]], + uniform bool enable_round_corners = false [[ + ::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."), + ::anno::display_name("Enable Round Corners"), + ::anno::in_group("Round Corners") + ]], + uniform bool across_materials = true [[ + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::display_name("Across Materials"), + ::anno::in_group("Round Corners") + ]], + uniform float radius = 0.00200000009f [[ + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::display_name("Round Corner Radius"), + ::anno::in_group("Round Corners") + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Use selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced") + ]]) +[[ + ::anno::display_name("Stone Pores Weathered"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "infinite", "stone", "nature", "moss", "weathered", "pores", "wall", "exterior", "rough", "plant", "urban", "city", "industrial")), + ::anno::thumbnail("./.thumbs/Stone_Pores_Weathered.Stone_Pores_Weathered.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += + let { + bool tmp0 = false; + material_surface tmp1(::df::custom_curve_layer(0.0299999993f, 1.f, 5.f, histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./multi_stone.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.209999993f, 0.75999999f), ::df::microfacet_ggx_smith_bsdf(::math::lerp(::math::lerp(::math::lerp(-0.419999987f, 1.75f, float3(::base::file_texture(texture_2d("./multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0]), 0.75f - ::math::clamp(remap(float3(infinite_tiling ? endless_texture(texture_2d("./multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./multi_stone.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.5f, 1.f, 0.f, 1.f), 0.f, 1.f) * ::math::lerp(1.20000005f, -1.f, reflection_roughness), histogram_scan_small(float3(::base::file_texture(texture_2d("./multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.200000003f, 0.600000024f)), histogram_range(::math::lerp(1.f, 0.f, float3(::base::file_texture(texture_2d("./multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), 0.48999998f, ::math::lerp(1.f, 0.680000007f, moss_moisture)), ::math::lerp(0.f, ::math::lerp(histogram_scan_big(float3(::base::file_texture(texture_2d("./multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.379000008f, ::math::lerp(0.817000031f, 0.100000001f, moss_distribution_amount)), float3(infinite_tiling ? endless_texture(texture_2d("./multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./multi_stone.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], ::math::clamp(histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./multi_stone.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.150000006f, ::math::lerp(0.200000003f, 0.680000007f, moss_height_growth)), 0.f, 1.f)), ::math::lerp(0.f, 2.f, moss_weight))) * ::math::lerp(::math::lerp(::math::lerp(-0.419999987f, 1.75f, float3(::base::file_texture(texture_2d("./multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0]), 0.75f - ::math::clamp(remap(float3(infinite_tiling ? endless_texture(texture_2d("./multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./multi_stone.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.5f, 1.f, 0.f, 1.f), 0.f, 1.f) * ::math::lerp(1.20000005f, -1.f, reflection_roughness), histogram_scan_small(float3(::base::file_texture(texture_2d("./multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.200000003f, 0.600000024f)), histogram_range(::math::lerp(1.f, 0.f, float3(::base::file_texture(texture_2d("./multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), 0.48999998f, ::math::lerp(1.f, 0.680000007f, moss_moisture)), ::math::lerp(0.f, ::math::lerp(histogram_scan_big(float3(::base::file_texture(texture_2d("./multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.379000008f, ::math::lerp(0.817000031f, 0.100000001f, moss_distribution_amount)), float3(infinite_tiling ? endless_texture(texture_2d("./multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./multi_stone.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], ::math::clamp(histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./multi_stone.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.150000006f, ::math::lerp(0.200000003f, 0.680000007f, moss_height_growth)), 0.f, 1.f)), ::math::lerp(0.f, 2.f, moss_weight))), ::math::lerp(::math::lerp(::math::lerp(-0.419999987f, 1.75f, float3(::base::file_texture(texture_2d("./multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0]), 0.75f - ::math::clamp(remap(float3(infinite_tiling ? endless_texture(texture_2d("./multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./multi_stone.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.5f, 1.f, 0.f, 1.f), 0.f, 1.f) * ::math::lerp(1.20000005f, -1.f, reflection_roughness), histogram_scan_small(float3(::base::file_texture(texture_2d("./multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.200000003f, 0.600000024f)), histogram_range(::math::lerp(1.f, 0.f, float3(::base::file_texture(texture_2d("./multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), 0.48999998f, ::math::lerp(1.f, 0.680000007f, moss_moisture)), ::math::lerp(0.f, ::math::lerp(histogram_scan_big(float3(::base::file_texture(texture_2d("./multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.379000008f, ::math::lerp(0.817000031f, 0.100000001f, moss_distribution_amount)), float3(infinite_tiling ? endless_texture(texture_2d("./multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./multi_stone.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], ::math::clamp(histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./multi_stone.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.150000006f, ::math::lerp(0.200000003f, 0.680000007f, moss_height_growth)), 0.f, 1.f)), ::math::lerp(0.f, 2.f, moss_weight))) * ::math::lerp(::math::lerp(::math::lerp(-0.419999987f, 1.75f, float3(::base::file_texture(texture_2d("./multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0]), 0.75f - ::math::clamp(remap(float3(infinite_tiling ? endless_texture(texture_2d("./multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./multi_stone.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.5f, 1.f, 0.f, 1.f), 0.f, 1.f) * ::math::lerp(1.20000005f, -1.f, reflection_roughness), histogram_scan_small(float3(::base::file_texture(texture_2d("./multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.200000003f, 0.600000024f)), histogram_range(::math::lerp(1.f, 0.f, float3(::base::file_texture(texture_2d("./multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), 0.48999998f, ::math::lerp(1.f, 0.680000007f, moss_moisture)), ::math::lerp(0.f, ::math::lerp(histogram_scan_big(float3(::base::file_texture(texture_2d("./multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.379000008f, ::math::lerp(0.817000031f, 0.100000001f, moss_distribution_amount)), float3(infinite_tiling ? endless_texture(texture_2d("./multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./multi_stone.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], ::math::clamp(histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./multi_stone.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.150000006f, ::math::lerp(0.200000003f, 0.680000007f, moss_height_growth)), 0.f, 1.f)), ::math::lerp(0.f, 2.f, moss_weight))), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(::math::lerp(nvidia::core_definitions::blend_colors(infinite_tiling ? endless_texture(texture_2d("./stone_diff.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.49019599f, 0.466666996f, 0.435294002f), 8.f, true) : ::base::file_texture(texture_2d("./stone_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, color(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./multi_stone.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.5f, 0.200000003f)), ::base::color_layer_multiply, ::math::lerp(1.f, 0.f, stone_diffuse_brightness)).tint, hue_shift(nvidia::core_definitions::blend_colors(::base::file_texture(texture_2d("./moss_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, color(::math::pow(hsv2rgb(float3(0.2214614f, ::math::lerp(0.f, 0.699999988f, moss_saturation), ::math::lerp(0.175000012f, 0.699999988f, moss_brightness))), 2.20000005f)), ::base::color_layer_overlay, 1.f).tint, 5.95100021f), moss_height_growth * ::math::lerp(histogram_scan_big(float3(::base::file_texture(texture_2d("./multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.379000008f, ::math::lerp(0.817000031f, 0.100000001f, moss_distribution_amount)), float3(infinite_tiling ? endless_texture(texture_2d("./multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./multi_stone.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], ::math::clamp(histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./multi_stone.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.150000006f, ::math::lerp(0.200000003f, 0.680000007f, moss_height_growth)), 0.f, 1.f))), 0.f, ""), bsdf(), add_detail_normal(::math::lerp(::state::normal(), ::base::tangent_space_normal_texture(texture_2d("./moss_norm.jpg", ::tex::gamma_linear), ::math::lerp(0.f, 2.f, moss_bump_factor), false, false, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f), ::math::lerp(0.f, 2.f, moss_weight) * ::math::lerp(histogram_scan_big(float3(::base::file_texture(texture_2d("./multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.379000008f, ::math::lerp(0.817000031f, 0.100000001f, moss_distribution_amount)), float3(infinite_tiling ? endless_texture(texture_2d("./multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./multi_stone.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], ::math::clamp(histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./multi_stone.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.150000006f, ::math::lerp(0.200000003f, 0.680000007f, moss_height_growth)), 0.f, 1.f))), infinite_tiling ? endless_normal(texture_2d("./stone_norm.jpg", ::tex::gamma_linear), ::math::lerp(0.f, 2.f, stones_bump_strength), false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 1.f, float3(0.498039007f, 0.501960993f, 0.882353008f), 3.f) : ::base::tangent_space_normal_texture(texture_2d("./stone_norm.jpg", ::tex::gamma_linear), ::math::lerp(0.f, 2.f, stones_bump_strength), false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f))), add_detail_normal(::math::lerp(::state::normal(), ::base::tangent_space_normal_texture(texture_2d("./moss_norm.jpg", ::tex::gamma_linear), ::math::lerp(0.f, 2.f, moss_bump_factor), false, false, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f), ::math::lerp(0.f, 2.f, moss_weight) * ::math::lerp(histogram_scan_big(float3(::base::file_texture(texture_2d("./multi_moss.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(0.638283014f, 0.638283014f, 0.638283014f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.379000008f, ::math::lerp(0.817000031f, 0.100000001f, moss_distribution_amount)), float3(infinite_tiling ? endless_texture(texture_2d("./multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./multi_stone.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], ::math::clamp(histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./multi_stone.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.572548985f, 0.988234997f, 0.505882025f), 3.f, false) : ::base::file_texture(texture_2d("./multi_stone.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.150000006f, ::math::lerp(0.200000003f, 0.680000007f, moss_height_growth)), 0.f, 1.f))), infinite_tiling ? endless_normal(texture_2d("./stone_norm.jpg", ::tex::gamma_linear), ::math::lerp(0.f, 2.f, stones_bump_strength), false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 1.f, float3(0.498039007f, 0.501960993f, 0.882353008f), 3.f) : ::base::tangent_space_normal_texture(texture_2d("./stone_norm.jpg", ::tex::gamma_linear), ::math::lerp(0.f, 2.f, stones_bump_strength), false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f))), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + material_geometry tmp5(float3(0.f), 1.f, enable_round_corners ? ::state::rounded_corner_normal(radius, across_materials, 1.f) : ::state::normal()); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + geometry: tmp5); + +export material Dry_Bright_Stone(*) +[[ + ::anno::display_name("Dry Bright Stone"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "infinite", "stone", "nature", "moss", "weathered", "pores", "wall", "exterior", "rough", "plant", "urban", "city", "industrial", "dry", "bright")), + ::anno::thumbnail("./.thumbs/Stone_Pores_Weathered.Dry_Bright_Stone.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Stone_Pores_Weathered +( + infinite_tiling: false, + stone_diffuse_brightness: 0.6f, + reflection_roughness: 0.7f, + stones_bump_strength: 1.f, + moss_brightness: 0.f, + moss_saturation: 0.f, + moss_distribution_amount: 0.f, + moss_height_growth: 0.f, + moss_weight: 0.f, + moss_moisture: 0.f, + moss_bump_factor: 0.f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + enable_round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material Matte_Stone(*) +[[ + ::anno::display_name("Matte Stone"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "infinite", "stone", "nature", "moss", "weathered", "pores", "wall", "exterior", "rough", "plant", "urban", "city", "industrial", "dry", "matte")), + ::anno::thumbnail("./.thumbs/Stone_Pores_Weathered.Matte_Stone.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Stone_Pores_Weathered +( + infinite_tiling: false, + stone_diffuse_brightness: 0.2f, + reflection_roughness: 0.f, + stones_bump_strength: 0.8f, + moss_brightness: 0.f, + moss_saturation: 0.f, + moss_distribution_amount: 0.f, + moss_height_growth: 0.f, + moss_weight: 0.f, + moss_moisture: 0.f, + moss_bump_factor: 0.f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + enable_round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material Slightly_Grown_Moss(*) +[[ + ::anno::display_name("Slightly Grown Moss"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "infinite", "stone", "nature", "moss", "weathered", "pores", "wall", "exterior", "rough", "plant", "urban", "city", "industrial", "dry", "slightly", "grown")), + ::anno::thumbnail("./.thumbs/Stone_Pores_Weathered.Slightly_Grown_Moss.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Stone_Pores_Weathered +( + infinite_tiling: false, + stone_diffuse_brightness: 1.f, + reflection_roughness: 0.8f, + stones_bump_strength: 0.5f, + moss_brightness: 0.8f, + moss_saturation: 0.89f, + moss_distribution_amount: 1.f, + moss_height_growth: 0.55f, + moss_weight: 1.f, + moss_moisture: 0.5f, + moss_bump_factor: 1.f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + enable_round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material Soft_Grown_Moss(*) +[[ + ::anno::display_name("Soft Grown Moss"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "infinite", "stone", "nature", "moss", "weathered", "pores", "wall", "exterior", "rough", "plant", "urban", "city", "industrial", "dry", "soft", "grown")), + ::anno::thumbnail("./.thumbs/Stone_Pores_Weathered.Soft_Grown_Moss.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Stone_Pores_Weathered +( + infinite_tiling: false, + stone_diffuse_brightness: 1.f, + reflection_roughness: 0.8f, + stones_bump_strength: 0.5f, + moss_brightness: 0.8f, + moss_saturation: 0.9f, + moss_distribution_amount: 1.f, + moss_height_growth: 0.8f, + moss_weight: 1.f, + moss_moisture: 0.7f, + moss_bump_factor: 1.f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + enable_round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material Saturated_Green_Patches(*) +[[ + ::anno::display_name("Saturated Green Patches"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "infinite", "stone", "nature", "moss", "weathered", "pores", "wall", "exterior", "rough", "plant", "urban", "city", "industrial", "dry", "saturated", "green")), + ::anno::thumbnail("./.thumbs/Stone_Pores_Weathered.Saturated_Green_Patches.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Stone_Pores_Weathered +( + infinite_tiling: false, + stone_diffuse_brightness: 0.f, + reflection_roughness: 1.f, + stones_bump_strength: 1.f, + moss_brightness: 0.8f, + moss_saturation: 0.85f, + moss_distribution_amount: 0.6f, + moss_height_growth: 0.9f, + moss_weight: 1.f, + moss_moisture: .21f, + moss_bump_factor: 1.f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + enable_round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); + +export material Fadely_Yellowish_Moss(*) +[[ + ::anno::display_name("Fadely Yellowish Moss"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "infinite", "stone", "nature", "moss", "weathered", "pores", "wall", "exterior", "rough", "plant", "urban", "city", "industrial", "dry", "fadely", "yellowish")), + ::anno::thumbnail("./.thumbs/Stone_Pores_Weathered.Fadely_Yellowish_Moss.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Stone_Pores_Weathered +( + infinite_tiling: false, + stone_diffuse_brightness: 0.f, + reflection_roughness: 0.8f, + stones_bump_strength: 0.2f, + moss_brightness: 1.f, + moss_saturation: 0.f, + moss_distribution_amount: .69f, + moss_height_growth: 1.f, + moss_weight: 0.25f, + moss_moisture: 1.f, + moss_bump_factor: 1.f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + enable_round_corners: false, + radius: 1.5f, + across_materials: true, + uv_space_index: 0 +); \ No newline at end of file diff --git a/Material/material_0325/Fabric_Cotton_Fine_Woven.mdl b/Material/material_0325/Fabric_Cotton_Fine_Woven.mdl new file mode 100644 index 0000000000000000000000000000000000000000..6d938f70c32b427361f10d3c70c4b34a9c35c7f8 --- /dev/null +++ b/Material/material_0325/Fabric_Cotton_Fine_Woven.mdl @@ -0,0 +1,519 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + + +mdl 1.4; + + +import ::base::*; +import ::anno::*; +import ::df::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + + +const string DESCRITPION = +"A fine woven cotton material with tweakable reflectivity and infinite tiling"; + +annotation preview_scale( float f); + +float remap_xy_to_0_1(float input, float x, float y) +{ + return (input - x)/(y - x); +} + +float histogram_scan_big(float input, float width, float position) +{ + return ::math::clamp( + remap_xy_to_0_1(input, + ::math::lerp(-width, 1.0, position), + ::math::lerp(0.0, 1.0 + width, position)), + 0.0, + 1.0); +} + +float histogram_range(float input, float range, float position) +{ + float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); + float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); + return ::math::lerp(low, high, input); +} + +::base::texture_coordinate_info vmat_transform( + uniform float2 translation = float2(0.0, 0.0), + uniform float rotation = 0.0, + uniform float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation_rad); + float c = ::math::cos(rotation_rad); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + + +float3 srgb2rgb(float3 val) +{ + return ::math::pow(::math::max(val, float3(0.0f)), 2.2); +} + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float2 rnd22(int2 p) { + float2 ret_val = float2( + uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f, + uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f + ); + return ret_val; +} + + +float2x2 invert_2x2(float2x2 M) +{ + float det = M[0][0]*M[1][1] - M[0][1]*M[1][0]; + //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/ + return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]); +} + +float3 nonrepeat_lookup( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5), + float patch_size = 8.0 +) +{ + + float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale; + float Z = patch_size; // patch scale inside example texture + float CON = 1.0f; + + float3 O = float3(0.f); + float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); + float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space + + float2 U = uv_in; + float2 V = M * uv_in; //pre-tilted hexa coordinates + int2 I = int2(::math::floor(V)); // hexa-tile id + + // The mean color needs to be determined in Photoshop then to make the + // average color work out, take the float value and calculate the apropriate + // mean value as (value^(1/2.2)) + + float3 m = average_color; + + float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; + F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates + + if( F[2] > 0.f ) + + O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON)) + + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON)) + + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON)); + else + O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON)) + + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON)) + + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON)); + O = m + O/::math::length(W); + O = ::math::clamp( (O), 0.0, 1.0); + + return float3(O); +} + +color endless_texture( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 10.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0, + bool gamma_correct_lookup = true +) +{ + return gamma_correct_lookup ? color(srgb2rgb( + nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )) + ) : color(nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )); +} + +float3 endless_normal( + uniform texture_2d texture = texture_2d(), + float factor = 1.0, + bool flip_tangent_u = false, + bool flip_tangent_v = false, + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0 +) +{ + float3 transformed_tangent_u = flip_tangent_u ? uvw.tangent_u : - uvw.tangent_u; + float3 transformed_tangent_v = flip_tangent_v ? uvw.tangent_v : - uvw.tangent_v; + + if (flip_tangent_u) + transformed_tangent_u=-transformed_tangent_u; + if (flip_tangent_v) + transformed_tangent_v=-transformed_tangent_v; + + // normalized Lookup + float3 tangent_space_normal = + (nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + ) - 0.5) * (2.0 * factor); + + return ::math::normalize(uvw.tangent_u * tangent_space_normal.x + + uvw.tangent_v * tangent_space_normal.y + + ::state::normal()*1.0); +} + +float3 normalmap_normal( + uniform texture_2d texture, + float factor = 1.0, + ::base::texture_coordinate_info uvw = ::base::texture_coordinate_info() +) +{ + float3 lookup = (::tex::lookup_float3(texture, float2(uvw.position.x, uvw.position.y)) - 0.5) * (factor * 2.0); + return ::math::normalize(uvw.tangent_u * lookup.x + uvw.tangent_v * lookup.y + ::state::normal()); +} + +export material Fabric_Cotton_Fine_Woven( + uniform bool infinite_tiling = false [[ + ::anno::display_name("Infinite Tiling"), + ::anno::description("Enables infinite tiling feature which removes repeating texture patterns."), + ::anno::in_group("Appearance") + ]], + color fabric_color = color(0.851252f, 0.851252f, 0.851252f) [[ + ::anno::display_name("Fabric Color"), + ::anno::description("Sets the color of the fabric."), + ::anno::in_group("Appearance") + ]], + float fabric_brightness = 0.5f [[ + ::anno::display_name("Fabric Brightness"), + ::anno::description("Adjusts the brightness of the fabric."), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance") + ]], + float fabric_reflectivity = 0.5f [[ + ::anno::display_name("Fabric Reflectivity"), + ::anno::description("Adjusts the amount of light that the fabric is reflecting."), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance") + ]], + float fabric_bump_factor = 1.f [[ + ::anno::display_name("Fabric Bump Factor"), + ::anno::description("Adjusts the bump intensity of the surface."), + ::anno::soft_range(0.0f, 1.0f), + ::anno::hard_range(0.0f, 2.0f), + ::anno::in_group("Appearance") + ]], + uniform float2 texture_translate = 0.f [[ + ::anno::display_name("Translate"), + ::anno::description("Offsets the position of the material."), + ::anno::in_group("Transform") + ]], + uniform float texture_rotate = 0.f [[ + ::anno::display_name("Rotate"), + ::anno::description("Rotates the material."), + ::anno::in_group("Transform") + ]], + uniform float2 texture_scale = 1.0f [[ + ::anno::display_name("Scale"), + ::anno::description("Scales the material."), + ::nvidia::core_definitions::dimension(float2(.5f, .5f)), + ::preview_scale(4.5f), + ::anno::in_group("Transform") + ]], + uniform int uv_space_index = 0 [[ + ::anno::display_name("UV Space Index"), + ::anno::description("Use selected UV space for material."), + ::anno::in_group("Advanced") + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Fine Woven Cotton - Light Gray"), + ::anno::description(DESCRITPION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven.png"), + ::anno::key_words(string[]("design", "fabric", "cotton", "design", "fashion", "woven", "new", "infinite tiling", "soft", "natural" )) +]] + = + let { + bool tmp0 = false; + float2 texture_rescale = texture_scale * 0.11f; // texture covers 11 cm, scale up so it covers 1m per default + + + material_surface tmp1( + ::df::custom_curve_layer(0.121000007f, 1.f, 5.f, histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./fine_woven_cotton_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 1.f, float3(0.647000015f, 0.5f, 0.426999986f), 8.f, false) : ::base::file_texture(texture_2d("./fine_woven_cotton_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_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], 0.944000065f, ::math::lerp(0.850000024f, 0.600000024f, fabric_reflectivity)), ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./fine_woven_cotton_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 1.f, float3(0.647000015f, 0.5f, 0.426999986f), 8.f, false) : ::base::file_texture(texture_2d("./fine_woven_cotton_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_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], 0.195000008f, 0.823000014f) * histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./fine_woven_cotton_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 1.f, float3(0.647000015f, 0.5f, 0.426999986f), 8.f, false) : ::base::file_texture(texture_2d("./fine_woven_cotton_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_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], 0.195000008f, 0.823000014f), histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./fine_woven_cotton_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 1.f, float3(0.647000015f, 0.5f, 0.426999986f), 8.f, false) : ::base::file_texture(texture_2d("./fine_woven_cotton_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_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], 0.195000008f, 0.823000014f) * histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./fine_woven_cotton_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 1.f, float3(0.647000015f, 0.5f, 0.426999986f), 8.f, false) : ::base::file_texture(texture_2d("./fine_woven_cotton_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_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], 0.195000008f, 0.823000014f), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(::nvidia::core_definitions::blend_colors((infinite_tiling ? endless_texture(texture_2d("./fine_woven_cotton_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.474999994f, 0.463f, 0.486000001f), 4.f, true) : ::base::file_texture(texture_2d("./fine_woven_cotton_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_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) * color(::math::lerp(0.649999976f, 1.f, fabric_brightness)), fabric_color, ::base::color_layer_overlay, 1.f).tint, 0.f, ""), ::state::normal()), + material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + 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)); + material_geometry tmp5( + float3(0.f), + 1.f, + infinite_tiling ? endless_normal(texture_2d("./fine_woven_cotton_norm.jpg", ::tex::gamma_linear), fabric_bump_factor, false, false, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.5f, 0.5f, 1.f), 4.f) : normalmap_normal(texture_2d("./fine_woven_cotton_norm.jpg", ::tex::gamma_linear), fabric_bump_factor, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index))); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + +// 2 +export material Fabric_Cotton_Fine_Woven_Yellow(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Fine Woven Cotton - Yellow"), + ::anno::description(DESCRITPION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven_Yellow.png"), + ::anno::key_words(string[]("design", "fabric", "cotton", "design", "fashion", "woven", "new", "infinite tiling", "soft", "natural", "yellow", "warm" )) +]] + = Fabric_Cotton_Fine_Woven ( + infinite_tiling: false, + fabric_color: color(0.673049f, 0.409826f, 0.005028f), + fabric_brightness: 0.5f, + fabric_reflectivity: 0.5f, + fabric_bump_factor: 1.0f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0 +); + + +// 3 +export material Fabric_Cotton_Fine_Woven_Orange(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Fine Woven Cotton - Orange"), + ::anno::description(DESCRITPION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven_Orange.png"), + ::anno::key_words(string[]("design", "fabric", "cotton", "design", "fashion", "woven", "new", "infinite tiling", "soft", "natural", "orange", "warm" )) +]] = Fabric_Cotton_Fine_Woven ( + infinite_tiling: false, + fabric_color: color(0.673049f, 0.227137f, 0.018913), + fabric_brightness: 0.5f, + fabric_reflectivity: 0.5f, + fabric_bump_factor: 1.0f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0 +); + + +// 4 +export material Fabric_Cotton_Fine_Woven_Cheery_Red(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Fine Woven Cotton - Cherry Red"), + ::anno::description(DESCRITPION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven_Cheery_Red.png"), + ::anno::key_words(string[]("design", "fabric", "cotton", "design", "fashion", "woven", "new", "infinite tiling", "soft", "natural", "red", "cherry", "warm" )) +]] = Fabric_Cotton_Fine_Woven ( + infinite_tiling: false, + fabric_color: color(0.659224f, 0.054592f, 0.030257f), + fabric_brightness: 0.5f, + fabric_reflectivity: 0.5f, + fabric_bump_factor: 1.0f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0 +); + + +// 5 +export material Fabric_Cotton_Fine_Woven_Dark_Red(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Fine Woven Cotton - Dark Red"), + ::anno::description(DESCRITPION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven_Dark_Red.png"), + ::anno::key_words(string[]("design", "fabric", "cotton", "design", "fashion", "woven", "new", "infinite tiling", "soft", "natural", "dark", "red", "warm" )) +]] = Fabric_Cotton_Fine_Woven ( + infinite_tiling: false, + fabric_color: color(0.242796f, 0.010398f, 0.026549f), + fabric_brightness: 0.5f, + fabric_reflectivity: 0.5f, + fabric_bump_factor: 1.0f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0 +); + + +// 6 +export material Fabric_Cotton_Fine_Woven_Dark_Green(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Fine Woven Cotton - Dark Green"), + ::anno::description(DESCRITPION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven_Dark_Green.png"), + ::anno::key_words(string[]("design", "fabric", "cotton", "design", "fashion", "woven", "new", "infinite tiling", "soft", "natural", "dark", "green" )) +]] = Fabric_Cotton_Fine_Woven ( + infinite_tiling: false, + fabric_color: color(0.071761f, 0.151058f, 0.001963), + fabric_brightness: 0.5f, + fabric_reflectivity: 0.5f, + fabric_bump_factor: 1.0f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0 +); + + +// 7 +export material Fabric_Cotton_Fine_Woven_Petrol(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Fine Woven Cotton - Petrol"), + ::anno::description(DESCRITPION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven_Petrol.png"), + ::anno::key_words(string[]("design", "fabric", "cotton", "design", "fashion", "woven", "new", "infinite tiling", "soft", "natural", "petrol", "blue", "cool" )) +]] = Fabric_Cotton_Fine_Woven ( + infinite_tiling: false, + fabric_color: color(0.133209f, 0.238828f, 0.442323f), + fabric_brightness: 0.5f, + fabric_reflectivity: 0.5f, + fabric_bump_factor: 1.0f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0 +); + + +// 8 +export material Fabric_Cotton_Fine_Woven_Light_Blue(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Fine Woven Cotton - Light Blue"), + ::anno::description(DESCRITPION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven_Light_Blue.png"), + ::anno::key_words(string[]("design", "fabric", "cotton", "design", "fashion", "woven", "new", "infinite tiling", "soft", "natural", "light", "blue", "cool" )) +]] = Fabric_Cotton_Fine_Woven ( + infinite_tiling: false, + fabric_color: color(0.091518f, 0.453456f, 0.827726f), + fabric_brightness: 0.5f, + fabric_reflectivity: 0.5f, + fabric_bump_factor: 1.0f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0 +); + + + + + + + + + + diff --git a/Material/material_0355/Ground_Hard_Court.mdl b/Material/material_0355/Ground_Hard_Court.mdl new file mode 100644 index 0000000000000000000000000000000000000000..13df1e1e7bf0809a7935e7389fdf3a2bd1cc90ee --- /dev/null +++ b/Material/material_0355/Ground_Hard_Court.mdl @@ -0,0 +1,570 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + + +mdl 1.5; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + + +const string DESCRIPTION = "A hard court material for sports activities"; + +// Taken from https://www.shadertoy.com/view/4tlBWB +float3 hsv2rgb(float3 c) +{ + float4 K = float4(1.0, 2.0/3.0, 1.0/3.0, 3.0); + float3 p = ::math::abs(::math::frac(float3(c.x) + float3(K.x, K.y, K.z)) * 6.0 - float3(K.w)); + return c.z * ::math::lerp(float3(K.x), ::math::clamp(p - float3(K.x), 0.0, 1.0), c.y); +} + + +float3 srgb2rgb(float3 val) +{ + return ::math::pow(::math::max(val, float3(0.0f)), 2.2); +} + + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float2 rnd22(int2 p) { + float2 ret_val = float2( + uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f, + uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f + ); + return ret_val; +} + +::base::texture_coordinate_info vmat_transform( + uniform float2 translation = float2(0.0, 0.0), + uniform float rotation = 0.0, + uniform float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation_rad); + float c = ::math::cos(rotation_rad); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + +float2x2 invert_2x2(float2x2 M) +{ + float det = M[0][0]*M[1][1] - M[0][1]*M[1][0]; + //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/ + return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]); +} + +float3 nonrepeat_lookup( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5), + float patch_size = 8.0 +) +{ + + float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale; + float Z = patch_size; // patch scale inside example texture + float CON = 1.0f; + + float3 O = float3(0.f); + float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); + float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space + + float2 U = uv_in; + float2 V = M * uv_in; //pre-tilted hexa coordinates + int2 I = int2(::math::floor(V)); // hexa-tile id + + // The mean color needs to be determined in Photoshop then to make the + // average color work out, take the float value and calculate the apropriate + // mean value as (value^(1/2.2)) + + float3 m = average_color; + + float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; + F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates + + if( F[2] > 0.f ) + + O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON)) + + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON)) + + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON)); + else + O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON)) + + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON)) + + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON)); + O = m + O/::math::length(W); + O = ::math::clamp( (O), 0.0, 1.0); + + return float3(O); +} + +float3 normalmap_normal( + uniform texture_2d texture, + float factor = 1.0, + ::base::texture_coordinate_info uvw = ::base::texture_coordinate_info() +) +{ + float3 lookup = (::tex::lookup_float3(texture, float2(uvw.position.x, uvw.position.y)) - 0.5) * (factor * 2.0); + return ::math::normalize(uvw.tangent_u * lookup.x + uvw.tangent_v * lookup.y + ::state::normal()); +} + +float histogram_range(float input, float range, float position) +{ + float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); + float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); + return ::math::lerp(low, high, input); +} + +float remap_xy_to_0_1(float input, float x, float y) +{ + return (input - x)/(y - x); +} + +float histogram_scan_big(float input, float width, float position) +{ + return ::math::clamp( + remap_xy_to_0_1(input, + ::math::lerp(-width, 1.0, position), + ::math::lerp(0.0, 1.0 + width, position)), + 0.0, + 1.0); +} + +color endless_texture( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 10.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0, + bool gamma_correct_lookup = true +) +{ + return gamma_correct_lookup ? color(srgb2rgb( + nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )) + ) : color(nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )); +} + +float3 endless_normal( + uniform texture_2d texture = texture_2d(), + float factor = 1.0, + bool flip_tangent_u = false, + bool flip_tangent_v = false, + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0 +) +{ + float3 transformed_tangent_u = flip_tangent_u ? uvw.tangent_u : - uvw.tangent_u; + float3 transformed_tangent_v = flip_tangent_v ? uvw.tangent_v : - uvw.tangent_v; + + if (flip_tangent_u) + transformed_tangent_u=-transformed_tangent_u; + if (flip_tangent_v) + transformed_tangent_v=-transformed_tangent_v; + + // normalized Lookup + float3 tangent_space_normal = + (nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + ) - 0.5) * (2.0 * factor); + + return ::math::normalize(uvw.tangent_u * tangent_space_normal.x + + uvw.tangent_v * tangent_space_normal.y + + ::state::normal()*1.0); +} + +export material Ground_Hard_Court( + uniform bool infinite_tiling = true [[ + ::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."), + ::anno::display_name("Infinite Tiling"), + ::anno::in_group("Appearance") + ]], + float ground_hue = 0.02f [[ + ::anno::description("Selects the Hue for the Ground cort material. You can select any hue that you want, though we recommend to stick to colors that are actually used in real life."), + ::anno::display_name("Ground Hue"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + float ground_saturation = 0.85f [[ + ::anno::description("Adjust the saturation of the hard court material color. Default is 0.8, Beware that setting the saturation to the maximum value will result in unrealistic looking saturation."), + ::anno::display_name("Ground Saturation"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + float ground_brightness = 0.6f [[ + ::anno::description("Adjusts the overall brightness of the hard court material. Default is 0.6."), + ::anno::display_name("Ground Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + float roughness = 1.f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + float roughness_variation = 0.f [[ + ::anno::description("Breaks up the roughness pattern and makes it less uniform."), + ::anno::display_name("Roughness Variation"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + float reflectivity = 1.f [[ + ::anno::description("The overall reflectivity of the surface."), + ::anno::display_name("Reflectivity"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + float bump_strength = 1.f [[ + ::anno::description("Specifies the strength of the bump."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 1.f), + ::anno::hard_range(0.f, 3.f) + ]], + uniform float2 texture_translate = 0.f [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Translate"), + ::anno::in_group("Transform") + ]], + uniform float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f) + ]], + uniform float2 texture_scale = 1.f [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Scale"), + ::nvidia::core_definitions::dimension(float2(1.0, 1.0)), + ::anno::in_group("Transform") + ]], + uniform bool enable_round_corners = false [[ + ::anno::description("Enabling creates the impression of rounded corners across hard edges. Comes at a slight performance cost as additional raytracing calls are required to evaluate the effect."), + ::anno::display_name("Enable Round Corners"), + ::anno::in_group("Round Corners") + ]], + uniform float roundcorners_radius = 1.5f [[ + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::display_name("Round Corner Radius (mm)"), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 1.f) + ]], + uniform bool roundcorners_across_materials = false [[ + ::anno::description("When enabled, the effect is across different materials, otherwise just the same material."), + ::anno::display_name("Across Materials"), + ::anno::in_group("Round Corners") + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Use selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced") + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Ground Hard Court - Red"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Ground_Hard_Court.Ground_Hard_Court.png"), + ::anno::key_words(string[]("ground", "hard court", "court", "hard", "exterior", "sports", "bumped", "rough", "artificial", "red", "saturated", "warm")) +]] + = + let { + bool tmp0 = false; + material_surface tmp1( + ::df::weighted_layer(1.f, ::df::custom_curve_layer(0.0350400023f, 1.f, 5.f, histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./hard_court_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 1.99800014f, float3(0.866999984f, 0.764999986f, 0.497999996f), 1.99800014f, true) : ::base::file_texture(texture_2d("./hard_court_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.722000062f, ::math::lerp(0.674000025f, 0.238000005f, reflectivity)), ::df::microfacet_ggx_smith_bsdf((histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./hard_court_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 1.99800014f, float3(0.866999984f, 0.764999986f, 0.497999996f), 1.99800014f, true) : ::base::file_texture(texture_2d("./hard_court_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.349999994f, 0.600000024f, roughness)) + roughness_variation * 0.197000012f * (float3(infinite_tiling ? endless_texture(texture_2d("./hard_court_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 1.99800014f, float3(0.866999984f, 0.764999986f, 0.497999996f), 1.99800014f, true) : ::base::file_texture(texture_2d("./hard_court_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2] - 0.108000003f)) * (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./hard_court_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 1.99800014f, float3(0.866999984f, 0.764999986f, 0.497999996f), 1.99800014f, true) : ::base::file_texture(texture_2d("./hard_court_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.349999994f, 0.600000024f, roughness)) + roughness_variation * 0.197000012f * (float3(infinite_tiling ? endless_texture(texture_2d("./hard_court_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 1.99800014f, float3(0.866999984f, 0.764999986f, 0.497999996f), 1.99800014f, true) : ::base::file_texture(texture_2d("./hard_court_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2] - 0.108000003f)), (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./hard_court_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 1.99800014f, float3(0.866999984f, 0.764999986f, 0.497999996f), 1.99800014f, true) : ::base::file_texture(texture_2d("./hard_court_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.349999994f, 0.600000024f, roughness)) + roughness_variation * 0.197000012f * (float3(infinite_tiling ? endless_texture(texture_2d("./hard_court_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 1.99800014f, float3(0.866999984f, 0.764999986f, 0.497999996f), 1.99800014f, true) : ::base::file_texture(texture_2d("./hard_court_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2] - 0.108000003f)) * (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./hard_court_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 1.99800014f, float3(0.866999984f, 0.764999986f, 0.497999996f), 1.99800014f, true) : ::base::file_texture(texture_2d("./hard_court_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.349999994f, 0.600000024f, roughness)) + roughness_variation * 0.197000012f * (float3(infinite_tiling ? endless_texture(texture_2d("./hard_court_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 1.99800014f, float3(0.866999984f, 0.764999986f, 0.497999996f), 1.99800014f, true) : ::base::file_texture(texture_2d("./hard_court_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2] - 0.108000003f)), 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(color(::math::pow(hsv2rgb(::math::lerp(float3(0.f, 0.f, 0.5f), float3(1.f, 0.800000012f, 0.899999976f), float3(ground_hue, ground_saturation, ground_brightness))), 2.20000005f)), infinite_tiling ? endless_texture(texture_2d("./hard_court_mono_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 1.99800014f, float3(0.63499999f), 1.99800014f, true) : color(::math::pow(::base::file_texture(texture_2d("./hard_court_mono_diff.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, 2.20000005f)), ::base::color_layer_multiply, 1.f).tint, color(::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./hard_court_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 1.99800014f, float3(0.866999984f, 0.764999986f, 0.497999996f), 1.99800014f, true) : ::base::file_texture(texture_2d("./hard_court_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 2.20000005f)), ::base::color_layer_multiply, 0.f).tint, 0.f), infinite_tiling ? endless_normal(texture_2d("./hard_court_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 1.99800014f, float3(0.497999996f, 0.50999999f, 0.92900002f), 1.99800014f) : normalmap_normal(texture_2d("./hard_court_norm.jpg", ::tex::gamma_linear), bump_strength, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index))), bsdf(), infinite_tiling ? endless_normal(texture_2d("./hard_court_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 1.99800014f, float3(0.497999996f, 0.50999999f, 0.92900002f), 1.99800014f) : normalmap_normal(texture_2d("./hard_court_norm.jpg", ::tex::gamma_linear), bump_strength, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index))), + material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + 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)); + material_geometry tmp5( + float3(0.f), + 1.f, + enable_round_corners ? ::state::rounded_corner_normal(roundcorners_radius / 1000.f, roundcorners_across_materials, 1.f) : ::state::normal()); + hair_bsdf tmp6 = hair_bsdf(); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5, + hair: tmp6); + +// 2 +export material Ground_Hard_Court_Red_Desaturated(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Ground Hard Court - Red Desaturated"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Ground_Hard_Court.Ground_Hard_Court_Red_Desaturated.png"), + ::anno::key_words(string[]("ground", "hard court", "court", "hard", "exterior", "sports", "bumped", "rough", "artificial", "red", "warm")) +]] = Ground_Hard_Court +( + infinite_tiling: true, + ground_hue: 0.02f, + ground_saturation: 0.65f, + ground_brightness: 0.6f, + roughness: 1.0f, + roughness_variation:1.0f, + reflectivity: 1.0f, + bump_strength: 1.0f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + enable_round_corners: false, + roundcorners_radius: 1.5f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +//3 +export material Ground_Hard_Court_Blue(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Ground Hard Court - Blue"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Ground_Hard_Court.Ground_Hard_Court_Blue.png"), + ::anno::key_words(string[]("ground", "hard court", "court", "hard", "exterior", "sports", "bumped", "rough", "artificial", "blue", "cool", "saturated")) +]] = Ground_Hard_Court +( + infinite_tiling: true, + ground_hue: 0.589f, + ground_saturation: 0.9f, + ground_brightness: 0.5f, + roughness: 0.41f, + roughness_variation:1.0f, + reflectivity: 0.5f, + bump_strength: 1.0f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + enable_round_corners: false, + roundcorners_radius: 1.5f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +//4 +export material Ground_Hard_Court_Faded_Blue(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Ground Hard Court - Faded Blue"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Ground_Hard_Court.Ground_Hard_Court_Faded_Blue.png"), + ::anno::key_words(string[]("ground", "hard court", "court", "hard", "exterior", "sports", "bumped", "rough", "artificial", "blue", "cool", "desaturated")) +]] = Ground_Hard_Court +( + infinite_tiling: true, + ground_hue: 0.58f, + ground_saturation: 0.65f, + ground_brightness: 0.65f, + roughness: 1.0f, + roughness_variation:1.0f, + reflectivity: 1.0f, + bump_strength: 1.0f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + enable_round_corners: false, + roundcorners_radius: 1.5f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + + +//5 +export material Ground_Hard_Court_Light_Green(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Ground Hard Court - Light Green"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Ground_Hard_Court.Ground_Hard_Court_Light_Green.png"), + ::anno::key_words(string[]("ground", "hard court", "court", "hard", "exterior", "sports", "bumped", "rough", "artificial", "green", "light")) +]] = Ground_Hard_Court +( + infinite_tiling: true, + ground_hue: 0.3f, + ground_saturation: 0.68f, + ground_brightness: 0.623f, + roughness: 0.41f, + roughness_variation:0.0f, + reflectivity: 0.5f, + bump_strength: 1.0f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + enable_round_corners: false, + roundcorners_radius: 1.5f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 6 +export material Ground_Hard_Court_Dark_Green(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Ground Hard Court - Dark Green"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Ground_Hard_Court.Ground_Hard_Court_Dark_Green.png"), + ::anno::key_words(string[]("ground", "hard court", "court", "hard", "exterior", "sports", "bumped", "rough", "artificial", "green", "dark")) +]] = Ground_Hard_Court +( + infinite_tiling: true, + ground_hue: 0.3f, + ground_saturation: 0.8f, + ground_brightness: 0.0f, + roughness: 0.41f, + roughness_variation:0.0f, + reflectivity: 0.5f, + bump_strength: 1.0f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + enable_round_corners: false, + roundcorners_radius: 1.5f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + + +// 7 +export material Ground_Hard_Court_Olive_Green(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Ground Hard Court - Olive Green"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Ground_Hard_Court.Ground_Hard_Court_Olive_Green.png"), + ::anno::key_words(string[]("ground", "hard court", "court", "hard", "exterior", "sports", "bumped", "rough", "artificial", "green", "olive")) +]] = Ground_Hard_Court +( + infinite_tiling: true, + ground_hue: 0.22f, + ground_saturation: 0.495f, + ground_brightness: 0.25f, + roughness: 0.5f, + roughness_variation:0.0f, + reflectivity: 0.5f, + bump_strength: 1.0f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + enable_round_corners: false, + roundcorners_radius: 1.5f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + + + + diff --git a/Material/material_0357/Ground_Leaves_Oak.mdl b/Material/material_0357/Ground_Leaves_Oak.mdl new file mode 100644 index 0000000000000000000000000000000000000000..fe484c331780892e77b80c292b815c18bde3d956 --- /dev/null +++ b/Material/material_0357/Ground_Leaves_Oak.mdl @@ -0,0 +1,375 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. * + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + + +mdl 1.5; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + + + +float3 srgb2rgb(float3 val) +{ + return ::math::pow(::math::max(val, float3(0.0f)), 2.2); +} + + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float2 rnd22(int2 p) { + float2 ret_val = float2( + uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f, + uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f + ); + return ret_val; +} + +::base::texture_coordinate_info vmat_transform( + uniform float2 translation = float2(0.0, 0.0), + uniform float rotation = 0.0, + uniform float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation_rad); + float c = ::math::cos(rotation_rad); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + +float2x2 invert_2x2(float2x2 M) +{ + float det = M[0][0]*M[1][1] - M[0][1]*M[1][0]; + //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/ + return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]); +} + +float3 nonrepeat_lookup( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5), + float patch_size = 8.0 +) +{ + + float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale; + float Z = patch_size; // patch scale inside example texture + float CON = 1.0f; + + float3 O = float3(0.f); + float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); + float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space + + float2 U = uv_in; + float2 V = M * uv_in; //pre-tilted hexa coordinates + int2 I = int2(::math::floor(V)); // hexa-tile id + + // The mean color needs to be determined in Photoshop then to make the + // average color work out, take the float value and calculate the apropriate + // mean value as (value^(1/2.2)) + + float3 m = average_color; + + float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; + F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates + + if( F[2] > 0.f ) + + O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON)) + + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON)) + + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON)); + else + O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON)) + + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON)) + + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON)); + O = m + O/::math::length(W); + O = ::math::clamp( (O), 0.0, 1.0); + + return float3(O); +} + + +float histogram_range(float input, float range, float position) +{ + float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); + float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); + return ::math::lerp(low, high, input); +} + +float remap_xy_to_0_1(float input, float x, float y) +{ + return (input - x)/(y - x); +} + +float histogram_scan_big(float input, float width, float position) +{ + return ::math::clamp( + remap_xy_to_0_1(input, + ::math::lerp(-width, 1.0, position), + ::math::lerp(0.0, 1.0 + width, position)), + 0.0, + 1.0); +} + +color endless_texture( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 10.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0, + bool gamma_correct_lookup = true +) +{ + return gamma_correct_lookup ? color(srgb2rgb( + nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )) + ) : color(nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )); +} + +float3 endless_normal( + uniform texture_2d texture = texture_2d(), + float factor = 1.0, + bool flip_tangent_u = false, + bool flip_tangent_v = false, + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0 +) +{ + float3 transformed_tangent_u = flip_tangent_u ? uvw.tangent_u : - uvw.tangent_u; + float3 transformed_tangent_v = flip_tangent_v ? uvw.tangent_v : - uvw.tangent_v; + + if (flip_tangent_u) + transformed_tangent_u=-transformed_tangent_u; + if (flip_tangent_v) + transformed_tangent_v=-transformed_tangent_v; + + // normalized Lookup + float3 tangent_space_normal = + (nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + ) - 0.5) * (2.0 * factor); + + return ::math::normalize(uvw.tangent_u * tangent_space_normal.x + + uvw.tangent_v * tangent_space_normal.y + + ::state::normal()*1.0); +} + + +export material Ground_Leaves_Oak( + uniform bool infinite_tiling = false [[ + ::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."), + ::anno::display_name("Infinite Tiling"), + ::anno::in_group("Appearance") + ]], + float brightness = 0.5f [[ + ::anno::description("Adjusts the lightness of the material."), + ::anno::display_name("Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + float roughness = 0.5f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Rougness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + float reflectivity = 0.5f [[ + ::anno::description("Amount of reflection, higher numbers provide more reflection."), + ::anno::display_name("Reflectivity"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float2 texture_translate = 0.f [[ + ::anno::display_name("Texture Translate"), + ::anno::description("Controls the position of the texture."), + ::anno::in_group("Transform") + ]], + uniform float texture_rotate = 0.f [[ + ::anno::display_name("Texture Rotate"), + ::anno::description("Rotation angle of the texture in degrees."), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f) + ]], + uniform float2 texture_scale = 1.f [[ + ::anno::display_name("Texture Scale"), + ::anno::description("Larger numbers increase the size."), + ::nvidia::core_definitions::dimension(float2(2.0f, 2.0f)), + ::anno::in_group("Transform") + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Uses selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Transform") + ]], + uniform bool enable_round_corners = false [[ + ::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."), + ::anno::display_name("Enable Round Corners"), + ::anno::in_group("Round Corners") + ]], + uniform float radius = 0.f [[ + ::anno::description("Radius of the rounded corners."), + ::anno::display_name("Round Corner Radius"), + ::anno::in_group("Round Corners") + ]], + uniform bool across_materials = true [[ + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::display_name("Across Materials"), + ::anno::in_group("Round Corners") + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Ground Leaves Oak"), + ::anno::description("A ground material of fallen leaves."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Ground_Leaves_Oak.Ground_Leaves_Oak.png"), + ::anno::key_words(string[]("ground", "oak", "leaves", "exterior", "nature", "soil", "organic", "brown")) +]] + = + let { + bool tmp0 = false; + material_surface tmp1( + ::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, ::math::pow(histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./ground_leaves_oak_r_rough_g_ao_b_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.713999987f, 0.838999987f, 0.349000007f), 3.f, false) : ::base::file_texture(texture_2d("./ground_leaves_oak_r_rough_g_ao_b_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.78700006f, ::math::lerp(0.75f, 0.529999971f, reflectivity)), 2.20000005f), ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./ground_leaves_oak_r_rough_g_ao_b_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.713999987f, 0.838999987f, 0.349000007f), 3.f, false) : ::base::file_texture(texture_2d("./ground_leaves_oak_r_rough_g_ao_b_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.272000015f, 0.605000019f, roughness)) * histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./ground_leaves_oak_r_rough_g_ao_b_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.713999987f, 0.838999987f, 0.349000007f), 3.f, false) : ::base::file_texture(texture_2d("./ground_leaves_oak_r_rough_g_ao_b_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.272000015f, 0.605000019f, roughness)), histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./ground_leaves_oak_r_rough_g_ao_b_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.713999987f, 0.838999987f, 0.349000007f), 3.f, false) : ::base::file_texture(texture_2d("./ground_leaves_oak_r_rough_g_ao_b_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.272000015f, 0.605000019f, roughness)) * histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./ground_leaves_oak_r_rough_g_ao_b_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.713999987f, 0.838999987f, 0.349000007f), 3.f, false) : ::base::file_texture(texture_2d("./ground_leaves_oak_r_rough_g_ao_b_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.272000015f, 0.605000019f, roughness)), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(::nvidia::core_definitions::blend_colors(infinite_tiling ? endless_texture(texture_2d("./ground_leaves_oak_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.651000023f, 0.423999995f, 0.226999998f), 3.f, true) : ::base::file_texture(texture_2d("./ground_leaves_oak_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.699999988f, 0.200000003f, brightness)).tint, 0.f), bsdf(), infinite_tiling ? endless_normal(texture_2d("./ground_leaves_oak_norm.jpg", ::tex::gamma_linear), 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.5f, 0.5f, 1.f), 3.f) : ::base::tangent_space_normal_texture(texture_2d("./ground_leaves_oak_norm.jpg", ::tex::gamma_linear), 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), infinite_tiling ? endless_normal(texture_2d("./ground_leaves_oak_norm.jpg", ::tex::gamma_linear), 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.5f, 0.5f, 1.f), 3.f) : ::base::tangent_space_normal_texture(texture_2d("./ground_leaves_oak_norm.jpg", ::tex::gamma_linear), 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), + material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + 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)); + material_geometry tmp5( + float3(0.f), + 1.f, + enable_round_corners ? ::state::rounded_corner_normal(radius, across_materials, 1.f) : ::state::normal()); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + +export material Ground_Leaves_Oak_Shiny(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Ground Leaves Oak - Shiny"), + ::anno::description("A ground material of fallen leaves."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Ground_Leaves_Oak.Ground_Leaves_Oak_Shiny.png"), + ::anno::key_words(string[]("ground", "oak", "leaves", "exterior", "nature", "soil", "shiny", "organic", "brown")) +]] = Ground_Leaves_Oak( + infinite_tiling: false, + brightness: 0.5f, + roughness: 0.0f, + reflectivity: 0.25f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + + + + + diff --git a/Material/material_0363/ABS_Hard_Leather.mdl b/Material/material_0363/ABS_Hard_Leather.mdl new file mode 100644 index 0000000000000000000000000000000000000000..3c443da3b6867a5f221ee75779fb50e3483fb498 --- /dev/null +++ b/Material/material_0363/ABS_Hard_Leather.mdl @@ -0,0 +1,1648 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. * + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + + +mdl 1.6; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + +const string DESCRIPTION = "A synthetic leather material."; +const string DESCRIPTION_PUNCHED = "A synthetic leather material with punched holes. Available punch shapes are circles, lines, rectangles and squares."; + +annotation preview_scale( float f); + +// returns the min-max coordinates of a 2x2 atlas tile +float4 tile_select_2x2(uniform int select = 0) +{ + switch(select) + { + case 2: return float4(0.0f, 0.5f, 0.0f, 0.5f); + case 3: return float4(0.5f, 1.0f, 0.0f, 0.5f); + case 0: return float4(0.0f, 0.5f, 0.5f, 1.0f); + case 1: return float4(0.5f, 1.0f, 0.5f, 1.0f); + + default: return float4(0.0f, 0.5f, 0.0f, 0.5f); + } +} + + +export struct vm_coordinates +[[ + ::anno::hidden() +]] +{ + float2 uv; + float rotation; + int uv_space_index; + float4 carry; +}; + +enum vm_mono_select +[[ + anno::description("Modes for the creation of a gray-scale value from a color."), + anno::hidden() +]] +{ + mono_r = 0, + mono_g = 1, + mono_b = 2, + mono_a = 3, + mono_average = 4 +}; + +vm_coordinates vm_coord +( + float2 translation = float2(0.0f, 0.0) [[ + ::anno::display_name("Translation"), + ::anno::description("Translates the coordinates.") + ]], + float rotation = 0.0f [[ + ::anno::display_name("Rotation"), + ::anno::description("Rotates the coordinates in degrees.") + ]], + float2 scaling = float2(1.0f, 1.0f) [[ + ::anno::display_name("Scaling"), + ::anno::description("Scales the coordinates.") + ]], + uniform int uv_space = 0 [[ + ::anno::display_name("UV Space"), + ::anno::description("Chose the UV space.") + ]] +) +[[ + ::anno::display_name("vm Transform"), + ::anno::description("Generates coordinates to be used in vm_lookup functions.") +]] +{ + vm_coordinates uv; + ::base::texture_coordinate_info info = ::base::coordinate_source( ::base::texture_coordinate_uvw, uv_space); + uv.rotation = (rotation * 3.1415926535897932384626433832f) / 180.f; + uv.uv = float2(info.position.x, info.position.y); + float sine = ::math::sin(uv.rotation); + float cosine = ::math::cos(uv.rotation); + float2x2 rot = float2x2(cosine, -sine, sine, cosine); + uv.uv = rot * uv.uv; + uv.uv /= scaling; + uv.uv += translation; + return uv; +} + + +vm_coordinates vm_coord_hex( + vm_coordinates uv, + float scale = 1.0f, + float rotation = 45.0f + + //,float2 rot_center=0.5f +) +{ + vm_coordinates uv_return; + float2 uv_ = float2(uv.uv.x, uv.uv.y); + float rot_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + + float sine = ::math::sin(rot_rad); + float cosine = ::math::cos(rot_rad); + float2x2 rot = float2x2(cosine, -sine, sine, cosine); + + // same as from function get_hex above + float2 s = float2(1.0f, 1.7320508f); + float2 n = uv_ - float2(0.5f, 1.0f); + float4 c = ::math::floor(float4(uv_.x, uv_.y, n.x, n.y)/float4(s.x, s.y, s.x, s.y)) + 0.5f; + float2 h_1 = uv_ - float2(c.x, c.y) * s; + float2 h_2 = uv_ - (float2(c.z, c.w) + 0.5f) * s; + 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); + + float2 id_xy = float2(uv_id.x, uv_id.y); + + //uv_return.uv = float2(id_xy.x*scale+.5f, id_xy.y*scale+.5f); + uv_return.uv = rot*float2(id_xy.x*scale, id_xy.y*scale); + uv_return.uv += 0.5f; + + + // unless we introduce random cell rotations where we need to compensate for this in the rotation + // we can just plain copy the rotation value + uv_return.rotation = uv.rotation + rot_rad; + return uv_return; +} + +// Offsets a set of uv coordinates in either row (u) or column (v) direction +vm_coordinates vm_coord_rowcol_offset( + vm_coordinates uv, + float offset, + bool horizontal_offset = true +) +{ + int index = horizontal_offset ? 0 : 1; + uv.uv[index] += ::math::floor(uv.uv[index ^ 1]) * offset; + return uv; +} + +vm_coordinates vm_coord_grid( + vm_coordinates uv, + float scale = 1.0f, + float rotation = 45.0f +) +{ + float rot_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + float sine = ::math::sin(rot_rad); + float cosine = ::math::cos(rot_rad); + float2x2 rot = float2x2(cosine, -sine, sine, cosine); + + float2x2 scal = float2x2(scale, 0., 0., scale); + uv.uv = ::math::frac(uv.uv); + uv.uv -= 0.5f; + uv.uv = rot*(scal * uv.uv); + uv.uv = uv.uv + 0.5f; + uv.rotation += rot_rad; + return uv; +} + +::base::texture_return vm_tex_lookup( + uniform texture_2d tex, + vm_coordinates uv = vm_coord(), + uniform vm_mono_select mono_source = mono_a, + float4 scale = float4(1.0f), + + uniform ::tex::wrap_mode wrap_u = ::tex::wrap_repeat, + uniform ::tex::wrap_mode wrap_v = ::tex::wrap_repeat, + uniform float2 crop_u = float2(0.0, 1.0), + uniform float2 crop_v = float2(0.0, 1.0) +) +{ + float mono; + float4 lookup = ::tex::lookup_float4(tex, uv.uv, wrap_u, wrap_v, crop_u, crop_v) * scale; + switch( mono_source ) { + case mono_r: mono = lookup.x; + break; + case mono_g: mono = lookup.y; + break; + case mono_b: mono = lookup.z; + break; + case mono_a: mono = lookup.w; + break; + case mono_average: mono = ::math::average(float3(lookup.x, lookup.y, lookup.z)); + break; + } + return ::base::texture_return(color(lookup.x, lookup.y, lookup.z), mono); +} + +// *** SET CUTOUT ENUM NAMES *** +export enum cutout_pattern +[[ + ::anno::description("Cutout Pattern"), + ::anno::hidden() +]] +{ + pattern_circle = 0 + [[ ::anno::display_name("Circle")]], + pattern_hexagon = 1 + [[ ::anno::display_name("Square")]], + pattern_line = 2 + [[ ::anno::display_name("Line") ]], + + pattern_square = 3 + [[ ::anno::display_name("Rectangle")]] +}; + + +float remap(float input, float low, float high) +{ + //return low + input * (high - low); + return ::math::lerp(low, high, input); +} + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + + + +float2 rnd22(int2 p) { + float2 ret_val = float2( + uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f, + uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f + ); + return ret_val; +} + +float2x2 invert_2x2(float2x2 M) +{ + float det = M[0][0]*M[1][1] - M[0][1]*M[1][0]; + //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/ + return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]); +} + +float3 srgb2rgb(float3 val) +{ + return ::math::pow(::math::max(val, float3(0.0f)), 2.2); +} + +float3 rgb2srgb(float3 val) [[ anno::unused() ]] { + return ::math::pow( ::math::max(val, float3(0.f)), float3(1./2.2) ); +} + + +float3 nonrepeat_lookup( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5), + float patch_size = 8.0 +) +{ + + float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale; + float Z = patch_size; // patch scale inside example texture + + float3 O = float3(0.f); + float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); + float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space + + float2 U = uv_in; + float2 V = M * uv_in; //pre-tilted hexa coordinates + int2 I = int2(::math::floor(V)); // hexa-tile id + + // The mean color needs to be determined in Photoshop then to make the + // average color work out, take the float value and calculate the apropriate + // mean value as (value^(1/2.2)) + + float3 m = average_color; + + float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; + F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates + + if( F[2] > 0.f ) + O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m) + + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m) + + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m); + else + O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m) + + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m) + + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m); + O = m + O/::math::length(W); + O = ::math::clamp( (O), 0.0, 1.0); + + return float3(O); +} + +float histogram_range(float input, float range = 1.0f, float position = 0.5f) +{ + float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); + float high = ::math::clamp(math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); + return ::math::lerp(low, high, input); +} + +float remap_xy_to_0_1(float input, float x, float y) +{ + return (input - x)/(y - x); +} + +float histogram_scan_big(float input, float width, float position) +{ + return ::math::clamp( + remap_xy_to_0_1(input, + ::math::lerp(-width, 1.0, position), + ::math::lerp(0.0, 1.0 + width, position)), + 0.0, + 1.0); +} + +float3 endless_normal( + uniform texture_2d texture = texture_2d(), + float factor = 1.0, + bool flip_tangent_u = false, + bool flip_tangent_v = false, + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 10.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0 + //bool srgb2rgb = false, + //bool rgb2srgb = false +) +{ + float3 transformed_tangent_u = flip_tangent_u ? uvw.tangent_u : - uvw.tangent_u; + float3 transformed_tangent_v = flip_tangent_v ? uvw.tangent_v : - uvw.tangent_v; + + // normalized Lookup + float3 tangent_space_normal = + (nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + ) - 0.5) * (2.0 * factor); + + return ::math::normalize(transformed_tangent_u * tangent_space_normal.x + + transformed_tangent_v * tangent_space_normal.y + + state::normal()*1.0); +} + +::base::texture_coordinate_info transform_coordinate_2( + float4x4 transform + [[ anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix") ]], + ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info() + [[ anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection") ]] +) [[ + ::anno::description("Transform a texture coordinate by a matrix.") , + ::anno::noinline() + ]] +{ + // Version 2 + float4 r_position = transform * float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1); + //Try aproximating it for the case that the rotation is only aroud z and assuming the texture layout is nice and z is ~constant. + //just pretend there is no other rotation happening + //get rid of scaling and translation. Then extract fields where sin and cos would be in a simple 2d transform around z. + float4 u = transform[0]; + float3 ru = ::math::normalize(float3(u.x,u.y,u.z)); + float cos = ru.x; + float sin = -ru.y; + + + return ::base::texture_coordinate_info( + float3(r_position.x,r_position.y,r_position.z), + math::normalize(cos * coordinate.tangent_u - sin * coordinate.tangent_v), + math::normalize(cos * coordinate.tangent_v + sin * coordinate.tangent_u)); +} + +::base::texture_coordinate_info vmat_transform( + float2 translation = float2(0.0, 0.0), + float rotation = 0.0, // rotation in degrees + float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation_rad); + float c = ::math::cos(rotation_rad); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return transform_coordinate_2(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + + +color endless_texture( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 10.0, + float3 average_color = float3(0.5, 0.5, .5), + float patch_size = 8.0, + bool gamma_correct_lookup = true +) +{ + return gamma_correct_lookup ? color(srgb2rgb( + nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )) + ) : color(nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )); +} +export material ABS_Hard_Leather( + uniform bool infinite_tiling = false [[ + ::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."), + ::anno::display_name("Infinite Tiling"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + color leather_color = color(0.02f) [[ + ::anno::description("Choose the color of the leather."), + ::anno::display_name("Leather Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(1) + ]], + float brightness_ao_cavity = 0.2f [[ + ::anno::description("Adjusts the lightness of the cavity."), + ::anno::display_name("Cavity Brightness"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 1.f), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float roughness = .6f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float reflectivity = 1.f [[ + ::anno::description("Amount of variation applied to the roughness, higher numbers lead to non uniform reflections of the material."), + ::anno::display_name("Roughness Variation"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + uniform float bump_strength = 0.5f [[ + ::anno::description("Specifies the strength of the bump."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 1.f), + ::anno::hard_range(0.f, 2.f), + ::anno::ui_order(5) + ]], + float2 texture_translate = 0.f [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform"), + ::anno::ui_order(6) + ]], + float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f), + ::anno::ui_order(7) + ]], + float2 texture_scale = 1.f [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::preview_scale(3.0f), + ::anno::ui_order(8) + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Uses selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Transform"), + ::anno::ui_order(9) + ]], + uniform bool enable_round_corners = false [[ + ::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."), + ::anno::display_name("Enable Round Corners"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(10) + ]], + uniform float radius = 1.5f [[ + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::display_name("Round Corner Radius"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(11) + ]], + uniform bool across_materials = false [[ + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::display_name("Across Materials"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(12) + ]]) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Hard Leather - Black"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "design", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "black", "dark", "neutral")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] + = + let { + bool tmp0 = false; + + texture_2d rough_height_ao_tex = texture_2d("./abs_hard_leather_multi_R_rough_G_height_B_ao.jpg", ::tex::gamma_linear); + texture_2d norm_tex = texture_2d("./abs_hard_leather_norm.jpg", ::tex::gamma_linear); + + material_surface tmp1(df::custom_curve_layer(0.0399999991f, 1.f, 5.f, math::pow(histogram_scan_big(float3(infinite_tiling ? endless_texture(rough_height_ao_tex, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 13.f, float3(0.792156994f, 0.545098007f, 0.800000012f), 13.f, false) : base::file_texture(rough_height_ao_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 * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[1], 0.389999986f, math::lerp(0.f, 0.560000002f, math::pow(reflectivity, 0.349999994f))), 1.49000001f), df::microfacet_ggx_smith_bsdf(histogram_range(float3(infinite_tiling ? endless_texture(rough_height_ao_tex, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 13.f, float3(0.792156994f, 0.545098007f, 0.800000012f), 13.f, false) : base::file_texture(rough_height_ao_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 * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[0], 0.300000012f, math::lerp(0.300000012f, 0.859999955f, roughness)) * histogram_range(float3(infinite_tiling ? endless_texture(rough_height_ao_tex, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 13.f, float3(0.792156994f, 0.545098007f, 0.800000012f), 13.f, false) : base::file_texture(rough_height_ao_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 * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[0], 0.300000012f, math::lerp(0.300000012f, 0.859999955f, roughness)), histogram_range(float3(infinite_tiling ? endless_texture(rough_height_ao_tex, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 13.f, float3(0.792156994f, 0.545098007f, 0.800000012f), 13.f, false) : base::file_texture(rough_height_ao_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 * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[0], 0.300000012f, math::lerp(0.300000012f, 0.859999955f, roughness)) * histogram_range(float3(infinite_tiling ? endless_texture(rough_height_ao_tex, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 13.f, float3(0.792156994f, 0.545098007f, 0.800000012f), 13.f, false) : base::file_texture(rough_height_ao_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 * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[0], 0.300000012f, math::lerp(0.300000012f, 0.859999955f, roughness)), color(1.f, 1.f, 1.f), nvidia::core_definitions::blend_colors(leather_color, color(histogram_range(0.100000001f, 0.289999992f, float3(infinite_tiling ? endless_texture(rough_height_ao_tex, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 13.f, float3(0.792156994f, 0.545098007f, 0.800000012f), 13.f, false) : base::file_texture(rough_height_ao_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 * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[2])), base::color_layer_multiply, math::lerp(0.930000007f, 0.149999991f, remap(brightness_ao_cavity, 0.f, 20.f)), true).tint, state::texture_tangent_u(0), df::scatter_reflect), df::weighted_layer(1.f, df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(leather_color, color(histogram_range(0.100000001f, 0.289999992f, float3(infinite_tiling ? endless_texture(rough_height_ao_tex, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 13.f, float3(0.792156994f, 0.545098007f, 0.800000012f), 13.f, false) : base::file_texture(rough_height_ao_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 * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[2])), base::color_layer_multiply, math::lerp(0.930000007f, 0.149999991f, remap(brightness_ao_cavity, 0.f, 20.f)), true).tint, 0.f), bsdf(), infinite_tiling ? endless_normal(norm_tex, math::lerp(0.f, 2.f, bump_strength), false, false, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 13.f, float3(0.505882025f, 0.494118005f, 0.92156899f), 13.f) : base::tangent_space_normal_texture(norm_tex, math::lerp(0.f, 2.f, bump_strength), false, false, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 1.f, 0.f, 0.f, int2(0), tex::wrap_repeat, 30.f)), infinite_tiling ? endless_normal(norm_tex, math::lerp(0.f, 2.f, bump_strength), false, false, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 13.f, float3(0.505882025f, 0.494118005f, 0.92156899f), 13.f) : base::tangent_space_normal_texture(norm_tex, math::lerp(0.f, 2.f, bump_strength), false, false, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 1.f, 0.f, 0.f, int2(0), tex::wrap_repeat, 30.f)), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + material_geometry tmp5(float3(0.f), 1.f, enable_round_corners ? state::rounded_corner_normal(radius, across_materials, 1.f) : state::normal()); + + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + geometry: tmp5); + +export material ABS_Hard_Leather_Brown(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Hard Leather - Brown"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "design", "artifical", "hard", "leather", "car", "dashboard", "cloth", "furniture", "brown", "warm")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Brown.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Hard_Leather +( + infinite_tiling: false, + leather_color: color(0.0718f, 0.0316f, 0.001f), + brightness_ao_cavity: .3f, + roughness: .5f, + reflectivity: .0f, + bump_strength: .5f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + + +export material ABS_Hard_Leather_Grey(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Hard Leather - Grey"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "design", "artifical", "hard", "leather", "car", "dashboard", "cloth", "furniture", "grey", "neutral")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Grey.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Hard_Leather +( + infinite_tiling: false, + leather_color: color(0.06f), + brightness_ao_cavity: .2f, + roughness: .2f, + reflectivity: .0f, + bump_strength: .5f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Hard_Leather_Peach(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Hard Leather - Peach"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "design", "artifical", "hard", "leather", "car", "dashboard", "cloth", "furniture", "warm", "peach", "orange")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Peach.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Hard_Leather +( + infinite_tiling: false, + leather_color: color(0.274677f, 0.078187f, 0.004777f), + brightness_ao_cavity: .2f, + roughness: .2f, + reflectivity: .0f, + bump_strength: .5f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Hard_Leather_Vintage_Rose(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Hard Leather - Rose Vintage"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "design", "artifical", "vintage", "hard", "leather", "car", "dashboard", "cloth", "furniture", "warm", "rose")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Vintage_Rose.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Hard_Leather +( + infinite_tiling: false, + leather_color: color(0.135633f, 0.059511f, 0.059511f), + brightness_ao_cavity: .2f, + roughness: .25f, + reflectivity: .0f, + bump_strength: .5f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + + +export material ABS_Hard_Leather_Moss(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Hard Leather - Moss"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "design", "artifical", "hard", "leather", "car", "dashboard", "cloth", "furniture", "green", "moss")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Moss.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Hard_Leather +( + infinite_tiling: false, + leather_color: color(0.0546f, 0.0582f, 0.00775f), + brightness_ao_cavity: .2f, + roughness: .4f, + reflectivity: .0f, + bump_strength: .5f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Hard_Leather_Sky(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Hard Leather - Sky"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "design", "artifical", "hard", "leather", "car", "dashboard", "cloth", "furniture", "cold", "blue", "sky", "baby")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Sky.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Hard_Leather +( + infinite_tiling: false, + leather_color: color(0.042311f, 0.116971f, 0.187821f), + brightness_ao_cavity: .2f, + roughness: .2f, + reflectivity: .0f, + bump_strength: .5f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Hard_Leather_Pop_Turquoise(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Hard Leather - Pop Turquoise"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "design", "artifical", "hard", "leather", "car", "dashboard", "cloth", "furniture", "cold", "pop", "turquoise", "blue")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Pop_Turquoise.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Hard_Leather +( + infinite_tiling: false, + leather_color: color(0.0399f, 0.448f, 0.364f), + brightness_ao_cavity: .1f, + roughness: .0f, + reflectivity: 1.f, + bump_strength: .6f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Hard_Leather_Pop_Pink(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Hard Leather - Pop Pink"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "design", "artifical", "hard", "leather", "car", "dashboard", "cloth", "furniture", "cold", "pop", "pink")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Pop_Pink.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Hard_Leather +( + infinite_tiling: false, + leather_color: color(0.567f, 0.0494f, 0.216f), + brightness_ao_cavity: .1f, + roughness: .0f, + reflectivity: 1.f, + bump_strength: .6f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Hard_Leather_Pop_Lime(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Hard Leather - Pop Lime"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "design", "artifical", "hard", "leather", "car", "dashboard", "cloth", "furniture", "pop", "lime", "green")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Pop_Lime.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Hard_Leather +( + infinite_tiling: false, + leather_color: color(0.254152f, 0.533276f, 0.042311f), + brightness_ao_cavity: .1f, + roughness: .0f, + reflectivity: 1.f, + bump_strength: .6f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Hard_Leather_Deep_Ocean(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Hard Leather - Deep Ocean"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "design", "artifical", "hard", "leather", "car", "dashboard", "cloth", "furniture", "cold", "deep", "ocean", "dark")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Deep_Ocean.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Hard_Leather +( + infinite_tiling: false, + leather_color: color(0.0097f, 0.0316f, 0.128f), + brightness_ao_cavity: .1f, + roughness: .3f, + reflectivity: 1.f, + bump_strength: .6f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Hard_Leather_Deep_Green(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Hard Leather - Deep Green"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "design", "artifical", "hard", "leather", "car", "dashboard", "cloth", "furniture", "cold", "deep", "green", "dark")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Deep_Green.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Hard_Leather +( + infinite_tiling: false, + leather_color: color(0.0179f, 0.0738f, 0.0478f), + brightness_ao_cavity: .1f, + roughness: .2f, + reflectivity: 1.f, + bump_strength: .6f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Hard_Leather_Deep_Violet(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Hard Leather - Deep Violet"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "design", "artifical", "hard", "leather", "car", "dashboard", "cloth", "furniture", "cold", "deep", "violet", "dark")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Deep_Violet.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Hard_Leather +( + infinite_tiling: false, + leather_color: color(0.043f, 0.00902f, 0.142f), + brightness_ao_cavity: .1f, + roughness: .5f, + reflectivity: .3f, + bump_strength: .6f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + + + + +// ----------------- Punched Leather ----------------- +export material ABS_Hard_Leather_Punched( + +// Leather parameters + uniform bool infinite_tiling = false [[ + ::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."), + ::anno::display_name("Infinite Tiling"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + color leather_color = color(0.012983f, 0.012983f, 0.012983f) [[ + ::anno::description("Choose the color of the leather."), + ::anno::display_name("Leather Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(1) + ]], + float roughness = .6f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float reflectivity = 1.f [[ + ::anno::description("Amount of variation applied to the roughness, higher numbers lead to non uniform reflections of the material."), + ::anno::display_name("Roughness Variation"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + uniform float bump_strength = 0.5f [[ + ::anno::description("Specifies the strength of the bump."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 1.f), + ::anno::hard_range(0.f, 2.f), + ::anno::ui_order(5) + ]], + float2 texture_translate = 0.f [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform"), + ::anno::ui_order(6) + ]], + float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f), + ::anno::ui_order(7) + ]], + float2 texture_scale = 1.f [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::preview_scale(3.5f), + ::anno::ui_order(8) + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Uses selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Transform"), + ::anno::ui_order(9) + ]], +// Punching parameters + uniform cutout_pattern shape_select = pattern_circle //select atlas tile here + [[ + ::anno::description("Select a cutout shape."), + ::anno::display_name("Cutout Shape"), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(10) + ]], + float punching_grid_size = 1.0f + [[ + ::anno::description("Scales the size of the punching grid."), + ::anno::display_name("Punching Grid Size"), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(11) + ]], + float cutout_rotation = 45.0f + [[ + ::anno::description("Rotates the cutout shape."), + ::anno::display_name("Cutout Rotation"), + ::anno::hard_range(0.f, 360.0f), + ::anno::soft_range(0.f, 360.0f), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(12) + ]], + float cutout_size = .4f + [[ + ::anno::description("Scales the size of the cutout pattern independently from the base material."), + ::anno::display_name("Cutout Size"), + ::anno::hard_range(0.f, 1.2f), + ::anno::soft_range(0.f, 1.0f), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(12) + ]], + float cutout_roundness = .5f + [[ + ::anno::description("At low values it makes the cutouts sharper. Higher values give the shapes a more rounded look."), + ::anno::display_name("Cutout Roundness"), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(13) + ]], + float cutout_bump_strength = 1.0f + [[ + ::anno::description("Sets the strength of the bevelled normal around the cutout."), + ::anno::display_name("Cutout Bevel Strength"), + ::anno::soft_range(0.0f, 1.0f), + ::anno::hard_range(0.0f, 2.0f), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(15) + ]], +// Grid Layout parameters + bool hexagonal_grid = true + [[ + ::anno::description("When enabled, the punching will occur on a hexagonal grid, otherwise a square grid."), + ::anno::display_name("Enable Hexagonal Grid"), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(16) + ]], + float square_grid_offset = 0.0f + [[ + ::anno::description("Offsets each row of the grid by a certain amount. Applies only when hexagonal grid is disabled."), + ::anno::display_name("Square Grid Offset"), + ::anno::in_group("Appearance", "Cutout"), + ::anno::enable_if("hexagonal_grid==false"), + ::anno::ui_order(17) + ]], + uniform bool enable_round_corners = false [[ + ::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."), + ::anno::display_name("Enable Round Corners"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(18) + ]], + uniform float radius = 1.5f [[ + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::display_name("Round Corner Radius"), + ::anno::in_group("Round Corners"), + ::anno::enable_if("enable_round_corners==true"), + ::anno::ui_order(19) + ]], + uniform bool across_materials = false [[ + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::display_name("Across Materials"), + ::anno::in_group("Round Corners"), + ::anno::enable_if("enable_round_corners==true"), + ::anno::ui_order(20) + ]] +) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Hard Leather - Black Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "design", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "black", "dark", "neutral")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] = let +{ + float brightness_ao_cavity = 0.2f; + bool horizontal_offset = true; + float cutout_bevel_width = 0.7f; + float cutout_bump_strength_2 = cutout_bump_strength * 5.0f; + + material base_mat = ABS_Hard_Leather( + infinite_tiling: infinite_tiling, + leather_color: leather_color, + brightness_ao_cavity: brightness_ao_cavity, + roughness: roughness, + reflectivity: reflectivity, + bump_strength: bump_strength, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + enable_round_corners: enable_round_corners, + radius: radius, + across_materials: across_materials + ); + + // remap range of slider to avoid artifacts in the bevelling + float2 punching_scale = texture_scale * 0.01f * float2(punching_grid_size); + float cutout_roundness_ = cutout_roundness*0.6f+0.4f; + float cutout_size_lin = (1.0f/cutout_size); + texture_2d punching_cutout = texture_2d("./leather_punch_atlas_01.png", ::tex::gamma_linear); + + vm_coordinates uv = vm_coord( + translation: texture_translate, + rotation: texture_rotate, + scaling: punching_scale, + uv_space: uv_space_index + ); + + vm_coordinates punching_uv = hexagonal_grid ? vm_coord_hex( + uv: uv, + scale: cutout_roundness_ * cutout_size_lin, + rotation: cutout_rotation + ) : vm_coord_grid( + uv: vm_coord_rowcol_offset( + uv: uv, + offset: square_grid_offset, + horizontal_offset: horizontal_offset + ), + scale: cutout_roundness_ * cutout_size_lin, + rotation: cutout_rotation + ); + // select the correct subtile from the atlas + float4 crop = tile_select_2x2(shape_select); + + ::base::texture_return lookup = vm_tex_lookup( + tex: punching_cutout, + uv: punching_uv, + mono_source: mono_a, + scale: float4(1.0f), + crop_u: float2(crop.x, crop.y), + crop_v: float2(crop.z, crop.w), + wrap_u: ::tex::wrap_clamp, + wrap_v: ::tex::wrap_clamp + ); + + float low = (1.0 - cutout_roundness_); + float high = (cutout_size_lin * (cutout_bevel_width * 0.2f) * cutout_roundness_) + (1.0 - cutout_roundness_); + // remap x...y to (clamped) 0...1 + float x = ::math::clamp((lookup.mono - low)/(high - low), 0.0, 1.0); + // spherical falloff + float falloff=::math::sqrt(1.0-x*x); + // masking falloff as the center of the cutout is flat + float masked_falloff=falloff<=0.0?1.0:falloff; + + // where base material is still there, use the value of the base material + float cutout= ::math::min(falloff<=0.0?0.0:1.0, base_mat.geometry.cutout_opacity); + + // bring in -.5 ... +.5 range and lerp between lookup and flat normal + float3 remap_norm = ::math::lerp(float3(lookup.tint), float3(0.5, 0.5, 1.0), masked_falloff) - float3(0.5); + float3 t_norm = ::math::normalize(remap_norm * float3(cutout_bump_strength_2, cutout_bump_strength_2, 1.0)); + + float3 rotfix_norm = float3(::math::cos(punching_uv.rotation) * t_norm.x - ::math::sin(punching_uv.rotation) * t_norm.y, + ::math::sin(punching_uv.rotation) * t_norm.x + ::math::cos(punching_uv.rotation) * t_norm.y, + t_norm.z); + + float3 normal = ::state::texture_tangent_u(punching_uv.uv_space_index) * rotfix_norm.x + + ::state::texture_tangent_v(punching_uv.uv_space_index) * rotfix_norm.y + + ::state::normal() * rotfix_norm.z; + + float3 final_normal = ::base::blend_normals( + base_normal: normal, + base_normal_weight: 1.0f, + detail_normal: base_mat.geometry.normal, + detail_normal_weight: 1.0f + ); + +} in material( + surface: material_surface( + scattering: base_mat.surface.scattering + ), + volume: base_mat.volume, + ior: base_mat.ior, + thin_walled: true, + geometry: material_geometry( + displacement: base_mat.geometry.displacement, + normal: final_normal, + cutout_opacity: cutout + ) +); + + + +export material ABS_Hard_Leather_Brown_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Hard Leather - Brown Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "ABS", "design", "artifical", "hard", "leather", "car", "dashboard", "cloth", "furniture", "brown", "warm")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Brown_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] = ABS_Hard_Leather_Punched( + infinite_tiling: false, + leather_color: color(0.0718f, 0.0316f, 0.001f), + roughness: .5f, + reflectivity: .0f, + bump_strength: .5f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + + +export material ABS_Hard_Leather_Grey_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Hard Leather - Grey Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "ABS", "design", "artifical", "hard", "leather", "car", "dashboard", "cloth", "furniture", "grey", "neutral")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Grey_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Hard_Leather_Punched +( + infinite_tiling: false, + leather_color: color(0.06f), + roughness: .2f, + reflectivity: .0f, + bump_strength: .5f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + + +export material ABS_Hard_Leather_Peach_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Hard Leather - Peach Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "ABS", "design", "artifical", "hard", "leather", "car", "dashboard", "cloth", "furniture", "warm", "peach", "orange")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Peach_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Hard_Leather_Punched +( + infinite_tiling: false, + leather_color: color(0.274677f, 0.078187f, 0.004777f), + roughness: .2f, + reflectivity: .0f, + bump_strength: .5f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Hard_Leather_Vintage_Rose_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Hard Leather - Rose Vintage Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "ABS", "design", "artifical", "vintage", "hard", "leather", "car", "dashboard", "cloth", "furniture", "warm", "rose")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Vintage_Rose_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Hard_Leather_Punched +( + infinite_tiling: false, + leather_color: color(0.135633f, 0.059511f, 0.059511f), + roughness: .25f, + reflectivity: .0f, + bump_strength: .5f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + + +export material ABS_Hard_Leather_Moss_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Hard Leather - Moss Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "ABS", "design", "artifical", "hard", "leather", "car", "dashboard", "cloth", "furniture", "green", "moss")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Moss_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Hard_Leather_Punched +( + infinite_tiling: false, + leather_color: color(0.0546f, 0.0582f, 0.00775f), + roughness: .4f, + reflectivity: .0f, + bump_strength: .5f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Hard_Leather_Sky_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Hard Leather - Sky Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "ABS", "design", "artifical", "hard", "leather", "car", "dashboard", "cloth", "furniture", "cold", "blue", "sky", "baby")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Sky_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Hard_Leather_Punched +( + infinite_tiling: false, + leather_color: color(0.042311f, 0.116971f, 0.187821f), + roughness: .2f, + reflectivity: .0f, + bump_strength: .5f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Hard_Leather_Pop_Turquoise_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Hard Leather - Pop Turquoise Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "ABS", "design", "artifical", "hard", "leather", "car", "dashboard", "cloth", "furniture", "cold", "pop", "turquoise", "blue")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Pop_Turquoise_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Hard_Leather_Punched +( + infinite_tiling: false, + leather_color: color(0.0399f, 0.448f, 0.364f), + roughness: .0f, + reflectivity: 1.f, + bump_strength: .6f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Hard_Leather_Pop_Pink_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Hard Leather - Pop Pink Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "ABS", "design", "artifical", "hard", "leather", "car", "dashboard", "cloth", "furniture", "cold", "pop", "pink")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Pop_Pink_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Hard_Leather_Punched +( + infinite_tiling: false, + leather_color: color(0.567f, 0.0494f, 0.216f), + roughness: .0f, + reflectivity: 1.f, + bump_strength: .6f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Hard_Leather_Pop_Lime_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Hard Leather - Pop Lime Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "ABS", "design", "artifical", "hard", "leather", "car", "dashboard", "cloth", "furniture", "pop", "lime", "green")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Pop_Lime_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Hard_Leather_Punched +( + infinite_tiling: false, + leather_color: color(0.254152f, 0.533276f, 0.042311f), + roughness: .0f, + reflectivity: 1.f, + bump_strength: .6f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Hard_Leather_Deep_Ocean_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Hard Leather - Deep Ocean Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "ABS", "design", "artifical", "hard", "leather", "car", "dashboard", "cloth", "furniture", "cold", "deep", "ocean", "dark")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Deep_Ocean_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Hard_Leather_Punched +( + infinite_tiling: false, + leather_color: color(0.0097f, 0.0316f, 0.128f), + roughness: .3f, + reflectivity: 1.f, + bump_strength: .6f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Hard_Leather_Deep_Green_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Hard Leather - Deep Green Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "ABS", "design", "artifical", "hard", "leather", "car", "dashboard", "cloth", "furniture", "cold", "deep", "green", "dark")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Deep_Green_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Hard_Leather_Punched +( + infinite_tiling: false, + leather_color: color(0.0179f, 0.0738f, 0.0478f), + roughness: .2f, + reflectivity: 1.f, + bump_strength: .6f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Hard_Leather_Deep_Violet_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Hard Leather - Deep Violet Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "ABS", "design", "artifical", "hard", "leather", "car", "dashboard", "cloth", "furniture", "cold", "deep", "violet", "dark")), + ::anno::thumbnail("./.thumbs/ABS_Hard_Leather.ABS_Hard_Leather_Deep_Violet_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Hard_Leather_Punched +( + infinite_tiling: false, + leather_color: color(0.043f, 0.00902f, 0.142f), + roughness: .5f, + reflectivity: .3f, + bump_strength: .6f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + + + diff --git a/Material/material_0365/ABS_Soft_Leather.mdl b/Material/material_0365/ABS_Soft_Leather.mdl new file mode 100644 index 0000000000000000000000000000000000000000..2be18929ebc1b890a7a2ca53075547ea717a3c39 --- /dev/null +++ b/Material/material_0365/ABS_Soft_Leather.mdl @@ -0,0 +1,1645 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. * + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + + +mdl 1.6; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + +const string DESCRIPTION = "A synthetic leather material."; +const string DESCRIPTION_PUNCHED = "A synthetic leather material with punched holes. Available punch shapes are circles, lines, rectangles and squares."; + +annotation preview_scale( float f); + + +// returns the min-max coordinates of a 2x2 atlas tile +float4 tile_select_2x2(uniform int select = 0) +{ + switch(select) + { + case 2: return float4(0.0f, 0.5f, 0.0f, 0.5f); + case 3: return float4(0.5f, 1.0f, 0.0f, 0.5f); + case 0: return float4(0.0f, 0.5f, 0.5f, 1.0f); + case 1: return float4(0.5f, 1.0f, 0.5f, 1.0f); + + default: return float4(0.0f, 0.5f, 0.0f, 0.5f); + } +} + + +export struct vm_coordinates +[[ + ::anno::hidden() +]] +{ + float2 uv; + float rotation; + int uv_space_index; + float4 carry; +}; + +enum vm_mono_select +[[ + anno::description("Modes for the creation of a gray-scale value from a color."), + anno::hidden() +]] +{ + mono_r = 0, + mono_g = 1, + mono_b = 2, + mono_a = 3, + mono_average = 4 +}; + +vm_coordinates vm_coord +( + float2 translation = float2(0.0f, 0.0) [[ + ::anno::display_name("Translation"), + ::anno::description("Translates the coordinates.") + ]], + float rotation = 0.0f [[ + ::anno::display_name("Rotation"), + ::anno::description("Rotates the coordinates in degrees.") + ]], + float2 scaling = float2(1.0f, 1.0f) [[ + ::anno::display_name("Scaling"), + ::anno::description("Scales the coordinates.") + ]], + uniform int uv_space = 0 [[ + ::anno::display_name("UV Space"), + ::anno::description("Choose the UV space.") + ]] +) +[[ + ::anno::display_name("vm Transform"), + ::anno::description("Generates coordinates to be used in vm_lookup functions.") +]] +{ + vm_coordinates uv; + ::base::texture_coordinate_info info = ::base::coordinate_source( ::base::texture_coordinate_uvw, uv_space); + uv.rotation = (rotation * 3.1415926535897932384626433832f) / 180.f; + uv.uv = float2(info.position.x, info.position.y); + float sine = ::math::sin(uv.rotation); + float cosine = ::math::cos(uv.rotation); + float2x2 rot = float2x2(cosine, -sine, sine, cosine); + uv.uv = rot * uv.uv; + uv.uv /= scaling; + uv.uv += translation; + return uv; +} + + +vm_coordinates vm_coord_hex( + vm_coordinates uv, + float scale = 1.0f, + float rotation = 45.0f + + //,float2 rot_center=0.5f +) +{ + vm_coordinates uv_return; + float2 uv_ = float2(uv.uv.x, uv.uv.y); + float rot_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + + float sine = ::math::sin(rot_rad); + float cosine = ::math::cos(rot_rad); + float2x2 rot = float2x2(cosine, -sine, sine, cosine); + + // same as from function get_hex above + float2 s = float2(1.0f, 1.7320508f); + float2 n = uv_ - float2(0.5f, 1.0f); + float4 c = ::math::floor(float4(uv_.x, uv_.y, n.x, n.y)/float4(s.x, s.y, s.x, s.y)) + 0.5f; + float2 h_1 = uv_ - float2(c.x, c.y) * s; + float2 h_2 = uv_ - (float2(c.z, c.w) + 0.5f) * s; + 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); + + float2 id_xy = float2(uv_id.x, uv_id.y); + + //uv_return.uv = float2(id_xy.x*scale+.5f, id_xy.y*scale+.5f); + uv_return.uv = rot*float2(id_xy.x*scale, id_xy.y*scale); + uv_return.uv += 0.5f; + + + // unless we introduce random cell rotations where we need to compensate for this in the rotation + // we can just plain copy the rotation value + uv_return.rotation = uv.rotation + rot_rad; + return uv_return; +} + +// Offsets a set of uv coordinates in either row (u) or column (v) direction +vm_coordinates vm_coord_rowcol_offset( + vm_coordinates uv, + float offset, + bool horizontal_offset = true +) +{ + int index = horizontal_offset ? 0 : 1; + uv.uv[index] += ::math::floor(uv.uv[index ^ 1]) * offset; + return uv; +} + +vm_coordinates vm_coord_grid( + vm_coordinates uv, + float scale = 1.0f, + float rotation = 45.0f +) +{ + float rot_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + float sine = ::math::sin(rot_rad); + float cosine = ::math::cos(rot_rad); + float2x2 rot = float2x2(cosine, -sine, sine, cosine); + + float2x2 scal = float2x2(scale, 0., 0., scale); + uv.uv = ::math::frac(uv.uv); + uv.uv -= 0.5f; + uv.uv = rot*(scal * uv.uv); + uv.uv = uv.uv + 0.5f; + uv.rotation += rot_rad; + return uv; +} + +::base::texture_return vm_tex_lookup( + uniform texture_2d tex, + vm_coordinates uv = vm_coord(), + uniform vm_mono_select mono_source = mono_a, + float4 scale = float4(1.0f), + + uniform ::tex::wrap_mode wrap_u = ::tex::wrap_repeat, + uniform ::tex::wrap_mode wrap_v = ::tex::wrap_repeat, + uniform float2 crop_u = float2(0.0, 1.0), + uniform float2 crop_v = float2(0.0, 1.0) +) +{ + float mono; + float4 lookup = ::tex::lookup_float4(tex, uv.uv, wrap_u, wrap_v, crop_u, crop_v) * scale; + switch( mono_source ) { + case mono_r: mono = lookup.x; + break; + case mono_g: mono = lookup.y; + break; + case mono_b: mono = lookup.z; + break; + case mono_a: mono = lookup.w; + break; + case mono_average: mono = ::math::average(float3(lookup.x, lookup.y, lookup.z)); + break; + } + return ::base::texture_return(color(lookup.x, lookup.y, lookup.z), mono); +} + +// *** SET CUTOUT ENUM NAMES *** +export enum cutout_pattern +[[ + ::anno::description("Cutout Pattern"), + ::anno::hidden() +]] +{ + pattern_circle = 0 + [[ ::anno::display_name("Circle")]], + pattern_hexagon = 1 + [[ ::anno::display_name("Square")]], + pattern_line = 2 + [[ ::anno::display_name("Line") ]], + + pattern_square = 3 + [[ ::anno::display_name("Rectangle")]] +}; + + +float remap(float input, float low, float high) +{ + //return low + input * (high - low); + return ::math::lerp(low, high, input); +} + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + + + +float2 rnd22(int2 p) { + float2 ret_val = float2( + uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f, + uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f + ); + return ret_val; +} + +float2x2 invert_2x2(float2x2 M) +{ + float det = M[0][0]*M[1][1] - M[0][1]*M[1][0]; + //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/ + return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]); +} + +float3 srgb2rgb(float3 val) +{ + return ::math::pow(::math::max(val, float3(0.0f)), 2.2); +} + +float3 rgb2srgb(float3 val) [[ anno::unused() ]] { + return ::math::pow( ::math::max(val, float3(0.f)), float3(1./2.2) ); +} + + +float3 nonrepeat_lookup( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5), + float patch_size = 8.0 +) +{ + + float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale; + float Z = patch_size; // patch scale inside example texture + + float3 O = float3(0.f); + float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); + float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space + + float2 U = uv_in; + float2 V = M * uv_in; //pre-tilted hexa coordinates + int2 I = int2(::math::floor(V)); // hexa-tile id + + // The mean color needs to be determined in Photoshop then to make the + // average color work out, take the float value and calculate the apropriate + // mean value as (value^(1/2.2)) + + float3 m = average_color; + + float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; + F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates + + if( F[2] > 0.f ) + O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m) + + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m) + + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m); + else + O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m) + + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m) + + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m); + O = m + O/::math::length(W); + O = ::math::clamp( (O), 0.0, 1.0); + + return float3(O); +} + +float histogram_range(float input, float range = 1.0f, float position = 0.5f) +{ + float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); + float high = ::math::clamp(math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); + return ::math::lerp(low, high, input); +} + +float remap_xy_to_0_1(float input, float x, float y) +{ + return (input - x)/(y - x); +} + +float histogram_scan_big(float input, float width, float position) +{ + return ::math::clamp( + remap_xy_to_0_1(input, + ::math::lerp(-width, 1.0, position), + ::math::lerp(0.0, 1.0 + width, position)), + 0.0, + 1.0); +} + +float3 endless_normal( + uniform texture_2d texture = texture_2d(), + float factor = 1.0, + bool flip_tangent_u = false, + bool flip_tangent_v = false, + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 10.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0 + //bool srgb2rgb = false, + //bool rgb2srgb = false +) +{ + float3 transformed_tangent_u = flip_tangent_u ? uvw.tangent_u : - uvw.tangent_u; + float3 transformed_tangent_v = flip_tangent_v ? uvw.tangent_v : - uvw.tangent_v; + + // normalized Lookup + float3 tangent_space_normal = + (nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + ) - 0.5) * (2.0 * factor); + + return ::math::normalize(transformed_tangent_u * tangent_space_normal.x + + transformed_tangent_v * tangent_space_normal.y + + state::normal()*1.0); +} + +::base::texture_coordinate_info transform_coordinate_2( + float4x4 transform + [[ anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix.") ]], + ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info() + [[ anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection.") ]] +) [[ + ::anno::description("Transform a texture coordinate by a matrix.") , + ::anno::noinline() + ]] +{ + // Version 2 + float4 r_position = transform * float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1); + //Try aproximating it for the case that the rotation is only aroud z and assuming the texture layout is nice and z is ~constant. + //just pretend there is no other rotation happening + //get rid of scaling and translation. Then extract fields where sin and cos would be in a simple 2d transform around z. + float4 u = transform[0]; + float3 ru = ::math::normalize(float3(u.x,u.y,u.z)); + float cos = ru.x; + float sin = -ru.y; + + + return ::base::texture_coordinate_info( + float3(r_position.x,r_position.y,r_position.z), + math::normalize(cos * coordinate.tangent_u - sin * coordinate.tangent_v), + math::normalize(cos * coordinate.tangent_v + sin * coordinate.tangent_u)); +} + +::base::texture_coordinate_info vmat_transform( + float2 translation = float2(0.0, 0.0), + float rotation = 0.0, // rotation in degrees + float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation_rad); + float c = ::math::cos(rotation_rad); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return transform_coordinate_2(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + +color endless_texture( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 10.0, + float3 average_color = float3(0.5, 0.5, .5), + float patch_size = 8.0, + bool gamma_correct_lookup = true +) +{ + return gamma_correct_lookup ? color(srgb2rgb( + nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )) + ) : color(nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )); +} +export material ABS_Soft_Leather( + uniform bool infinite_tiling = false [[ + ::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."), + ::anno::display_name("Infinite Tiling"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + color color_2 = color( 0.012983f, 0.012983f, 0.012983f) [[ + ::anno::description("Choose the color of the leather."), + ::anno::display_name("Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(1) + ]], + float brightness_ao_cavity = 0.2f [[ + ::anno::description("Adjusts the lightness of the cavity."), + ::anno::display_name("Cavity Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float roughness = .6f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 1.f), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float reflectivity = 1.f [[ + ::anno::description("Amount of variation applied to the roughness, higher numbers lead to non uniform reflections of the material."), + ::anno::display_name("Roughness Variation"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + uniform float bump_strength = 0.5f [[ + ::anno::description("Specifies the strength of the bump."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 1.f), + ::anno::hard_range(0.f, 2.f), + ::anno::ui_order(5) + ]], + float2 texture_translate = 0.f [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform"), + ::anno::ui_order(6) + ]], + float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f), + ::anno::ui_order(7) + ]], + float2 texture_scale = 1.f [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::preview_scale(3.5f), + ::anno::ui_order(8) + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Uses selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Transform"), + ::anno::ui_order(9) + ]], + uniform bool enable_round_corners = false [[ + ::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."), + ::anno::display_name("Enable Round Corners"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(10) + ]], + uniform float radius = 1.5f [[ + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::display_name("Round Corner Radius"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(11) + ]], + uniform bool across_materials = false [[ + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::display_name("Across Materials"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(12) + ]]) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Soft Leather - Black"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "artifical", "black", "soft", "leather", "car", "dashboard", "cloth", "furniture")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] + = + let { + bool tmp0 = false; + + texture_2d rough_height_ao_tex = texture_2d("./abs_soft_leather_multi_R_rough_G_height_B_ao.jpg", ::tex::gamma_linear); + texture_2d norm_tex = texture_2d("./abs_soft_leather_norm.jpg", ::tex::gamma_linear); + + material_surface tmp1(df::custom_curve_layer(0.0399999991f, 1.f, 5.f, math::pow(histogram_scan_big(nvidia::core_definitions::blend_colors(color(float3(infinite_tiling ? endless_texture(rough_height_ao_tex, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 13.f, float3(0.627451003f, 0.615685999f, 0.690195978f), 13.f, false) : base::file_texture(rough_height_ao_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 * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[1]), color(float3(infinite_tiling ? endless_texture(rough_height_ao_tex, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 13.f, float3(0.627451003f, 0.615685999f, 0.690195978f), 13.f, false) : base::file_texture(rough_height_ao_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 * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[2]), base::color_layer_blend, 0.600000024f, true).mono, 1.f, math::lerp(0.f, 0.550000012f, math::pow(reflectivity, 0.349999994f))), 1.49000001f), df::microfacet_ggx_smith_bsdf(histogram_range(float3(infinite_tiling ? endless_texture(rough_height_ao_tex, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 13.f, float3(0.627451003f, 0.615685999f, 0.690195978f), 13.f, false) : base::file_texture(rough_height_ao_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 * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[0], 0.269999981f, math::lerp(0.300000012f, 1.f, roughness)) * histogram_range(float3(infinite_tiling ? endless_texture(rough_height_ao_tex, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 13.f, float3(0.627451003f, 0.615685999f, 0.690195978f), 13.f, false) : base::file_texture(rough_height_ao_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 * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[0], 0.269999981f, math::lerp(0.300000012f, 1.f, roughness)), histogram_range(float3(infinite_tiling ? endless_texture(rough_height_ao_tex, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 13.f, float3(0.627451003f, 0.615685999f, 0.690195978f), 13.f, false) : base::file_texture(rough_height_ao_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 * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[0], 0.269999981f, math::lerp(0.300000012f, 1.f, roughness)) * histogram_range(float3(infinite_tiling ? endless_texture(rough_height_ao_tex, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 13.f, float3(0.627451003f, 0.615685999f, 0.690195978f), 13.f, false) : base::file_texture(rough_height_ao_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 * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[0], 0.269999981f, math::lerp(0.300000012f, 1.f, roughness)), color(1.f, 1.f, 1.f), nvidia::core_definitions::blend_colors(color_2, color(histogram_range(0.100000001f, 0.289999992f, float3(infinite_tiling ? endless_texture(rough_height_ao_tex, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 13.f, float3(0.627451003f, 0.615685999f, 0.690195978f), 13.f, false) : base::file_texture(rough_height_ao_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 * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[2])), base::color_layer_multiply, math::lerp(0.930000007f, 0.149999991f, remap(brightness_ao_cavity, 0.f, 10.f)), true).tint, state::texture_tangent_u(0), df::scatter_reflect), df::weighted_layer(1.f, df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(color_2, color(histogram_range(0.100000001f, 0.289999992f, float3(infinite_tiling ? endless_texture(rough_height_ao_tex, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 13.f, float3(0.627451003f, 0.615685999f, 0.690195978f), 13.f, false) : base::file_texture(rough_height_ao_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 * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 0.f, int2(0), tex::wrap_repeat, 30.f).tint)[2])), base::color_layer_multiply, math::lerp(0.930000007f, 0.149999991f, remap(brightness_ao_cavity, 0.f, 10.f)), true).tint, 0.f), bsdf(), infinite_tiling ? endless_normal(norm_tex, math::lerp(0.f, 2.f, bump_strength), true, true, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 13.f, float3(0.501960993f, 0.501960993f, 0.972549021f), 13.f) : base::tangent_space_normal_texture(norm_tex, math::lerp(0.f, 2.f, bump_strength), false, false, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 1.f, 0.f, 0.f, int2(0), tex::wrap_repeat, 30.f)), infinite_tiling ? endless_normal(norm_tex, math::lerp(0.f, 2.f, bump_strength), true, true, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 13.f, float3(0.501960993f, 0.501960993f, 0.972549021f), 13.f) : base::tangent_space_normal_texture(norm_tex, math::lerp(0.f, 2.f, bump_strength), false, false, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 1.f, 0.f, 0.f, int2(0), tex::wrap_repeat, 30.f)), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + material_geometry tmp5(float3(0.f), 1.f, enable_round_corners ? state::rounded_corner_normal(radius, across_materials, 1.f) : state::normal()); + + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + geometry: tmp5); + +export material ABS_Soft_Leather_Brown(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Soft Leather - Brown"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "warm", "brown")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Brown.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather +( + infinite_tiling: false, + color_2: color(0.106f, 0.0528f, 0.021f), + brightness_ao_cavity: .3f, + roughness: .75f, + reflectivity: 1.f, + bump_strength: .3f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Soft_Leather_Ash(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Soft Leather - Ash"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "ash", "gray", "grey", "neutral")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Ash.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather +( + infinite_tiling: false, + color_2: color(0.099899f, 0.099899f, 0.099899f), + brightness_ao_cavity: .2f, + roughness: .75f, + reflectivity: 1.f, + bump_strength: .3f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + + +export material ABS_Soft_Leather_Bone(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Soft Leather - Bone"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "bone", "brown", "warm")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Bone.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather +( + infinite_tiling: false, + color_2: color(0.599f, 0.511f, 0.431f), + brightness_ao_cavity: .2f, + roughness: .75f, + reflectivity: 1.f, + bump_strength: .3f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + + +export material ABS_Soft_Leather_Salmon(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Soft Leather - Salmon"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "salmon", "warm", "red")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Salmon.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather +( + infinite_tiling: false, + color_2: color(0.632f, 0.216f, 0.184f), + brightness_ao_cavity: .2f, + roughness: .75f, + reflectivity: 1.f, + bump_strength: .3f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Soft_Leather_Cognac(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Soft Leather - Cognac"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "warm", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "brown", "red", "cognac", "dark")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Cognac.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather +( + infinite_tiling: false, + color_2: color(0.231f, 0.0461f, 0.0356f), + brightness_ao_cavity: .2f, + roughness: .75f, + reflectivity: 1.f, + bump_strength: .3f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Soft_Leather_Beige(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Soft Leather - Beige"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "warm", "brown", "beige")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Beige.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather +( + infinite_tiling: false, + color_2: color(0.205079f, 0.132868f, 0.064803f), + brightness_ao_cavity: .2f, + roughness: .75f, + reflectivity: 1.f, + bump_strength: .3f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Soft_Leather_Pop_Orange(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Soft Leather - Pop Orange"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "warm", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "orange", "light", "gaudy", "saturated")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Pop_Orange.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather +( + infinite_tiling: false, + color_2: color(0.659f, 0.114f, 0.022f), + brightness_ao_cavity: .2f, + roughness: 0.f, + reflectivity: 1.f, + bump_strength: .3f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Soft_Leather_Pop_Purple(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Soft Leather - Pop Purple"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "cold", "purple", "violet", "bright", "gaudy")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Pop_Purple.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather +( + infinite_tiling: false, + color_2: color(0.201f, 0.017f, 0.659f), + brightness_ao_cavity: .1f, + roughness: 0.f, + reflectivity: 1.f, + bump_strength: .4f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Soft_Leather_Pop_Grapefruit(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Soft Leather - Pop Grapefruit"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "grapefruit", "bright", "gaudy", "warm")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Pop_Grapefruit.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather +( + infinite_tiling: false, + color_2: color(0.646f, 0.0582f, 0.037f), + brightness_ao_cavity: .1f, + roughness: 0.f, + reflectivity: 1.f, + bump_strength: .6f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Soft_Leather_Deep_Blue(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Soft Leather - Deep Blue"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "cold", "blue", "dark", "intense")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Deep_Blue.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather +( + infinite_tiling: false, + color_2: color(0.021f, 0.037f, 0.32f), + brightness_ao_cavity: .1f, + roughness: 0.f, + reflectivity: 1.f, + bump_strength: .6f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Soft_Leather_Deep_Mint(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Soft Leather - Deep Mint"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "cold", "mint", "green", "dark", "intense")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Deep_Mint.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather +( + infinite_tiling: false, + color_2: color(0.0161f, 0.122f, 0.0478f), + brightness_ao_cavity: .1f, + roughness: 0.f, + reflectivity: 1.f, + bump_strength: .6f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Soft_Leather_Deep_Radish(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("ABS Soft Leather - Deep Radish"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "radish", "red", "dark", "intense", "warm")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Deep_Radish.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather +( + infinite_tiling: false, + color_2: color(0.16f, 0.0127f, 0.0254f), + brightness_ao_cavity: .1f, + roughness: 0.f, + reflectivity: .25f, + bump_strength: .6f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + + +// ----------------- Punched Leather ----------------- +export material ABS_Soft_Leather_Punched( + +// Leather parameters + uniform bool infinite_tiling = false [[ + ::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."), + ::anno::display_name("Infinite Tiling"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + color leather_color = color( 0.012983f, 0.012983f, 0.012983f) [[ + ::anno::description("Choose the color of the leather."), + ::anno::display_name("Leather Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(1) + ]], + float roughness = .6f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float reflectivity = 1.f [[ + ::anno::description("Amount of variation applied to the roughness, higher numbers lead to non uniform reflections of the material."), + ::anno::display_name("Roughness Variation"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + uniform float bump_strength = 0.5f [[ + ::anno::description("Specifies the strength of the bump."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 1.f), + ::anno::hard_range(0.f, 2.f), + ::anno::ui_order(4) + ]], + float2 texture_translate = 0.f [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform"), + ::anno::ui_order(5) + ]], + float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f), + ::anno::ui_order(6) + ]], + float2 texture_scale = 1.f [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::preview_scale(3.5f), + ::anno::ui_order(7) + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Uses selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Transform"), + ::anno::ui_order(8) + ]], +// Punching parameters + uniform cutout_pattern shape_select = pattern_circle //select atlas tile here + [[ + ::anno::description("Select a cutout shape."), + ::anno::display_name("Cutout Shape"), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(9) + ]], + float punching_grid_size = 1.0f + [[ + ::anno::description("Scales the size of the punching grid."), + ::anno::display_name("Punching Grid Size"), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(10) + ]], + float cutout_rotation = 45.0f + [[ + ::anno::description("Rotates the cutout shape."), + ::anno::display_name("Cutout Rotation"), + ::anno::hard_range(0.f, 360.0f), + ::anno::soft_range(0.f, 360.0f), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(11) + ]], + float cutout_size = .4f + [[ + ::anno::description("Scales the size of the cutout pattern independently from the base material."), + ::anno::display_name("Cutout Size"), + ::anno::hard_range(0.f, 1.2f), + ::anno::soft_range(0.f, 1.0f), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(12) + ]], + float cutout_roundness = .5f + [[ + ::anno::description("At low values it makes the cutouts sharper. Higher values give the shapes a more rounded look."), + ::anno::display_name("Cutout Roundness"), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(13) + ]], + float cutout_bump_strength = 1.0f + [[ + ::anno::description("Sets the strength of the bevelled normal around the cutout."), + ::anno::display_name("Cutout Bevel Strength"), + ::anno::soft_range(0.0f, 1.0f), + ::anno::hard_range(0.0f, 2.0f), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(14) + ]], +// Grid Layout parameters + bool hexagonal_grid = true + [[ + ::anno::description("When enabled, the punching will occur on a hexagonal grid, otherwise a square grid."), + ::anno::display_name("Enable Hexagonal Grid"), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(15) + ]], + float square_grid_offset = 0.0f + [[ + ::anno::description("Offsets each row of the grid by a certain amount. Applies only when hexagonal grid is disabled."), + ::anno::display_name("Square Grid Offset"), + ::anno::in_group("Appearance", "Cutout"), + ::anno::enable_if("hexagonal_grid==false"), + ::anno::ui_order(16) + ]], + uniform bool enable_round_corners = false [[ + ::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."), + ::anno::display_name("Enable Round Corners"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(17) + ]], + uniform float radius = 1.5f [[ + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::display_name("Round Corner Radius"), + ::anno::in_group("Round Corners"), + ::anno::enable_if("enable_round_corners==true"), + ::anno::ui_order(18) + ]], + uniform bool across_materials = false [[ + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::display_name("Across Materials"), + ::anno::in_group("Round Corners"), + ::anno::enable_if("enable_round_corners==true"), + ::anno::ui_order(19) + ]] +) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Soft Leather - Black Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "design", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "black", "dark", "neutral")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] = let +{ + float brightness_ao_cavity = 0.2f; + bool horizontal_offset = true; + float cutout_bevel_width = 0.7f; + float cutout_bump_strength_2 = cutout_bump_strength * 5.0f; + + material base_mat = ABS_Soft_Leather( + infinite_tiling: infinite_tiling, + color_2: leather_color, + brightness_ao_cavity: brightness_ao_cavity, + roughness: roughness, + reflectivity: reflectivity, + bump_strength: bump_strength, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + enable_round_corners: enable_round_corners, + radius: radius, + across_materials: across_materials + ); + + // remap range of slider to avoid artifacts in the bevelling + float2 punching_scale = texture_scale * 0.01f * float2(punching_grid_size); + float cutout_roundness_ = cutout_roundness*0.6f+0.4f; + float cutout_size_lin = (1.0f/cutout_size); + texture_2d punching_cutout = texture_2d("./leather_punch_atlas_01.png", ::tex::gamma_linear); + + vm_coordinates uv = vm_coord( + translation: texture_translate, + rotation: texture_rotate, + scaling: punching_scale, + uv_space: uv_space_index + ); + + vm_coordinates punching_uv = hexagonal_grid ? vm_coord_hex( + uv: uv, + scale: cutout_roundness_ * cutout_size_lin, + rotation: cutout_rotation + ) : vm_coord_grid( + uv: vm_coord_rowcol_offset( + uv: uv, + offset: square_grid_offset, + horizontal_offset: horizontal_offset + ), + scale: cutout_roundness_ * cutout_size_lin, + rotation: cutout_rotation + ); + // select the correct subtile from the atlas + float4 crop = tile_select_2x2(shape_select); + + ::base::texture_return lookup = vm_tex_lookup( + tex: punching_cutout, + uv: punching_uv, + mono_source: mono_a, + scale: float4(1.0f), + crop_u: float2(crop.x, crop.y), + crop_v: float2(crop.z, crop.w), + wrap_u: ::tex::wrap_clamp, + wrap_v: ::tex::wrap_clamp + ); + + float low = (1.0 - cutout_roundness_); + float high = (cutout_size_lin * (cutout_bevel_width * 0.2f) * cutout_roundness_) + (1.0 - cutout_roundness_); + // remap x...y to (clamped) 0...1 + float x = ::math::clamp((lookup.mono - low)/(high - low), 0.0, 1.0); + // spherical falloff + float falloff=::math::sqrt(1.0-x*x); + // masking falloff as the center of the cutout is flat + float masked_falloff=falloff<=0.0?1.0:falloff; + + // where base material is still there, use the value of the base material + float cutout= ::math::min(falloff<=0.0?0.0:1.0, base_mat.geometry.cutout_opacity); + + // bring in -.5 ... +.5 range and lerp between lookup and flat normal + float3 remap_norm = ::math::lerp(float3(lookup.tint), float3(0.5, 0.5, 1.0), masked_falloff) - float3(0.5); + float3 t_norm = ::math::normalize(remap_norm * float3(cutout_bump_strength_2, cutout_bump_strength_2, 1.0)); + + float3 rotfix_norm = float3(::math::cos(punching_uv.rotation) * t_norm.x - ::math::sin(punching_uv.rotation) * t_norm.y, + ::math::sin(punching_uv.rotation) * t_norm.x + ::math::cos(punching_uv.rotation) * t_norm.y, + t_norm.z); + + float3 normal = ::state::texture_tangent_u(punching_uv.uv_space_index) * rotfix_norm.x + + ::state::texture_tangent_v(punching_uv.uv_space_index) * rotfix_norm.y + + ::state::normal() * rotfix_norm.z; + + float3 final_normal = ::base::blend_normals( + base_normal: normal, + base_normal_weight: 1.0f, + detail_normal: base_mat.geometry.normal, + detail_normal_weight: 1.0f + ); + +} in material( + surface: material_surface( + scattering: base_mat.surface.scattering + ), + volume: base_mat.volume, + ior: base_mat.ior, + thin_walled: true, + geometry: material_geometry( + displacement: base_mat.geometry.displacement, + normal: final_normal, + cutout_opacity: cutout + ) +); + + +export material ABS_Soft_Leather_Brown_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Soft Leather - Brown Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "ABS", "warm","artifical", "brown", "soft", "leather", "car", "dashboard", "cloth", "furniture")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Brown_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather_Punched +( + infinite_tiling: false, + leather_color: color(0.106f, 0.0528f, 0.021f), + roughness: .75f, + reflectivity: 1.f, + bump_strength: .3f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + + +export material ABS_Soft_Leather_Ash_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Soft Leather - Ash Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "ash", "gray", "grey", "neutral")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Ash_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather_Punched +( + infinite_tiling: false, + leather_color: color(0.099899f, 0.099899f, 0.099899f), + roughness: .75f, + reflectivity: 1.f, + bump_strength: .3f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + + +export material ABS_Soft_Leather_Bone_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Soft Leather - Bone Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "bone", "brown", "warm")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Bone_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather_Punched +( + infinite_tiling: false, + leather_color: color(0.599f, 0.511f, 0.431f), + roughness: .75f, + reflectivity: 1.f, + bump_strength: .3f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + + +export material ABS_Soft_Leather_Salmon_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Soft Leather - Salmon Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "salmon", "warm", "red")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Salmon_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather_Punched +( + infinite_tiling: false, + leather_color: color(0.632f, 0.216f, 0.184f), + roughness: .75f, + reflectivity: 1.f, + bump_strength: .3f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Soft_Leather_Cognac_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Soft Leather - Cognac Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "warm", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "brown", "red", "cognac", "dark")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Cognac_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather_Punched +( + infinite_tiling: false, + leather_color: color(0.231f, 0.0461f, 0.0356f), + roughness: .75f, + reflectivity: 1.f, + bump_strength: .3f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Soft_Leather_Beige_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Soft Leather - Beige Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "warm", "brown", "beige")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Beige_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather_Punched +( + infinite_tiling: false, + leather_color: color(0.205079f, 0.132868f, 0.064803f), + roughness: .75f, + reflectivity: 1.f, + bump_strength: .3f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Soft_Leather_Pop_Orange_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Soft Leather - Pop Orange Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "ABS", "warm", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "orange", "light", "gaudy", "saturated")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Pop_Orange_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather_Punched +( + infinite_tiling: false, + leather_color: color(0.659f, 0.114f, 0.022f), + roughness: 0.f, + reflectivity: 1.f, + bump_strength: .3f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Soft_Leather_Pop_Purple_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Soft Leather - Pop Purple Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "cold", "purple", "violet", "bright", "gaudy")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Pop_Purple_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather_Punched +( + infinite_tiling: false, + leather_color: color(0.201f, 0.017f, 0.659f), + roughness: 0.f, + reflectivity: 1.f, + bump_strength: .4f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Soft_Leather_Pop_Grapefruit_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Soft Leather - Pop Grapefruit Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "grapefruit", "bright", "gaudy", "warm")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Pop_Grapefruit_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather_Punched +( + infinite_tiling: false, + leather_color: color(0.646f, 0.0582f, 0.037f), + roughness: 0.f, + reflectivity: 1.f, + bump_strength: .6f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Soft_Leather_Deep_Blue_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Soft Leather - Deep Blue Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "cold", "blue", "dark", "intense")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Deep_Blue_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather_Punched +( + infinite_tiling: false, + leather_color: color(0.021f, 0.037f, 0.32f), + roughness: 0.f, + reflectivity: 1.f, + bump_strength: .6f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Soft_Leather_Deep_Mint_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Soft Leather - Deep Mint Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "cold", "mint", "green", "dark", "intense")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Deep_Mint_Punched.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather_Punched +( + infinite_tiling: false, + leather_color: color(0.0161f, 0.122f, 0.0478f), + roughness: 0.f, + reflectivity: 1.f, + bump_strength: .6f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + +export material ABS_Soft_Leather_Deep_Radish_Punched(*) +[[ + ::anno::description(DESCRIPTION_PUNCHED), + ::anno::display_name("ABS Soft Leather - Deep Radish Punched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "automotive", "punched", "ABS", "artifical", "soft", "leather", "car", "dashboard", "cloth", "furniture", "radish", "red", "dark", "intense", "warm")), + ::anno::thumbnail("./.thumbs/ABS_Soft_Leather.ABS_Soft_Leather_Deep_Radish.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += ABS_Soft_Leather_Punched +( + infinite_tiling: false, + leather_color: color(0.16f, 0.0127f, 0.0254f), + roughness: 0.f, + reflectivity: .25f, + bump_strength: .6f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.f, + uv_space_index: 0, + + shape_select: pattern_circle, + punching_grid_size: 0.7f, + cutout_size: 0.4f, + cutout_roundness: 0.8f, + cutout_bump_strength: 2.0f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + + enable_round_corners: false, + radius: 1.5f, + across_materials: false +); + diff --git a/Material/material_0376/Aging_Copper.mdl b/Material/material_0376/Aging_Copper.mdl new file mode 100644 index 0000000000000000000000000000000000000000..2f9c91099e8cdf9a0c1736b3af50cd820b8bab2c --- /dev/null +++ b/Material/material_0376/Aging_Copper.mdl @@ -0,0 +1,730 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. * + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + +mdl 1.6; + +import ::anno::*; +import ::base::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::df::*; +import ::nvidia::core_definitions::*; +import ::nvidia::core_definitions::dimension; + +const string DESCRIPTION = "Zinc material with optional oxidation effect"; + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + + +float2x2 invert_2x2(float2x2 M) +{ + float det = M[0][0]*M[1][1] - M[0][1]*M[1][0]; + //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/ + return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]); +} + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float2 rnd22(int2 p) { + float2 ret_val = float2( + uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f, + uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f + ); + return ret_val; +} + +float3 srgb2rgb(float3 val) +{ + return ::math::pow(::math::max(val, float3(0.0f)), 2.2); +} + +float3 nonrepeat_lookup( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5), + float patch_size = 8.0 +) +{ + + float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale; + float Z = patch_size; // patch scale inside example texture + float CON = 1.0f; + + float3 O = float3(0.f); + float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); + float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space + + float2 U = uv_in; + float2 V = M * uv_in; //pre-tilted hexa coordinates + int2 I = int2(::math::floor(V)); // hexa-tile id + + // The mean color needs to be determined in Photoshop then to make the + // average color work out, take the float value and calculate the apropriate + // mean value as (value^(1/2.2)) + + float3 m = average_color; + + float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; + F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates + + if( F[2] > 0.f ) + + O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON)) + + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON)) + + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON)); + else + O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON)) + + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON)) + + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON)); + O = m + O/::math::length(W); + O = ::math::clamp( (O), 0.0, 1.0); + + return float3(O); +} + + float3 endless_normal( + uniform texture_2d texture = texture_2d(), + float factor = 1.0, + bool flip_tangent_u = false, + bool flip_tangent_v = false, + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0 + //bool srgb2rgb = false, + //bool rgb2srgb = false +) +{ + float3 transformed_tangent_u = flip_tangent_u ? uvw.tangent_u : - uvw.tangent_u; + float3 transformed_tangent_v = flip_tangent_v ? uvw.tangent_v : - uvw.tangent_v; + + if (flip_tangent_u) + transformed_tangent_u=-transformed_tangent_u; + if (flip_tangent_v) + transformed_tangent_v=-transformed_tangent_v; + + // normalized Lookup + float3 tangent_space_normal = + (nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + ) - 0.5) * (2.0 * factor); + + + return ::math::normalize(uvw.tangent_u * tangent_space_normal.x + + uvw.tangent_v * tangent_space_normal.y + + ::state::normal()*1.0); + //return ::state::normal(); +} + + color endless_texture( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 10.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0, + bool gamma_correct_lookup = true +) +{ + return gamma_correct_lookup ? color(srgb2rgb( + nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )) + ) : color(nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )); +} + + float histogram_range(float input, float range = 1.0f, float position = 0.5f) +{ + float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); + float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); + return ::math::lerp(low, high, input); +} + +::base::texture_coordinate_info transform_coordinate_2( + float4x4 transform + [[ ::anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix.") ]], + ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info() + [[ ::anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection.") ]] +) [[ + ::anno::description("Transform a texture coordinate by a matrix.") , + ::anno::noinline() + ]] +{ + // Version 2 + float4 r_position = transform * float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1); + //Try aproximating it for the case that the rotation is only aroud z and assuming the texture layout is nice and z is ~constant. + //just pretend there is no other rotation happening + //get rid of scaling and translation. Then extract fields where sin and cos would be in a simple 2d transform around z. + float4 u = transform[0]; + float3 ru = ::math::normalize(float3(u.x,u.y,u.z)); + float cos = ru.x; + float sin = -ru.y; + + return ::base::texture_coordinate_info( + float3(r_position.x,r_position.y,r_position.z), + ::math::normalize(cos * coordinate.tangent_u - sin * coordinate.tangent_v), + ::math::normalize(cos * coordinate.tangent_v + sin * coordinate.tangent_u)); +} + +::base::texture_coordinate_info vmat_transform( + float2 translation = float2(0.0, 0.0), + float rotation = 0.0, // rotation in degrees + float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation_rad); + float c = ::math::cos(rotation_rad); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return transform_coordinate_2(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + +color gradient_lookup(uniform texture_2d gradient_texture, float position, int gradient_select = 0) +{ + int2 texel_coord = int2(int(position * ::tex::width(gradient_texture)), gradient_select); + return color(::tex::texel_float3(gradient_texture, texel_coord)); +} + +float3 gradient_lookup_float3(uniform texture_2d gradient_texture, float position, int gradient_select = 0) +{ + int2 texel_coord = int2(int(position * ::tex::width(gradient_texture)), gradient_select); + return float3(::tex::texel_float3(gradient_texture, texel_coord)); +} + +float3 normalmap_normal( + uniform texture_2d texture, + float factor = 1.0, + ::base::texture_coordinate_info uvw = ::base::texture_coordinate_info() +) +{ + float3 lookup = (::tex::lookup_float3(texture, float2(uvw.position.x, uvw.position.y)) - float3(0.5)) * (factor * 2.0); + return ::math::normalize(uvw.tangent_u * lookup.x + uvw.tangent_v * lookup.y + ::state::normal() * (lookup.z + (1.0 - factor))); +} + +export material Aging_Copper( + uniform bool infinite_tiling = false [[ + ::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."), + ::anno::display_name("Infinite Tiling"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + float age = 0.0f [[ + ::anno::description("Ages the copper so that it transitions through all the states from brand new to covered by a lovely Patina."), + ::anno::display_name("Age"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float age_variation = 0.5f [[ + ::anno::description("Adds some more variation to the aging process, so that the surface ages less uniform."), + ::anno::display_name("Age Variation"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float scratches_abrasion = 0.11f [[ + ::anno::description("This parameter removes some of the aging process by simulating scratches and abrasion."), + ::anno::display_name("Scratches Abrasion"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float drops_variation = 0.f [[ + ::anno::description("Adds Water droplets that increase the effect of againg."), + ::anno::display_name("Drops Variation"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + float flow_stains_balance = 0.5f [[ + ::anno::description("This parameter should be centered at 0.5 to have no effect. When below 0.5, the flows remove some of the aging process. When greater than 0.5, the stains add to the aging process."), + ::anno::display_name("Flow Stains Balance"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(5) + ]], + float spotsdirt_amount = .26f [[ + ::anno::description("Adds a layer of spots and dirt."), + ::anno::display_name("Spots Dirt Amount"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(6) + ]], + float2 texture_translate = 0.f [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform"), + ::anno::ui_order(7) + ]], + float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f), + ::anno::ui_order(8) + ]], + float2 texture_scale = 1.f [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::anno::ui_order(9) + ]], + uniform bool roundcorners_enable = false [[ + ::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."), + ::anno::display_name("Enable Round Corners"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(10) + ]], + uniform float roundcorners_radius_mm = 1.5f [[ + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::display_name("Round Corner Radius (mm)"), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f), + ::anno::ui_order(11) + ]], + uniform bool roundcorners_across_materials = false [[ + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::display_name("Across Materials"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(12) + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Uses selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Transform"), + ::anno::ui_order(13) + ]]) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aging copper - Pretty New"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("metal", "copper", "infinite", "tiling", "construction", "design", "aec", "sanitary", "kitchen", "architecture", "new", "metallic", "shiny", "reflective", "warm")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Aging_Copper.Aging_Copper.png") +]] + = + let { + bool tmp0 = false; + material_surface tmp1(::df::weighted_layer(::math::pow(1.f - ::math::clamp((flow_stains_balance - 0.5f) * 2.f * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).y + (::math::lerp(0.78f , 0.18f, age * 0.94f) * (drops_variation * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).x) + (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).x, age_variation * 0.5f, age * 0.94f * 0.95f) + float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).z * (age * 0.94f * 0.39f + 0.05f) - scratches_abrasion * 0.32f * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).y)) + spotsdirt_amount * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).z, 0.f, 0.999f), 2.6f), ::df::weighted_layer(gradient_lookup_float3(texture_2d("./aging_copper_haze_weight.png", ::tex::gamma_linear), age, 0).x, ::df::microfacet_ggx_smith_bsdf(0.16f, 0.16f, gradient_lookup(texture_2d("./aging_copper_gradient.png", ::tex::gamma_srgb), ::math::clamp((flow_stains_balance - 0.5f) * 2.f * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).y + (::math::lerp(0.78f , 0.18f, age * 0.94f) * (drops_variation * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).x) + (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).x, age_variation * 0.5f, age * 0.94f * 0.95f) + float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).z * (age * 0.94f * 0.39f + 0.05f) - scratches_abrasion * 0.32f * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).y)) + spotsdirt_amount * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).z, 0.f, 0.999f), 0), color(0.f, 0.f, 0.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::microfacet_ggx_smith_bsdf(::math::clamp((flow_stains_balance - 0.5f) * 2.f * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).y + (::math::lerp(0.78f , 0.18f, age * 0.94f) * (drops_variation * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).x) + (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).x, age_variation * 0.5f, age * 0.94f * 0.95f) + float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).z * (age * 0.94f * 0.39f + 0.05f) - scratches_abrasion * 0.32f * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).y)) + spotsdirt_amount * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).z, 0.f, 0.999f) - float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).y * (age * 0.94f * scratches_abrasion), ::math::clamp((flow_stains_balance - 0.5f) * 2.f * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).y + (::math::lerp(0.78f , 0.18f, age * 0.94f) * (drops_variation * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).x) + (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).x, age_variation * 0.5f, age * 0.94f * 0.95f) + float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).z * (age * 0.94f * 0.39f + 0.05f) - scratches_abrasion * 0.32f * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).y)) + spotsdirt_amount * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).z, 0.f, 0.999f) - float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).y * (age * 0.94f * scratches_abrasion), gradient_lookup(texture_2d("./aging_copper_gradient.png", ::tex::gamma_srgb), ::math::clamp((flow_stains_balance - 0.5f) * 2.f * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).y + (::math::lerp(0.78f , 0.18f, age * 0.94f) * (drops_variation * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).x) + (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).x, age_variation * 0.5f, age * 0.94f * 0.95f) + float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).z * (age * 0.94f * 0.39f + 0.05f) - scratches_abrasion * 0.32f * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).y)) + spotsdirt_amount * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).z, 0.f, 0.999f), 0), color(0.f, 0.f, 0.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), bsdf(), infinite_tiling ? endless_normal(texture_2d("./aging_copper_norm.jpg", ::tex::gamma_linear), ::math::clamp((flow_stains_balance - 0.5f) * 2.f * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).y + (::math::lerp(0.78f , 0.18f, age * 0.94f) * (drops_variation * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).x) + (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).x, age_variation * 0.5f, age * 0.94f * 0.95f) + float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).z * (age * 0.94f * 0.39f + 0.05f) - scratches_abrasion * 0.32f * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).y)) + spotsdirt_amount * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).z, 0.f, 0.999f) - float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).y * (age * 0.94f * scratches_abrasion), false, false, ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 2.01f, float3(0.5f, 0.5f, 1.f), 2.02f) : normalmap_normal(texture_2d("./aging_copper_norm.jpg", ::tex::gamma_linear), ::math::clamp((flow_stains_balance - 0.5f) * 2.f * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).y + (::math::lerp(0.78f , 0.18f, age * 0.94f) * (drops_variation * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).x) + (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).x, age_variation * 0.5f, age * 0.94f * 0.95f) + float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).z * (age * 0.94f * 0.39f + 0.05f) - scratches_abrasion * 0.32f * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).y)) + spotsdirt_amount * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).z, 0.f, 0.999f) - float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).y * (age * 0.94f * scratches_abrasion), ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)))), ::state::normal()), ::df::custom_curve_layer(0.04f, 1.f, 5.f, 1.f, ::df::weighted_layer(gradient_lookup_float3(texture_2d("./aging_copper_haze_weight.png", ::tex::gamma_linear), age, 0).x, ::df::microfacet_ggx_smith_bsdf(0.16f, 0.16f, gradient_lookup(texture_2d("./aging_copper_gradient.png", ::tex::gamma_srgb), ::math::clamp((flow_stains_balance - 0.5f) * 2.f * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).y + (::math::lerp(0.78f , 0.18f, age * 0.94f) * (drops_variation * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).x) + (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).x, age_variation * 0.5f, age * 0.94f * 0.95f) + float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).z * (age * 0.94f * 0.39f + 0.05f) - scratches_abrasion * 0.32f * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).y)) + spotsdirt_amount * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).z, 0.f, 0.999f), 0), color(0.f, 0.f, 0.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::microfacet_ggx_smith_bsdf(::math::clamp((flow_stains_balance - 0.5f) * 2.f * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).y + (::math::lerp(0.78f , 0.18f, age * 0.94f) * (drops_variation * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).x) + (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).x, age_variation * 0.5f, age * 0.94f * 0.95f) + float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).z * (age * 0.94f * 0.39f + 0.05f) - scratches_abrasion * 0.32f * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).y)) + spotsdirt_amount * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).z, 0.f, 0.999f) - float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).y * (age * 0.94f * scratches_abrasion), ::math::clamp((flow_stains_balance - 0.5f) * 2.f * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).y + (::math::lerp(0.78f , 0.18f, age * 0.94f) * (drops_variation * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).x) + (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).x, age_variation * 0.5f, age * 0.94f * 0.95f) + float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).z * (age * 0.94f * 0.39f + 0.05f) - scratches_abrasion * 0.32f * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).y)) + spotsdirt_amount * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).z, 0.f, 0.999f) - float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).y * (age * 0.94f * scratches_abrasion), gradient_lookup(texture_2d("./aging_copper_gradient.png", ::tex::gamma_srgb), ::math::clamp((flow_stains_balance - 0.5f) * 2.f * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).y + (::math::lerp(0.78f , 0.18f, age * 0.94f) * (drops_variation * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).x) + (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).x, age_variation * 0.5f, age * 0.94f * 0.95f) + float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).z * (age * 0.94f * 0.39f + 0.05f) - scratches_abrasion * 0.32f * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).y)) + spotsdirt_amount * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).z, 0.f, 0.999f), 0), color(0.f, 0.f, 0.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), bsdf(), infinite_tiling ? endless_normal(texture_2d("./aging_copper_norm.jpg", ::tex::gamma_linear), ::math::clamp((flow_stains_balance - 0.5f) * 2.f * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).y + (::math::lerp(0.78f , 0.18f, age * 0.94f) * (drops_variation * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).x) + (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).x, age_variation * 0.5f, age * 0.94f * 0.95f) + float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).z * (age * 0.94f * 0.39f + 0.05f) - scratches_abrasion * 0.32f * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).y)) + spotsdirt_amount * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).z, 0.f, 0.999f) - float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).y * (age * 0.94f * scratches_abrasion), false, false, ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 2.01f, float3(0.5f, 0.5f, 1.f), 2.02f) : normalmap_normal(texture_2d("./aging_copper_norm.jpg", ::tex::gamma_linear), ::math::clamp((flow_stains_balance - 0.5f) * 2.f * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).y + (::math::lerp(0.78f , 0.18f, age * 0.94f) * (drops_variation * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).x) + (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).x, age_variation * 0.5f, age * 0.94f * 0.95f) + float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).z * (age * 0.94f * 0.39f + 0.05f) - scratches_abrasion * 0.32f * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).y)) + spotsdirt_amount * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).z, 0.f, 0.999f) - float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).y * (age * 0.94f * scratches_abrasion), ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)))), ::state::normal()), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(gradient_lookup(texture_2d("./aging_copper_gradient.png", ::tex::gamma_srgb), ::math::clamp((flow_stains_balance - 0.5f) * 2.f * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).y + (::math::lerp(0.78f , 0.18f, age * 0.94f) * (drops_variation * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).x) + (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).x, age_variation * 0.5f, age * 0.94f * 0.95f) + float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).z * (age * 0.94f * 0.39f + 0.05f) - scratches_abrasion * 0.32f * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).y)) + spotsdirt_amount * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).z, 0.f, 0.999f), 0), 0.f), bsdf(), infinite_tiling ? endless_normal(texture_2d("./aging_copper_norm.jpg", ::tex::gamma_linear), ::math::clamp((flow_stains_balance - 0.5f) * 2.f * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).y + (::math::lerp(0.78f , 0.18f, age * 0.94f) * (drops_variation * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).x) + (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).x, age_variation * 0.5f, age * 0.94f * 0.95f) + float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).z * (age * 0.94f * 0.39f + 0.05f) - scratches_abrasion * 0.32f * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).y)) + spotsdirt_amount * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).z, 0.f, 0.999f) - float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).y * (age * 0.94f * scratches_abrasion), false, false, ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 2.01f, float3(0.5f, 0.5f, 1.f), 2.02f) : normalmap_normal(texture_2d("./aging_copper_norm.jpg", ::tex::gamma_linear), ::math::clamp((flow_stains_balance - 0.5f) * 2.f * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).y + (::math::lerp(0.78f , 0.18f, age * 0.94f) * (drops_variation * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).x) + (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).x, age_variation * 0.5f, age * 0.94f * 0.95f) + float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).z * (age * 0.94f * 0.39f + 0.05f) - scratches_abrasion * 0.32f * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).y)) + spotsdirt_amount * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).z, 0.f, 0.999f) - float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).y * (age * 0.94f * scratches_abrasion), ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)))), infinite_tiling ? endless_normal(texture_2d("./aging_copper_norm.jpg", ::tex::gamma_linear), ::math::clamp((flow_stains_balance - 0.5f) * 2.f * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).y + (::math::lerp(0.78f , 0.18f, age * 0.94f) * (drops_variation * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).x) + (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).x, age_variation * 0.5f, age * 0.94f * 0.95f) + float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).z * (age * 0.94f * 0.39f + 0.05f) - scratches_abrasion * 0.32f * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).y)) + spotsdirt_amount * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).z, 0.f, 0.999f) - float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).y * (age * 0.94f * scratches_abrasion), false, false, ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 2.01f, float3(0.5f, 0.5f, 1.f), 2.02f) : normalmap_normal(texture_2d("./aging_copper_norm.jpg", ::tex::gamma_linear), ::math::clamp((flow_stains_balance - 0.5f) * 2.f * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).y + (::math::lerp(0.78f , 0.18f, age * 0.94f) * (drops_variation * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).x) + (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).x, age_variation * 0.5f, age * 0.94f * 0.95f) + float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).z * (age * 0.94f * 0.39f + 0.05f) - scratches_abrasion * 0.32f * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).y)) + spotsdirt_amount * float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.058f, 0.088f, 0.036f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_drops_G_flowstains_B_spotsdirt.jpg", ::tex::gamma_linear), color(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).z, 0.f, 0.999f) - float3(infinite_tiling ? endless_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.01f, float3(0.511f, 0.208f, 0.2f), 2.02f, false) : ::base::file_texture(texture_2d("./aging_copper_multi_R_base_G_scratches_B_castmetal.jpg", ::tex::gamma_linear), color(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).y * (age * 0.94f * scratches_abrasion), ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)))), ::state::normal()), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + 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)); + 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()); + hair_bsdf tmp6 = hair_bsdf(); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5, + hair: tmp6); + + +// -------------------- 2 -------------------- +export material Aging_Copper_State_2_of_12(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aging copper - Slight Drops"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("metal", "copper", "infinite", "tiling", "construction", "drops", "residue", "design", "aec", "sanitary", "kitchen", "architecture", "new", "metallic", "shiny", "reflective", "warm")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Aging_Copper.Aging_Copper_State_2_of_12.png") +]] = Aging_Copper +( + infinite_tiling: true, + age: 0.02f, + age_variation: 0.51f, + scratches_abrasion: 0.0f, + drops_variation: 0.41f, + flow_stains_balance: 0.48f, + spotsdirt_amount: 0.0f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + roundcorners_enable: false, + roundcorners_radius_mm: 1.0f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// -------------------- 3 -------------------- +export material Aging_Copper_State_3_of_12(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aging copper - Initial Oxidation"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("metal", "copper", "infinite", "tiling", "construction", "oxide", "oxidized", "drops", "residue", "design", "aec", "sanitary", "kitchen", "architecture", "aged", "metallic", "shiny", "warm")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Aging_Copper.Aging_Copper_State_3_of_12.png") +]] = Aging_Copper +( + infinite_tiling: true, + age: 0.15f, + age_variation: 0.47f, + scratches_abrasion: 0.0f, + drops_variation: 0.09f, + flow_stains_balance: 0.52f, + spotsdirt_amount: 0.17f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + roundcorners_enable: false, + roundcorners_radius_mm: 1.0f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +// -------------------- 4 -------------------- +export material Aging_Copper_State_4_of_12(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aging copper - Worn Oxidation"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("metal", "copper", "infinite", "tiling", "construction", "oxide", "oxidized", "design", "aec", "sanitary", "kitchen", "architecture", "aged", "metallic", "matte", "warm")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Aging_Copper.Aging_Copper_State_4_of_12.png") +]] = Aging_Copper +( + infinite_tiling: true, + age: 0.24f, + age_variation: 0.83f, + scratches_abrasion: 0.66f, + drops_variation: 0.09f, + flow_stains_balance: 0.52f, + spotsdirt_amount: 0.17f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + roundcorners_enable: false, + roundcorners_radius_mm: 1.0f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +// -------------------- 5 -------------------- +export material Aging_Copper_State_5_of_12(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aging copper - Even Oxidation"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("metal", "copper", "infinite", "tiling", "construction", "oxide", "oxidized", "design", "aec", "sanitary", "kitchen", "architecture", "aged", "metallic", "matte", "warm")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Aging_Copper.Aging_Copper_State_5_of_12.png") +]] = Aging_Copper +( + infinite_tiling: true, + age: 0.24f, + age_variation: 0.83f, + scratches_abrasion: 0.0f, + drops_variation: 0.09f, + flow_stains_balance: 0.52f, + spotsdirt_amount: 0.17f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + roundcorners_enable: false, + roundcorners_radius_mm: 1.0f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +// -------------------- 6 -------------------- +export material Aging_Copper_State_6_of_12(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aging copper - Minimal Patina"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("metal", "copper", "infinite", "tiling", "construction", "oxide", "oxidized", "patina", "design", "aec", "sanitary", "kitchen", "architecture", "aged", "metallic", "matte", "warm")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Aging_Copper.Aging_Copper_State_6_of_12.png") +]] = Aging_Copper +( + infinite_tiling: true, + age: 0.4f, + age_variation: 1.0f, + scratches_abrasion: 0.63f, + drops_variation: 0.48f, + flow_stains_balance: 0.48f, + spotsdirt_amount: 0.17f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + roundcorners_enable: false, + roundcorners_radius_mm: 1.0f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +// -------------------- 7 -------------------- +export material Aging_Copper_State_7_of_12(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aging copper - Slight Patina"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("metal", "copper", "infinite", "tiling", "construction", "oxide", "oxidized", "patina", "design", "aec", "sanitary", "kitchen", "architecture", "aged", "metallic", "matte", "brown")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Aging_Copper.Aging_Copper_State_7_of_12.png") +]] = Aging_Copper +( + infinite_tiling: true, + age: 0.4f, + age_variation: 1.0f, + scratches_abrasion: 0.63f, + drops_variation: 0.76f, + flow_stains_balance: 0.91f, + spotsdirt_amount: 1.0f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + roundcorners_enable: false, + roundcorners_radius_mm: 1.0f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +// -------------------- 8 -------------------- +export material Aging_Copper_State_8_of_12(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aging copper - Medium Patina"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("metal", "copper", "infinite", "tiling", "construction", "oxide", "oxidized", "patina", "design", "aec", "sanitary", "kitchen", "architecture", "aged", "metallic", "matte", "brown")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Aging_Copper.Aging_Copper_State_8_of_12.png") +]] = Aging_Copper +( + infinite_tiling: true, + age: 0.61f, + age_variation: 1.0f, + scratches_abrasion: 0.85f, + drops_variation: 0.48f, + flow_stains_balance: 0.91f, + spotsdirt_amount: 0.17f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + roundcorners_enable: false, + roundcorners_radius_mm: 1.0f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +// -------------------- 9 -------------------- +export material Aging_Copper_State_9_of_12(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aging copper - Weathered Patina"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("metal", "copper", "infinite", "tiling", "construction", "oxide", "oxidized", "patina", "design", "aec", "sanitary", "kitchen", "architecture", "aged", "weathered", "metallic", "matte", "turquoise")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Aging_Copper.Aging_Copper_State_9_of_12.png") +]] = Aging_Copper +( + infinite_tiling: true, + age: 0.91f, + age_variation: 1.0f, + scratches_abrasion: 0.85f, + drops_variation: 1.0f, + flow_stains_balance: 0.0f, + spotsdirt_amount: 0.76f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + roundcorners_enable: false, + roundcorners_radius_mm: 1.0f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +// -------------------- 10 -------------------- +export material Aging_Copper_State_10_of_12(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aging copper - Strong Weathered Patina"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("metal", "copper", "infinite", "tiling", "construction", "oxide", "oxidized", "patina", "design", "aec", "sanitary", "kitchen", "architecture", "aged", "weathered", "rough", "metallic", "matte", "turquoise")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Aging_Copper.Aging_Copper_State_10_of_12.png") +]] = Aging_Copper +( + infinite_tiling: true, + age: 0.91f, + age_variation: 1.0f, + scratches_abrasion: 0.85f, + drops_variation: 1.0f, + flow_stains_balance: 0.5f, + spotsdirt_amount: 0.76f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + roundcorners_enable: false, + roundcorners_radius_mm: 1.0f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +// -------------------- 11 -------------------- +export material Aging_Copper_State_11_of_12(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aging copper - Strong Patina"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("metal", "copper", "infinite", "tiling", "construction", "oxide", "oxidized", "patina", "design", "aec", "sanitary", "kitchen", "architecture", "aged", "weathered", "rough", "metallic", "matte", "turquoise")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Aging_Copper.Aging_Copper_State_11_of_12.png") +]] = Aging_Copper +( + infinite_tiling: true, + age: 0.91f, + age_variation: 1.0f, + scratches_abrasion: 0.0f, + drops_variation: 1.0f, + flow_stains_balance: 0.5f, + spotsdirt_amount: 0.0f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + roundcorners_enable: false, + roundcorners_radius_mm: 1.0f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +// -------------------- 12 -------------------- +export material Aging_Copper_State_12_of_12(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aging copper - Pure Even Patina"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("metal", "copper", "infinite", "tiling", "construction", "oxide", "oxidized", "patina", "design", "aec", "sanitary", "kitchen", "architecture", "aged", "weathered", "rough", "metallic", "matte", "turquoise")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Aging_Copper.Aging_Copper_State_12_of_12.png") +]] = Aging_Copper +( + infinite_tiling: true, + age: 1.0f, + age_variation: 0.0f, + scratches_abrasion: 0.0f, + drops_variation: 1.0f, + flow_stains_balance: 0.5f, + spotsdirt_amount: 0.0f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + roundcorners_enable: false, + roundcorners_radius_mm: 1.0f, + roundcorners_across_materials: false, + uv_space_index: 0 +); \ No newline at end of file diff --git a/Material/material_0377/Aluminum.mdl b/Material/material_0377/Aluminum.mdl new file mode 100644 index 0000000000000000000000000000000000000000..0a1a6e1b9f97de40878be3420b114e7832ef6511 --- /dev/null +++ b/Material/material_0377/Aluminum.mdl @@ -0,0 +1,382 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + +mdl 1.4; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + + +::base::texture_coordinate_info vmat_transform( + uniform float2 translation = float2(0.0, 0.0), + uniform float rotation = 0.0, + uniform float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation_rad); + float c = ::math::cos(rotation_rad); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float2 rnd22(int2 p) { + float2 ret_val = float2( + uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f, + uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f + ); + return ret_val; +} + +float3 srgb2rgb(float3 val) +{ + return ::math::pow(::math::max(val, float3(0.0f)), 2.2); +} + +float2x2 invert_2x2(float2x2 M) +{ + float det = M[0][0]*M[1][1] - M[0][1]*M[1][0]; + //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/ + return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]); +} + +float3 nonrepeat_lookup( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5), + float patch_size = 8.0 +) +{ + + float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale; + float Z = patch_size; // patch scale inside example texture + float CON = 1.0f; + + float3 O = float3(0.f); + float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); + float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space + + float2 U = uv_in; + float2 V = M * uv_in; //pre-tilted hexa coordinates + int2 I = int2(::math::floor(V)); // hexa-tile id + + // The mean color needs to be determined in Photoshop then to make the + // average color work out, take the float value and calculate the apropriate + // mean value as (value^(1/2.2)) + + float3 m = average_color; + + float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; + F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates + + if( F[2] > 0.f ) + + O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON)) + + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON)) + + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON)); + else + O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON)) + + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON)) + + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON)); + O = m + O/::math::length(W); + O = ::math::clamp( (O), 0.0, 1.0); + + return float3(O); +} + +color endless_texture( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 10.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0, + bool gamma_correct_lookup = true +) +{ + return gamma_correct_lookup ? color(srgb2rgb( + nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )) + ) : color(nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )); +} + + +export material Aluminum( + uniform bool infinite_tiling = true [[ + ::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."), + ::anno::display_name("Infinite Tiling"), + ::anno::in_group("Appearance") + ]], + float roughness = 0.1f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + float smudges = 0.5f [[ + ::anno::description("Adds blurrier reflection that follow the intensities of the Roughness texture on top."), + ::anno::display_name("Smudges"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform bool enable_round_corners = false [[ + ::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."), + ::anno::display_name("Enable Round Corners"), + ::anno::in_group("Round Corners") + ]], + uniform float radius = 1.0f [[ + ::anno::description("Radius of the rounded corners."), + ::anno::display_name("Round Corner Radius in mm"), + ::anno::in_group("Round Corners") + ]], + uniform bool across_materials = false [[ + ::anno::display_name("Across Materials"), + ::anno::description("When enabled the round corner effect is applied across different materials."), + ::anno::in_group("Round Corners") + ]], + uniform float2 texture_translate = 0.f [[ + ::anno::display_name("Texture Translate"), + ::anno::description("Controls the position of the texture."), + ::anno::in_group("Transform") + ]], + uniform float texture_rotate = 0.f [[ + ::anno::display_name("Texture Rotate"), + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::soft_range(0.f, 360.f), + ::anno::in_group("Transform") + ]], + uniform float2 texture_scale = 1.f [[ + ::anno::display_name("Texture Scale"), + ::anno::description("Larger numbers increase the size."), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(.45f, .45f)) + ]], + uniform int uv_space_index = 0 [[ + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced") + ]], + float3 normal = ::state::normal() [[ + ::anno::description("Modify the surface normal."), + ::anno::display_name("Normal"), + ::anno::in_group("Advanced") + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Aluminum"), + ::anno::description("Pure metal material with optional smudges."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Aluminum.Aluminum.png"), + ::anno::key_words(string[]("metal", "pure", "smudged", "design", "reflective", "infinite tiling", "smooth", "conductor", "new", "polished", "aluminum")) +]] + = + let { + + color normal_reflectivity = color(0.911810895428f,0.914089043421f,0.920152876196f); + color grazing_reflectivity = color(0.99942f, 1.f, 1.f); + + float radius_mm = (radius * ::state::meters_per_scene_unit() ) / 1000.f; + + bool tmp0 = false; + material_surface tmp1( + ::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), + material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + 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)); + material_geometry tmp5( + float3(0.f), + 1.f, + enable_round_corners ? ::state::rounded_corner_normal(radius_mm, across_materials, 1.f) : ::state::normal()); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + + +export material Aluminum_Polished(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Aluminum Polished"), + ::anno::description("Pure metal material with optional smudges."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Aluminum.Aluminum_Polished.png"), + ::anno::key_words(string[]("metal", "pure", "design", "reflective", "infinite tiling", "smooth", "conductor", "new", "polished", "aluminum")) +]] += Aluminum( + infinite_tiling: true, + roughness: 0.0f, + smudges: 0.0f, + enable_round_corners: false, + radius: 0.03f, + across_materials: false, + texture_translate: float2(0.0f, 0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f, 1.0f), + uv_space_index: 0, + normal: ::state::normal() +); + + +export material Aluminum_Glossy_Fingerprints(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Aluminum Glossy Fingerprints"), + ::anno::description("Pure metal material with optional smudges."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Aluminum.Aluminum_Glossy_Fingerprints.png"), + ::anno::key_words(string[]("metal", "pure", "design", "smudged", "reflective", "infinite tiling", "smooth", "conductor", "new", "polished", "Aluminum")) +]] += Aluminum( + infinite_tiling: true, + roughness: 0.23f, + smudges: 1.0f, + enable_round_corners: false, + radius: 0.03f, + across_materials: false, + texture_translate: float2(0.0f, 0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f, 1.0f), + uv_space_index: 0, + normal: ::state::normal() +); + + + + +/* +- Aluminum + 0.911810895428,0.914089043421,0.920152876196 + +- Copper + 0.9654565, 0.6899602, 0.4830392 + +- Chromium + 0.549302, 0.5560554, 0.5542377 + +- Iron + 0.5293683, 0.5132565, 0.4942483 + +- Gold + 1.0,0.722306985258,0.340058756743 + +- Nickel + 0.696691094703,0.640529134605,0.563260231405 + +- Platinum + 0.678533319955,0.639590890417,0.583638675413 + +- Mercury + 0.780978740699,0.779541528985,0.778441417779 + +- Silver + 0.9614253056,0.948983344333,0.918968346466 + +- Titanium + 0.618264052974,0.579396264956,0.542545225681 + +- Tungsten + 0.951001417565,0.815051845356,0.751931718925 + +- Zinc + 0.87467950988,0.868943040106,0.855089634324 + + +*/ diff --git a/Material/material_0378/Aluminum_Anodized.mdl b/Material/material_0378/Aluminum_Anodized.mdl new file mode 100644 index 0000000000000000000000000000000000000000..7988bda65e951a4702106013c08a47a0c4f19953 --- /dev/null +++ b/Material/material_0378/Aluminum_Anodized.mdl @@ -0,0 +1,1774 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + +mdl 1.7; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + +const string DESCRIPTION = "Aluminum material that has been anodized with a colored layer. Additional control features include scratches, smudges and dirt which give the material a worn and used appearance."; + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + + +struct vm_coordinates{ + float2 uv; // UV coordinates stored as a simple float2 + float rotation; // The rotation is stored in radiands (not degress), to convert use ((rotation* 3.1415926535897932384626433832f) / 180.f) + int uv_space_index; // The UV space Index from which the UV data came from + float4 carry; // may carry additional data, such as random IDs +}; + +struct vm_3float{ + float x; + float y; + float z; +}; + +struct vm_4float{ + float x; + float y; + float z; + float w; +}; + +struct vm_col_norm{ + float3 value; + float3 norm; +}; + +enum vm_mono_select +[[ + anno::description("Modes for the creation of a gray-scale value from a color."), + anno::hidden() +]] +{ + mono_r = 0, + mono_g = 1, + mono_b = 2, + mono_a = 3, + mono_average = 4 +}; + + + +vm_coordinates vm_coord +( + float2 translation = float2(0.0f, 0.0) [[ + ::anno::display_name("Translation"), + ::anno::description("Translates the coordinates.") + ]], + float rotation = 0.0f [[ + ::anno::display_name("Rotation"), + ::anno::description("Rotates the coordinates in degrees.") + ]], + float2 scaling = float2(1.0f, 1.0f) [[ + ::anno::display_name("Scaling"), + ::anno::description("Scales the coordinates.") + ]], + uniform int uv_space = 0 [[ + ::anno::display_name("UV Space"), + ::anno::description("Chose the UV space.") + ]] +) +[[ + ::anno::display_name("vm Transform"), + ::anno::description("Generates coordinates to be used in vm_lookup functions.") +]] +{ + vm_coordinates uv; + ::base::texture_coordinate_info info = ::base::coordinate_source( ::base::texture_coordinate_uvw, uv_space); + uv.rotation = (rotation * 3.1415926535897932384626433832f) / 180.f; + uv.uv = float2(info.position.x, info.position.y); + float sine = ::math::sin(uv.rotation); + float cosine = ::math::cos(uv.rotation); + float2x2 rot = float2x2(cosine, -sine, sine, cosine); + uv.uv = rot * uv.uv; + uv.uv /= scaling; + uv.uv += translation; + // Translation before or after rotation? + return uv; +} + + +vm_coordinates vm_coord_post_scale( + vm_coordinates uv = vm_coord(), + float2 scale = 1.0f +) +{ + uv.uv /= scale; + return uv; +} + +float remap_xy_to_0_1(float input, float x, float y) +{ + return (input - x)/(y - x); +} + +float2x2 invert_2x2(float2x2 M) +{ + float det = M[0][0]*M[1][1] - M[0][1]*M[1][0]; + //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/ + return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]); +} + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + +float2 rnd22(int2 p) { + float2 ret_val = float2( + uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f, + uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f + ); + return ret_val; +} + +float3 vm_tex_infinite( + uniform texture_2d tex = texture_2d(), + vm_coordinates uv = vm_coord(), + float3 average_color = float3(0.5f, 0.5f, 1.0f), + float patch_size = 1.0, + bool gamma_correct = true, + float gamma = 2.2f +) +{ + float2 uv_in = uv.uv; + + float3 O = float3(0.f); + float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); + float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space + + float2 U = uv_in; + float2 V = M * (uv.uv / patch_size); //pre-tilted hexa coordinates + int2 I = int2(::math::floor(V))+int2(935); // hexa-tile id + + // The mean color needs to be determined in Photoshop then to make the + // average color work out, take the float value and calculate the apropriate + // mean value as (value^(1/2.2)) + + float3 m = average_color; + + float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; + F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates + + if( F[2] > 0.f ) + O = (W[0] = F[2]) * (( ::tex::lookup_float3(tex, U-rnd22(I))) - m) + + (W[1] = F[1]) * (( ::tex::lookup_float3(tex, U-rnd22(I+int2(0,1)))) - m) + + (W[2] = F[0]) * (( ::tex::lookup_float3(tex, U-rnd22(I+int2(1,0)))) - m); + else + O = (W[0] = -F[2]) * (( ::tex::lookup_float3(tex, U-rnd22(I+int2(1)))) - m) + + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(tex, U-rnd22(I+int2(1, 0)))) - m) + + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(tex, U-rnd22(I+int2(0, 1)))) - m); + O = m + O/::math::length(W); + O = ::math::clamp( (O), 0.0f, 1.0f); + + return gamma_correct? ::math::pow(::math::max(O, float3(0.0f)), gamma) : float3(O); +} + +float3 vm_tex_infinite_normal( + uniform texture_2d tex = texture_2d(), + vm_coordinates uv = vm_coord(), + float3 average_color = float3(0.5f), + float patch_size = 1.0, + float normal_strength = 1.0 +) +{ + float2 uv_in = uv.uv; + + float3 O = float3(0.f); + float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); + float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space + + float2 U = uv_in; + float2 V = M * (uv.uv / patch_size); //pre-tilted hexa coordinates + int2 I = int2(::math::floor(V))+int2(935); // hexa-tile id + + // The mean color needs to be determined in Photoshop then to make the + // average color work out, take the float value and calculate the apropriate + // mean value as (value^(1/2.2)) + + float3 m = average_color; + + float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; + F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates + + if( F[2] > 0.f ) + O = (W[0] = F[2]) * (( ::tex::lookup_float3(tex, U-rnd22(I))) - m) + + (W[1] = F[1]) * (( ::tex::lookup_float3(tex, U-rnd22(I+int2(0,1)))) - m) + + (W[2] = F[0]) * (( ::tex::lookup_float3(tex, U-rnd22(I+int2(1,0)))) - m); + else + O = (W[0] = -F[2]) * (( ::tex::lookup_float3(tex, U-rnd22(I+int2(1)))) - m) + + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(tex, U-rnd22(I+int2(1, 0)))) - m) + + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(tex, U-rnd22(I+int2(0, 1)))) - m); + O = m + O/::math::length(W); + O = ::math::clamp( (O), 0.0, 1.0); + + float3 norm = (O - float3(.5f)) * 2.0f; + norm = ::math::normalize(norm * float3(normal_strength, normal_strength, 1.0)); + // if any rotation happened prior to the lookup, compensate for it + norm = float3(::math::cos(uv.rotation) * norm.x - ::math::sin(uv.rotation) * norm.y, + ::math::sin(uv.rotation) * norm.x + ::math::cos(uv.rotation) * norm.y, + norm.z); + return norm.x * ::state::texture_tangent_u(uv.uv_space_index) + + norm.y * ::state::texture_tangent_v(uv.uv_space_index) + + norm.z * ::state::normal(); +} + + +vm_col_norm vm_tex_infinite_color_normal( + uniform texture_2d tex_col = texture_2d(), + uniform texture_2d tex_norm = texture_2d(), + vm_coordinates uv = vm_coord(), + float3 average_color = float3(0.5), + float3 average_norm = float3(0.5f, 0.5f, 1.0f), + float patch_size = 1.0, + // Color output settings + bool color_out_gamma_correct = true, + float color_out_gamma = 2.2f, + // Normal output setting + float normal_strength = 1.0 +) +{ + vm_col_norm ret; + float2 uv_in = uv.uv; + + float3 O_a = float3(0.f); + float3 O_b = float3(0.f); + float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); + float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space + + float2 U = uv_in; + float2 V = M * (uv.uv / patch_size); //pre-tilted hexa coordinates + int2 I = int2(::math::floor(V))+int2(935); // hexa-tile id + + // The mean color needs to be determined in Photoshop then to make the + // average color work out, take the float value and calculate the apropriate + // mean value as (value^(1/2.2)) + + float3 m_a = average_color; + float3 m_b = average_norm; + + float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; + F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates + + if( F[2] > 0.f ) + { + O_a = (W[0] = F[2]) * (( ::tex::lookup_float3(tex_col, U-rnd22(I))) - m_a) + + (W[1] = F[1]) * (( ::tex::lookup_float3(tex_col, U-rnd22(I+int2(0,1)))) - m_a) + + (W[2] = F[0]) * (( ::tex::lookup_float3(tex_col, U-rnd22(I+int2(1,0)))) - m_a); + O_b = (W[0] = F[2]) * (( ::tex::lookup_float3(tex_norm, U-rnd22(I))) - m_b) + + (W[1] = F[1]) * (( ::tex::lookup_float3(tex_norm, U-rnd22(I+int2(0,1)))) - m_b) + + (W[2] = F[0]) * (( ::tex::lookup_float3(tex_norm, U-rnd22(I+int2(1,0)))) - m_b); + } + else + { + O_a = (W[0] = -F[2]) * (( ::tex::lookup_float3(tex_col, U-rnd22(I+int2(1)))) - m_a) + + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(tex_col, U-rnd22(I+int2(1, 0)))) - m_a) + + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(tex_col, U-rnd22(I+int2(0, 1)))) - m_a); + O_b = (W[0] = -F[2]) * (( ::tex::lookup_float3(tex_norm, U-rnd22(I+int2(1)))) - m_b) + + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(tex_norm, U-rnd22(I+int2(1, 0)))) - m_b) + + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(tex_norm, U-rnd22(I+int2(0, 1)))) - m_b); + } + + O_a = m_a + O_a/::math::length(W); + O_a = ::math::clamp( (O_a), 0.0, 1.0); + ret.value = color_out_gamma_correct? ::math::pow(::math::max(O_a, float3(0.0f)), color_out_gamma) : float3(O_a); + + O_b = m_b + O_b/::math::length(W); + O_b = ::math::clamp( (O_b), 0.0, 1.0); + + float3 norm = (O_b - float3(.5f)) * 2.0f; + norm = ::math::normalize(norm * float3(normal_strength, normal_strength, 1.0)); + // if any rotation happened prior to the lookup, compensate for it + norm = float3(::math::cos(uv.rotation) * norm.x - ::math::sin(uv.rotation) * norm.y, + ::math::sin(uv.rotation) * norm.x + ::math::cos(uv.rotation) * norm.y, + norm.z); + ret.norm = norm.x * ::state::texture_tangent_u(uv.uv_space_index) + + norm.y * ::state::texture_tangent_v(uv.uv_space_index) + + norm.z * ::state::normal(); + + return ret; +} + + +float3 vm_tex_normal_lookup( + uniform texture_2d tex, + vm_coordinates uv = vm_coord(), + float strength = 1.0f +) +{ + float rot = uv.rotation; + // Lookup and convert normal texture to -1 ... 1 range + float3 norm = (::tex::lookup_float3(tex, uv.uv, ::tex::wrap_repeat, ::tex::wrap_repeat) - float3(.5f)) * 2.0f; + norm = ::math::normalize(norm * float3(strength, strength, 1.0)); + // if any rotation happened prior to the lookup, compensate for it + norm = float3(::math::cos(rot) * norm.x - ::math::sin(rot) * norm.y, + ::math::sin(rot) * norm.x + ::math::cos(rot) * norm.y, + norm.z); + return norm.x * ::state::texture_tangent_u(uv.uv_space_index) + + norm.y * ::state::texture_tangent_v(uv.uv_space_index) + + norm.z * ::state::normal(); +} + +float3 vm_tex_lookup_float3( + uniform texture_2d tex, + vm_coordinates uv = vm_coord(), + float3 scale = float3(1.0f)) +{ + return ::tex::lookup_float3(tex, uv.uv, ::tex::wrap_repeat, ::tex::wrap_repeat) * scale; +} + +vm_3float vm_tex_lookup_3float( + uniform texture_2d tex, + vm_coordinates uv = vm_coord(), + float3 scale = float3(1.0f)) +{ + vm_3float ret; + float3 lookup = ::tex::lookup_float3(tex, uv.uv, ::tex::wrap_repeat, ::tex::wrap_repeat) * scale; + ret.x = lookup.x; + ret.y = lookup.y; + ret.z = lookup.z; + return ret; +} + + + +// ********************** *********************** + +// Returns the normal n in tangent space, given n is in internal space. +float3 transform_internal_to_tangent(float3 n) +[[ + anno::hidden() +]] +{ + return + n.x* float3(state::texture_tangent_u(0).x,state::texture_tangent_v(0).x,state::normal().x)+ + n.y* float3(state::texture_tangent_u(0).y,state::texture_tangent_v(0).y,state::normal().y)+ + n.z* float3(state::texture_tangent_u(0).z,state::texture_tangent_v(0).z,state::normal().z); +} + +// Returns the normal n in internal space, given n is in tangent space. +float3 transform_tangent_to_internal(float3 n) +[[ + anno::hidden() +]] +{ + return state::texture_tangent_u(0) * n.x + + state::texture_tangent_v(0) * n.y + + state::normal() * n.z ; +} + +float3 add_detail_normal(float3 nd = state::normal(), float3 n = state::normal()) +{ + // http://blog.selfshadow.com/publications/blending-in-detail/ + float3 n_t = transform_internal_to_tangent(n); + float3 nd_t = transform_internal_to_tangent(nd); + + n_t=n_t + float3(0.,0.,1.); + nd_t = nd_t * float3(-1.,-1.,1.); + n = n_t*math::dot(n_t, nd_t)/n_t.z - nd_t; + return ::math::normalize(transform_tangent_to_internal(n)); +} + +float screen(float base, float layer, float weight) +{ + return base + (1.0f - base) * layer * weight; +} + + +float histogram_scan_big(float input, float width, float position) +{ + return ::math::clamp( + remap_xy_to_0_1(input, + ::math::lerp(-width, 1.0, position), + position * (1.0 + width)), // special case of ::math::lerp(0.0, 1.0 + width, position)), + 0.0, + 1.0); +} + + +const float4[128] grad4( + float4(0,1,1,1), float4(0,-1,1,0), float4(1,1,0,-1), float4(0,-1,1,-1), float4(0,1,1,0), float4(1,0,-1,1), float4(0,-1,-1,0), float4(-1,0,-1,-1), float4(0,1,-1,1), float4(1,1,0,1), float4(1,0,-1,-1), float4(0,1,1,-1), float4(0,1,-1,0), float4(-1,1,0,1), float4(0,-1,-1,1), float4(-1,0,1,-1), float4(0,-1,-1,-1), float4(1,0,1,1), float4(-1,-1,0,-1), float4(0,-1,1,1), float4(-1,1,0,-1), float4(0,1,-1,-1), float4(1,-1,0,1), float4(0,-1,-1,0), float4(-1,0,-1,1), float4(1,-1,0,-1), float4(0,-1,1,0), float4(-1,-1,0,1), float4(0,1,-1,0), float4(1,1,0,-1), float4(-1,0,1,1), float4(0,1,1,0), + float4(1,1,0,-1), float4(0,1,1,-1), float4(-1,0,1,1), float4(0,1,1,0), float4(0,-1,1,-1), float4(0,-1,-1,0), float4(1,0,-1,1), float4(0,1,-1,1), float4(-1,0,-1,-1), float4(1,0,-1,-1), float4(1,1,0,1), float4(0,1,-1,0), float4(0,1,1,1), float4(0,-1,1,0), float4(-1,1,0,1), float4(0,1,-1,0), float4(1,1,0,-1), float4(0,-1,-1,1), float4(-1,0,1,-1), float4(0,-1,-1,-1), float4(1,0,1,1), float4(-1,-1,0,-1), float4(0,-1,1,1), float4(-1,1,0,-1), float4(0,1,-1,-1), float4(1,-1,0,1), float4(0,-1,-1,0), float4(-1,0,-1,1), float4(1,-1,0,-1), float4(0,1,1,0), float4(0,-1,1,0), float4(-1,-1,0,1), + float4(1,0,1,1), float4(-1,-1,0,-1), float4(0,1,1,0), float4(-1,0,1,-1), float4(1,1,0,1), float4(-1,0,-1,-1), float4(0,-1,-1,0), float4(1,0,-1,-1), float4(-1,0,-1,1), float4(1,-1,0,-1), float4(0,1,1,-1), float4(0,1,-1,0), float4(-1,1,0,1), float4(0,-1,-1,1), float4(1,1,0,-1), float4(-1,0,1,1), float4(0,-1,-1,-1), float4(1,0,-1,1), float4(0,1,1,1), float4(0,-1,1,0), float4(-1,1,0,-1), float4(0,-1,1,1), float4(0,1,-1,-1), float4(1,-1,0,1), float4(0,-1,1,0), float4(-1,-1,0,1), float4(0,1,-1,0), float4(0,-1,1,-1), float4(0,1,1,0), float4(1,1,0,-1), float4(0,-1,-1,0), float4(0,1,-1,1), + float4(0,1,-1,1), float4(1,1,0,1), float4(1,0,-1,-1), float4(0,1,-1,0), float4(0,1,1,1), float4(0,-1,1,0), float4(-1,1,0,1), float4(0,1,-1,0), float4(1,1,0,-1), float4(0,-1,-1,1), float4(-1,0,1,-1), float4(0,-1,-1,-1), float4(1,0,1,1), float4(-1,-1,0,-1), float4(0,-1,1,1), float4(-1,1,0,-1), float4(0,1,-1,-1), float4(1,-1,0,1), float4(0,-1,-1,0), float4(-1,0,-1,1), float4(1,-1,0,-1), float4(0,1,1,0), float4(0,-1,1,0), float4(-1,-1,0,1), float4(1,1,0,-1), float4(0,1,1,-1), float4(-1,0,1,1), float4(0,1,1,0), float4(0,-1,1,-1), float4(1,0,-1,1), float4(0,-1,-1,0), float4(-1,0,-1,-1)); + + +const int[256] rnd1(151,160,137,91,90,15, + 131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23, + 190, 6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33, + 88,237,149,56,87,174,20,125,136,171,168, 68,175,74,165,71,134,139,48,27,166, + 77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244, + 102,143,54, 65,25,63,161, 1,216,80,73,209,76,132,187,208, 89,18,169,200,196, + 135,130,116,188,159,86,164,100,109,198,173,186, 3,64,52,217,226,250,124,123, + 5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42, + 223,183,170,213,119,248,152, 2,44,154,163, 70,221,153,101,155,167, 43,172,9, + 129,22,39,253, 19,98,108,110,79,113,224,232,178,185, 112,104,218,246,97,228, + 251,34,242,193,238,210,144,12,191,179,162,241, 81,51,145,235,249,14,239,107, + 49,192,214, 31,181,199,106,157,184, 84,204,176,115,121,50,45,127, 4,150,254, + 138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180); + +const int[256] rnd2(120,73,105,71,106,25,159,92,184,93,179,181, + 51,168,252,235,114,143,108,82,4,72,9,192,214,112,12,200,188,8,187,117,157,88,70,87, + 56,38,115,96,59,24,215,231,123,44,144,119,243,245,212,249,197,109,76,66,183,58,232, + 113,86,234,203,80,163,254,140,62,174,118,167,18,55,99,126,170,52,149,156,142,89,189, + 178,240,255,251,169,226,236,153,223,219,54,130,133,7,173,77,242,190,1,122,27,147,196, + 180,238,124,145,101,195,57,61,39,53,154,45,47,107,233,20,176,83,36,136,138,15,230, + 246,94,69,6,135,132,29,131,172,199,228,177,182,216,134,151,95,17,218,155,19,175,41, + 191,85,23,160,125,248,42,209,165,110,102,79,221,32,26,217,2,46,81,74,16,63,202,220, + 37,75,205,13,21,68,148,40,253,241,250,141,164,35,104,49,50,224,166,247,208,162,193, + 150,30,14,10,60,98,207,84,11,239,100,116,152,90,225,129,128,64,28,158,186,127,97, + 204,206,65,5,194,91,67,198,48,111,211,227,229,237,244,43,146,139,222,137,201,22,103, + 210,34,213,31,0,33,185,161,78,121,171,3); + +const int[256] rnd3( + 88,147,251,140,206,77,107,169,5,222,84,97,116,234,24,90,201,133,40,216,229,34,37, + 158,186,49,98,61,47,9,124,123,65,249,2,66,76,172,198,179,218,210,78,170,132,32,60, + 110,213,223,151,225,115,83,180,161,42,41,164,250,233,70,231,27,217,244,114,96,183, + 228,63,195,236,192,177,209,246,109,171,72,101,23,35,112,182,162,57,69,146,81,248,215, + 7,154,178,252,136,55,150,8,1,142,167,199,39,3,14,135,152,74,33,243,121,13,181,26,211, + 19,64,168,58,67,52,143,113,43,25,240,166,59,4,187,53,238,103,159,220,204,208,245,85, + 122,62,120,93,191,224,16,68,80,226,207,134,188,73,232,102,125,196,254,253,130,241, + 46,119,38,94,221,153,100,163,175,242,131,255,214,87,139,92,12,203,117,219,21,239,6, + 31,20,44,50,28,111,141,18,157,145,11,30,237,82,129,200,89,148,95,194,144,128,176,45, + 79,106,235,75,0,230,160,126,138,227,247,91,17,173,29,51,71,22,36,118,149,189,155,156, + 197,54,202,99,174,137,105,184,205,108,10,193,165,127,56,212,104,190,185,48,86,15); + +const int[256] rnd4( + 249,199,162,114,17,55,64,57,29,137,194,247,45,70,210,106,184,178,219,122,156,193, + 214,126,138,28,148,121,19,37,135,132,173,225,221,161,180,220,36,84,224,10,185,209, + 238,119,89,253,165,248,120,235,198,52,3,190,125,226,20,6,168,2,170,167,94,54,201, + 179,42,208,242,33,146,158,245,196,166,83,86,34,74,188,44,49,85,11,243,4,99,100,102, + 78,252,26,35,24,113,236,237,9,1,72,63,204,13,15,129,53,79,163,212,213,48,92,97,38, + 189,68,230,234,41,22,246,133,250,202,77,112,18,218,229,124,181,14,108,107,255,91, + 145,223,134,142,96,88,222,207,141,175,203,27,69,95,62,47,147,164,130,232,39,244,21, + 154,239,153,110,172,59,46,81,176,217,80,150,159,182,186,66,174,169,98,231,123,215, + 12,128,187,127,58,32,111,160,149,31,195,65,152,144,82,197,216,75,61,101,117,93,51, + 60,0,67,211,241,206,90,87,56,240,73,177,43,155,157,71,191,136,103,116,140,205,143, + 228,109,23,16,171,115,7,131,192,183,105,251,5,139,40,200,30,254,227,76,151,50,8,104, + 118,233,25); + +struct noise_deriv { + float value; + float3 deriv; +}; + +float ridge(float h, float offset) +{ + h = offset - math::abs(h); + return h*h; +} + +float4 grad128_deriv(int hash) +{ + return grad4[hash]; +} + +float3 ridge_d(float n, float3 deriv, float ridged_n) +{ + return deriv * (2.0f*((n > 0.f) ? -ridged_n : ridged_n)); +} + +float fade(float t) { return t * t * t * (t * (t * 6.0f - 15.0f) + 10.0f); } +float fade_deriv(float t) { return t * t * (t * (t * 30.0f - 60.0f) + 30.0f); } +float3 abs_d(float n, float3 deriv) +{ + return (n < 0.f) ? -deriv : deriv; +} + +noise_deriv perlin_noise_deriv(float4 pos) +{ + int X = math::floor(pos.x), + Y = math::floor(pos.y), + Z = math::floor(pos.z), + W = math::floor(pos.w); + pos.x -= math::floor(pos.x); + pos.y -= math::floor(pos.y); + pos.z -= math::floor(pos.z); + pos.w -= math::floor(pos.w); + float u = fade(pos.x); + float v = fade(pos.y), + w = fade(pos.z), + x = fade(pos.w); + float du = fade_deriv(pos.x), + dv = fade_deriv(pos.y), + dw = fade_deriv(pos.z); + int AX = rnd1[ X &255] & 127, // &127 = hash for grad4 lookups + BX = rnd1[(X+1)&255] & 127, + AY = rnd2[ Y &255] & 127, + BY = rnd2[(Y+1)&255] & 127, + AZ = rnd3[ Z &255] & 127, + BZ = rnd3[(Z+1)&255] & 127, + AW = rnd4[ W &255] & 127, + BW = rnd4[(W+1)&255] & 127; + + // .w always holds the actual value, .xyz the derivative + float4 x0y0z0w0_d = grad128_deriv(AX^AY^AZ^AW); + x0y0z0w0_d.w = pos.x*x0y0z0w0_d.x + pos.y*x0y0z0w0_d.y + pos.z*x0y0z0w0_d.z + pos.w*x0y0z0w0_d.w; + float4 x1y0z0w0_d = grad128_deriv(BX^AY^AZ^AW); + x1y0z0w0_d.w = pos.x*x1y0z0w0_d.x - x1y0z0w0_d.x + pos.y*x1y0z0w0_d.y + pos.z*x1y0z0w0_d.z + pos.w*x1y0z0w0_d.w; + float4 x0y1z0w0_d = grad128_deriv(AX^BY^AZ^AW); + x0y1z0w0_d.w = pos.x*x0y1z0w0_d.x + pos.y*x0y1z0w0_d.y - x0y1z0w0_d.y + pos.z*x0y1z0w0_d.z + pos.w*x0y1z0w0_d.w; + float4 x1y1z0w0_d = grad128_deriv(BX^BY^AZ^AW); + x1y1z0w0_d.w = pos.x*x1y1z0w0_d.x - x1y1z0w0_d.x + pos.y*x1y1z0w0_d.y - x1y1z0w0_d.y + pos.z*x1y1z0w0_d.z + pos.w*x1y1z0w0_d.w; + float4 x0y0z1w0_d = grad128_deriv(AX^AY^BZ^AW); + x0y0z1w0_d.w = pos.x*x0y0z1w0_d.x + pos.y*x0y0z1w0_d.y + pos.z*x0y0z1w0_d.z - x0y0z1w0_d.z + pos.w*x0y0z1w0_d.w; + float4 x1y0z1w0_d = grad128_deriv(BX^AY^BZ^AW); + x1y0z1w0_d.w = pos.x*x1y0z1w0_d.x - x1y0z1w0_d.x + pos.y*x1y0z1w0_d.y + pos.z*x1y0z1w0_d.z - x1y0z1w0_d.z + pos.w*x1y0z1w0_d.w; + float4 x0y1z1w0_d = grad128_deriv(AX^BY^BZ^AW); + x0y1z1w0_d.w = pos.x*x0y1z1w0_d.x + pos.y*x0y1z1w0_d.y - x0y1z1w0_d.y + pos.z*x0y1z1w0_d.z - x0y1z1w0_d.z + pos.w*x0y1z1w0_d.w; + float4 x1y1z1w0_d = grad128_deriv(BX^BY^BZ^AW); + x1y1z1w0_d.w = pos.x*x1y1z1w0_d.x - x1y1z1w0_d.x + pos.y*x1y1z1w0_d.y - x1y1z1w0_d.y + pos.z*x1y1z1w0_d.z - x1y1z1w0_d.z + pos.w*x1y1z1w0_d.w; + float4 x0y0z0w1_d = grad128_deriv(AX^AY^AZ^BW); + x0y0z0w1_d.w = pos.x*x0y0z0w1_d.x + pos.y*x0y0z0w1_d.y + pos.z*x0y0z0w1_d.z + pos.w*x0y0z0w1_d.w - x0y0z0w1_d.w; + float4 x1y0z0w1_d = grad128_deriv(BX^AY^AZ^BW); + x1y0z0w1_d.w = pos.x*x1y0z0w1_d.x - x1y0z0w1_d.x + pos.y*x1y0z0w1_d.y + pos.z*x1y0z0w1_d.z + pos.w*x1y0z0w1_d.w - x1y0z0w1_d.w; + float4 x0y1z0w1_d = grad128_deriv(AX^BY^AZ^BW); + x0y1z0w1_d.w = pos.x*x0y1z0w1_d.x + pos.y*x0y1z0w1_d.y - x0y1z0w1_d.y + pos.z*x0y1z0w1_d.z + pos.w*x0y1z0w1_d.w - x0y1z0w1_d.w; + float4 x1y1z0w1_d = grad128_deriv(BX^BY^AZ^BW); + x1y1z0w1_d.w = pos.x*x1y1z0w1_d.x - x1y1z0w1_d.x + pos.y*x1y1z0w1_d.y - x1y1z0w1_d.y + pos.z*x1y1z0w1_d.z + pos.w*x1y1z0w1_d.w - x1y1z0w1_d.w; + + float4 i1_d = x1y0z0w0_d - x0y0z0w0_d; + float4 i2_d = x0y1z0w0_d - x0y0z0w0_d; + + float4 d_r = x0y0z0w0_d + i1_d*u + i2_d*v; + d_r.x += i1_d.w*du; + d_r.y += i2_d.w*dv; + + float4 i5_d = x1y1z0w0_d - x0y1z0w0_d - i1_d; + float4 i3_d = x0y0z1w0_d - x0y0z0w0_d; + float4 i4_d = x0y0z0w1_d - x0y0z0w0_d; + float4 i6_d = x0y1z1w0_d - x0y1z0w0_d - i3_d; + float4 i7t_d = x0y1z0w1_d - x0y1z0w0_d; + float4 i7_d = i7t_d - i4_d; + float4 i8t_d = x1y0z1w0_d - x1y0z0w0_d; + float4 i8_d = i8t_d - i3_d; + float4 i9_d = x1y0z0w1_d - x1y0z0w0_d - i4_d; + + float4 x0y0z1w1_d = grad128_deriv(AX^AY^BZ^BW); + x0y0z1w1_d.w = pos.x*x0y0z1w1_d.x + pos.y*x0y0z1w1_d.y + pos.z*x0y0z1w1_d.z - x0y0z1w1_d.z + pos.w*x0y0z1w1_d.w - x0y0z1w1_d.w; + + float4 i10t_d = x0y0z1w1_d - x0y0z0w1_d; + float4 i10_d = i10t_d - i3_d; + float4 i11_d = x1y1z1w0_d - i6_d - i8t_d - x1y1z0w0_d; + float4 i12_d = x0y0z0w1_d - x0y1z0w1_d + x1y1z0w1_d - i5_d - x1y0z0w1_d; + + float4 x0y1z1w1_d = grad128_deriv(AX^BY^BZ^BW); + x0y1z1w1_d.w = pos.x*x0y1z1w1_d.x + pos.y*x0y1z1w1_d.y - x0y1z1w1_d.y + pos.z*x0y1z1w1_d.z - x0y1z1w1_d.z + pos.w*x0y1z1w1_d.w - x0y1z1w1_d.w; + + float4 i13t_d = x0y1z1w1_d - x0y0z1w1_d; + float4 i13_d = i13t_d + x0y0z0w1_d - i6_d - x0y1z0w1_d; + + float4 x1y0z1w1_d = grad128_deriv(BX^AY^BZ^BW); + x1y0z1w1_d.w = pos.x*x1y0z1w1_d.x - x1y0z1w1_d.x + pos.y*x1y0z1w1_d.y + pos.z*x1y0z1w1_d.z - x1y0z1w1_d.z + pos.w*x1y0z1w1_d.w - x1y0z1w1_d.w; + + float4 i14_d = x1y0z1w1_d - i10t_d - i8_d - x1y0z0w1_d; + + float4 x1y1z1w1_d = grad128_deriv(BX^BY^BZ^BW); + x1y1z1w1_d.w = pos.x*x1y1z1w1_d.x - x1y1z1w1_d.x + pos.y*x1y1z1w1_d.y - x1y1z1w1_d.y + pos.z*x1y1z1w1_d.z - x1y1z1w1_d.z + pos.w*x1y1z1w1_d.w - x1y1z1w1_d.w; + + float4 i15_d = x1y1z1w1_d + i9_d + x1y0z1w0_d + i7t_d - x0y0z1w0_d + x1y1z0w0_d - x1y1z1w0_d - x0y1z1w0_d - x1y1z0w1_d - i13t_d - x1y0z1w1_d; + + d_r += i5_d*(u*v) + i6_d*(v*w) + i3_d*w + i4_d*x + i7_d*(v*x) + i8_d*(u*w) + i9_d*(u*x) + i10_d*(w*x) + i11_d*(u*v*w) + i12_d*(u*v*x) + i13_d*(v*w*x) + i14_d*(w*x*u) + i15_d*(u*v*w*x); + + float3 deriv; + deriv.x = d_r.x + + i5_d.w*du*v + + i8_d.w*du*w + + i9_d.w*du*x + + i11_d.w*du*v*w + + i12_d.w*du*v*x + + i14_d.w*w*x*du + + i15_d.w*du*v*w*x; + + deriv.y = d_r.y + + i5_d.w*u*dv + + i6_d.w*dv*w + + i7_d.w*dv*x + + i11_d.w*u*dv*w + + i12_d.w*u*dv*x + + i13_d.w*dv*w*x + + i15_d.w*u*dv*w*x; + + deriv.z = d_r.z + + i3_d.w*dw + + i6_d.w*v*dw + + i8_d.w*u*dw + + i10_d.w*dw*x + + i11_d.w*u*v*dw + + i13_d.w*v*dw*x + + i14_d.w*dw*x*u + + i15_d.w*u*v*dw*x; + + return noise_deriv(deriv: float3(deriv.x, deriv.y, deriv.z), value: d_r.w); +} + +noise_deriv summed_perlin_noise_deriv(float3 pos, float time, int terms, float3 turbulence_weight, bool abs_noise, bool ridged) +{ + float sum = 0.0f; + float3 deriv = float3(0.0f); + float weight = ridged ? 0.625f : 1.0f; + float prev = 1.0f; + float4 p = float4(pos.x,pos.y,pos.z,time); + while(terms != 0) { + terms--; + noise_deriv n_d = perlin_noise_deriv(p); + float n2 = ridged ? ridge(n_d.value, 1.0f) : (abs_noise ? math::abs(n_d.value) : n_d.value); // ridged offset = 1.0f, could be configurable + float3 deriv2 = ridged ? ridge_d(n_d.value, n_d.deriv, n_d.value) : (abs_noise ? abs_d(n_d.value, n_d.deriv) : n_d.deriv); + + sum += weight*prev*n2; + deriv += prev*deriv2; // gain (weight) cancels frequency doubling (0.5*2) + p += p; // frequency doubled, could be configurable + if (ridged) + prev = n2; + weight *= 0.5f; // gain halved, could be configurable + } + + if((turbulence_weight.x != 0.0f) || (turbulence_weight.y != 0.0f) || (turbulence_weight.z != 0.0f)) + { + float[2] sc = math::sincos(pos.x*turbulence_weight.x + pos.y*turbulence_weight.y + pos.z*turbulence_weight.z + sum); + sum = sc[0]; + deriv = sc[1] * (deriv + turbulence_weight); + } + + if (!abs_noise && !ridged) { // Absolute & Ridged already are in 0..1 + // Scale [-1,1] to [0,1] + sum = sum*0.5f+0.5f; + deriv *= 0.5f; + } + return noise_deriv(value: sum, deriv: deriv); +} + +float3 apply_noise_modifications_deriv( + float value, + float3 deriv, + float position, + uniform bool apply_marble = false + [[ + anno::description("Triggers a modification to make the pattern have a marble like appearance (cosine)") + ]], + uniform bool apply_dent = false + [[ + anno::description("Raises the output of the function to the power of 3") + ]], + uniform float noise_threshold_high = 1.0 + [[ + anno::description("Noise values greater then \"noise_threshold_high\" are mapped to \"color1\""), + anno::hard_range(0.0, 1.0) + ]], + uniform float noise_threshold_low = 0.0 + [[ + anno::description("Noise values greater then \"noise_threshold_low\" are mapped to \"color2\""), + anno::hard_range(0.0, 1.0) + ]], + uniform float noise_bands = 1.0 + [[ + anno::description("Creates a \"tree ring\" like banding effect") + ]] +) +{ + float sn = value; + if(apply_marble) + { + // Classic Perlin marble function + float[2] sc = math::sincos(position + sn*5.0f); //!! 5.0f = magic + sn = sc[1]; + deriv = sc[0] * float3(deriv.x*-5.0f-1.0f, deriv.y*-5.0f, deriv.z*-5.0f); + } + + if(apply_dent) + { + // Cube + sn *= sn * sn; + deriv *= 3.0f * (sn * sn); + } + + // Create banding/stripes by using the fraction component only + if(noise_bands != 1.0f) // avoid case of sn = 1 being wrapped to 0 + { + sn *= noise_bands; + sn -= math::floor(sn); + + // Smooth transition slightly + float tmp = 1.0f - sn; + float tmp2 = tmp*tmp; // ^2 + float tmp4 = tmp2*tmp2; // ^4 + float tmp16 = tmp4*tmp4; // ^8 + tmp16 *= tmp16; // ^16 + deriv *= 1.0f - 20.0f*tmp16*tmp2*tmp; // ^19 + sn += tmp16*tmp4; // ^20 + } + + // Clamp the noise + if (noise_threshold_high > noise_threshold_low) + { + sn = (sn - noise_threshold_low) / (noise_threshold_high - noise_threshold_low); + if (sn < 0.0f || sn > 1.0f) { + deriv = float3(0.0f); + sn = math::saturate(sn); + } + else + deriv /= (noise_threshold_high - noise_threshold_low); + } + + return deriv; +} + +export float3 perlin_noise_bump_texture( + ::base::texture_coordinate_info uvw = ::base::texture_coordinate_info() + [[ + anno::description("Parameterization to be used for texture mapping. Defaults to texture channel 0.") + ]], + uniform float factor = 1. + [[ + anno::description("Strength of the bump mapping effect") + ]], + uniform float size = 1. + [[ + anno::description("Size of the biggest feature of the pattern") + ]], + uniform bool apply_marble = false + [[ + anno::description("Triggers a modification to make the pattern have a marble like appearance (cosine)") + ]], + uniform bool apply_dent = false + [[ + anno::description("Raises the output of the function to the power of 3") + ]], + uniform float noise_phase = 0.0 + [[ + anno::description("Controls the 4th dimension of the function") + ]], + uniform int noise_levels = 1 + [[ + anno::description("Number of octaves to of Perlin to sum up"), + anno::soft_range(1, 6) + ]], + uniform bool absolute_noise = false + [[ + anno::description("If set to true, the appearance of the pattern will be more \"billowing\" and \"turbulent\"") + ]], + uniform bool ridged_noise = false + [[ + anno::description("If set to true, the appearance of the pattern will be more \"electrical\"") + ]], + uniform float3 noise_distortion = float3( 0.0 ) + [[ + anno::description("Weight of additional noise turbulence") + ]], + uniform float noise_threshold_high = 1.0 + [[ + anno::description("Noise values greater then \"noise_threshold_high\" are mapped to the maximum bump height"), + anno::hard_range(0.0, 1.0) + ]], + uniform float noise_threshold_low = 0.0 + [[ + anno::description("Noise values greater then \"noise_threshold_low\" are mapped to the minimum bump height"), + anno::hard_range(0.0, 1.0) + ]], + uniform float noise_bands = 1.0 + [[ + anno::description("creates a \"tree ring\" like banding effect") + ]], + float3 normal = state::normal() + [[ + anno::description("Base normal for the bump mapping.") + ]] +) +[[ + anno::description("Bump-mapping Perlin noise"), + anno::noinline() +]] +{ + if (factor == 0.0f || size == 0.0f) + return normal; + + float3 scaled_position = uvw.position / size; + + noise_deriv nd = summed_perlin_noise_deriv( + scaled_position, + noise_phase, + noise_levels, + noise_distortion, + absolute_noise, + ridged_noise); + + float3 deriv = apply_noise_modifications_deriv( + nd.value, + nd.deriv, + scaled_position.x, + apply_marble, + apply_dent, + noise_threshold_high, + noise_threshold_low, + noise_bands); + + float bump_factor = -0.1f * factor; // original code used 0.1 as magic constant for delta, obtain same magnitude + + return math::normalize( + normal * (math::abs(deriv.z * bump_factor) + 1.0f) + + uvw.tangent_u * (deriv.x * bump_factor) + + uvw.tangent_v * (deriv.y * bump_factor)); +} + +export material Aluminum_Anodized( + uniform bool infinite_tiling = false [[ + ::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."), + ::anno::display_name("Infinite Tiling"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + uniform bool enable_coating = false [[ + ::anno::description("Enables a clearcoat layer on top of the material."), + ::anno::display_name("Enable Clearcoat"), + ::anno::in_group("Appearance"), + ::anno::ui_order(1) + ]], + color color_1 = color(0.031896f, 0.250158f, 0.644480f) [[ + ::anno::description("Sets the color of the anodized aluminum."), + ::anno::display_name("Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(2) + ]], + float anodization_roughness = 0.69f [[ + ::anno::description("The roughness of the anodized aluminum. Higher values yield blurrier reflections."), + ::anno::display_name("Anodization Roughness"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 1.f), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float smudges = 0.f [[ + ::anno::description("Adds a layer of smudges that makes reflections blurrier."), + ::anno::display_name("Smudges"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::soft_range(0.f, 1.f), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + float wear = 0.f [[ + ::anno::description("Adds a layer of wear that makes reflections blurrier."), + ::anno::display_name("Wear"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::soft_range(0.f, 1.f), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(5) + ]], + float abrasion = 0.f [[ + ::anno::description("Adds a layer of abrasion that makes reflections blurrier."), + ::anno::display_name("Abrasion"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::soft_range(0.f, 1.f), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(6) + ]], + float balance = 0.5f [[ + ::anno::description("Small values make the imperfections smaller and enhance the contrast while higher values make them bigger."), + ::anno::display_name("Imperfections Balance"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::soft_range(0.f, 1.f), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(7) + ]], + float dirt_weight = 0.f [[ + ::anno::description("Increasing this value applies the imperfections also a a visible layer of dirt that covers the surface."), + ::anno::display_name("Dirt Weight"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::soft_range(0.f, 1.f), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(8) + ]], + float scratches = 0.f [[ + ::anno::description("Adjusts the amount and size of scratches that appear on the material."), + ::anno::display_name("Scratches"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 1.f), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(9) + ]], + float scratches_bump_strength = 0.199999988f [[ + ::anno::description("Determines the degree of bumpiness."), + ::anno::display_name("Scratches Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 1.f), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(10) + ]], + uniform bool enable_anodization_bump = true [[ + ::anno::description("Enables bumpy surface for the anodization layer."), + ::anno::display_name("Anodization Bumps"), + ::anno::in_group("Appearance", "Anodization Bumps"), + ::anno::ui_order(11) + ]], + uniform float factor = 1.f [[ + ::anno::description("Controls the strength of the finegrained bump on the anodization layer."), + ::anno::display_name("Anodization Bump Strength"), + ::anno::in_group("Appearance", "Anodization Bumps"), + ::anno::hard_range(0.f, 1.f), + ::anno::soft_range(0.f, 1.f), + ::anno::enable_if("enable_anodization_bump == true"), + ::anno::ui_order(12) + ]], + uniform float anodization_bump_size = 0.24f [[ + ::anno::description("Controls the size of the finegrained bump on the anodization layer."), + ::anno::display_name("Anodization Bump Scale"), + ::anno::in_group("Appearance", "Anodization Bumps"), + ::anno::enable_if("enable_anodization_bump == true"), + ::anno::ui_order(13) + ]], + uniform bool object_scaled_bump = false [[ + ::anno::description("When enabled, local object scale does scale the procedural noise of the anodization. If disabled, the noise is kept at a global scale that is independent from the scale of the object."), + ::anno::display_name("Object Scaled Bump"), + ::anno::in_group("Appearance", "Anodization Bumps"), + ::anno::enable_if("enable_anodization_bump == true"), + ::anno::ui_order(14) + ]], + float2 texture_translate = 0.f [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform"), + ::anno::ui_order(13) + ]], + float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f), + ::anno::ui_order(14) + ]], + float2 texture_scale = 1.0f [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::anno::in_group("Transform"), + ::anno::ui_order(15) + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Uses selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Transform"), + ::anno::ui_order(16) + ]], + uniform bool roundcorners_enable = false [[ + ::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."), + ::anno::display_name("Enable Round Corners"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(17) + ]], + uniform float roundcorners_radius_mm = 0.5f [[ + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::display_name("Round Corner Radius (mm)"), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f), + ::anno::ui_order(18) + ]], + uniform bool roundcorners_across_materials = false [[ + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::display_name("Across Materials"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(19) + ]]) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aluminum Anodized - Electric Blue"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::thumbnail("./.thumbs/Aluminum_Anodized.Aluminum_Anodized.png"), + ::anno::key_words(string[]("aec", "metal", "aluminum", "anodized", "coated", "treated", "modern", "automotive", "design", "reflective", "shiny", "new", "blue", "electric", "saturated", "cool")) +]] + = + let { + bool tmp0 = false; + material_surface tmp1(::df::weighted_layer(screen(screen(smudges * histogram_scan_big(::math::pow(infinite_tiling ? vm_tex_infinite_color_normal(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./analum_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.0599999987f, 0.0500000007f, 0.210999995f), float3(0.5f, 0.5f, 1.f), 0.349999994f, false, 2.20000005f, 1.f).value : vm_tex_lookup_float3(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)), float3(1.f, 1.f, 0.98999995f)).x, 0.329999983f, 0.299999982f), histogram_scan_big(::math::pow(infinite_tiling ? vm_tex_infinite_color_normal(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./analum_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.0599999987f, 0.0500000007f, 0.210999995f), float3(0.5f, 0.5f, 1.f), 0.349999994f, false, 2.20000005f, 1.f).value : vm_tex_lookup_float3(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)), float3(1.f, 1.f, 0.98999995f)).y, 0.239999995f, 0.179999992f), wear), histogram_scan_big(::math::pow(infinite_tiling ? vm_tex_infinite_color_normal(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./analum_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.0599999987f, 0.0500000007f, 0.210999995f), float3(0.5f, 0.5f, 1.f), 0.349999994f, false, 2.20000005f, 1.f).value : vm_tex_lookup_float3(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)), float3(1.f, 1.f, 0.98999995f)).z, 0.349999994f, 0.349999994f), abrasion) * ::math::pow(dirt_weight, 0.409999996f), ::df::diffuse_reflection_bsdf(color(0.0144440001f, 0.0094130002f, 0.00926099997f), 0.f), enable_coating ? ::df::custom_curve_layer(0.049999997f, 1.f, 5.f, 1.f - histogram_scan_big(infinite_tiling ? vm_tex_infinite(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(1.f)).x, 0.0799999982f, ::math::lerp(0.730000019f, 0.0900000036f, ::math::pow(scratches, 0.25999999f))), ::df::microfacet_beckmann_smith_bsdf(screen(screen(smudges * ::math::pow(infinite_tiling ? vm_tex_infinite_color_normal(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./analum_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.0599999987f, 0.0500000007f, 0.210999995f), float3(0.5f, 0.5f, 1.f), 0.349999994f, false, 2.20000005f, 1.f).value : vm_tex_lookup_float3(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)), ::math::lerp(float3(0.699999988f, 0.670000017f, 0.779999971f), float3(0.189999998f, 0.400000006f, 0.400000006f), float3(balance))).x, ::math::pow(infinite_tiling ? vm_tex_infinite_color_normal(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./analum_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.0599999987f, 0.0500000007f, 0.210999995f), float3(0.5f, 0.5f, 1.f), 0.349999994f, false, 2.20000005f, 1.f).value : vm_tex_lookup_float3(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)), ::math::lerp(float3(0.699999988f, 0.670000017f, 0.779999971f), float3(0.189999998f, 0.400000006f, 0.400000006f), float3(balance))).y, wear), ::math::pow(infinite_tiling ? vm_tex_infinite_color_normal(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./analum_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.0599999987f, 0.0500000007f, 0.210999995f), float3(0.5f, 0.5f, 1.f), 0.349999994f, false, 2.20000005f, 1.f).value : vm_tex_lookup_float3(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)), ::math::lerp(float3(0.699999988f, 0.670000017f, 0.779999971f), float3(0.189999998f, 0.400000006f, 0.400000006f), float3(balance))).z, abrasion) * screen(screen(smudges * ::math::pow(infinite_tiling ? vm_tex_infinite_color_normal(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./analum_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.0599999987f, 0.0500000007f, 0.210999995f), float3(0.5f, 0.5f, 1.f), 0.349999994f, false, 2.20000005f, 1.f).value : vm_tex_lookup_float3(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)), ::math::lerp(float3(0.699999988f, 0.670000017f, 0.779999971f), float3(0.189999998f, 0.400000006f, 0.400000006f), float3(balance))).x, ::math::pow(infinite_tiling ? vm_tex_infinite_color_normal(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./analum_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.0599999987f, 0.0500000007f, 0.210999995f), float3(0.5f, 0.5f, 1.f), 0.349999994f, false, 2.20000005f, 1.f).value : vm_tex_lookup_float3(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)), ::math::lerp(float3(0.699999988f, 0.670000017f, 0.779999971f), float3(0.189999998f, 0.400000006f, 0.400000006f), float3(balance))).y, wear), ::math::pow(infinite_tiling ? vm_tex_infinite_color_normal(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./analum_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.0599999987f, 0.0500000007f, 0.210999995f), float3(0.5f, 0.5f, 1.f), 0.349999994f, false, 2.20000005f, 1.f).value : vm_tex_lookup_float3(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)), ::math::lerp(float3(0.699999988f, 0.670000017f, 0.779999971f), float3(0.189999998f, 0.400000006f, 0.400000006f), float3(balance))).z, abrasion), screen(screen(smudges * ::math::pow(infinite_tiling ? vm_tex_infinite_color_normal(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./analum_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.0599999987f, 0.0500000007f, 0.210999995f), float3(0.5f, 0.5f, 1.f), 0.349999994f, false, 2.20000005f, 1.f).value : vm_tex_lookup_float3(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)), ::math::lerp(float3(0.699999988f, 0.670000017f, 0.779999971f), float3(0.189999998f, 0.400000006f, 0.400000006f), float3(balance))).x, ::math::pow(infinite_tiling ? vm_tex_infinite_color_normal(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./analum_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.0599999987f, 0.0500000007f, 0.210999995f), float3(0.5f, 0.5f, 1.f), 0.349999994f, false, 2.20000005f, 1.f).value : vm_tex_lookup_float3(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)), ::math::lerp(float3(0.699999988f, 0.670000017f, 0.779999971f), float3(0.189999998f, 0.400000006f, 0.400000006f), float3(balance))).y, wear), ::math::pow(infinite_tiling ? vm_tex_infinite_color_normal(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./analum_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.0599999987f, 0.0500000007f, 0.210999995f), float3(0.5f, 0.5f, 1.f), 0.349999994f, false, 2.20000005f, 1.f).value : vm_tex_lookup_float3(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)), ::math::lerp(float3(0.699999988f, 0.670000017f, 0.779999971f), float3(0.189999998f, 0.400000006f, 0.400000006f), float3(balance))).z, abrasion) * screen(screen(smudges * ::math::pow(infinite_tiling ? vm_tex_infinite_color_normal(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./analum_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.0599999987f, 0.0500000007f, 0.210999995f), float3(0.5f, 0.5f, 1.f), 0.349999994f, false, 2.20000005f, 1.f).value : vm_tex_lookup_float3(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)), ::math::lerp(float3(0.699999988f, 0.670000017f, 0.779999971f), float3(0.189999998f, 0.400000006f, 0.400000006f), float3(balance))).x, ::math::pow(infinite_tiling ? vm_tex_infinite_color_normal(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./analum_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.0599999987f, 0.0500000007f, 0.210999995f), float3(0.5f, 0.5f, 1.f), 0.349999994f, false, 2.20000005f, 1.f).value : vm_tex_lookup_float3(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)), ::math::lerp(float3(0.699999988f, 0.670000017f, 0.779999971f), float3(0.189999998f, 0.400000006f, 0.400000006f), float3(balance))).y, wear), ::math::pow(infinite_tiling ? vm_tex_infinite_color_normal(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./analum_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.0599999987f, 0.0500000007f, 0.210999995f), float3(0.5f, 0.5f, 1.f), 0.349999994f, false, 2.20000005f, 1.f).value : vm_tex_lookup_float3(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)), ::math::lerp(float3(0.699999988f, 0.670000017f, 0.779999971f), float3(0.189999998f, 0.400000006f, 0.400000006f), float3(balance))).z, abrasion), color(1.f, 1.f, 1.f), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::simple_glossy_bsdf(::math::lerp(::math::lerp(0.179999992f, 0.649999976f, anodization_roughness), 0.529999971f, histogram_scan_big(infinite_tiling ? vm_tex_infinite(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(1.f)).x, 0.0799999982f, ::math::lerp(0.730000019f, 0.0900000036f, ::math::pow(scratches, 0.25999999f)))) * ::math::lerp(::math::lerp(0.179999992f, 0.649999976f, anodization_roughness), 0.529999971f, histogram_scan_big(infinite_tiling ? vm_tex_infinite(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(1.f)).x, 0.0799999982f, ::math::lerp(0.730000019f, 0.0900000036f, ::math::pow(scratches, 0.25999999f)))), ::math::lerp(::math::lerp(0.179999992f, 0.649999976f, anodization_roughness), 0.529999971f, histogram_scan_big(infinite_tiling ? vm_tex_infinite(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(1.f)).x, 0.0799999982f, ::math::lerp(0.730000019f, 0.0900000036f, ::math::pow(scratches, 0.25999999f)))) * ::math::lerp(::math::lerp(0.179999992f, 0.649999976f, anodization_roughness), 0.529999971f, histogram_scan_big(infinite_tiling ? vm_tex_infinite(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(1.f)).x, 0.0799999982f, ::math::lerp(0.730000019f, 0.0900000036f, ::math::pow(scratches, 0.25999999f)))), nvidia::core_definitions::blend_colors(color_1, color(0.346704006f, 0.346704006f, 0.346704006f), ::base::color_layer_blend, histogram_scan_big(infinite_tiling ? vm_tex_infinite(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(1.f)).x, 0.0799999982f, ::math::lerp(0.730000019f, 0.0900000036f, ::math::pow(scratches, 0.25999999f))), true).tint, nvidia::core_definitions::blend_colors(color_1, color(0.346704006f, 0.346704006f, 0.346704006f), ::base::color_layer_blend, histogram_scan_big(infinite_tiling ? vm_tex_infinite(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(1.f)).x, 0.0799999982f, ::math::lerp(0.730000019f, 0.0900000036f, ::math::pow(scratches, 0.25999999f))), true).tint, ::state::texture_tangent_u(0), ::df::scatter_reflect), bsdf(), ::math::lerp(add_detail_normal(vm_tex_normal_lookup(texture_2d("./analum_worn_norm.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.289999992f), scratches_bump_strength * histogram_scan_big(infinite_tiling ? vm_tex_infinite(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(1.f)).x, 0.0799999982f, ::math::lerp(0.730000019f, 0.0900000036f, ::math::pow(scratches, 0.25999999f))) * 0.579999983f), infinite_tiling ? vm_tex_infinite_normal(texture_2d("./analum_scratches_norm.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(0.497999996f, 0.497999996f, 0.987999976f), 0.349999994f, histogram_scan_big(infinite_tiling ? vm_tex_infinite(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(1.f)).x, 0.0799999982f, ::math::lerp(0.730000019f, 0.0900000036f, ::math::pow(scratches, 0.25999999f))) * scratches_bump_strength) : vm_tex_normal_lookup(texture_2d("./analum_scratches_norm.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), histogram_scan_big(infinite_tiling ? vm_tex_infinite(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(1.f)).x, 0.0799999982f, ::math::lerp(0.730000019f, 0.0900000036f, ::math::pow(scratches, 0.25999999f))) * scratches_bump_strength)), enable_anodization_bump ? ::perlin_noise_bump_texture(::base::transform_coordinate(::base::rotation_translation_scale(float3(0.f), float3(0.f), float3(::state::meters_per_scene_unit()) * (object_scaled_bump ? 1.f : ::state::transform_scale(::state::coordinate_object, ::state::coordinate_world, 1.f))), ::base::coordinate_source(::base::texture_coordinate_object, 0)), factor * 3.f, anodization_bump_size * 0.00200000009f, false, false, 0.f, 1, false, false, float3(0.f), 1.f, 0.f, 1.f, ::state::normal()) : ::state::normal(), 1.f - histogram_scan_big(infinite_tiling ? vm_tex_infinite(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(1.f)).x, 0.0799999982f, ::math::lerp(0.730000019f, 0.0900000036f, ::math::pow(scratches, 0.25999999f))))), ::state::normal()) : ::df::weighted_layer(::math::pow(screen(screen(smudges * ::math::pow(infinite_tiling ? vm_tex_infinite_color_normal(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./analum_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.0599999987f, 0.0500000007f, 0.210999995f), float3(0.5f, 0.5f, 1.f), 0.349999994f, false, 2.20000005f, 1.f).value : vm_tex_lookup_float3(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)), ::math::lerp(float3(0.699999988f, 0.670000017f, 0.779999971f), float3(0.189999998f, 0.400000006f, 0.400000006f), float3(balance))).x, ::math::pow(infinite_tiling ? vm_tex_infinite_color_normal(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./analum_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.0599999987f, 0.0500000007f, 0.210999995f), float3(0.5f, 0.5f, 1.f), 0.349999994f, false, 2.20000005f, 1.f).value : vm_tex_lookup_float3(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)), ::math::lerp(float3(0.699999988f, 0.670000017f, 0.779999971f), float3(0.189999998f, 0.400000006f, 0.400000006f), float3(balance))).y, wear), ::math::pow(infinite_tiling ? vm_tex_infinite_color_normal(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./analum_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.0599999987f, 0.0500000007f, 0.210999995f), float3(0.5f, 0.5f, 1.f), 0.349999994f, false, 2.20000005f, 1.f).value : vm_tex_lookup_float3(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)), ::math::lerp(float3(0.699999988f, 0.670000017f, 0.779999971f), float3(0.189999998f, 0.400000006f, 0.400000006f), float3(balance))).z, abrasion), 1.66999996f) * 0.209999993f, ::df::microfacet_beckmann_smith_bsdf(screen(screen(smudges * ::math::pow(infinite_tiling ? vm_tex_infinite_color_normal(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./analum_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.0599999987f, 0.0500000007f, 0.210999995f), float3(0.5f, 0.5f, 1.f), 0.349999994f, false, 2.20000005f, 1.f).value : vm_tex_lookup_float3(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)), ::math::lerp(float3(0.699999988f, 0.670000017f, 0.779999971f), float3(0.189999998f, 0.400000006f, 0.400000006f), float3(balance))).x, ::math::pow(infinite_tiling ? vm_tex_infinite_color_normal(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./analum_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.0599999987f, 0.0500000007f, 0.210999995f), float3(0.5f, 0.5f, 1.f), 0.349999994f, false, 2.20000005f, 1.f).value : vm_tex_lookup_float3(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)), ::math::lerp(float3(0.699999988f, 0.670000017f, 0.779999971f), float3(0.189999998f, 0.400000006f, 0.400000006f), float3(balance))).y, wear), ::math::pow(infinite_tiling ? vm_tex_infinite_color_normal(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./analum_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.0599999987f, 0.0500000007f, 0.210999995f), float3(0.5f, 0.5f, 1.f), 0.349999994f, false, 2.20000005f, 1.f).value : vm_tex_lookup_float3(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)), ::math::lerp(float3(0.699999988f, 0.670000017f, 0.779999971f), float3(0.189999998f, 0.400000006f, 0.400000006f), float3(balance))).z, abrasion) * screen(screen(smudges * ::math::pow(infinite_tiling ? vm_tex_infinite_color_normal(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./analum_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.0599999987f, 0.0500000007f, 0.210999995f), float3(0.5f, 0.5f, 1.f), 0.349999994f, false, 2.20000005f, 1.f).value : vm_tex_lookup_float3(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)), ::math::lerp(float3(0.699999988f, 0.670000017f, 0.779999971f), float3(0.189999998f, 0.400000006f, 0.400000006f), float3(balance))).x, ::math::pow(infinite_tiling ? vm_tex_infinite_color_normal(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./analum_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.0599999987f, 0.0500000007f, 0.210999995f), float3(0.5f, 0.5f, 1.f), 0.349999994f, false, 2.20000005f, 1.f).value : vm_tex_lookup_float3(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)), ::math::lerp(float3(0.699999988f, 0.670000017f, 0.779999971f), float3(0.189999998f, 0.400000006f, 0.400000006f), float3(balance))).y, wear), ::math::pow(infinite_tiling ? vm_tex_infinite_color_normal(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./analum_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.0599999987f, 0.0500000007f, 0.210999995f), float3(0.5f, 0.5f, 1.f), 0.349999994f, false, 2.20000005f, 1.f).value : vm_tex_lookup_float3(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)), ::math::lerp(float3(0.699999988f, 0.670000017f, 0.779999971f), float3(0.189999998f, 0.400000006f, 0.400000006f), float3(balance))).z, abrasion), screen(screen(smudges * ::math::pow(infinite_tiling ? vm_tex_infinite_color_normal(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./analum_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.0599999987f, 0.0500000007f, 0.210999995f), float3(0.5f, 0.5f, 1.f), 0.349999994f, false, 2.20000005f, 1.f).value : vm_tex_lookup_float3(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)), ::math::lerp(float3(0.699999988f, 0.670000017f, 0.779999971f), float3(0.189999998f, 0.400000006f, 0.400000006f), float3(balance))).x, ::math::pow(infinite_tiling ? vm_tex_infinite_color_normal(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./analum_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.0599999987f, 0.0500000007f, 0.210999995f), float3(0.5f, 0.5f, 1.f), 0.349999994f, false, 2.20000005f, 1.f).value : vm_tex_lookup_float3(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)), ::math::lerp(float3(0.699999988f, 0.670000017f, 0.779999971f), float3(0.189999998f, 0.400000006f, 0.400000006f), float3(balance))).y, wear), ::math::pow(infinite_tiling ? vm_tex_infinite_color_normal(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./analum_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.0599999987f, 0.0500000007f, 0.210999995f), float3(0.5f, 0.5f, 1.f), 0.349999994f, false, 2.20000005f, 1.f).value : vm_tex_lookup_float3(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)), ::math::lerp(float3(0.699999988f, 0.670000017f, 0.779999971f), float3(0.189999998f, 0.400000006f, 0.400000006f), float3(balance))).z, abrasion) * screen(screen(smudges * ::math::pow(infinite_tiling ? vm_tex_infinite_color_normal(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./analum_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.0599999987f, 0.0500000007f, 0.210999995f), float3(0.5f, 0.5f, 1.f), 0.349999994f, false, 2.20000005f, 1.f).value : vm_tex_lookup_float3(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)), ::math::lerp(float3(0.699999988f, 0.670000017f, 0.779999971f), float3(0.189999998f, 0.400000006f, 0.400000006f), float3(balance))).x, ::math::pow(infinite_tiling ? vm_tex_infinite_color_normal(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./analum_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.0599999987f, 0.0500000007f, 0.210999995f), float3(0.5f, 0.5f, 1.f), 0.349999994f, false, 2.20000005f, 1.f).value : vm_tex_lookup_float3(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)), ::math::lerp(float3(0.699999988f, 0.670000017f, 0.779999971f), float3(0.189999998f, 0.400000006f, 0.400000006f), float3(balance))).y, wear), ::math::pow(infinite_tiling ? vm_tex_infinite_color_normal(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./analum_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.0599999987f, 0.0500000007f, 0.210999995f), float3(0.5f, 0.5f, 1.f), 0.349999994f, false, 2.20000005f, 1.f).value : vm_tex_lookup_float3(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)), ::math::lerp(float3(0.699999988f, 0.670000017f, 0.779999971f), float3(0.189999998f, 0.400000006f, 0.400000006f), float3(balance))).z, abrasion), color(1.f, 1.f, 1.f), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::simple_glossy_bsdf(::math::lerp(::math::lerp(0.179999992f, 0.649999976f, anodization_roughness), 0.529999971f, histogram_scan_big(infinite_tiling ? vm_tex_infinite(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(1.f)).x, 0.0799999982f, ::math::lerp(0.730000019f, 0.0900000036f, ::math::pow(scratches, 0.25999999f)))) * ::math::lerp(::math::lerp(0.179999992f, 0.649999976f, anodization_roughness), 0.529999971f, histogram_scan_big(infinite_tiling ? vm_tex_infinite(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(1.f)).x, 0.0799999982f, ::math::lerp(0.730000019f, 0.0900000036f, ::math::pow(scratches, 0.25999999f)))), ::math::lerp(::math::lerp(0.179999992f, 0.649999976f, anodization_roughness), 0.529999971f, histogram_scan_big(infinite_tiling ? vm_tex_infinite(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(1.f)).x, 0.0799999982f, ::math::lerp(0.730000019f, 0.0900000036f, ::math::pow(scratches, 0.25999999f)))) * ::math::lerp(::math::lerp(0.179999992f, 0.649999976f, anodization_roughness), 0.529999971f, histogram_scan_big(infinite_tiling ? vm_tex_infinite(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(1.f)).x, 0.0799999982f, ::math::lerp(0.730000019f, 0.0900000036f, ::math::pow(scratches, 0.25999999f)))), nvidia::core_definitions::blend_colors(color_1, color(0.346704006f, 0.346704006f, 0.346704006f), ::base::color_layer_blend, histogram_scan_big(infinite_tiling ? vm_tex_infinite(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(1.f)).x, 0.0799999982f, ::math::lerp(0.730000019f, 0.0900000036f, ::math::pow(scratches, 0.25999999f))), true).tint, nvidia::core_definitions::blend_colors(color_1, color(0.346704006f, 0.346704006f, 0.346704006f), ::base::color_layer_blend, histogram_scan_big(infinite_tiling ? vm_tex_infinite(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(1.f)).x, 0.0799999982f, ::math::lerp(0.730000019f, 0.0900000036f, ::math::pow(scratches, 0.25999999f))), true).tint, ::state::texture_tangent_u(0), ::df::scatter_reflect), bsdf(), ::math::lerp(add_detail_normal(vm_tex_normal_lookup(texture_2d("./analum_worn_norm.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.289999992f), scratches_bump_strength * histogram_scan_big(infinite_tiling ? vm_tex_infinite(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(1.f)).x, 0.0799999982f, ::math::lerp(0.730000019f, 0.0900000036f, ::math::pow(scratches, 0.25999999f))) * 0.579999983f), infinite_tiling ? vm_tex_infinite_normal(texture_2d("./analum_scratches_norm.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(0.497999996f, 0.497999996f, 0.987999976f), 0.349999994f, histogram_scan_big(infinite_tiling ? vm_tex_infinite(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(1.f)).x, 0.0799999982f, ::math::lerp(0.730000019f, 0.0900000036f, ::math::pow(scratches, 0.25999999f))) * scratches_bump_strength) : vm_tex_normal_lookup(texture_2d("./analum_scratches_norm.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), histogram_scan_big(infinite_tiling ? vm_tex_infinite(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(1.f)).x, 0.0799999982f, ::math::lerp(0.730000019f, 0.0900000036f, ::math::pow(scratches, 0.25999999f))) * scratches_bump_strength)), enable_anodization_bump ? ::perlin_noise_bump_texture(::base::transform_coordinate(::base::rotation_translation_scale(float3(0.f), float3(0.f), float3(::state::meters_per_scene_unit()) * (object_scaled_bump ? 1.f : ::state::transform_scale(::state::coordinate_object, ::state::coordinate_world, 1.f))), ::base::coordinate_source(::base::texture_coordinate_object, 0)), factor * 3.f, anodization_bump_size * 0.00200000009f, false, false, 0.f, 1, false, false, float3(0.f), 1.f, 0.f, 1.f, ::state::normal()) : ::state::normal(), 1.f - histogram_scan_big(infinite_tiling ? vm_tex_infinite(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(1.f)).x, 0.0799999982f, ::math::lerp(0.730000019f, 0.0900000036f, ::math::pow(scratches, 0.25999999f))))), ::math::lerp(add_detail_normal(vm_tex_normal_lookup(texture_2d("./analum_worn_norm.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.289999992f), scratches_bump_strength * histogram_scan_big(infinite_tiling ? vm_tex_infinite(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(1.f)).x, 0.0799999982f, ::math::lerp(0.730000019f, 0.0900000036f, ::math::pow(scratches, 0.25999999f))) * 0.579999983f), infinite_tiling ? vm_tex_infinite_normal(texture_2d("./analum_scratches_norm.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(0.497999996f, 0.497999996f, 0.987999976f), 0.349999994f, histogram_scan_big(infinite_tiling ? vm_tex_infinite(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(1.f)).x, 0.0799999982f, ::math::lerp(0.730000019f, 0.0900000036f, ::math::pow(scratches, 0.25999999f))) * scratches_bump_strength) : vm_tex_normal_lookup(texture_2d("./analum_scratches_norm.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), histogram_scan_big(infinite_tiling ? vm_tex_infinite(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(1.f)).x, 0.0799999982f, ::math::lerp(0.730000019f, 0.0900000036f, ::math::pow(scratches, 0.25999999f))) * scratches_bump_strength)), enable_anodization_bump ? ::perlin_noise_bump_texture(::base::transform_coordinate(::base::rotation_translation_scale(float3(0.f), float3(0.f), float3(::state::meters_per_scene_unit()) * (object_scaled_bump ? 1.f : ::state::transform_scale(::state::coordinate_object, ::state::coordinate_world, 1.f))), ::base::coordinate_source(::base::texture_coordinate_object, 0)), factor * 3.f, anodization_bump_size * 0.00200000009f, false, false, 0.f, 1, false, false, float3(0.f), 1.f, 0.f, 1.f, ::state::normal()) : ::state::normal(), 1.f - histogram_scan_big(infinite_tiling ? vm_tex_infinite(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.5f), float3(1.f)).x, 0.0799999982f, ::math::lerp(0.730000019f, 0.0900000036f, ::math::pow(scratches, 0.25999999f))))), infinite_tiling ? vm_tex_infinite_color_normal(texture_2d("./analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./analum_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.0599999987f, 0.0500000007f, 0.210999995f), float3(0.5f, 0.5f, 1.f), 0.349999994f, false, 2.20000005f, 1.f).norm : vm_tex_normal_lookup(texture_2d("./analum_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 1.f)), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + 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), emission_intensity: color(0.f, 0.f, 0.f)); + 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()); + hair_bsdf tmp6 = hair_bsdf(); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5, + hair: tmp6); + + +export material Aluminum_Anodized_Electric_Blue_Shiny(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aluminum Anodized - Electric Blue Shiny"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::thumbnail("./.thumbs/Aluminum_Anodized.Aluminum_Anodized_Electric_Blue_Shiny.png"), + ::anno::key_words(string[]("aec", "metal", "aluminum", "anodized", "coated", "clearcoat", "treated", "modern", "automotive", "design", "reflective", "shiny", "new", "blue", "electric", "saturated", "cool")) +]] + = Aluminum_Anodized( + infinite_tiling: false, + enable_coating: false, + color_1: color(0.031896f, 0.250158f, 0.644480f), + anodization_roughness: .01f, + scratches: 0.0f, + scratches_bump_strength: 0.35f, + smudges: 0.0f, + wear: 0.0f, + abrasion: 0.0f, + balance: 0.62f, + dirt_weight: 0.0f, + enable_anodization_bump: true, + factor: 0.27f, + anodization_bump_size: 0.24f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + +export material Aluminum_Anodized_Electric_Blue_Coated(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aluminum Anodized - Electric Blue Coated"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::thumbnail("./.thumbs/Aluminum_Anodized.Aluminum_Anodized_Electric_Blue_Coated.png"), + ::anno::key_words(string[]("aec", "metal", "aluminum", "anodized", "coated", "clearcoat", "treated", "modern", "automotive", "design", "reflective", "shiny", "new", "blue", "electric", "saturated", "cool")) +]] + = Aluminum_Anodized( + infinite_tiling: false, + enable_coating: true, + color_1: color(0.031896f, 0.250158f, 0.644480f), + anodization_roughness: .69f, + scratches: 0.0f, + scratches_bump_strength: 0.35f, + smudges: 0.0f, + wear: 0.0f, + abrasion: 0.0f, + balance: 0.62f, + dirt_weight: 0.0f, + enable_anodization_bump: true, + factor: 1.0f, + anodization_bump_size: 0.24f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + +export material Aluminum_Anodized_Electric_Blue_Smudges(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aluminum Anodized - Electric Blue Smudges"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::thumbnail("./.thumbs/Aluminum_Anodized.Aluminum_Anodized_Electric_Blue_Smudges.png"), + ::anno::key_words(string[]("aec", "metal", "aluminum", "anodized", "coated", "treated", "modern", "automotive", "design", "reflective", "shiny", "smudged", "handled", "imperfections", "blue", "electric", "saturated", "cool")) +]] + = Aluminum_Anodized( + infinite_tiling: false, + enable_coating: false, + color_1: color(0.031896f, 0.250158f, 0.644480f), + anodization_roughness: .49f, + scratches: 0.0f, + scratches_bump_strength: 0.35f, + smudges: 0.66f, + wear: 0.0f, + abrasion: 0.66f, + balance: 0.62f, + dirt_weight: 0.0f, + enable_anodization_bump: true, + factor: 0.27f, + anodization_bump_size: 0.24f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + +export material Aluminum_Anodized_Electric_Blue_Scratched(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aluminum Anodized - Electric Blue Scratched"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::thumbnail("./.thumbs/Aluminum_Anodized.Aluminum_Anodized_Electric_Blue_Scratched.png"), + ::anno::key_words(string[]("aec", "metal", "aluminum", "anodized", "coated", "treated", "modern", "automotive", "design", "reflective", "shiny", "scratched", "worn", "old", "imperfections", "blue", "electric", "saturated", "cool")) +]] + = Aluminum_Anodized( + infinite_tiling: false, + enable_coating: false, + color_1: color(0.031896f, 0.250158f, 0.644480f), + anodization_roughness: .49f, + scratches: 1.00f, + scratches_bump_strength: 0.35f, + smudges: 0.0f, + wear: 0.0f, + abrasion: 0.66f, + balance: 0.62f, + dirt_weight: 0.0f, + enable_anodization_bump: true, + factor: 0.27f, + anodization_bump_size: 0.24f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + + +export material Aluminum_Anodized_Electric_Blue_Dirty(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aluminum Anodized - Electric Blue Dirty"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::thumbnail("./.thumbs/Aluminum_Anodized.Aluminum_Anodized_Electric_Blue_Dirty.png"), + ::anno::key_words(string[]("aec", "metal", "aluminum", "anodized", "coated", "treated", "modern", "automotive", "design", "reflective", "dirty", "dirt", "worn", "imperfections", "blue", "electric", "saturated", "cool")) +]] + = Aluminum_Anodized( + infinite_tiling: false, + enable_coating: false, + color_1: color(0.031896f, 0.250158f, 0.644480f), + anodization_roughness: .79f, + scratches: 0.0f, + scratches_bump_strength: 0.35f, + smudges: 1.0f, + wear: 0.0f, + abrasion: 0.99f, + balance: 0.62f, + dirt_weight: 0.28f, + enable_anodization_bump: true, + factor: 0.27f, + anodization_bump_size: 0.24f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + + +export material Aluminum_Anodized_Royal_Blue(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aluminum Anodized - Royal Blue"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::thumbnail("./.thumbs/Aluminum_Anodized.Aluminum_Anodized_Royal_Blue.png"), + ::anno::key_words(string[]("aec", "metal", "aluminum", "anodized", "coated", "treated", "modern", "automotive", "design", "reflective", "new", "matte", "blue", "royal", "saturated", "cool")) +]] + = Aluminum_Anodized( + infinite_tiling: false, + enable_coating: false, + color_1: color(0.031896f, 0.046665f, 0.644480f), + anodization_roughness: 0.57f, + scratches: 0.0f, + scratches_bump_strength: 0.35f, + smudges: 0.0f, + wear: 0.0f, + abrasion: 0.0f, + balance: 0.62f, + dirt_weight: 0.0f, + enable_anodization_bump: true, + factor: 0.75f, + anodization_bump_size: 0.24f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.75f, + roundcorners_across_materials: false +); + + +export material Aluminum_Anodized_Sky_Blue(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aluminum Anodized - Sky Blue"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::thumbnail("./.thumbs/Aluminum_Anodized.Aluminum_Anodized_Sky_Blue.png"), + ::anno::key_words(string[]("aec", "metal", "aluminum", "anodized", "coated", "treated", "modern", "automotive", "design", "reflective", "new", "matte", "blue", "sky", "light", "cool")) +]] + = Aluminum_Anodized( + infinite_tiling: false, + enable_coating: false, + color_1: color(0.171441f, 0.376262f, 0.520996f), + anodization_roughness: 0.7f, + scratches: 0.0f, + scratches_bump_strength: 0.35f, + smudges: 0.0f, + wear: 0.0f, + abrasion: 0.0f, + balance: 0.62f, + dirt_weight: 0.0f, + enable_anodization_bump: true, + factor: 0.75f, + anodization_bump_size: 0.24f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.75f, + roundcorners_across_materials: false +); + + +export material Aluminum_Anodized_Purple(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aluminum Anodized - Purple"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::thumbnail("./.thumbs/Aluminum_Anodized.Aluminum_Anodized_Purple.png"), + ::anno::key_words(string[]("aec", "metal", "aluminum", "anodized", "coated", "treated", "modern", "automotive", "design", "reflective", "new", "matte", "purple", "saturated", "cool")) +]] + = Aluminum_Anodized( + infinite_tiling: false, + enable_coating: false, + color_1: color(0.194618f, 0.046665f, 0.630757f), + anodization_roughness: 0.7f, + scratches: 0.0f, + scratches_bump_strength: 0.35f, + smudges: 0.0f, + wear: 0.0f, + abrasion: 0.0f, + balance: 0.62f, + dirt_weight: 0.0f, + enable_anodization_bump: true, + factor: 0.75f, + anodization_bump_size: 0.24f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.75f, + roundcorners_across_materials: false +); + + +export material Aluminum_Anodized_Pink(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aluminum Anodized - Pink"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::thumbnail("./.thumbs/Aluminum_Anodized.Aluminum_Anodized_Pink.png"), + ::anno::key_words(string[]("aec", "metal", "aluminum", "anodized", "coated", "treated", "modern", "automotive", "design", "reflective", "new", "matte", "pink", "saturated", "warm")) +]] + = Aluminum_Anodized( + infinite_tiling: false, + enable_coating: false, + color_1: color(0.539479f, 0.057805f, 0.381326f), + anodization_roughness: 0.7f, + scratches: 0.0f, + scratches_bump_strength: 0.35f, + smudges: 0.0f, + wear: 0.0f, + abrasion: 0.0f, + balance: 0.62f, + dirt_weight: 0.0f, + enable_anodization_bump: true, + factor: 0.75f, + anodization_bump_size: 0.24f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.75f, + roundcorners_across_materials: false +); + + +export material Aluminum_Anodized_Red(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aluminum Anodized - Red"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::thumbnail("./.thumbs/Aluminum_Anodized.Aluminum_Anodized_Red.png"), + ::anno::key_words(string[]("aec", "metal", "aluminum", "anodized", "coated", "treated", "modern", "automotive", "design", "reflective", "new", "matte", "red", "saturated", "warm")) +]] + = Aluminum_Anodized( + infinite_tiling: false, + enable_coating: false, + color_1: color(0.564712f, 0.029557f, 0.031896f), + anodization_roughness: 0.7f, + scratches: 0.0f, + scratches_bump_strength: 0.35f, + smudges: 0.0f, + wear: 0.0f, + abrasion: 0.0f, + balance: 0.62f, + dirt_weight: 0.0f, + enable_anodization_bump: true, + factor: 0.75f, + anodization_bump_size: 0.24f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.75f, + roundcorners_across_materials: false +); + + +export material Aluminum_Anodized_Orange(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aluminum Anodized - Orange"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::thumbnail("./.thumbs/Aluminum_Anodized.Aluminum_Anodized_Orange.png"), + ::anno::key_words(string[]("aec", "metal", "aluminum", "anodized", "coated", "treated", "modern", "automotive", "design", "reflective", "new", "matte", "orange", "saturated", "warm")) +]] + = Aluminum_Anodized( + infinite_tiling: false, + enable_coating: false, + color_1: color(0.58f, 0.251f, 0.021f), + anodization_roughness: 0.77f, + scratches: 0.0f, + scratches_bump_strength: 0.35f, + smudges: 0.0f, + wear: 0.0f, + abrasion: 0.0f, + balance: 0.62f, + dirt_weight: 0.0f, + enable_anodization_bump: true, + factor: 0.75f, + anodization_bump_size: 0.24f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.75f, + roundcorners_across_materials: false +); + + +export material Aluminum_Anodized_Gold(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aluminum Anodized - Gold"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::thumbnail("./.thumbs/Aluminum_Anodized.Aluminum_Anodized_Gold.png"), + ::anno::key_words(string[]("aec", "metal", "aluminum", "anodized", "coated", "treated", "modern", "automotive", "design", "reflective", "new", "matte", "gold", "yellow", "saturated", "warm")) +]] + = Aluminum_Anodized( + infinite_tiling: false, + enable_coating: false, + color_1: color(0.479320f, 0.296138f, 0.040915f), + anodization_roughness: 0.77f, + scratches: 0.0f, + scratches_bump_strength: 0.35f, + smudges: 0.0f, + wear: 0.0f, + abrasion: 0.0f, + balance: 0.62f, + dirt_weight: 0.0f, + enable_anodization_bump: true, + factor: 0.75f, + anodization_bump_size: 0.24f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.75f, + roundcorners_across_materials: false +); + + +export material Aluminum_Anodized_Yellow(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aluminum Anodized - Yellow"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::thumbnail("./.thumbs/Aluminum_Anodized.Aluminum_Anodized_Yellow.png"), + ::anno::key_words(string[]("aec", "metal", "aluminum", "anodized", "coated", "treated", "modern", "automotive", "design", "reflective", "new", "matte", "yellow", "saturated", "warm")) +]] + = Aluminum_Anodized( + infinite_tiling: false, + enable_coating: false, + color_1: color(0.584078f, 0.508881f, 0.021219f), + anodization_roughness: 0.77f, + scratches: 0.0f, + scratches_bump_strength: 0.35f, + smudges: 0.0f, + wear: 0.0f, + abrasion: 0.0f, + balance: 0.62f, + dirt_weight: 0.0f, + enable_anodization_bump: true, + factor: 0.75f, + anodization_bump_size: 0.24f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.75f, + roundcorners_across_materials: false +); + + +export material Aluminum_Anodized_Grass_Green(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aluminum Anodized - Grass Green"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::thumbnail("./.thumbs/Aluminum_Anodized.Aluminum_Anodized_Grass_Green.png"), + ::anno::key_words(string[]("aec", "metal", "aluminum", "anodized", "coated", "treated", "modern", "automotive", "design", "reflective", "new", "matte", "green", "grass", "saturated", "cool")) +]] + = Aluminum_Anodized( + infinite_tiling: false, + enable_coating: false, + color_1: color(0.039546f, 0.381326f, 0.039546f), + anodization_roughness: 0.77f, + scratches: 0.0f, + scratches_bump_strength: 0.35f, + smudges: 0.0f, + wear: 0.0f, + abrasion: 0.0f, + balance: 0.62f, + dirt_weight: 0.0f, + enable_anodization_bump: true, + factor: 0.75f, + anodization_bump_size: 0.24f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.75f, + roundcorners_across_materials: false +); + + +export material Aluminum_Anodized_Lime_Green(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aluminum Anodized - Lime Green"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::thumbnail("./.thumbs/Aluminum_Anodized.Aluminum_Anodized_Lime_Green.png"), + ::anno::key_words(string[]("aec", "metal", "aluminum", "anodized", "coated", "treated", "modern", "automotive", "design", "reflective", "new", "matte", "green", "grass", "saturated", "cool")) +]] + = Aluminum_Anodized( + infinite_tiling: false, + enable_coating: false, + color_1: color(0.201556f, 0.539479f, 0.036889f), + anodization_roughness: 0.8f, + scratches: 0.0f, + scratches_bump_strength: 0.35f, + smudges: 0.0f, + wear: 0.0f, + abrasion: 0.0f, + balance: 0.62f, + dirt_weight: 0.0f, + enable_anodization_bump: true, + factor: 0.75f, + anodization_bump_size: 0.24f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.75f, + roundcorners_across_materials: false +); + + +export material Aluminum_Anodized_Turquoise(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aluminum Anodized - Turquoise"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::thumbnail("./.thumbs/Aluminum_Anodized.Aluminum_Anodized_Turquoise.png"), + ::anno::key_words(string[]("aec", "metal", "aluminum", "anodized", "coated", "treated", "modern", "automotive", "design", "reflective", "new", "matte", "turquoise", "green", "saturated", "cool")) +]] + = Aluminum_Anodized( + infinite_tiling: false, + enable_coating: false, + color_1: color(0.048172f, 0.439657f, 0.246201f), + anodization_roughness: 0.7f, + scratches: 0.0f, + scratches_bump_strength: 0.35f, + smudges: 0.0f, + wear: 0.0f, + abrasion: 0.0f, + balance: 0.62f, + dirt_weight: 0.0f, + enable_anodization_bump: true, + factor: 0.75f, + anodization_bump_size: 0.24f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.75f, + roundcorners_across_materials: false +); + + +export material Aluminum_Anodized_Silver(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aluminum Anodized - Silver"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::thumbnail("./.thumbs/Aluminum_Anodized.Aluminum_Anodized_Silver.png"), + ::anno::key_words(string[]("aec", "metal", "aluminum", "anodized", "coated", "treated", "modern", "automotive", "design", "reflective", "new", "matte", "silver", "neutral")) +]] + = Aluminum_Anodized( + infinite_tiling: false, + enable_coating: false, + color_1: color(0.502886f, 0.502886f, 0.502886f), + anodization_roughness: 0.8f, + scratches: 0.0f, + scratches_bump_strength: 0.35f, + smudges: 0.0f, + wear: 0.0f, + abrasion: 0.0f, + balance: 0.62f, + dirt_weight: 0.0f, + enable_anodization_bump: true, + factor: 0.75f, + anodization_bump_size: 0.24f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.75f, + roundcorners_across_materials: false +); + + +export material Aluminum_Anodized_Rose(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aluminum Anodized - Rose"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::thumbnail("./.thumbs/Aluminum_Anodized.Aluminum_Anodized_Rose.png"), + ::anno::key_words(string[]("aec", "metal", "aluminum", "anodized", "coated", "treated", "modern", "automotive", "design", "reflective", "new", "matte", "rose", "warm", "pastel", "light")) +]] + = Aluminum_Anodized( + infinite_tiling: false, + enable_coating: false, + color_1: color(0.693872f, 0.445201f, 0.467784f), + anodization_roughness: 0.77f, + scratches: 0.0f, + scratches_bump_strength: 0.35f, + smudges: 0.0f, + wear: 0.0f, + abrasion: 0.0f, + balance: 0.62f, + dirt_weight: 0.0f, + enable_anodization_bump: true, + factor: 0.75f, + anodization_bump_size: 0.24f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.75f, + roundcorners_across_materials: false +); + + +export material Aluminum_Anodized_Lavender(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aluminum Anodized - Lavender"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::thumbnail("./.thumbs/Aluminum_Anodized.Aluminum_Anodized_Lavender.png"), + ::anno::key_words(string[]("aec", "metal", "aluminum", "anodized", "coated", "treated", "modern", "automotive", "design", "reflective", "new", "matte", "lavender", "purple", "cool", "pastel", "light")) +]] + = Aluminum_Anodized( + infinite_tiling: false, + enable_coating: false, + color_1: color(0.428690f, 0.371238f, 0.708376f), + anodization_roughness: 0.79f, + scratches: 0.0f, + scratches_bump_strength: 0.35f, + smudges: 0.0f, + wear: 0.0f, + abrasion: 0.0f, + balance: 0.62f, + dirt_weight: 0.0f, + enable_anodization_bump: true, + factor: 0.75f, + anodization_bump_size: 0.24f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.75f, + roundcorners_across_materials: false +); + + +export material Aluminum_Anodized_Light_Gold(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Aluminum Anodized - Light Gold"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::thumbnail("./.thumbs/Aluminum_Anodized.Aluminum_Anodized_Light_Gold.png"), + ::anno::key_words(string[]("aec", "metal", "aluminum", "anodized", "coated", "treated", "modern", "automotive", "design", "reflective", "new", "matte", "gold", "warm", "pastel", "light")) +]] + = Aluminum_Anodized( + infinite_tiling: false, + enable_coating: false, + color_1: color(0.693872f, 0.527115f, 0.283149f), + anodization_roughness: 0.8f, + scratches: 0.0f, + scratches_bump_strength: 0.35f, + smudges: 0.0f, + wear: 0.0f, + abrasion: 0.0f, + balance: 0.62f, + dirt_weight: 0.0f, + enable_anodization_bump: true, + factor: 0.75f, + anodization_bump_size: 0.24f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.75f, + roundcorners_across_materials: false +); \ No newline at end of file diff --git a/Material/material_0379/Aluminum_Brushed.mdl b/Material/material_0379/Aluminum_Brushed.mdl new file mode 100644 index 0000000000000000000000000000000000000000..e3924bce1410bd088dc5fd4e351f9563f6ce9c00 --- /dev/null +++ b/Material/material_0379/Aluminum_Brushed.mdl @@ -0,0 +1,301 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + +mdl 1.5; +import ::anno::*; +import ::base::*; +import ::math::*; +import ::state::*; +import ::std::*; +import ::tex::*; +import ::df::*; +import ::nvidia::core_definitions::*; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + +const string DESCRIPTION = "Brushed metal material with adjustable settings for the brushing"; + + +float histogram_range(float input, float range, float position) +{ + float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); + float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); + return ::math::lerp(low, high, input); +} + +::base::texture_coordinate_info vmat_transform( + uniform float2 translation = float2(0.0, 0.0), + uniform float rotation = 0.0, + uniform float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation_rad); + float c = ::math::cos(rotation_rad); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + + +export material Aluminum_Brushed( + float brush_width = 1.0f [[ + ::anno::display_name("Roughness Width"), + ::anno::description("Widens the anisotropic metal reflections which leads to a stronger effect of " + "the metal brushing."), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance") + ]], + float brush_height_blur = 0.75f [[ + ::anno::display_name("Roughness Height"), + ::anno::description("Increases the anisotropy of the brushed metal, blurring the reflections."), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance") + ]], + float scratch_variation_amount = 1.f [[ + ::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."), + ::anno::display_name("Scratch Variation Amount"), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance") + ]], + float scratch_reflection_variation = 0.4f [[ + ::anno::description("Attenuates the reflection of the brushed metal which will also make the material appear darker."), + ::anno::display_name("Scratch Reflection Variation"), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance") + ]], + float scratches_bump = 0.65f [[ + ::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."), + ::anno::display_name("Scratches Bump Amount"), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance") + ]], + uniform bool enable_round_corners = false [[ + ::anno::display_name("Enable Round Corners"), + ::anno::in_group("Round Corners") + ]], + uniform float roundcorner_radius = 0.01f [[ + ::anno::display_name("Round Corner Radius"), + ::anno::description("Adjusts the radius of the round corner effect."), + ::anno::soft_range(0.0f, 0.1f), + ::anno::in_group("Round Corners") + ]], + uniform bool across_materials = false [[ + ::anno::display_name("Across Materials"), + ::anno::description("Applies the rounded corner effect also between other materials."), + ::anno::in_group("Round Corners") + ]], + uniform float2 texture_translate = 0.f [[ + ::anno::display_name("Translate"), + ::anno::description("Controls the position of the texture."), + ::anno::in_group("Transform") + ]], + uniform float texture_rotate = 0.f [[ + ::anno::display_name("Rotate"), + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::in_group("Transform") + ]], + uniform float2 texture_scale = 1.f [[ + ::anno::display_name("Scale"), + ::anno::description("Larger numbers increase the size."), + ::nvidia::core_definitions::dimension(float2(0.75f, 0.75f)), + ::anno::in_group("Transform") + ]], + uniform int uv_space_index = 0 [[ + ::anno::display_name("UV Space Index"), + ::anno::description("Use selected UV space for material."), + ::anno::in_group("Advanced") + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Brushed Aluminum - Strong Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Aluminum_Brushed.Aluminum_Brushed.png"), + ::anno::key_words(string[]("aec", "metal", "aluminum", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] + = + let { + color normal_reflectivity = color(0.911810895428f,0.914089043421f,0.920152876196f); + color grazing_reflectivity = color(0.99942f, 1.f, 1.f); + + bool tmp0 = false; + material_surface tmp1( + ::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)), + material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + 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)); + 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()); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + + +export material Aluminum_Brushed_Light_Brushing(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Brushed Aluminum - Light Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Aluminum_Brushed.Aluminum_Brushed_Light_Brushing.png"), + ::anno::key_words(string[]("aec", "metal", "aluminum", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] + = Aluminum_Brushed( + brush_width: 0.225f, + brush_height_blur: 0.035f, + scratch_variation_amount: 1.0f, + scratch_reflection_variation: 0.4f, + scratches_bump: 0.2f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0 +); + + + +export material Aluminum_Brushed_Medium_Light_Brushing(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Brushed Aluminum - Medium Light Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Aluminum_Brushed.Aluminum_Brushed_Medium_Light_Brushing.png"), + ::anno::key_words(string[]("aec", "metal", "aluminum", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] += Aluminum_Brushed( + brush_width: 0.361f, + brush_height_blur: 0.204f, + scratch_variation_amount: 1.0f, + scratch_reflection_variation: 0.559f, + scratches_bump: 0.35f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0 +); + + + +export material Aluminum_Brushed_Medium_Brushing(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Brushed Aluminum - Medium Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Aluminum_Brushed.Aluminum_Brushed_Medium_Brushing.png"), + ::anno::key_words(string[]("aec", "metal", "aluminum", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] += Aluminum_Brushed( + brush_width: 0.665f, + brush_height_blur: 0.471f, + scratch_variation_amount: 1.0f, + scratch_reflection_variation: 0.621f, + scratches_bump: 0.5f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0 +); + + +export material Aluminum_Brushed_Very_Strong_Brushing(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Brushed Aluminum - Very Strong Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Aluminum_Brushed.Aluminum_Brushed_Very_Strong_Brushing.png"), + ::anno::key_words(string[]("aec", "metal", "aluminum", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] += Aluminum_Brushed( + brush_width: 1.0f, + brush_height_blur: 1.0f, + scratch_variation_amount: 1.0f, + scratch_reflection_variation: 0.824f, + scratches_bump: 1.0f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0 +); + + + + diff --git a/Material/material_0399/Bronze_Hammered.mdl b/Material/material_0399/Bronze_Hammered.mdl new file mode 100644 index 0000000000000000000000000000000000000000..92b003ec41f580d99008c3ee536aebadc23506a1 --- /dev/null +++ b/Material/material_0399/Bronze_Hammered.mdl @@ -0,0 +1,284 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. * + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + + +mdl 1.6; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + +const string DESCRIPTION = "A hammered bronze material"; + +::base::texture_coordinate_info vmat_transform( + uniform float2 translation = float2(0.0, 0.0), + uniform float rotation = 0.0, + uniform float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation); + float c = ::math::cos(rotation); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + + + +float histogram_range(float input, float range, float position) +{ + float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); + float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); + return ::math::lerp(low, high, input); +} + + + +float3 normalmap_normal( + uniform texture_2d texture, + float factor = 1.0, + ::base::texture_coordinate_info uvw = ::base::texture_coordinate_info() +) +{ + float3 lookup = (::tex::lookup_float3(texture, float2(uvw.position.x, uvw.position.y)) - float3(0.5)) * (factor * 2.0); + return ::math::normalize(uvw.tangent_u * lookup.x + uvw.tangent_v * lookup.y + ::state::normal() * (lookup.z + (1.0 - factor))); +} + +color gradient_lookup_smooth(uniform texture_2d gradient_texture, float position, float gradient_select = 0) +{ + // Pixel centers lie in the middle. To properly access the pixel centers of the gradients, apply an offset + float2 texel_coord = float2(position, gradient_select + (0.5f / ::tex::height(gradient_texture))); + return color(::tex::lookup_float3(gradient_texture, texel_coord)); +} + + +export material Bronze_Hammered( + float copper_tint = 0.5f [[ + ::anno::description("Blends between the bronze types. 0.0 yields yellowish bronze, increasing the copper amount fades to reddish bronze."), + ::anno::display_name("Copper Tint"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(0) + ]], + float cavities_darkening = 1.f [[ + ::anno::description("Darkens the areas where cavities appear."), + ::anno::display_name("Cavities Darkening"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float roughness = 0.f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float bump_strength = 0.99f [[ + ::anno::description("Specifies the strength of the bump."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + uniform float2 texture_translate = 0.f [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform"), + ::anno::ui_order(4) + ]], + uniform float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f), + ::anno::ui_order(5) + ]], + uniform float2 texture_scale = 1.f [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::anno::ui_order(6) + ]], + uniform bool roundcorners_enable = false [[ + ::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."), + ::anno::display_name("Enable Round Corners"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(7) + ]], + uniform float roundcorners_radius_mm = 1.0f [[ + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::display_name("Round Corner Radius (mm)"), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f), + ::anno::ui_order(8) + ]], + uniform bool roundcorners_across_materials = false [[ + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::display_name("Across Materials"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(9) + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Uses selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced"), + ::anno::hard_range(0, 10), + ::anno::ui_order(10) + ]]) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Hammered - Hammered Darkened"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze_Hammered.Bronze_Hammered.png"), + // scratched, old, stained, crumpled, handled, worn, creative, smudged, bumped, matte, shiny + ::anno::key_words(string[]("metal", "bronze", "reflective", "shiny", "hammered", "stained", "bumped", "design", "warm")) +]] + = + let { + float copper_amount_remap = copper_tint / 1.5f; + bool tmp0 = false; + material_surface tmp1(::df::custom_curve_layer(0.f, 1.f, 5.35999966f, 1.f, ::df::weighted_layer(0.349999994f, ::df::microfacet_ggx_smith_bsdf(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, ::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).x, 0.170000002f, ::math::lerp(0.399999976f, 0.736000001f, roughness * 0.699999988f)) * 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, ::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).x, 0.170000002f, ::math::lerp(0.399999976f, 0.736000001f, roughness * 0.699999988f)), 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, ::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).x, 0.170000002f, ::math::lerp(0.399999976f, 0.736000001f, roughness * 0.699999988f)) * 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, ::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).x, 0.170000002f, ::math::lerp(0.399999976f, 0.736000001f, roughness * 0.699999988f)), color(1.f, 1.f, 1.f), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::microfacet_ggx_smith_bsdf(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, ::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).x, ::math::lerp(0.40200001f, 0.245000005f, roughness * 0.699999988f), ::math::lerp(0.234000012f, 0.395000011f, roughness * 0.699999988f))), 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, ::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).y), ::base::color_layer_add, ::math::lerp(0.189999998f, 0.569999993f, roughness * 0.699999988f)).tint, color(::math::pow(1.f - float3(::base::file_texture(texture_2d("./brass_hammered_multi_R_pit_G_ao_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint).x, 2.20000005f)), ::base::color_layer_add, ::math::lerp(0.185000002f, 0.960000038f, roughness * 0.699999988f)).mono * 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, ::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).x, ::math::lerp(0.40200001f, 0.245000005f, roughness * 0.699999988f), ::math::lerp(0.234000012f, 0.395000011f, roughness * 0.699999988f))), 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, ::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).y), ::base::color_layer_add, ::math::lerp(0.189999998f, 0.569999993f, roughness * 0.699999988f)).tint, color(::math::pow(1.f - float3(::base::file_texture(texture_2d("./brass_hammered_multi_R_pit_G_ao_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint).x, 2.20000005f)), ::base::color_layer_add, ::math::lerp(0.185000002f, 0.960000038f, roughness * 0.699999988f)).mono, 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, ::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).x, ::math::lerp(0.40200001f, 0.245000005f, roughness * 0.699999988f), ::math::lerp(0.234000012f, 0.395000011f, roughness * 0.699999988f))), 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, ::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).y), ::base::color_layer_add, ::math::lerp(0.189999998f, 0.569999993f, roughness * 0.699999988f)).tint, color(::math::pow(1.f - float3(::base::file_texture(texture_2d("./brass_hammered_multi_R_pit_G_ao_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint).x, 2.20000005f)), ::base::color_layer_add, ::math::lerp(0.185000002f, 0.960000038f, roughness * 0.699999988f)).mono * 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, ::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).x, ::math::lerp(0.40200001f, 0.245000005f, roughness * 0.699999988f), ::math::lerp(0.234000012f, 0.395000011f, roughness * 0.699999988f))), 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, ::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).y), ::base::color_layer_add, ::math::lerp(0.189999998f, 0.569999993f, roughness * 0.699999988f)).tint, color(::math::pow(1.f - float3(::base::file_texture(texture_2d("./brass_hammered_multi_R_pit_G_ao_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint).x, 2.20000005f)), ::base::color_layer_add, ::math::lerp(0.185000002f, 0.960000038f, roughness * 0.699999988f)).mono, color(1.f, 1.f, 1.f), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), bsdf(), normalmap_normal(texture_2d("./hammered_norm.jpg", ::tex::gamma_linear), bump_strength, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index))), normalmap_normal(texture_2d("./hammered_norm.jpg", ::tex::gamma_linear), bump_strength, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index))), ::df::tint(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(gradient_lookup_smooth(texture_2d("./bronze_gradients.png", ::tex::gamma_srgb), float3(::base::file_texture(texture_2d("./brass_hammered_multi_R_pit_G_ao_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint).z, copper_amount_remap), color(::math::pow(float3(::base::file_texture(texture_2d("./brass_hammered_multi_R_pit_G_ao_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint).x, 2.20000005f)), ::base::color_layer_multiply, cavities_darkening * 0.75f + 0.25f).tint, color(float3(::base::file_texture(texture_2d("./brass_hammered_multi_R_pit_G_ao_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint).y), ::base::color_layer_overlay, cavities_darkening * 0.75f + 0.25f).tint, ::df::weighted_layer(0.349999994f, ::df::microfacet_ggx_smith_bsdf(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, ::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).x, 0.170000002f, ::math::lerp(0.399999976f, 0.736000001f, roughness * 0.699999988f)) * 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, ::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).x, 0.170000002f, ::math::lerp(0.399999976f, 0.736000001f, roughness * 0.699999988f)), 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, ::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).x, 0.170000002f, ::math::lerp(0.399999976f, 0.736000001f, roughness * 0.699999988f)) * 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, ::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).x, 0.170000002f, ::math::lerp(0.399999976f, 0.736000001f, roughness * 0.699999988f)), color(1.f, 1.f, 1.f), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::microfacet_ggx_smith_bsdf(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, ::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).x, ::math::lerp(0.40200001f, 0.245000005f, roughness * 0.699999988f), ::math::lerp(0.234000012f, 0.395000011f, roughness * 0.699999988f))), 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, ::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).y), ::base::color_layer_add, ::math::lerp(0.189999998f, 0.569999993f, roughness * 0.699999988f)).tint, color(::math::pow(1.f - float3(::base::file_texture(texture_2d("./brass_hammered_multi_R_pit_G_ao_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint).x, 2.20000005f)), ::base::color_layer_add, ::math::lerp(0.185000002f, 0.960000038f, roughness * 0.699999988f)).mono * 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, ::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).x, ::math::lerp(0.40200001f, 0.245000005f, roughness * 0.699999988f), ::math::lerp(0.234000012f, 0.395000011f, roughness * 0.699999988f))), 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, ::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).y), ::base::color_layer_add, ::math::lerp(0.189999998f, 0.569999993f, roughness * 0.699999988f)).tint, color(::math::pow(1.f - float3(::base::file_texture(texture_2d("./brass_hammered_multi_R_pit_G_ao_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint).x, 2.20000005f)), ::base::color_layer_add, ::math::lerp(0.185000002f, 0.960000038f, roughness * 0.699999988f)).mono, 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, ::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).x, ::math::lerp(0.40200001f, 0.245000005f, roughness * 0.699999988f), ::math::lerp(0.234000012f, 0.395000011f, roughness * 0.699999988f))), 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, ::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).y), ::base::color_layer_add, ::math::lerp(0.189999998f, 0.569999993f, roughness * 0.699999988f)).tint, color(::math::pow(1.f - float3(::base::file_texture(texture_2d("./brass_hammered_multi_R_pit_G_ao_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint).x, 2.20000005f)), ::base::color_layer_add, ::math::lerp(0.185000002f, 0.960000038f, roughness * 0.699999988f)).mono * 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, ::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).x, ::math::lerp(0.40200001f, 0.245000005f, roughness * 0.699999988f), ::math::lerp(0.234000012f, 0.395000011f, roughness * 0.699999988f))), 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, ::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).y), ::base::color_layer_add, ::math::lerp(0.189999998f, 0.569999993f, roughness * 0.699999988f)).tint, color(::math::pow(1.f - float3(::base::file_texture(texture_2d("./brass_hammered_multi_R_pit_G_ao_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint).x, 2.20000005f)), ::base::color_layer_add, ::math::lerp(0.185000002f, 0.960000038f, roughness * 0.699999988f)).mono, color(1.f, 1.f, 1.f), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), bsdf(), normalmap_normal(texture_2d("./hammered_norm.jpg", ::tex::gamma_linear), bump_strength, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index))), normalmap_normal(texture_2d("./hammered_norm.jpg", ::tex::gamma_linear), bump_strength, vmat_transform(texture_translate, texture_rotate, texture_scale, ::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)); + material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + 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)); + 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()); + hair_bsdf tmp6 = hair_bsdf(); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5, + hair: tmp6); + +// 2 +export material Bronze_Hammered_Shiny_Soft_Hammering(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Hammered - Shiny Soft Hammering"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze_Hammered.Bronze_Hammered_Shiny_Soft_Hammering.png"), + // scratched, old, stained, crumpled, handled, worn, creative, smudged, bumped, matte, shiny + ::anno::key_words(string[]("metal", "bronze", "reflective", "shiny", "hammered", "bumped", "design", "warm")) +]] = Bronze_Hammered( + copper_tint: 0.5f, + cavities_darkening: 0.0f, + roughness: 0.0f, + bump_strength: 0.51f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + roundcorners_enable: false, + roundcorners_radius_mm: 1.0f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 3 +export material Bronze_Hammered_Matte_Hammering(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Hammered - Matte Hammering"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze_Hammered.Bronze_Hammered_Matte_Hammering.png"), + // scratched, old, stained, crumpled, handled, worn, creative, smudged, bumped, matte, shiny + ::anno::key_words(string[]("metal", "bronze", "reflective", "matte", "hammered", "bumped", "design", "warm")) +]] = Bronze_Hammered( + copper_tint: 0.5f, + cavities_darkening: 1.0f, + roughness: 0.8f, + bump_strength: 0.99f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + roundcorners_enable: false, + roundcorners_radius_mm: 1.0f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + + + + + + + + diff --git a/Material/material_0400/Bronze_Knurling.mdl b/Material/material_0400/Bronze_Knurling.mdl new file mode 100644 index 0000000000000000000000000000000000000000..3b9c4e90b21c25171bda02fbe58c156bd042bbd1 --- /dev/null +++ b/Material/material_0400/Bronze_Knurling.mdl @@ -0,0 +1,362 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. * + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + +mdl 1.6; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + +const string DESCRIPTION = "A bronze material with a knurling pattern that has controls to add wear and dirt. Use " + "the parameter 'Bronze Tint' to blend between the bronze types. 0.0 yields yellowish bronze, " + "increasing the copper amount fades to reddish bronze"; + +color gradient_lookup_smooth(uniform texture_2d gradient_texture, float position, float gradient_select = 0) +{ + // Pixel centers lie in the middle. To properly access the pixel centers of the gradients, apply an offset + float2 texel_coord = float2(position, gradient_select + (0.5f / ::tex::height(gradient_texture))); + return color(::tex::lookup_float3(gradient_texture, texel_coord)); +} + +float3 srgb2rgb(float3 val) +{ + return ::math::pow(::math::max(val, float3(0.0f)), 2.2); +} + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float2 rnd22(int2 p) { + float2 ret_val = float2( + uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f, + uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f + ); + return ret_val; +} + +::base::texture_coordinate_info vmat_transform( + uniform float2 translation = float2(0.0, 0.0), + uniform float rotation = 0.0, + uniform float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation); + float c = ::math::cos(rotation); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + +float2x2 invert_2x2(float2x2 M) +{ + float det = M[0][0]*M[1][1] - M[0][1]*M[1][0]; + //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/ + return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]); +} + +float3 nonrepeat_lookup( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5), + float patch_size = 8.0 +) +{ + + float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale; + float Z = patch_size; // patch scale inside example texture + float CON = 1.0f; + + float3 O = float3(0.f); + float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); + float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space + + float2 U = uv_in; + float2 V = M * uv_in; //pre-tilted hexa coordinates + int2 I = int2(::math::floor(V)); // hexa-tile id + + // The mean color needs to be determined in Photoshop then to make the + // average color work out, take the float value and calculate the apropriate + // mean value as (value^(1/2.2)) + + float3 m = average_color; + + float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; + F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates + + if( F[2] > 0.f ) + + O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON)) + + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON)) + + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON)); + else + O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON)) + + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON)) + + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON)); + O = m + O/::math::length(W); + O = ::math::clamp( (O), 0.0, 1.0); + + return float3(O); +} + + +float histogram_range(float input, float range, float position) +{ + float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); + float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); + return ::math::lerp(low, high, input); +} + +color endless_texture( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 10.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0, + bool gamma_correct_lookup = true +) +{ + return gamma_correct_lookup ? color(srgb2rgb( + nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )) + ) : color(nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )); +} + + +float3 normalmap_normal( + uniform texture_2d texture, + float factor = 1.0, + ::base::texture_coordinate_info uvw = ::base::texture_coordinate_info() +) +{ + float3 lookup = (::tex::lookup_float3(texture, float2(uvw.position.x, uvw.position.y)) - float3(0.5)) * (factor * 2.0); + return ::math::normalize(uvw.tangent_u * lookup.x + uvw.tangent_v * lookup.y + ::state::normal() * (lookup.z + (1.0 - factor))); +} + + +export material Bronze_Knurling( + float copper_tint = 0.5f [[ + ::anno::description("Blends between the bronze types. 0.0 yields yellowish bronze, increasing the copper amount fades to reddish bronze."), + ::anno::display_name("Copper Tint"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(0) + ]], + float knurling_roughness = 0.3f [[ + ::anno::description("Adjusts the roughness of the material."), + ::anno::display_name("Knurling Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float surface_dirt = 0.12f [[ + ::anno::description("Adds a layer of dirt on the surface which darkens the appearance."), + ::anno::display_name("Surface Dirt"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float cavities_dirt = 0.73f [[ + ::anno::description("Adds dirt in the areas where dents and cavities appear on the surface."), + ::anno::display_name("Cavities Dirt"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float bump_strength = 1.f [[ + ::anno::description("Specifies the strength of the bump."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + uniform float2 texture_translate = 0.f [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform"), + ::anno::ui_order(5) + ]], + uniform float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f), + ::anno::ui_order(6) + ]], + uniform float2 texture_scale = 1.0f [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(0.5f, 0.5f)), + ::anno::ui_order(7) + ]], + uniform bool roundcorners_enable = false [[ + ::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."), + ::anno::display_name("Enable Round Corners"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(8) + ]], + uniform float roundcorners_radius_mm = 1.5f [[ + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::display_name("Round Corner Radius (mm)"), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f), + ::anno::ui_order(9) + ]], + uniform bool roundcorners_across_materials = false [[ + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::display_name("Across Materials"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(10) + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Uses selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced"), + ::anno::hard_range(0, 10), + ::anno::ui_order(11) + ]]) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Knurling"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze_Knurling.Bronze_Knurling.png"), + ::anno::key_words(string[]("metal", "bronze", "knurl", "knurling", "bumped", "diamond", "pattern", "reflective", "design", "sanitary", "warm")) +]] + = + let { + float2 texture_scale_remap = texture_scale / 4.0f; + float copper_amount_remap = copper_tint / 1.5f; + bool tmp0 = false; + material_surface tmp1(::df::weighted_layer(::math::max(float3(endless_texture(texture_2d("./brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_remap, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).x * surface_dirt, ::math::min(cavities_dirt, float3(endless_texture(texture_2d("./brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_remap, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).y)), ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(color(0.00560500007f, 0.00191999995f, 0.f), color(0.0437350012f, 0.0346640013f, 0.0266149994f), ::base::color_layer_blend, float3(endless_texture(texture_2d("./brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_remap, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).x).tint, 0.f), ::df::custom_curve_layer(0.f, 1.f, 5.35999966f, 1.f, ::df::weighted_layer(0.349999994f, ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(endless_texture(texture_2d("./brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_remap, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, 0.170000002f, ::math::lerp(0.399999976f, 0.720000029f, knurling_roughness)) * histogram_range(float3(endless_texture(texture_2d("./brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_remap, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, 0.170000002f, ::math::lerp(0.399999976f, 0.720000029f, knurling_roughness)), histogram_range(float3(endless_texture(texture_2d("./brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_remap, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, 0.170000002f, ::math::lerp(0.399999976f, 0.720000029f, knurling_roughness)) * histogram_range(float3(endless_texture(texture_2d("./brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_remap, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, 0.170000002f, ::math::lerp(0.399999976f, 0.720000029f, knurling_roughness)), color(::math::pow(float3(::base::file_texture(texture_2d("./metal_knurling_R_rough_G_curvature_B_reflectivity.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_remap, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint).z, cavities_dirt * 1.42999995f + 0.300000012f)), color(::math::pow(float3(::base::file_texture(texture_2d("./metal_knurling_R_rough_G_curvature_B_reflectivity.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_remap, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint).z, cavities_dirt * 1.42999995f + 0.300000012f)), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(endless_texture(texture_2d("./brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_remap, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, 0.0700000003f, ::math::lerp(0.0399999991f, 0.416000009f, knurling_roughness)) * histogram_range(float3(endless_texture(texture_2d("./brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_remap, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, 0.0700000003f, ::math::lerp(0.0399999991f, 0.416000009f, knurling_roughness)), histogram_range(float3(endless_texture(texture_2d("./brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_remap, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, 0.0700000003f, ::math::lerp(0.0399999991f, 0.416000009f, knurling_roughness)) * histogram_range(float3(endless_texture(texture_2d("./brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_remap, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, 0.0700000003f, ::math::lerp(0.0399999991f, 0.416000009f, knurling_roughness)), color(::math::pow(float3(::base::file_texture(texture_2d("./metal_knurling_R_rough_G_curvature_B_reflectivity.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_remap, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint).z, cavities_dirt * 1.42999995f + 0.300000012f)), color(::math::pow(float3(::base::file_texture(texture_2d("./metal_knurling_R_rough_G_curvature_B_reflectivity.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_remap, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint).z, cavities_dirt * 1.42999995f + 0.300000012f)), ::state::texture_tangent_u(0), ::df::scatter_reflect), bsdf(), normalmap_normal(texture_2d("./metal_knurling_norm.jpg", ::tex::gamma_linear), bump_strength, vmat_transform(texture_translate, texture_rotate, texture_scale_remap, ::base::texture_coordinate_uvw, uv_space_index))), normalmap_normal(texture_2d("./metal_knurling_norm.jpg", ::tex::gamma_linear), bump_strength, vmat_transform(texture_translate, texture_rotate, texture_scale_remap, ::base::texture_coordinate_uvw, uv_space_index))), ::df::tint(gradient_lookup_smooth(texture_2d("./bronze_gradients.png", ::tex::gamma_srgb), ::math::pow(float3(endless_texture(texture_2d("./brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_remap, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, 0.399999976f), copper_amount_remap), ::df::weighted_layer(0.349999994f, ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(endless_texture(texture_2d("./brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_remap, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, 0.170000002f, ::math::lerp(0.399999976f, 0.720000029f, knurling_roughness)) * histogram_range(float3(endless_texture(texture_2d("./brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_remap, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, 0.170000002f, ::math::lerp(0.399999976f, 0.720000029f, knurling_roughness)), histogram_range(float3(endless_texture(texture_2d("./brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_remap, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, 0.170000002f, ::math::lerp(0.399999976f, 0.720000029f, knurling_roughness)) * histogram_range(float3(endless_texture(texture_2d("./brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_remap, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, 0.170000002f, ::math::lerp(0.399999976f, 0.720000029f, knurling_roughness)), color(::math::pow(float3(::base::file_texture(texture_2d("./metal_knurling_R_rough_G_curvature_B_reflectivity.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_remap, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint).z, cavities_dirt * 1.42999995f + 0.300000012f)), color(::math::pow(float3(::base::file_texture(texture_2d("./metal_knurling_R_rough_G_curvature_B_reflectivity.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_remap, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint).z, cavities_dirt * 1.42999995f + 0.300000012f)), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(endless_texture(texture_2d("./brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_remap, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, 0.0700000003f, ::math::lerp(0.0399999991f, 0.416000009f, knurling_roughness)) * histogram_range(float3(endless_texture(texture_2d("./brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_remap, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, 0.0700000003f, ::math::lerp(0.0399999991f, 0.416000009f, knurling_roughness)), histogram_range(float3(endless_texture(texture_2d("./brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_remap, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, 0.0700000003f, ::math::lerp(0.0399999991f, 0.416000009f, knurling_roughness)) * histogram_range(float3(endless_texture(texture_2d("./brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_remap, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, 0.0700000003f, ::math::lerp(0.0399999991f, 0.416000009f, knurling_roughness)), color(::math::pow(float3(::base::file_texture(texture_2d("./metal_knurling_R_rough_G_curvature_B_reflectivity.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_remap, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint).z, cavities_dirt * 1.42999995f + 0.300000012f)), color(::math::pow(float3(::base::file_texture(texture_2d("./metal_knurling_R_rough_G_curvature_B_reflectivity.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_remap, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint).z, cavities_dirt * 1.42999995f + 0.300000012f)), ::state::texture_tangent_u(0), ::df::scatter_reflect), bsdf(), normalmap_normal(texture_2d("./metal_knurling_norm.jpg", ::tex::gamma_linear), bump_strength, vmat_transform(texture_translate, texture_rotate, texture_scale_remap, ::base::texture_coordinate_uvw, uv_space_index))), normalmap_normal(texture_2d("./metal_knurling_norm.jpg", ::tex::gamma_linear), bump_strength, vmat_transform(texture_translate, texture_rotate, texture_scale_remap, ::base::texture_coordinate_uvw, uv_space_index)))), ::state::normal()), normalmap_normal(texture_2d("./metal_knurling_norm.jpg", ::tex::gamma_linear), bump_strength, vmat_transform(texture_translate, texture_rotate, texture_scale_remap, ::base::texture_coordinate_uvw, uv_space_index))), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + 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)); + 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()); + hair_bsdf tmp6 = hair_bsdf(); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5, + hair: tmp6); + +// 2 +export material Bronze_Knurling_Rough_Dirty(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Knurling - Rough Dirty"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze_Knurling.Bronze_Knurling_Rough_Dirty.png"), + ::anno::key_words(string[]("metal", "bronze", "knurl", "knurling", "bumped", "diamond", "dirty", "worn", "pattern", "reflective", "design", "sanitary", "warm")) +]] = Bronze_Knurling( + copper_tint: 0.5f, + knurling_roughness: 0.87f, + surface_dirt: 0.95f, + cavities_dirt: 1.0f, + bump_strength: 1.0f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + diff --git a/Material/material_0413/Copper_Antique_Brushed.mdl b/Material/material_0413/Copper_Antique_Brushed.mdl new file mode 100644 index 0000000000000000000000000000000000000000..418a9aa1ccf36cdba513ad07cbc34db7f9ccf423 --- /dev/null +++ b/Material/material_0413/Copper_Antique_Brushed.mdl @@ -0,0 +1,434 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + +mdl 1.4; + +import ::df::*; +import ::base::*; +import ::math::*; +import ::state::*; +import ::anno::*; +import ::tex::*; +import ::nvidia::core_definitions::dimension; + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + + +float contrast_brightness( + float input, + float contrast, + float brightness +) +{ + float return_value = contrast > 0.5 ? + 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) + : + float(::math::clamp((input - 0.5) * contrast * 2.0 + 0.5 + (brightness - 0.5)*2.0, 0.0, 1.0)); + + return return_value; +} + + +uniform float4x4 rotation_translation_scale( + uniform float3 rotation = float3(0.) + [[ ::anno::description("Rotation applied to every UVW coordinate.") ]], + uniform float3 translation = float3(0.) + [[ ::anno::description("Offset applied to every UVW coordinate.") ]], + uniform float3 scaling = float3(1.) + [[ ::anno::description("Scale applied to every UVW coordinate.") ]] +) +[[ + ::anno::description("Construct transformation matrix from Euler rotation, translation and scale."), + ::anno::hidden() +]] +{ + float4x4 scale = + float4x4(scaling.x , 0. , 0. , 0., + 0. , scaling.y , 0. , 0., + 0. , 0. , scaling.z , 0., + translation.x, translation.y, translation.z, 1.); + + float3 s = ::math::sin(rotation); + float3 c = ::math::cos(rotation); + float4x4 rotate = + 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, + 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, + -s.y , s.x*c.y , c.x*c.y , 0.0, + 0. , 0 , 0 , 1.); + + return scale*rotate; +} + +::base::texture_return blend_colors( + color color_1 = color(1.0, 1.0, 1.0), + color color_2 = color(.5, .5, .5), + float weight = 1.0 +) [[ + ::anno::hidden() +]] +{ + return ::base::blend_color_layers( + layers: ::base::color_layer[]( + ::base::color_layer( + layer_color: color_2, + weight: weight, + mode: ::base::color_layer_blend + )), + base: color_1 + ); +} + +export material Copper_Antique_Brushed ( + float reflection_contrast = 0.5 + [[ + ::anno::display_name("Metal Roughness Contrast"), + ::anno::soft_range(float(0.0f), float(1.0f)), + ::anno::description("The contrast of the roughness of the metal material."), + ::anno::in_group("Appearance") + ]], + float reflection_brightness = 0.5 + [[ + ::anno::display_name("Metal Roughness"), + ::anno::soft_range(float(0.0f), float(1.0f)), + ::anno::description("The specular level (intensity) of the material."), + ::anno::in_group("Appearance") + ]], + float smudge_amount = 0.0 + [[ + ::anno::display_name("Metal Smudge"), + ::anno::soft_range(float(0.0f), float(1.0f)), + ::anno::description("The specular level (intensity) of the material."), + ::anno::in_group("Appearance") + ]], + + float patina_amount = float(0.5) + [[ + ::anno::display_name("Patina Amount"), + ::anno::soft_range(float(0.0f), float(1.0f)), + ::anno::description("The specular level (intensity) of the material."), + ::anno::in_group("Appearance") + ]], + float patina_spots_brightness = float(0.5) + [[ + ::anno::display_name("Patina Spots Brightness"), + ::anno::soft_range(float(0.0f), float(1.0f)), + ::anno::description("The specular level (intensity) of the material."), + ::anno::in_group("Appearance") + ]], + uniform float bump_amount = 1.0 + [[ + ::anno::display_name("Bump Amount"), + ::anno::description("Specifies the intensity of the normal texture."), + ::anno::in_group("Normal") + ]], + + // Adjustments Group + uniform float2 texture_translate = 0.0f + [[ + ::anno::display_name("Translate"), + ::anno::description("Controls the position of the texture."), + ::anno::in_group("Adjustments") + ]], + uniform float texture_rotate = 0.f + [[ + ::anno::display_name("Rotate"), + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::in_group("Adjustments") + ]], + uniform float2 texture_scale = 1.0f + [[ + ::anno::display_name("Scale"), + ::anno::description("Larger numbers increase the size."), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::anno::in_group("Adjustments") + ]] + +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Antique copper"), + ::anno::description("A copper material with an antique look, bumps and small impurities."), + ::anno::key_words(string[]("design", "metal", "copper", "antique", "oxidized", "aged", "bumped", "brushed", "scratched", "patina", "matte")), + ::anno::thumbnail("./.thumbs/Copper_Antique_Brushed.Copper_Antique_Brushed.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = let { + ::base::texture_coordinate_info uvw = ::base::coordinate_source( + coordinate_system: ::base::texture_coordinate_uvw, + texture_space: 0 + ); + + ::base::texture_coordinate_info transformed_uvw = ::base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(1.0f/texture_scale.x, 1.0f/texture_scale.y, 1.0), + rotation: float3(0.0, 0.0, texture_rotate/180.*::math::PI ), + translation: float3(texture_translate.x, texture_translate.y, 0.0) + ), + coordinate: uvw + ); + + ::base::texture_coordinate_info patina_uvw = ::base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(1.0f/(texture_scale.x*2.0f), 1.0f/(texture_scale.y*2.0), 1.0), + rotation: float3(0.0, 0.0, texture_rotate/180.*::math::PI ), + translation: float3(texture_translate.x, texture_translate.y, 0.0) + ), + coordinate: uvw + ); + + // Diffuse Color lookup + color diffuse_color = ::base::file_texture( + texture: texture_2d("./brushed_antique_copper_diff.jpg" , ::tex::gamma_srgb), + color_offset: color(0.0, 0.0, 0.0), + color_scale: color(1.0, 1.0, 1.0), + mono_source: ::base::mono_average, + uvw: transformed_uvw, + clip: false + ).tint; + + color patina_color = ::base::file_texture( + texture: texture_2d("./brushed_antique_copper_patina_diff.jpg" , ::tex::gamma_srgb), + color_offset: color(0.0, 0.0, 0.0), + color_scale: color(patina_spots_brightness), + mono_source: ::base::mono_average, + uvw: patina_uvw, + clip: false + ).tint; + + ::base::texture_return spots_weight_map = ::base::file_texture( + texture: texture_2d("./brushed_antique_copper_spots_mask.jpg" , ::tex::gamma_linear), + color_offset: color(0.0, 0.0, 0.0), + color_scale: color(1.0, 1.0, 1.0), + mono_source: ::base::mono_average, + uvw: transformed_uvw, + clip: false + ); + + color final_diffuse_color = blend_colors(diffuse_color, patina_color, blend_colors(color(0.0), spots_weight_map.tint, patina_amount).mono).tint; + + float roughness_lookup = contrast_brightness( + ::tex::lookup_float( + tex: texture_2d("./brushed_antique_copper_rough.jpg" , ::tex::gamma_linear), + coord: float2(uvw.position.x, uvw.position.y)), + reflection_contrast, + reflection_brightness + ) + ::base::file_texture( + texture: texture_2d("./brushed_antique_copper_smudge_map.jpg" , ::tex::gamma_linear), + color_offset: color(0.0, 0.0, 0.0), + color_scale: color(smudge_amount * .5f), + mono_source: ::base::mono_average, + uvw: transformed_uvw, + clip: false + ).mono; + + + // Specular Level lookup + float specular_level = ::base::file_texture( + texture: texture_2d("./brushed_antique_copper_ref.jpg" , ::tex::gamma_linear), + color_offset: color(0.0, 0.0, 0.0), + color_scale: color(1.0, 1.0, 1.0), + mono_source: ::base::mono_average, + uvw: transformed_uvw, + clip: false + ).mono; + + + // Metallic compositing + float metallic = ::math::clamp(0.0, 1.0, blend_colors(color(1.0), blend_colors(color(1.0), color(0.0), spots_weight_map.mono).tint, patina_amount).mono - .15f); + + + bsdf diffuse_bsdf = ::df::diffuse_reflection_bsdf( + roughness: 0.0f, //assign the user controllable + tint: final_diffuse_color //values to the bsdf + ); + + bsdf ggx_smith_bsdf = ::df::microfacet_ggx_smith_bsdf( + roughness_u: roughness_lookup*roughness_lookup, + roughness_v: roughness_lookup*roughness_lookup, + tint: color(1.0, 1.0, 1.0), + mode: ::df::scatter_reflect + ); + + + bsdf custom_curve_layer_bsdf = ::df::custom_curve_layer( + normal_reflectivity: 0.08 * specular_level, + grazing_reflectivity: 1.0, + exponent: 3.0, + weight: 1.0, + layer: ggx_smith_bsdf, + base: diffuse_bsdf + ); + + bsdf directional_factor_bsdf = ::df::directional_factor( + normal_tint: final_diffuse_color, + grazing_tint: color(1.0, 1.0, 1.0), + exponent: 3.0f, + base: ggx_smith_bsdf + ); + + bsdf final_bsdf = ::df::weighted_layer( + base: custom_curve_layer_bsdf, + weight: metallic, + layer: directional_factor_bsdf + ); + + // Normal lookup + float3 bump = ::base::tangent_space_normal_texture( + texture: texture_2d("./brushed_antique_copper_norm.jpg" , ::tex::gamma_linear), + factor: bump_amount, + uvw: transformed_uvw, + flip_tangent_u: false, + flip_tangent_v: false + ); + + +} in material ( + surface: material_surface( + scattering: final_bsdf + + ), + geometry: material_geometry( + normal: bump + ) +); + + +// 2 Shiny Polished +export material Copper_Antique_Brushed_Shiny(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Antique copper - Shiny Polished"), + ::anno::description("A copper material with an antique look, bumps and small impurities."), + ::anno::key_words(string[]("design", "metal", "copper", "antique", "oxidized", "aged", "bumped", "brushed", "polished", "scratched", "patina", "matte")), + ::anno::thumbnail("./.thumbs/Copper_Antique_Brushed.Copper_Antique_Brushed_Shiny.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Copper_Antique_Brushed( + reflection_contrast: 0.2f, + reflection_brightness: 0.35f, + smudge_amount: 0.0f, + patina_amount: 0.0f, + patina_spots_brightness: 0.5, + bump_amount: 0.7 +); + + + +// 3 Shiny Smudged +export material Copper_Antique_Brushed_Shiny_Smudged(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Antique copper - Shiny Smudged"), + ::anno::description("A copper material with an antique look, bumps and small impurities."), + ::anno::key_words(string[]("design", "metal", "copper", "antique", "oxidized", "aged", "bumped", "brushed", "polished", "scratched", "patina", "shiny", "glossy")), + ::anno::thumbnail("./.thumbs/Copper_Antique_Brushed.Copper_Antique_Brushed_Shiny_Smudged.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Copper_Antique_Brushed( + reflection_contrast: 0.2f, + reflection_brightness: 0.35f, + smudge_amount: 1.0f, + patina_amount: 0.0f, + patina_spots_brightness: 0.5, + bump_amount: 0.6 +); + + +// 4 Worn Matte +export material Copper_Antique_Brushed_Worn_Matte(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Antique copper - Worn Matte"), + ::anno::description("A copper material with an antique look, bumps and small impurities."), + ::anno::key_words(string[]("design", "metal", "copper", "antique", "oxidized", "aged", "bumped", "brushed", "smudge", "smudges", "smudged", "scratched", "patina", "matte")), + ::anno::thumbnail("./.thumbs/Copper_Antique_Brushed.Copper_Antique_Brushed_Worn_Matte.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Copper_Antique_Brushed( + reflection_contrast: 0.65f, + reflection_brightness: 0.55f, + smudge_amount: 0.65f, + patina_amount: 0.5f, + patina_spots_brightness: 0.5, + bump_amount: 1.0 +); + +// 5 Decayed Matte +export material Copper_Antique_Brushed_Decayed_Matte(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Antique copper - Decayed Matte"), + ::anno::description("A copper material with an antique look, bumps and small impurities."), + ::anno::key_words(string[]("design", "metal", "copper", "antique", "oxidized", "aged", "bumped", "brushed", "smudge", "smudges", "smudged", "scratched", "decayed", "patina", "matte")), + ::anno::thumbnail("./.thumbs/Copper_Antique_Brushed.Copper_Antique_Brushed_Decayed_Matte.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Copper_Antique_Brushed( + reflection_contrast: 0.4f, + reflection_brightness: 0.45f, + smudge_amount: 0.8f, + patina_amount: 0.4f, + patina_spots_brightness: 0.3, + bump_amount: 0.5 +); + +// 6 Shiny Matte Smudged +export material Copper_Antique_Brushed_Shiny_Matte_Smudged(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Antique copper - Shiny Matte Smudged"), + ::anno::description("A copper material with an antique look, bumps and small impurities."), + ::anno::key_words(string[]("design", "metal", "copper", "antique", "oxidized", "aged", "bumped", "brushed", "smudge", "smudges", "smudged", "scratched", "decayed", "patina", "shiny", "matte")), + ::anno::thumbnail("./.thumbs/Copper_Antique_Brushed.Copper_Antique_Brushed_Shiny_Matte_Smudged.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Copper_Antique_Brushed( + reflection_contrast: 0.5f, + reflection_brightness: 0.7f, + smudge_amount: 0.0f, + patina_amount: 0.8f, + patina_spots_brightness: 0.5, + bump_amount: 1.0 +); diff --git a/Material/material_0416/Copper_Foil.mdl b/Material/material_0416/Copper_Foil.mdl new file mode 100644 index 0000000000000000000000000000000000000000..e8083ca098a75983624c581d6cfa33c15bff92c5 --- /dev/null +++ b/Material/material_0416/Copper_Foil.mdl @@ -0,0 +1,502 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + + +mdl 1.5; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + +const string DESCRIPTION = "Metal foil material with additional controls for wrinkling the material"; + +float remap_xy_to_0_1(float input, float x, float y) +{ + return (input - x)/(y - x); +} + +float histogram_scan_big(float input, float width, float position) +{ + return ::math::clamp( + remap_xy_to_0_1(input, + ::math::lerp(-width, 1.0, position), + ::math::lerp(0.0, 1.0 + width, position)), + 0.0, + 1.0); +} + +::base::texture_coordinate_info vmat_transform( + uniform float2 translation = float2(0.0, 0.0), + uniform float rotation = 0.0, + uniform float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation_rad); + float c = ::math::cos(rotation_rad); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + +float histogram_range(float input, float range, float position) +{ + float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); + float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); + return ::math::lerp(low, high, input); +} + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float2 rnd22(int2 p) { + float2 ret_val = float2( + uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f, + uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f + ); + return ret_val; +} + +float3 srgb2rgb(float3 val) +{ + return ::math::pow(::math::max(val, float3(0.0f)), 2.2); +} + +float2x2 invert_2x2(float2x2 M) +{ + float det = M[0][0]*M[1][1] - M[0][1]*M[1][0]; + //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/ + return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]); +} + +float3 nonrepeat_lookup( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5), + float patch_size = 8.0 +) +{ + + float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale; + float Z = patch_size; // patch scale inside example texture + float CON = 1.0f; + + float3 O = float3(0.f); + float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); + float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space + + float2 U = uv_in; + float2 V = M * uv_in; //pre-tilted hexa coordinates + int2 I = int2(::math::floor(V)); // hexa-tile id + + // The mean color needs to be determined in Photoshop then to make the + // average color work out, take the float value and calculate the apropriate + // mean value as (value^(1/2.2)) + + float3 m = average_color; + + float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; + F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates + + if( F[2] > 0.f ) + + O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON)) + + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON)) + + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON)); + else + O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON)) + + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON)) + + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON)); + O = m + O/::math::length(W); + O = ::math::clamp( (O), 0.0, 1.0); + + return float3(O); +} + +color endless_texture( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 10.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0, + bool gamma_correct_lookup = true +) +{ + return gamma_correct_lookup ? color(srgb2rgb( + nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )) + ) : color(nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )); +} + +float3 endless_normal( + uniform texture_2d texture = texture_2d(), + float factor = 1.0, + bool flip_tangent_u = false, + bool flip_tangent_v = false, + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0 +) +{ + float3 transformed_tangent_u = flip_tangent_u ? uvw.tangent_u : - uvw.tangent_u; + float3 transformed_tangent_v = flip_tangent_v ? uvw.tangent_v : - uvw.tangent_v; + + if (flip_tangent_u) + transformed_tangent_u=-transformed_tangent_u; + if (flip_tangent_v) + transformed_tangent_v=-transformed_tangent_v; + + // normalized Lookup + float3 tangent_space_normal = + (nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + ) - 0.5) * (2.0 * factor); + + return ::math::normalize(uvw.tangent_u * tangent_space_normal.x + + uvw.tangent_v * tangent_space_normal.y + + ::state::normal()*1.0); +} + +export material Copper_Foil( + uniform bool infinite_tiling = true [[ + ::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."), + ::anno::display_name("Infinite Tiling"), + ::anno::in_group("Infinite Tiing") + ]], + float brightness = 1.f [[ + ::anno::description("Ajusts the total reflectivity of the metal."), + ::anno::display_name("Brightness"), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Appearance") + ]], + float roughness = 0.15f [[ + ::anno::display_name("Roughness"), + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Appearance") + ]], + float roughness_variation = 0.564f [[ + ::anno::description("Amount of variation applied to the roughness, higher numbers add more non uniform appearance to the reflectivity of the material."), + ::anno::display_name("Roughness Variation"), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Appearance") + ]], + float smudges = 0.35f [[ + ::anno::description("Adds blurrier reflections that show smudges on the surface."), + ::anno::display_name("Smudges"), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Appearance") + ]], + uniform float bump_strength = 0.05f [[ + ::anno::description("Specifies the strength of the bump."), + ::anno::display_name("Bump Strength"), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Appearance") + ]], + uniform float2 texture_translate = 0.f [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform") + ]], + uniform float texture_rotate = 0.0f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform") + ]], + uniform float2 texture_scale = 1.f [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::nvidia::core_definitions::dimension(float2(0.4, 0.4)), + ::anno::in_group("Transform") + ]], + uniform int uv_space_index = 0 [[ + ::anno::display_name("UV Space Index"), + ::anno::in_group("Transform") + ]], + uniform bool enable_round_corners = false [[ + ::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."), + ::anno::display_name("Enable Round Corners"), + ::anno::in_group("Round Corners") + ]], + uniform float radius = 0.002f [[ + ::anno::description("Radius of the rounded corners."), + ::anno::display_name("Round Corner Radius"), + ::anno::in_group("Round Corners") + ]], + uniform bool across_materials = false [[ + ::anno::display_name("Across Materials"), + ::anno::in_group("Round Corners") + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Copper Foil - Slightly Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Copper_Foil.Copper_Foil.png"), + ::anno::key_words(string[]("design", "metal", "copper", "foil", "smooth", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "warm")) +]] + = + let { + color normal_reflectivity = color(0.9654565f, 0.6899602f, 0.4830392f); + color grazing_reflectivity = color(0.99942f, 1.f, 1.f); + + texture_2d rough_ao_tex = texture_2d("./foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear); + texture_2d smudge_splotch_tex = texture_2d("./foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear); + texture_2d norm_tex = texture_2d("./foil_crumpled_norm.jpg", ::tex::gamma_linear); + + + bool tmp0 = false; + material_surface tmp1( + ::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)), + material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + 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)); + material_geometry tmp5( + float3(0.f), + 1.f, + enable_round_corners ? ::state::rounded_corner_normal(radius, across_materials, 1.f) : ::state::normal()); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + +export material Copper_Foil_Smudged_Foil(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Copper Foil - Smudgy Foil"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Copper_Foil.Copper_Foil_Smudged_Foil.png"), + ::anno::key_words(string[]("design", "metal", "copper", "foil", "smooth", "unfinished", "decorative", "creative", "warm")) +]] += Copper_Foil( + infinite_tiling: true, + roughness: 0.15f, + roughness_variation: 0.84f, + smudges: 0.35f, + bump_strength: 0.0f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + +export material Copper_Foil_Shiny_Wrinkled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Copper Foil - Shiny Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Copper_Foil.Copper_Foil_Shiny_Wrinkled.png"), + ::anno::key_words(string[]("design", "metal", "copper", "foil", "shiny", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "warm")) +]] += Copper_Foil( + infinite_tiling: true, + roughness: 0.25f, + roughness_variation: 0.25f, + smudges: 0.75f, + bump_strength: 0.25f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + + +export material Copper_Foil_Matte_Wrinkled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Copper Foil - Matte Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Copper_Foil.Copper_Foil_Matte_Wrinkled.png"), + ::anno::key_words(string[]("design", "metal", "copper", "foil", "matte", "smooth", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "warm")) +]] += Copper_Foil( + infinite_tiling: true, + roughness: 0.65f, + roughness_variation: 1.0f, + smudges: 0.4f, + bump_strength: 0.15f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + +export material Copper_Foil_Heavy_Glossy_Wrinkles(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Copper Foil - Heavy Glossy Wrinkles"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Copper_Foil.Copper_Foil_Heavy_Glossy_Wrinkles.png"), + ::anno::key_words(string[]("design", "metal", "copper", "foil", "smooth", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "warm")) +]] += Copper_Foil( + infinite_tiling: true, + roughness: 0.164f, + roughness_variation: 0.021f, + smudges: 0.143f, + bump_strength: 0.99f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + +export material Copper_Foil_Heavy_Matte_Wrinkled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Copper Foil - Heavy Matte Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Copper_Foil.Copper_Foil_Heavy_Matte_Wrinkled.png"), + ::anno::key_words(string[]("design", "metal", "copper", "foil", "matte", "bumped", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "warm")) +]] += Copper_Foil( + infinite_tiling: true, + roughness: 0.889f, + roughness_variation: 0.018f, + smudges: 0.246f, + bump_strength: 0.732f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + + + + + + + + + + + + diff --git a/Material/material_0429/Gold_Foil.mdl b/Material/material_0429/Gold_Foil.mdl new file mode 100644 index 0000000000000000000000000000000000000000..84de866929112a434354cea7d93a320394faff20 --- /dev/null +++ b/Material/material_0429/Gold_Foil.mdl @@ -0,0 +1,501 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + + +mdl 1.5; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + +const string DESCRIPTION = "Metal foil material with additional controls for wrinkling the material"; + +float remap_xy_to_0_1(float input, float x, float y) +{ + return (input - x)/(y - x); +} + +float histogram_scan_big(float input, float width, float position) +{ + return ::math::clamp( + remap_xy_to_0_1(input, + ::math::lerp(-width, 1.0, position), + ::math::lerp(0.0, 1.0 + width, position)), + 0.0, + 1.0); +} + +::base::texture_coordinate_info vmat_transform( + uniform float2 translation = float2(0.0, 0.0), + uniform float rotation = 0.0, + uniform float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation_rad); + float c = ::math::cos(rotation_rad); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + +float histogram_range(float input, float range, float position) +{ + float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); + float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); + return ::math::lerp(low, high, input); +} + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float2 rnd22(int2 p) { + float2 ret_val = float2( + uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f, + uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f + ); + return ret_val; +} + +float3 srgb2rgb(float3 val) +{ + return ::math::pow(::math::max(val, float3(0.0f)), 2.2); +} + +float2x2 invert_2x2(float2x2 M) +{ + float det = M[0][0]*M[1][1] - M[0][1]*M[1][0]; + //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/ + return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]); +} + +float3 nonrepeat_lookup( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5), + float patch_size = 8.0 +) +{ + + float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale; + float Z = patch_size; // patch scale inside example texture + float CON = 1.0f; + + float3 O = float3(0.f); + float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); + float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space + + float2 U = uv_in; + float2 V = M * uv_in; //pre-tilted hexa coordinates + int2 I = int2(::math::floor(V)); // hexa-tile id + + // The mean color needs to be determined in Photoshop then to make the + // average color work out, take the float value and calculate the apropriate + // mean value as (value^(1/2.2)) + + float3 m = average_color; + + float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; + F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates + + if( F[2] > 0.f ) + + O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON)) + + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON)) + + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON)); + else + O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON)) + + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON)) + + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON)); + O = m + O/::math::length(W); + O = ::math::clamp( (O), 0.0, 1.0); + + return float3(O); +} + +color endless_texture( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 10.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0, + bool gamma_correct_lookup = true +) +{ + return gamma_correct_lookup ? color(srgb2rgb( + nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )) + ) : color(nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )); +} + +float3 endless_normal( + uniform texture_2d texture = texture_2d(), + float factor = 1.0, + bool flip_tangent_u = false, + bool flip_tangent_v = false, + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0 +) +{ + float3 transformed_tangent_u = flip_tangent_u ? uvw.tangent_u : - uvw.tangent_u; + float3 transformed_tangent_v = flip_tangent_v ? uvw.tangent_v : - uvw.tangent_v; + + if (flip_tangent_u) + transformed_tangent_u=-transformed_tangent_u; + if (flip_tangent_v) + transformed_tangent_v=-transformed_tangent_v; + + // normalized Lookup + float3 tangent_space_normal = + (nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + ) - 0.5) * (2.0 * factor); + + return ::math::normalize(uvw.tangent_u * tangent_space_normal.x + + uvw.tangent_v * tangent_space_normal.y + + ::state::normal()*1.0); +} + +export material Gold_Foil( + uniform bool infinite_tiling = true [[ + ::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."), + ::anno::display_name("Infinite Tiling"), + ::anno::in_group("Infinite Tiing") + ]], + float brightness = 1.f [[ + ::anno::description("Ajusts the total reflectivity of the metal."), + ::anno::display_name("Brightness"), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Appearance") + ]], + float roughness = 0.15f [[ + ::anno::display_name("Roughness"), + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Appearance") + ]], + float roughness_variation = 0.564f [[ + ::anno::description("Amount of variation applied to the roughness, higher numbers add more non uniform appearance to the reflectivity of the material."), + ::anno::display_name("Roughness Variation"), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Appearance") + ]], + float smudges = 0.35f [[ + ::anno::description("Adds blurrier reflections that show smudges on the surface."), + ::anno::display_name("Smudges"), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Appearance") + ]], + uniform float bump_strength = 0.05f [[ + ::anno::description("Specifies the strength of the bump."), + ::anno::display_name("Bump Strength"), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Appearance") + ]], + uniform float2 texture_translate = 0.f [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform") + ]], + uniform float texture_rotate = 0.0f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform") + ]], + uniform float2 texture_scale = 1.f [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::nvidia::core_definitions::dimension(float2(0.4, 0.4)), + ::anno::in_group("Transform") + ]], + uniform int uv_space_index = 0 [[ + ::anno::display_name("UV Space Index"), + ::anno::in_group("Transform") + ]], + uniform bool enable_round_corners = false [[ + ::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."), + ::anno::display_name("Enable Round Corners"), + ::anno::in_group("Round Corners") + ]], + uniform float radius = 0.002f [[ + ::anno::description("Radius of the rounded corners."), + ::anno::display_name("Round Corner Radius"), + ::anno::in_group("Round Corners") + ]], + uniform bool across_materials = false [[ + ::anno::display_name("Across Materials"), + ::anno::in_group("Round Corners") + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Gold Foil - Slightly Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Gold_Foil.Gold_Foil.png"), + ::anno::key_words(string[]("design", "metal", "gold", "foil", "smooth", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "warm", "yellow")) +]] + = + let { + color normal_reflectivity = color(1.0f,0.722306985258f,0.340058756743f); + color grazing_reflectivity = color(0.99942f, 1.f, 1.f); + + texture_2d rough_ao_tex = texture_2d("./foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear); + texture_2d smudge_splotch_tex = texture_2d("./foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear); + texture_2d norm_tex = texture_2d("./foil_crumpled_norm.jpg", ::tex::gamma_linear); + + bool tmp0 = false; + material_surface tmp1( + ::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)), + material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + 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)); + material_geometry tmp5( + float3(0.f), + 1.f, + enable_round_corners ? ::state::rounded_corner_normal(radius, across_materials, 1.f) : ::state::normal()); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + +export material Gold_Foil_Smudged_Foil(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Gold Foil - Smudgy Foil"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Gold_Foil.Gold_Foil_Smudged_Foil.png"), + ::anno::key_words(string[]("design", "metal", "gold", "foil", "smooth", "unfinished", "decorative", "creative", "warm", "yellow")) +]] += Gold_Foil( + infinite_tiling: true, + roughness: 0.15f, + roughness_variation: 0.84f, + smudges: 0.35f, + bump_strength: 0.0f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + +export material Gold_Foil_Shiny_Wrinkled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Gold Foil - Shiny Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Gold_Foil.Gold_Foil_Shiny_Wrinkled.png"), + ::anno::key_words(string[]("design", "metal", "gold", "foil", "shiny", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "warm", "yellow")) +]] += Gold_Foil( + infinite_tiling: true, + roughness: 0.25f, + roughness_variation: 0.25f, + smudges: 0.75f, + bump_strength: 0.25f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + + +export material Gold_Foil_Matte_Wrinkled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Gold Foil - Matte Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Gold_Foil.Gold_Foil_Matte_Wrinkled.png"), + ::anno::key_words(string[]("design", "metal", "gold", "foil", "matte", "smooth", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "warm", "yellow", "gray")) +]] += Gold_Foil( + infinite_tiling: true, + roughness: 0.65f, + roughness_variation: 1.0f, + smudges: 0.4f, + bump_strength: 0.15f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + +export material Gold_Foil_Heavy_Glossy_Wrinkles(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Gold Foil - Heavy Glossy Wrinkles"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Gold_Foil.Gold_Foil_Heavy_Glossy_Wrinkles.png"), + ::anno::key_words(string[]("design", "metal", "gold", "foil", "smooth", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "warm", "yellow")) +]] += Gold_Foil( + infinite_tiling: true, + roughness: 0.164f, + roughness_variation: 0.021f, + smudges: 0.143f, + bump_strength: 0.99f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + +export material Gold_Foil_Heavy_Matte_Wrinkled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Gold Foil - Heavy Matte Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Gold_Foil.Gold_Foil_Heavy_Matte_Wrinkled.png"), + ::anno::key_words(string[]("design", "metal", "gold", "foil", "matte", "bumped", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "warm", "yellow", "gray")) +]] += Gold_Foil( + infinite_tiling: true, + roughness: 0.889f, + roughness_variation: 0.018f, + smudges: 0.246f, + bump_strength: 0.732f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + + + + + + + + + + + + diff --git a/Material/material_0437/Iron_Hammered.mdl b/Material/material_0437/Iron_Hammered.mdl new file mode 100644 index 0000000000000000000000000000000000000000..c4115b89b2f0b9272c95c8595a682d634d8e1dca --- /dev/null +++ b/Material/material_0437/Iron_Hammered.mdl @@ -0,0 +1,263 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + +mdl 1.5; + +import ::anno::*; +import ::math::*; +import ::base::*; +import ::df::*; +import ::nvidia::core_definitions::*; +import ::state::*; +import ::tex::*; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + +const string DESCRIPTION = "A hammered metal material"; + + + +float histogram_range(float input, float range = 1.0f, float position = 0.5f) +{ + float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); + float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); + return ::math::lerp(low, high, input); +} + +::base::texture_coordinate_info transform_coordinate_2( + float4x4 transform + [[ ::anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix.") ]], + ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info() + [[ ::anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection.") ]] +) [[ + ::anno::description("Transform a texture coordinate by a matrix.") , + ::anno::noinline() + ]] +{ + // Version 2 + float4 r_position = transform * float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1); + //Try aproximating it for the case that the rotation is only aroud z and assuming the texture layout is nice and z is ~constant. + //just pretend there is no other rotation happening + //get rid of scaling and translation. Then extract fields where sin and cos would be in a simple 2d transform around z. + float4 u = transform[0]; + float3 ru = ::math::normalize(float3(u.x,u.y,u.z)); + float cos = ru.x; + float sin = -ru.y; + + return ::base::texture_coordinate_info( + float3(r_position.x,r_position.y,r_position.z), + ::math::normalize(cos * coordinate.tangent_u - sin * coordinate.tangent_v), + ::math::normalize(cos * coordinate.tangent_v + sin * coordinate.tangent_u)); +} + + +// Takes the standard input that every material has. It combines a couple of +// functions in one convenience function. +::base::texture_coordinate_info vmat_transform( + float2 translation = float2(0.0, 0.0), + float rotation = 0.0, // rotation in degrees + float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation_rad); + float c = ::math::cos(rotation_rad); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return transform_coordinate_2(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + +export material Iron_Hammered( + color metal_color = color(0.243f, 0.239f, 0.227f) [[ + ::anno::description("Adjusts the reflection color of the metal material."), + ::anno::display_name("Metal Color"), + ::anno::in_group("Appearance") + ]], + float roughness = 0.5f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + float diffuse_variation = 0.8f [[ + ::anno::description("Adds grime, dirt and imperfections."), + ::anno::display_name("Variation"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float bump_strength = 0.8f [[ + ::anno::description("Determines the degree of bumpiness."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + + uniform bool roundcorners_enable = false [[ + ::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."), + ::anno::display_name("Enable Round Corners"), + ::anno::in_group("Round Corners") + ]], + uniform float roundcorners_radius_mm = 1.5f [[ + ::anno::description("Radius of the rounded corners."), + ::anno::display_name("Round Corner Radius"), + ::anno::in_group("Round Corners") + ]], + uniform bool roundcorners_across_materials = false [[ + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::display_name("Across Materials"), + ::anno::in_group("Round Corners") + ]], + float2 texture_translate = 0.f [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform") + ]], + float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform") + ]], + float2 texture_scale = 1.f [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::nvidia::core_definitions::dimension(float2(.4f, 0.4f)), + ::anno::in_group("Transform") + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Use selected UV space."), + ::anno::display_name("UV Space index"), + ::anno::in_group("Advanced") + ]] +) +[[ + ::anno::display_name("Hammered Iron - Dark Pits"), + ::anno::author("NVIDIA vMaterials"), + ::anno::in_group("Metal"), + ::anno::key_words(string[]("metal", "iron", "blackened", "hammered", "design", "classic", "architecture", "pattern", "reflective", "rough", "bumped", "conductor")), + ::anno::thumbnail("./.thumbs/Iron_Hammered.Iron_Hammered.png"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT) +]] + = + let { + bool tmp0 = false; + 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)); + material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + 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)); + 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()); + hair_bsdf tmp6 = hair_bsdf(); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5, + hair: tmp6); + + +export material Iron_Hammered_Shiny(*) +[[ + ::anno::display_name("Hammered Iron - Shiny"), + ::anno::author("NVIDIA vMaterials"), + ::anno::in_group("Metal"), + ::anno::key_words(string[]("metal", "iron", "hammered", "design", "classic", "architecture", "pattern", "reflective", "rough", "bumped", "conductor", "shiny")), + ::anno::thumbnail("./.thumbs/Iron_Hammered.Iron_Hammered_Shiny.png"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT) +]] + = Iron_Hammered( + metal_color: color(0.243f, 0.239f, 0.227f), + roughness: 0.3f, + diffuse_variation: 0.2f, + bump_strength: 0.5f, + roundcorners_enable:false, + roundcorners_radius_mm: 1.5f, + roundcorners_across_materials: false, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0 +); + +export material Iron_Hammered_Dull(*) +[[ + ::anno::display_name("Hammered Iron - Dull"), + ::anno::author("NVIDIA vMaterials"), + ::anno::in_group("Metal"), + ::anno::key_words(string[]("metal", "iron", "hammered", "design", "classic", "architecture", "pattern", "reflective", "rough", "bumped", "conductor", "matte", "dull")), + ::anno::thumbnail("./.thumbs/Iron_Hammered.Iron_Hammered_Dull.png"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT) +]] + = Iron_Hammered( + metal_color: color(0.243f, 0.239f, 0.227f), + roughness: 1.0f, + diffuse_variation: 0.4f, + bump_strength: 0.8f, + roundcorners_enable:false, + roundcorners_radius_mm: 1.5f, + roundcorners_across_materials: false, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0 +); \ No newline at end of file diff --git a/Material/material_0452/Nickel_Scratched.mdl b/Material/material_0452/Nickel_Scratched.mdl new file mode 100644 index 0000000000000000000000000000000000000000..6380ce1a166d05e7210ad0266543100c1148eb88 --- /dev/null +++ b/Material/material_0452/Nickel_Scratched.mdl @@ -0,0 +1,596 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. * + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + + +mdl 1.5; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + +const string DESCRIPTION = "A scratched metal material"; + +float3 srgb2rgb(float3 val) +{ + return ::math::pow(::math::max(val, float3(0.0f)), 2.2); +} + + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float2 rnd22(int2 p) { + float2 ret_val = float2( + uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f, + uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f + ); + return ret_val; +} + +::base::texture_coordinate_info vmat_transform( + uniform float2 translation = float2(0.0, 0.0), + uniform float rotation = 0.0, + uniform float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation); + float c = ::math::cos(rotation); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + +float2x2 invert_2x2(float2x2 M) +{ + float det = M[0][0]*M[1][1] - M[0][1]*M[1][0]; + //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/ + return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]); +} + +float3 nonrepeat_lookup( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5), + float patch_size = 8.0 +) +{ + + float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale; + float Z = patch_size; // patch scale inside example texture + float CON = 1.0f; + + float3 O = float3(0.f); + float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); + float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space + + float2 U = uv_in; + float2 V = M * uv_in; //pre-tilted hexa coordinates + int2 I = int2(::math::floor(V)); // hexa-tile id + + // The mean color needs to be determined in Photoshop then to make the + // average color work out, take the float value and calculate the apropriate + // mean value as (value^(1/2.2)) + + float3 m = average_color; + + float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; + F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates + + if( F[2] > 0.f ) + + O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON)) + + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON)) + + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON)); + else + O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON)) + + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON)) + + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON)); + O = m + O/::math::length(W); + O = ::math::clamp( (O), 0.0, 1.0); + + return float3(O); +} + + +float histogram_range(float input, float range, float position) +{ + float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); + float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); + return ::math::lerp(low, high, input); +} + +float remap_xy_to_0_1(float input, float x, float y) +{ + return (input - x)/(y - x); +} + +float histogram_scan_big(float input, float width, float position) +{ + return ::math::clamp( + remap_xy_to_0_1(input, + ::math::lerp(-width, 1.0, position), + ::math::lerp(0.0, 1.0 + width, position)), + 0.0, + 1.0); +} + +color endless_texture( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 10.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0, + bool gamma_correct_lookup = true +) +{ + return gamma_correct_lookup ? color(srgb2rgb( + nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )) + ) : color(nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )); +} + +float3 endless_normal( + uniform texture_2d texture = texture_2d(), + float factor = 1.0, + bool flip_tangent_u = false, + bool flip_tangent_v = false, + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0 +) +{ + float3 transformed_tangent_u = flip_tangent_u ? uvw.tangent_u : - uvw.tangent_u; + float3 transformed_tangent_v = flip_tangent_v ? uvw.tangent_v : - uvw.tangent_v; + + if (flip_tangent_u) + transformed_tangent_u=-transformed_tangent_u; + if (flip_tangent_v) + transformed_tangent_v=-transformed_tangent_v; + + // normalized Lookup + float3 tangent_space_normal = + (nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + ) - 0.5) * (2.0 * factor); + + return ::math::normalize(uvw.tangent_u * tangent_space_normal.x + + uvw.tangent_v * tangent_space_normal.y + + ::state::normal()*1.0); +} + + +// Returns the normal n in tangent space, given n is in internal space. +float3 transform_internal_to_tangent(float3 n) +[[ + ::anno::hidden() +]] +{ + return + n.x* float3(::state::texture_tangent_u(0).x,::state::texture_tangent_v(0).x,::state::normal().x)+ + n.y* float3(::state::texture_tangent_u(0).y,::state::texture_tangent_v(0).y,::state::normal().y)+ + n.z* float3(::state::texture_tangent_u(0).z,::state::texture_tangent_v(0).z,::state::normal().z); +} + +// Returns the normal n in internal space, given n is in tangent space. +float3 transform_tangent_to_internal(float3 n) +[[ + ::anno::hidden() +]] +{ + return ::state::texture_tangent_u(0) * n.x + + ::state::texture_tangent_v(0) * n.y + + ::state::normal() * n.z ; +} + + + +// Returns a normal by adding a detail normal to a global normal. +// If detail blending of two normal maps gives visual artifacts, check if texture_2d are loaded +// correctly with ::tex::gamma_linear +float3 add_detail_normal(float3 nd = ::state::normal(), float3 n = ::state::normal()) +{ + // http://blog.selfshadow.com/publications/blending-in-detail/ + float3 n_t = transform_internal_to_tangent(n); + float3 nd_t = transform_internal_to_tangent(nd); + + n_t=n_t + float3(0.,0.,1.); + nd_t = nd_t * float3(-1.,-1.,1.); + + n = n_t*::math::dot(n_t, nd_t)/n_t.z - nd_t; + return ::math::normalize(transform_tangent_to_internal(n)); +} + + + + +export material Nickel_Scratched( + uniform bool infinite_tiling = false [[ + ::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."), + ::anno::display_name("Infinite Tiling"), + ::anno::in_group("Appearance") + ]], + float roughness_metal_surface = 1.0f [[ + ::anno::description("The overall roughness of the metal surface."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance", "Metal"), + ::anno::hard_range(0.f, 1.f) + ]], + float roughness_variation = 0.208f [[ + ::anno::description("Adds more roughness variation to the scratched metal material."), + ::anno::display_name("Roughness Variation"), + ::anno::in_group("Appearance", "Metal"), + ::anno::hard_range(0.f, 1.f) + ]], + float brightness = 0.55f [[ + ::anno::display_name("Brightness"), + ::anno::in_group("Appearance", "Metal"), + ::anno::hard_range(0.f, 1.f) + ]], + float brightness_variation = 0.3f [[ + ::anno::description("Adds brightness variation to the metal . Has no effect as soon as the of the material is full on."), + ::anno::display_name("Brightness Variation"), + ::anno::in_group("Appearance", "Metal"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float bump_factor = 0.187f [[ + ::anno::display_name("Bump Factor"), + ::anno::in_group("Appearance", "Metal"), + ::anno::soft_range(0.f, 2.f) + ]], + +// Scratches + float roughness_scratches = 0.145f [[ + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance", "Scratches"), + ::anno::hard_range(0.f, 1.f) + ]], + float scratches_variation = 0.3f [[ + ::anno::display_name("Variation"), + ::anno::in_group("Appearance", "Scratches"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float scratches_bump_factor = 0.435f [[ + ::anno::display_name("Bump Factor"), + ::anno::in_group("Appearance", "Scratches"), + ::anno::soft_range(0.f, 2.f) + ]], + +// Dirt + float dirt_transition_softness = 0.85f [[ + ::anno::description("Controls the softness of the dirt-metal transition."), + ::anno::display_name("Dirt Transition Softness"), + ::anno::in_group("Appearance", "Dirt Layer"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_amount = 0.212f [[ + ::anno::description("Adds dirt and grime on top of the scratched metal. Note that the dirt layer also infoences the roughness of the material."), + ::anno::display_name("Dirt Amount"), + ::anno::in_group("Appearance", "Dirt Layer"), + ::anno::hard_range(0.f, 1.f) + ]], + + +// Transform + uniform float2 texture_translate = 0.f [[ + ::anno::display_name("Translate"), + ::anno::description("Offsets the position of the material."), + ::anno::in_group("Transform") + ]], + uniform float texture_rotate = 0.f [[ + ::anno::description("Rotates the material."), + ::anno::display_name("Rotate"), + ::anno::in_group("Transform") + ]], + uniform float2 texture_scale = 1.0f [[ + ::anno::description("Scales the material."), + ::anno::display_name("Scale"), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::anno::in_group("Transform") + ]], + + + +// Round Corners + uniform bool enable_round_corners = false [[ + ::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."), + ::anno::display_name("Round Corners"), + ::anno::in_group("Round Corners") + ]], + uniform float radius_mm = 0.f [[ + ::anno::description("Radius of the rounded corners."), + ::anno::display_name("Corner Radius"), + ::anno::in_group("Round Corners") + ]], + uniform bool across_materials = true [[ + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::display_name("Across Materials"), + ::anno::in_group("Round Corners") + ]], + +// Advanced + uniform int uv_space_index = 0 [[ + ::anno::description("Uses selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced") + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Nickel Scratched"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "nickel", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "gray", "neutral")), + ::anno::thumbnail("./.thumbs/Nickel_Scratched.Nickel_Scratched.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = + let { + float brush_scratches_weight = 0.5f; + // Nickel Reflection Color + color reflection_color = color(0.696691094703f, 0.640529134605f, 0.563260231405f); // Nickel + float radius = radius_mm * 0.001; + bool tmp0 = false; + material_surface tmp1( + ::df::weighted_layer(::math::pow(1.f - float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.455000013f, 0.50999999f, 0.73299998f), 8.f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.537f) * (histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.455000013f, 0.50999999f, 0.73299998f), 8.f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], dirt_transition_softness, ::math::lerp(0.782999992f, 0.305999994f, dirt_amount)) * 0.899999976f), ::df::diffuse_reflection_bsdf(color(0.0116450004f, 0.00893499982f, 0.00379400002f), 0.f, ""), ::df::color_custom_curve_layer(reflection_color, color(1.f, 1.f, 1.f), 5.f, color(::math::clamp(::math::lerp(0.f, ::math::max(float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.52000022f, float3(0.109999999f, 0.105999999f, 0.184f), 3.52000022f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), color(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], float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.52000022f, float3(0.109999999f, 0.105999999f, 0.184f), 3.52000022f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), color(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_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.455000013f, 0.50999999f, 0.73299998f), 8.f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.666000009f, ::math::lerp(0.159999996f, 0.600000024f, scratches_variation))) + histogram_range(::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.455000013f, 0.50999999f, 0.73299998f), 8.f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 2.20000005f), brightness_variation, ::math::lerp(0.173000008f, 0.850000024f, brightness)), 0.f, 1.f)), ::df::microfacet_ggx_smith_bsdf((::math::lerp(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.455000013f, 0.50999999f, 0.73299998f), 8.f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], roughness_variation, ::math::lerp(0.f, 0.588999987f, roughness_metal_surface)), roughness_scratches, ::math::lerp(0.f, ::math::max(brush_scratches_weight * float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.52000022f, float3(0.109999999f, 0.105999999f, 0.184f), 3.52000022f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), color(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::max(float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.52000022f, float3(0.109999999f, 0.105999999f, 0.184f), 3.52000022f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), color(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], float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.52000022f, float3(0.109999999f, 0.105999999f, 0.184f), 3.52000022f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), color(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_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.455000013f, 0.50999999f, 0.73299998f), 8.f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.666000009f, ::math::lerp(0.159999996f, 0.600000024f, scratches_variation)))) + histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.455000013f, 0.50999999f, 0.73299998f), 8.f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], dirt_transition_softness, ::math::lerp(0.782999992f, 0.305999994f, dirt_amount)) * 0.400000006f) * (::math::lerp(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.455000013f, 0.50999999f, 0.73299998f), 8.f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], roughness_variation, ::math::lerp(0.f, 0.588999987f, roughness_metal_surface)), roughness_scratches, ::math::lerp(0.f, ::math::max(brush_scratches_weight * float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.52000022f, float3(0.109999999f, 0.105999999f, 0.184f), 3.52000022f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), color(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::max(float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.52000022f, float3(0.109999999f, 0.105999999f, 0.184f), 3.52000022f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), color(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], float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.52000022f, float3(0.109999999f, 0.105999999f, 0.184f), 3.52000022f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), color(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_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.455000013f, 0.50999999f, 0.73299998f), 8.f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.666000009f, ::math::lerp(0.159999996f, 0.600000024f, scratches_variation)))) + histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.455000013f, 0.50999999f, 0.73299998f), 8.f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], dirt_transition_softness, ::math::lerp(0.782999992f, 0.305999994f, dirt_amount)) * 0.400000006f), (::math::lerp(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.455000013f, 0.50999999f, 0.73299998f), 8.f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], roughness_variation, ::math::lerp(0.f, 0.588999987f, roughness_metal_surface)), roughness_scratches, ::math::lerp(0.f, ::math::max(brush_scratches_weight * float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.52000022f, float3(0.109999999f, 0.105999999f, 0.184f), 3.52000022f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), color(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::max(float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.52000022f, float3(0.109999999f, 0.105999999f, 0.184f), 3.52000022f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), color(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], float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.52000022f, float3(0.109999999f, 0.105999999f, 0.184f), 3.52000022f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), color(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_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.455000013f, 0.50999999f, 0.73299998f), 8.f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.666000009f, ::math::lerp(0.159999996f, 0.600000024f, scratches_variation)))) + histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.455000013f, 0.50999999f, 0.73299998f), 8.f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], dirt_transition_softness, ::math::lerp(0.782999992f, 0.305999994f, dirt_amount)) * 0.400000006f) * (::math::lerp(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.455000013f, 0.50999999f, 0.73299998f), 8.f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], roughness_variation, ::math::lerp(0.f, 0.588999987f, roughness_metal_surface)), roughness_scratches, ::math::lerp(0.f, ::math::max(brush_scratches_weight * float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.52000022f, float3(0.109999999f, 0.105999999f, 0.184f), 3.52000022f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), color(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::max(float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.52000022f, float3(0.109999999f, 0.105999999f, 0.184f), 3.52000022f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), color(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], float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.52000022f, float3(0.109999999f, 0.105999999f, 0.184f), 3.52000022f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), color(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_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.455000013f, 0.50999999f, 0.73299998f), 8.f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.666000009f, ::math::lerp(0.159999996f, 0.600000024f, scratches_variation)))) + histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.455000013f, 0.50999999f, 0.73299998f), 8.f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], dirt_transition_softness, ::math::lerp(0.782999992f, 0.305999994f, dirt_amount)) * 0.400000006f), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), bsdf(), add_detail_normal(::math::lerp(::state::normal(), infinite_tiling ? endless_normal(texture_2d("./metal_scratched_scratch_norm.jpg", ::tex::gamma_linear), scratches_bump_factor, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.52000022f, float3(0.497999996f, 0.497999996f, 0.991999984f), 3.52000022f) : ::base::tangent_space_normal_texture(texture_2d("./metal_scratched_scratch_norm.jpg", ::tex::gamma_linear), scratches_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(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.455000013f, 0.50999999f, 0.73299998f), 8.f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.666000009f, ::math::lerp(0.159999996f, 0.600000024f, scratches_variation))), infinite_tiling ? endless_normal(texture_2d("./metal_scratched_scratch_norm.jpg", ::tex::gamma_linear), bump_factor, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.52000022f, float3(0.497999996f, 0.497999996f, 0.995999992f), 3.52000022f) : ::base::tangent_space_normal_texture(texture_2d("./metal_scratched_scratch_norm.jpg", ::tex::gamma_linear), 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))), add_detail_normal(::math::lerp(::state::normal(), infinite_tiling ? endless_normal(texture_2d("./metal_scratched_scratch_norm.jpg", ::tex::gamma_linear), scratches_bump_factor, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.52000022f, float3(0.497999996f, 0.497999996f, 0.991999984f), 3.52000022f) : ::base::tangent_space_normal_texture(texture_2d("./metal_scratched_scratch_norm.jpg", ::tex::gamma_linear), scratches_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(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.455000013f, 0.50999999f, 0.73299998f), 8.f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.666000009f, ::math::lerp(0.159999996f, 0.600000024f, scratches_variation))), infinite_tiling ? endless_normal(texture_2d("./metal_scratched_scratch_norm.jpg", ::tex::gamma_linear), bump_factor, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.52000022f, float3(0.497999996f, 0.497999996f, 0.995999992f), 3.52000022f) : ::base::tangent_space_normal_texture(texture_2d("./metal_scratched_scratch_norm.jpg", ::tex::gamma_linear), 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))), + material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + 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)); + material_geometry tmp5( + float3(0.f), + 1.f, + enable_round_corners ? ::state::rounded_corner_normal(radius, across_materials, 1.f) : ::state::normal()); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + +export material Nickel_Scratched_Light_Bumpy(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Nickel Scratched - Bright and Bumped"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "nickel", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "gray", "neutral", "shiny")), + ::anno::thumbnail("./.thumbs/Nickel_Scratched.Nickel_Scratched_Light_Bumpy.png"), + ::anno::copyright_notice(COPYRIGHT) +]]= Nickel_Scratched( + infinite_tiling: true, + roughness_metal_surface: 1.0f, + roughness_variation: 0.21f, + brightness: 0.75f, + brightness_variation: 0.3f, + bump_factor: 1.0f, + roughness_scratches: 0.145f, + scratches_variation: 0.3f, + scratches_bump_factor: 0.25f, + dirt_transition_softness: 0.85f, + dirt_amount: 0.05f, + texture_translate: 1.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); + + + +export material Nickel_Scratched_Dark_Shiny(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Nickel Scratched - Dark Shiny"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "nickel", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "gray", "neutral", "shiny", "dark")), + ::anno::thumbnail("./.thumbs/Nickel_Scratched.Nickel_Scratched_Dark_Shiny.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Nickel_Scratched( + infinite_tiling: true, + roughness_metal_surface: 0.28f, + roughness_variation: 0.517f, + brightness: 0.35f, + brightness_variation: 0.43f, + bump_factor: 0.26f, + roughness_scratches: 0.21f, + scratches_variation: 0.76f, + scratches_bump_factor: 0.23f, + dirt_transition_softness: 0.98f, + dirt_amount: 0.06f, + texture_translate: 1.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); + + +export material Nickel_Scratched_Dark_Matte(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Nickel Scratched - Dark Matte"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "nickel", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "gray", "neutral", "matte", "dark")), + ::anno::thumbnail("./.thumbs/Nickel_Scratched.Nickel_Scratched_Dark_Matte.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Nickel_Scratched( + infinite_tiling: true, + roughness_metal_surface: 1.0f, + roughness_variation: 0.21f, + brightness: 0.023f, + brightness_variation: 0.119f, + bump_factor: 0.521f, + roughness_scratches: 0.28f, + scratches_variation: 0.86f, + scratches_bump_factor: 1.0f, + dirt_transition_softness: 0.85f, + dirt_amount: 0.057f, + texture_translate: 1.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); + + + + +export material Nickel_Scratched_Scuffs_and_Grime(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Nickel Scratched - Scuffs and Grime"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "nickel", "scratched", "worn", "dirty", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "gray", "neutral", "matte", "dark")), + ::anno::thumbnail("./.thumbs/Nickel_Scratched.Nickel_Scratched_Scuffs_and_Grime.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Nickel_Scratched( + infinite_tiling: true, + roughness_metal_surface: 0.756f, + roughness_variation: 0.208f, + brightness: 0.948f, + brightness_variation: 0.119f, + bump_factor: 1.848f, + roughness_scratches: 0.099f, + scratches_variation: 0.075f, + scratches_bump_factor: 0.903f, + dirt_transition_softness: 0.85f, + dirt_amount: 1.0f, + texture_translate: 1.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); + + + + +export material Nickel_Scratched_Dirty_Rough(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Nickel Scratched - Dirty Rough"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "nickel", "scratched", "worn", "dirt", "dirty", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "gray", "neutral", "matte", "dark")), + ::anno::thumbnail("./.thumbs/Nickel_Scratched.Nickel_Scratched_Dirty_Rough.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Nickel_Scratched( + infinite_tiling: true, + roughness_metal_surface: 1.0f, + roughness_variation: 0.208f, + brightness: 0.8f, + brightness_variation: 0.838f, + bump_factor: 1.914f, + roughness_scratches: 0.35f, + scratches_variation: 0.0f, + scratches_bump_factor: 0.903f, + dirt_transition_softness: 0.901f, + dirt_amount: 0.581f, + texture_translate: 1.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); diff --git a/Material/material_0453/Nickel_Sheet.mdl b/Material/material_0453/Nickel_Sheet.mdl new file mode 100644 index 0000000000000000000000000000000000000000..73a075e4fd0e03842ead0b846e7ef24a676ac3d5 --- /dev/null +++ b/Material/material_0453/Nickel_Sheet.mdl @@ -0,0 +1,1344 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + + +mdl 1.5; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + +const string DESCRIPTION = "A sheet metal material with adjustable imperfections."; +const string DESCRIPTION_PUNCH = "Punched nickel sheet metal material with adjustable imperfections and punchings."; + +float4 tile_select(uniform int select = 0) +{ + switch (select) + { + case 0: return float4(0.000, 0.333, 0.666, 1.000); + case 1: return float4(0.333, 0.666, 0.666, 1.000); + case 2: return float4(0.666, 1.000, 0.666, 1.000); + + case 3: return float4(0.000, 0.333, 0.333, 0.666); + case 4: return float4(0.333, 0.666, 0.333, 0.666); + case 5: return float4(0.666, 1.000, 0.333, 0.666); + + case 6: return float4(0.000, 0.333, 0.000, 0.333); + case 7: return float4(0.333, 0.666, 0.000, 0.333); + case 8: return float4(0.666, 1.000, 0.000, 0.333); + + default: return float4(0.000, 0.333, 0.000, 0.333); + } +} + +export struct vm_coordinates +[[ + ::anno::hidden() +]] +{ + float2 uv; + float rotation; + int uv_space_index; + float4 carry; +}; + +enum vm_mono_select +[[ + anno::description("Modes for the creation of a gray-scale value from a color"), + anno::hidden() +]] +{ + mono_r = 0, + mono_g = 1, + mono_b = 2, + mono_a = 3, + mono_average = 4 +}; + +vm_coordinates vm_coord +( + float2 translation = float2(0.0f, 0.0) [[ + ::anno::display_name("Translation"), + ::anno::description("Translates the coordinates.") + ]], + float rotation = 0.0f [[ + ::anno::display_name("Rotation"), + ::anno::description("Rotates the coordinates in degrees.") + ]], + float2 scaling = float2(1.0f, 1.0f) [[ + ::anno::display_name("Scaling"), + ::anno::description("Scales the coordinates.") + ]], + uniform int uv_space = 0 [[ + ::anno::display_name("UV Space"), + ::anno::description("Chose the UV space.") + ]] +) +[[ + ::anno::display_name("vm Transform"), + ::anno::description("Generates coordinates to be used in vm_lookup functions.") +]] +{ + vm_coordinates uv; + ::base::texture_coordinate_info info = ::base::coordinate_source( ::base::texture_coordinate_uvw, uv_space); + uv.rotation = (rotation * 3.1415926535897932384626433832f) / 180.f; + uv.uv = float2(info.position.x, info.position.y); + float sine = ::math::sin(uv.rotation); + float cosine = ::math::cos(uv.rotation); + float2x2 rot = float2x2(cosine, -sine, sine, cosine); + uv.uv = rot * uv.uv; + uv.uv /= scaling; + uv.uv += translation; + return uv; +} + + +vm_coordinates vm_coord_hex( + vm_coordinates uv, + float scale = 1.0f) +{ + vm_coordinates uv_return; + float2 uv_ = float2(uv.uv.x, uv.uv.y); + + // same as from function get_hex above + float2 s = float2(1.0f, 1.7320508f); + float2 n = uv_ - float2(0.5f, 1.0f); + float4 c = ::math::floor(float4(uv_.x, uv_.y, n.x, n.y)/float4(s.x, s.y, s.x, s.y)) + 0.5f; + float2 h_1 = uv_ - float2(c.x, c.y) * s; + float2 h_2 = uv_ - (float2(c.z, c.w) + 0.5f) * s; + 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); + + uv_return.uv = float2(uv_id.x*scale+0.5, uv_id.y*scale+0.5); + // unless we introduce random cell rotations where we need to compensate for this in the rotation + // we can just plain copy the rotation value + uv_return.rotation = uv.rotation; + return uv_return; +} + +// Offsets a set of uv coordinates in either row (u) or column (v) direction +vm_coordinates vm_coord_rowcol_offset( + vm_coordinates uv, + float offset, + bool horizontal_offset = true +) +{ + int index = horizontal_offset ? 0 : 1; + uv.uv[index] += ::math::floor(uv.uv[index ^ 1]) * offset; + return uv; +} + +vm_coordinates vm_coord_grid( + vm_coordinates uv, + float scale = 1.0f +) +{ + float2x2 scal = float2x2(scale, 0., 0., scale); + uv.uv = ::math::frac(uv.uv); + uv.uv -= 0.5f; + uv.uv = scal * uv.uv; + uv.uv = uv.uv + 0.5f; + return uv; +} + +::base::texture_return vm_tex_lookup( + uniform texture_2d tex, + vm_coordinates uv = vm_coord(), + uniform vm_mono_select mono_source = mono_a, + float4 scale = float4(1.0f), + + uniform ::tex::wrap_mode wrap_u = ::tex::wrap_repeat, + uniform ::tex::wrap_mode wrap_v = ::tex::wrap_repeat, + uniform float2 crop_u = float2(0.0, 1.0), + uniform float2 crop_v = float2(0.0, 1.0) +) +{ + float mono; + float4 lookup = ::tex::lookup_float4(tex, uv.uv, wrap_u, wrap_v, crop_u, crop_v) * scale; + switch( mono_source ) { + case mono_r: mono = lookup.x; + break; + case mono_g: mono = lookup.y; + break; + case mono_b: mono = lookup.z; + break; + case mono_a: mono = lookup.w; + break; + case mono_average: mono = ::math::average(float3(lookup.x, lookup.y, lookup.z)); + break; + } + return ::base::texture_return(color(lookup.x, lookup.y, lookup.z), mono); +} + +// *** SET CUTOUT ENUM NAMES *** +export enum cutout_pattern +[[ + ::anno::description("Cutout Pattern."), + ::anno::hidden() +]] +{ + pattern_circle = 0 + [[ ::anno::display_name("Circle")]], + pattern_hexagon = 1 + [[ ::anno::display_name("Hexagon")]], + pattern_line = 2 + [[ ::anno::display_name("Line") ]], + + pattern_square = 3 + [[ ::anno::display_name("Square")]], + pattern_rectangle = 4 + [[ ::anno::display_name("Rectangle")]], + pattern_cross = 5 + [[ ::anno::display_name("Cross")]], + + pattern_rhombus = 6 + [[ ::anno::display_name("Rhombus")]], + pattern_triangle = 7 + [[ ::anno::display_name("Triangle")]], + pattern_star = 8 + [[ ::anno::display_name("Star")]] +}; + +float remap_xy_to_0_1(float input, float x, float y) +{ + return (input - x)/(y - x); +} + +float histogram_scan_big(float input, float width, float position) +{ + return ::math::clamp( + remap_xy_to_0_1(input, + ::math::lerp(-width, 1.0, position), + ::math::lerp(0.0, 1.0 + width, position)), + 0.0, + 1.0); +} + + +::base::texture_coordinate_info vmat_transform( + uniform float2 translation = float2(0.0, 0.0), + uniform float rotation = 0.0, + uniform float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation_rad); + float c = ::math::cos(rotation_rad); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float2 rnd22(int2 p) { + float2 ret_val = float2( + uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f, + uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f + ); + return ret_val; +} + +float3 srgb2rgb(float3 val) +{ + return ::math::pow(::math::max(val, float3(0.0f)), 2.2); +} + +float2x2 invert_2x2(float2x2 M) +{ + float det = M[0][0]*M[1][1] - M[0][1]*M[1][0]; + //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/ + return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]); +} + +float3 nonrepeat_lookup( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5), + float patch_size = 8.0 +) +{ + + float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale; + float Z = patch_size; // patch scale inside example texture + float CON = 1.0f; + + float3 O = float3(0.f); + float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); + float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space + + float2 U = uv_in; + float2 V = M * uv_in; //pre-tilted hexa coordinates + int2 I = int2(::math::floor(V)); // hexa-tile id + + // The mean color needs to be determined in Photoshop then to make the + // average color work out, take the float value and calculate the apropriate + // mean value as (value^(1/2.2)) + + float3 m = average_color; + + float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; + F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates + + if( F[2] > 0.f ) + + O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON)) + + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON)) + + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON)); + else + O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON)) + + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON)) + + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON)); + O = m + O/::math::length(W); + O = ::math::clamp( (O), 0.0, 1.0); + + return float3(O); +} + +color endless_texture( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 10.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0, + bool gamma_correct_lookup = true +) +{ + return gamma_correct_lookup ? color(srgb2rgb( + nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )) + ) : color(nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )); +} + + +export material Nickel_Sheet( + uniform bool infinite_tiling = false [[ + ::anno::display_name("Infinite Tiling"), + ::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."), + ::anno::in_group("Appearance", "Main") + ]], + float sheet_brightness = 0.5f [[ + ::anno::display_name("Brightness"), + ::anno::description("Controls the brightness of the material."), + ::anno::in_group("Appearance", "Main"), + ::anno::hard_range(0.f, 1.f) + ]], + float roughness = 0.2f [[ + ::anno::display_name("Roughness"), + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::in_group("Appearance", "Main"), + ::anno::hard_range(0.f, 1.f) + ]], + float streaks = 0.0f [[ + ::anno::display_name("Streaks Weight"), + ::anno::description("Adds directional streaks that occur as part of the sheet manufacturing process."), + ::anno::in_group("Appearance", "Main"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float scratch_bump_factor = 0.0f [[ + ::anno::description("Determines the degree of bumpiness."), + ::anno::display_name("Bump Factor Streaks"), + ::anno::in_group("Appearance", "Main"), + ::anno::hard_range(0.f, 1.f) + ]], + float imperfections_amount = 0.6f [[ + ::anno::description("Balances between a perfectly smooth metal and a surface that has various imperfections."), + ::anno::display_name("Imperfections Amount"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float impurities_weight_1 = 0.f [[ + ::anno::display_name("Washed Imperfections Ratio"), + ::anno::description("Cloudy water deposits."), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float impurities_weight_2 = 0.939f [[ + ::anno::display_name("Noisy Imperfections Ratio"), + ::anno::description("Generic spotted noisy imperfections."), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float impurities_weight_3 = 0.0 [[ + ::anno::display_name("Splotchy Imperfection Ratio"), + ::anno::description("Splotchy cloudy imperfections."), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform bool enable_round_corners = false [[ + ::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."), + ::anno::display_name("Enable Round Corners"), + ::anno::in_group("Round Corners") + ]], + uniform float roundcorner_radius = 0.01f [[ + ::anno::description("Radius of the rounded corners."), + ::anno::display_name("Round Corner Radius"), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 0.1f) + ]], + uniform bool across_materials = false [[ + ::anno::display_name("Across Materials"), + ::anno::in_group("Round Corners") + ]], + uniform float2 texture_translate = 0.f [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform") + ]], + uniform float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f) + ]], + uniform float2 texture_scale = 1.0f [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::nvidia::core_definitions::dimension(float2(0.75f, 0.75f)), + ::anno::in_group("Transform") + ]], + uniform int uv_space_index = 0 [[ + ::anno::display_name("UV Space Index"), + ::anno::description("Uses selected UV space for material."), + ::anno::in_group("Transform") + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Nickel - New Clean"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Nickel_Sheet.Nickel_Sheet.png"), + ::anno::key_words(string[]("metal", "sheet", "nickel", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "neutral")) +]] + = + let { + color normal_reflectivity = color(0.696691094703f, 0.640529134605f, 0.563260231405f); // Nickel + color grazing_reflectivity = color(0.99942f, 1.f, 1.f); + + bool tmp0 = false; + material_surface tmp1( + ::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)))), + material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + 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)); + material_geometry tmp5( + float3(0.f), + 1.f, + enable_round_corners ? ::state::rounded_corner_normal(roundcorner_radius, across_materials, 1.f) : ::state::normal()); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + +export material Nickel_Sheet_Punched( + // Cutout parameters + + uniform cutout_pattern shape_select = pattern_circle //select atlas tile here + [[ + ::anno::description("Select a cutout shape."), + ::anno::display_name("Cutout Shape"), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(0) + ]], + float2 punching_grid_size = 1.0f + [[ + ::anno::description("Scales the size of the punching grid."), + ::anno::display_name("Punching Grid Size"), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(1) + ]], + float cutout_size = .92f + [[ + ::anno::description("Scales the size of the cutout pattern independently from the base material."), + ::anno::display_name("Cutout Size"), + ::anno::hard_range(0.f, 1.2f), + ::anno::soft_range(0.f, 1.0f), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(2) + ]], + float cutout_roundness = .4f + [[ + ::anno::description("At low values it makes the cutouts sharper. Higher values give the shapes a more rounded look."), + ::anno::display_name("Cutout Roundness"), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(3) + ]], + float cutout_bevel_width = 0.5f + [[ + ::anno::description("Adjusts the width of the bevel transition."), + ::anno::display_name("Cutout Bevel Width"), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(4) + ]], + float cutout_bump_strength = .8f + [[ + ::anno::description("Sets the strength of the bevelled normal around the cutout."), + ::anno::display_name("Cutout Bevel Strength"), + ::anno::soft_range(0.0f, 1.0f), + ::anno::hard_range(0.0f, 2.0f), + ::anno::in_group("Appearance", "Cutout"), + ::anno::ui_order(5) + ]], +// Grid Layout parameters + bool hexagonal_grid = true + [[ + ::anno::description("When enabled, the punching will occur on a hexagonal grid, otherwise a square grid."), + ::anno::display_name("Enable Hexagonal Grid"), + ::anno::in_group("Appearance", "Cutout Layout"), + ::anno::ui_order(6) + ]], + float square_grid_offset = 0.0f + [[ + ::anno::description("Offsets each row of the grid by a certain amount."), + ::anno::display_name("Square Grid Offset"), + ::anno::in_group("Appearance", "Cutout Layout"), + ::anno::enable_if("hexagonal_grid==false"), + ::anno::ui_order(7) + ]], + bool horizontal_offset = true + [[ + ::anno::description("Choose whether to offset either in row or column direction."), + ::anno::display_name("Horizontal Offset"), + ::anno::in_group("Appearance", "Cutout Layout"), + ::anno::enable_if("hexagonal_grid==false"), + ::anno::ui_order(8) + ]], + + + +// Nickel Sheet parameters + uniform bool infinite_tiling = false [[ + ::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."), + ::anno::display_name("Infinite Tiling"), + ::anno::in_group("Appearance", "Main") + ]], + float sheet_brightness = 0.5f [[ + ::anno::display_name("Brightness"), + ::anno::description("Controls the brightness of the material."), + ::anno::in_group("Appearance", "Main"), + ::anno::hard_range(0.f, 1.f) + ]], + float roughness = 0.2f [[ + ::anno::display_name("Roughness"), + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::in_group("Appearance", "Main"), + ::anno::hard_range(0.f, 1.f) + ]], + float streaks = 0.0f [[ + ::anno::display_name("Streaks Weight"), + ::anno::in_group("Appearance", "Main"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float scratch_bump_factor = 0.0f [[ + ::anno::description("Determines the degree of bumpiness."), + ::anno::display_name("Bump Factor Streaks"), + ::anno::in_group("Appearance", "Main"), + ::anno::hard_range(0.f, 1.f) + ]], + float imperfections_amount = 0.6f [[ + ::anno::description("Balances between a perfectly smooth metal and a surface that has various imperfections."), + ::anno::display_name("Imperfections Amount"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float impurities_weight_1 = 0.f [[ + ::anno::display_name("Washed Imperfections Ratio"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float impurities_weight_2 = 0.939f [[ + ::anno::display_name("Noisy Imperfections Ratio"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float impurities_weight_3 = 0.0 [[ + ::anno::display_name("Splotchy Imperfection Ratio"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float2 texture_translate = 0.f [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform") + ]], + uniform float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f) + ]], + uniform float2 texture_scale = 1.0f [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::nvidia::core_definitions::dimension(float2(0.75f, 0.75f)), + ::anno::in_group("Transform") + ]], + uniform int uv_space_index = 0 [[ + ::anno::display_name("UV Space Index"), + ::anno::description("Uses selected UV space for material."), + ::anno::in_group("Transform") + ]], + uniform bool enable_round_corners = false [[ + ::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."), + ::anno::display_name("Enable Round Corners"), + ::anno::in_group("Round Corners") + ]], + uniform float roundcorner_radius = 0.01f [[ + ::anno::description("Radius of the rounded corners."), + ::anno::display_name("Round Corner Radius"), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 0.1f) + ]], + uniform bool across_materials = false [[ + ::anno::display_name("Across Materials"), + ::anno::in_group("Round Corners") + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Nickel Sheet - Circular Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Nickel_Sheet.Nickel_Sheet_Punched.png"), + ::anno::key_words(string[]("metal", "sheet", "nickel", "decorative", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "circular", "neutral")) +]] = let +{ + material base_mat = Nickel_Sheet( + infinite_tiling: infinite_tiling, + sheet_brightness: sheet_brightness, + roughness: roughness, + streaks: streaks, + scratch_bump_factor: scratch_bump_factor, + imperfections_amount: imperfections_amount, + impurities_weight_1: impurities_weight_1, + impurities_weight_2: impurities_weight_2, + impurities_weight_3: impurities_weight_3, + enable_round_corners: enable_round_corners, + roundcorner_radius: roundcorner_radius, + across_materials: across_materials, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index + ); + texture_2d punching_cutout = texture_2d("./atlas_02_norm_dist.png", ::tex::gamma_linear); + + // remap range of slider to avoid artifacts in the bevelling + float2 punching_scale = texture_scale * 0.01f * punching_grid_size; + float cutout_roundness_ = cutout_roundness*0.6f+0.4f; + float cutout_size_lin = (1.0f/cutout_size); + float cutout_bevel_width_ = 0.1 + cutout_bevel_width * 0.9f; + + vm_coordinates uv = vm_coord( + translation: texture_translate, + rotation: texture_rotate, + scaling: punching_scale, + uv_space: uv_space_index + ); + + vm_coordinates punching_uv = hexagonal_grid ? vm_coord_hex( + uv: uv, + scale: cutout_roundness_ * cutout_size_lin + ) : vm_coord_grid( + uv: vm_coord_rowcol_offset( + uv: uv, + offset: square_grid_offset, + horizontal_offset: horizontal_offset + ), + scale: cutout_roundness_ * cutout_size_lin + ); + // select the correct subtile from the atlas + float4 crop = tile_select(shape_select); + + ::base::texture_return lookup = vm_tex_lookup( + tex: punching_cutout, + uv: punching_uv, + mono_source: mono_a, + scale: float4(1.0f), + crop_u: float2(crop.x, crop.y), + crop_v: float2(crop.z, crop.w), + wrap_u: ::tex::wrap_clamp, + wrap_v: ::tex::wrap_clamp + ); + + float low = (1.0 - cutout_roundness_); + float high = (cutout_size_lin * (cutout_bevel_width_ * 0.2f) * cutout_roundness_) + (1.0 - cutout_roundness_); + // remap x...y to (clamped) 0...1 + float x = ::math::clamp((lookup.mono - low)/(high - low), 0.0, 1.0); + // spherical falloff + float falloff=::math::sqrt(1.0-x*x); + // masking falloff as the center of the cutout is flat + float masked_falloff=falloff<=0.0?1.0:falloff; + + // where base material is still there, use the value of the base material + float cutout= ::math::min(falloff<=0.0?0.0:1.0, base_mat.geometry.cutout_opacity); + + // bring in -.5 ... +.5 range and lerp between lookup and flat normal + float3 remap_norm = ::math::lerp(float3(lookup.tint), float3(0.5, 0.5, 1.0), masked_falloff) - float3(0.5); + float3 t_norm = ::math::normalize(remap_norm * float3(cutout_bump_strength, cutout_bump_strength, 1.0)); + + float3 rotfix_norm = float3(::math::cos(punching_uv.rotation) * t_norm.x - ::math::sin(punching_uv.rotation) * t_norm.y, + ::math::sin(punching_uv.rotation) * t_norm.x + ::math::cos(punching_uv.rotation) * t_norm.y, + t_norm.z); + + float3 normal = ::state::texture_tangent_u(punching_uv.uv_space_index) * rotfix_norm.x + + ::state::texture_tangent_v(punching_uv.uv_space_index) * rotfix_norm.y + + ::state::normal() * rotfix_norm.z; + + float3 final_normal = ::base::blend_normals( + base_normal: normal, + base_normal_weight: 1.0f, + detail_normal: base_mat.geometry.normal, + detail_normal_weight: 1.0f + ); + +} in material( + surface: material_surface( + scattering: base_mat.surface.scattering + ), + volume: base_mat.volume, + ior: base_mat.ior, + thin_walled: true, + geometry: material_geometry( + displacement: base_mat.geometry.displacement, + normal: final_normal, + cutout_opacity: cutout + ) +); + + + +// ---------------- Nickel Sheet Material Presets ---------------- +export material Nickel_Sheet_Soft_Splotches(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Nickel - Soft Splotches"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Nickel_Sheet.Nickel_Sheet_Soft_Splotches.png"), + ::anno::key_words(string[]("metal", "sheet", "nickel", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "neutral", "gray")) +]] += Nickel_Sheet( + infinite_tiling: false, + sheet_brightness: 0.5f, + roughness: 0.3f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.75f, + impurities_weight_1: 0.75f, + impurities_weight_2: 0.01f, + impurities_weight_3: 0.98f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0 +); + + + + +export material Nickel_Sheet_Matte_Imperfections(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Nickel - Matte Imperfections"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Nickel_Sheet.Nickel_Sheet_Matte_Imperfections.png"), + ::anno::key_words(string[]("metal", "sheet", "nickel", "imperfections", "new", "matte", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "neutral")) +]]= Nickel_Sheet( + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.75f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.265f, + impurities_weight_1: 0.75f, + impurities_weight_2: 0.43f, + impurities_weight_3: 0.0f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0 +); + + + + +export material Nickel_Sheet_Glossy_Imperfections(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Nickel - Glossy Imperfections"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Nickel_Sheet.Nickel_Sheet_Glossy_Imperfections.png"), + ::anno::key_words(string[]("metal", "sheet", "nickel", "imperfections", "new", "glossy", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "neutral")) +]] += Nickel_Sheet( + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.3f, + streaks: 0.1f, + scratch_bump_factor: 0.15f, + imperfections_amount: 0.1f, + impurities_weight_1: 0.75f, + impurities_weight_2: 0.89f, + impurities_weight_3: 0.86f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0 +); + + + + +export material Nickel_Sheet_Splotchy_Streaks(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Nickel - Splotchy Streaks"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Nickel_Sheet.Nickel_Sheet_Splotchy_Streaks.png"), + ::anno::key_words(string[]("metal", "sheet", "nickel", "imperfections", "new", "glossy", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "neutral")) +]]= Nickel_Sheet( + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.6f, + streaks: 0.1f, + scratch_bump_factor: 0.2f, + imperfections_amount: 0.26f, + impurities_weight_1: 1.0f, + impurities_weight_2: 0.76f, + impurities_weight_3: 0.13f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0 +); + +export material Nickel_Sheet_Glossy_Streaks(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Nickel - Glossy Streaks"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Nickel_Sheet.Nickel_Sheet_Glossy_Streaks.png"), + ::anno::key_words(string[]("metal", "sheet", "nickel", "imperfections", "new", "glossy", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "neutral")) +]] += Nickel_Sheet( + infinite_tiling: false, + sheet_brightness: 0.65f, + roughness: 0.25f, + streaks: 0.8f, + scratch_bump_factor: 0.88f, + imperfections_amount: 0.86f, + impurities_weight_1: 1.0f, + impurities_weight_2: 0.75f, + impurities_weight_3: 0.125f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0 +); + +// ---------------- Punched Nickel Sheet Material Presets ---------------- + +export material Nickel_Sheet_Punched_Small_Circular(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Nickel Sheet - Small Circular Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Nickel_Sheet.Nickel_Sheet_Punched_Small_Circular.png"), + ::anno::key_words(string[]("metal", "sheet", "nickel", "decorative", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "circular", "neutral")) +]] += Nickel_Sheet_Punched( + // Punching Parameters + shape_select: pattern_circle, + punching_grid_size: 1.0f, + cutout_size: 0.5f, + cutout_roundness: 0.4f, + cutout_bevel_width: 0.5f, + cutout_bump_strength: 0.8f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + horizontal_offset: true, + + //Nickel Sheet Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.4f, + streaks: 0.1f, + scratch_bump_factor: 0.2f, + imperfections_amount: 0.26f, + impurities_weight_1: 1.0f, + impurities_weight_2: 0.76f, + impurities_weight_3: 0.13f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0 +); + + +export material Nickel_Sheet_Punched_Hexagonal(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Nickel Sheet - Hexagonal Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Nickel_Sheet.Nickel_Sheet_Punched_Hexagonal.png"), + ::anno::key_words(string[]("metal", "sheet", "nickel", "decorative", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "hexagonal", "neutral")) +]] += Nickel_Sheet_Punched( + // Punching Parameters + shape_select: pattern_hexagon, + punching_grid_size: 1.5f, + cutout_size: .95f, + cutout_roundness: 0.4f, + cutout_bevel_width: 0.5f, + cutout_bump_strength: 1.5f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + horizontal_offset: true, + + //Nickel Sheet Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.4f, + streaks: 0.1f, + scratch_bump_factor: 0.2f, + imperfections_amount: 0.26f, + impurities_weight_1: 1.0f, + impurities_weight_2: 0.76f, + impurities_weight_3: 0.13f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0 +); + + +export material Nickel_Sheet_Punched_Hexagonal_Small(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Nickel Sheet - Small Hexagonal Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Nickel_Sheet.Nickel_Sheet_Punched_Hexagonal_Small.png"), + ::anno::key_words(string[]("metal", "sheet", "nickel", "decorative", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "hexagonal", "neutral")) +]] += Nickel_Sheet_Punched( + // Punching Parameters + shape_select: pattern_hexagon, + punching_grid_size: float2(.75f), + cutout_size: .58f, + cutout_roundness: 0.4f, + cutout_bevel_width: 0.3f, + cutout_bump_strength: 1.5f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + horizontal_offset: true, + + //Nickel Sheet Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.4f, + streaks: 0.1f, + scratch_bump_factor: 0.2f, + imperfections_amount: 0.26f, + impurities_weight_1: 1.0f, + impurities_weight_2: 0.76f, + impurities_weight_3: 0.13f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0 +); + + +export material Nickel_Sheet_Punched_Square(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Nickel Sheet - Square Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Nickel_Sheet.Nickel_Sheet_Punched_Square.png"), + ::anno::key_words(string[]("metal", "sheet", "nickel", "decorative", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "square", "neutral")) +]] += Nickel_Sheet_Punched( + // Punching Parameters + shape_select: pattern_square, + punching_grid_size: 1.2f, + cutout_size: 0.56f, + cutout_roundness: 0.1f, + cutout_bevel_width: 0.5f, + cutout_bump_strength: 1.5f, + hexagonal_grid: false, + square_grid_offset: 0.5f, + horizontal_offset: true, + + //Nickel Sheet Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.4f, + streaks: 0.1f, + scratch_bump_factor: 0.2f, + imperfections_amount: 0.26f, + impurities_weight_1: 1.0f, + impurities_weight_2: 0.76f, + impurities_weight_3: 0.13f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0 +); + + +export material Nickel_Sheet_Punched_Line(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Nickel Sheet - Line Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Nickel_Sheet.Nickel_Sheet_Punched_Line.png"), + ::anno::key_words(string[]("metal", "sheet", "nickel", "decorative", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "line", "neutral")) +]] += Nickel_Sheet_Punched( + // Punching Parameters + shape_select: pattern_line, + punching_grid_size: 1.3f, + cutout_size: 0.59f, + cutout_roundness: 0.4f, + cutout_bevel_width: 0.3f, + cutout_bump_strength: 1.5f, + hexagonal_grid: false, + square_grid_offset: 0.3333f, + horizontal_offset: true, + + //Nickel Sheet Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.4f, + streaks: 0.1f, + scratch_bump_factor: 0.2f, + imperfections_amount: 0.26f, + impurities_weight_1: 1.0f, + impurities_weight_2: 0.76f, + impurities_weight_3: 0.13f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0 +); + + +export material Nickel_Sheet_Punched_Cross(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Nickel Sheet - Cross Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Nickel_Sheet.Nickel_Sheet_Punched_Cross.png"), + ::anno::key_words(string[]("metal", "sheet", "nickel", "decorative", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "cross", "neutral")) +]] += Nickel_Sheet_Punched( + // Punching Parameters + shape_select: pattern_cross, + punching_grid_size: 2.0f, + cutout_size: 0.59f, + cutout_roundness: 0.1f, + cutout_bevel_width: 0.44f, + cutout_bump_strength: 1.5f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + horizontal_offset: true, + + //Nickel Sheet Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.4f, + streaks: 0.1f, + scratch_bump_factor: 0.2f, + imperfections_amount: 0.26f, + impurities_weight_1: 1.0f, + impurities_weight_2: 0.76f, + impurities_weight_3: 0.13f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0 +); + + + +export material Nickel_Sheet_Punched_Rhombus(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Nickel Sheet - Rhombus Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Nickel_Sheet.Nickel_Sheet_Punched_Rhombus.png"), + ::anno::key_words(string[]("metal", "sheet", "nickel", "decorative", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "rhombus", "neutral")) +]] += Nickel_Sheet_Punched( + // Punching Parameters + shape_select: pattern_rhombus, + punching_grid_size: 1.4f, + cutout_size: 1.0f, + cutout_roundness: 0.8f, + cutout_bevel_width: 0.5f, + cutout_bump_strength: 1.5f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + horizontal_offset: true, + + //Nickel Sheet Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.4f, + streaks: 0.1f, + scratch_bump_factor: 0.2f, + imperfections_amount: 0.26f, + impurities_weight_1: 1.0f, + impurities_weight_2: 0.76f, + impurities_weight_3: 0.13f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0 +); + + +export material Nickel_Sheet_Punched_Triangle(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Nickel Sheet - Triangle Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Nickel_Sheet.Nickel_Sheet_Punched_Triangle.png"), + ::anno::key_words(string[]("metal", "sheet", "nickel", "decorative", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "triangle", "neutral")) +]] += Nickel_Sheet_Punched( + // Punching Parameters + shape_select: pattern_triangle, + punching_grid_size: 1.3f, + cutout_size: 1.08f, + cutout_roundness: 1.0f, + cutout_bevel_width: 1.0f, + cutout_bump_strength: 1.5f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + horizontal_offset: true, + + //Nickel Sheet Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.4f, + streaks: 0.1f, + scratch_bump_factor: 0.2f, + imperfections_amount: 0.26f, + impurities_weight_1: 1.0f, + impurities_weight_2: 0.76f, + impurities_weight_3: 0.13f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0 +); + + +export material Nickel_Sheet_Punched_Star(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Rüdiger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Nickel Sheet - Star Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Nickel_Sheet.Nickel_Sheet_Punched_Star.png"), + ::anno::key_words(string[]("metal", "sheet", "nickel", "decorative", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "star", "neutral")) +]] += Nickel_Sheet_Punched( + // Punching Parameters + shape_select: pattern_star, + punching_grid_size: 1.5f, + cutout_size: 0.68f, + cutout_roundness: 0.5f, + cutout_bevel_width: 0.44f, + cutout_bump_strength: 1.5f, + hexagonal_grid: true, + square_grid_offset: 0.0f, + horizontal_offset: true, + + //Nickel Sheet Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.4f, + streaks: 0.1f, + scratch_bump_factor: 0.2f, + imperfections_amount: 0.26f, + impurities_weight_1: 1.0f, + impurities_weight_2: 0.76f, + impurities_weight_3: 0.13f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0 +); \ No newline at end of file diff --git a/Material/material_0479/Steel_Painted.mdl b/Material/material_0479/Steel_Painted.mdl new file mode 100644 index 0000000000000000000000000000000000000000..70f5e0b54a930121d79867b2db7e8bb83cf8daa6 --- /dev/null +++ b/Material/material_0479/Steel_Painted.mdl @@ -0,0 +1,1177 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. * + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + +mdl 1.7; + +import ::state::*; +import ::anno::*; +import ::base::*; +import ::df::*; +import ::math::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + +const string DESCRIPTION = "A painted steel material with dirt and weathering effects as well as optional damages and paint artifacts."; + + +float remap_xy_to_0_1(float input, float x, float y) +{ + return (input - x)/(y - x); +} + +struct vm_coordinates{ + float2 uv; // UV coordinates stored as a simple float2 + float rotation; // The rotation is stored in radiands (not degress), to convert use ((rotation* 3.1415926535897932384626433832f) / 180.f) + int uv_space_index; // The UV space Index from which the UV data came from + float4 carry; // may carry additional data, such as random IDs +}; + +enum vm_mono_select +[[ + anno::description("Modes for the creation of a gray-scale value from a color."), + anno::hidden() +]] +{ + mono_r = 0, + mono_g = 1, + mono_b = 2, + mono_a = 3, + mono_average = 4 +}; + +vm_coordinates vm_coord +( + float2 translation = float2(0.0f, 0.0) [[ + ::anno::display_name("Translation"), + ::anno::description("Translates the coordinates.") + ]], + float rotation = 0.0f [[ + ::anno::display_name("Rotation"), + ::anno::description("Rotates the coordinates in degrees.") + ]], + float2 scaling = float2(1.0f, 1.0f) [[ + ::anno::display_name("Scaling"), + ::anno::description("Scales the coordinates.") + ]], + uniform int uv_space = 0 [[ + ::anno::display_name("UV Space"), + ::anno::description("Chose the UV space.") + ]] +) +[[ + ::anno::display_name("vm Transform"), + ::anno::description("Generates coordinates to be used in vm_lookup functions.") +]] +{ + vm_coordinates uv; + ::base::texture_coordinate_info info = ::base::coordinate_source( ::base::texture_coordinate_uvw, uv_space); + uv.rotation = (rotation * 3.1415926535897932384626433832f) / 180.f; + uv.uv = float2(info.position.x, info.position.y); + float sine = ::math::sin(uv.rotation); + float cosine = ::math::cos(uv.rotation); + float2x2 rot = float2x2(cosine, -sine, sine, cosine); + uv.uv = rot * uv.uv; + uv.uv /= scaling; + uv.uv += translation; + // Translation before or after rotation? + return uv; +} + +vm_coordinates vm_coord_post_scale( + vm_coordinates uv = vm_coord(), + float2 scale = 1.0f +) +{ + uv.uv /= scale; + return uv; +} + +::base::texture_return vm_tex_lookup( + uniform texture_2d tex, + vm_coordinates uv = vm_coord(), + uniform vm_mono_select mono_source = mono_a, + float4 scale = float4(1.0f)) +{ + float mono; + float4 lookup = ::tex::lookup_float4(tex, uv.uv, ::tex::wrap_repeat, ::tex::wrap_repeat) * scale; + switch( mono_source ) { + case mono_r: mono = lookup.x; + break; + case mono_g: mono = lookup.y; + break; + case mono_b: mono = lookup.z; + break; + case mono_a: mono = lookup.w; + break; + case mono_average: mono = ::math::average(float3(lookup.x, lookup.y, lookup.z)); + break; + } + return ::base::texture_return(color(lookup.x, lookup.y, lookup.z), mono); +} + +float3 vm_tex_normal_lookup( + uniform texture_2d tex, + vm_coordinates uv = vm_coord(), + float strength = 1.0f +) +{ + float rot = uv.rotation; + // Lookup and convert normal texture to -1 ... 1 range + float3 norm = (::tex::lookup_float3(tex, uv.uv, ::tex::wrap_repeat, ::tex::wrap_repeat) - float3(.5f)) * 2.0f; + norm = ::math::normalize(norm * float3(strength, strength, 1.0)); + // if any rotation happened prior to the lookup, compensate for it + norm = float3(::math::cos(rot) * norm.x - ::math::sin(rot) * norm.y, + ::math::sin(rot) * norm.x + ::math::cos(rot) * norm.y, + norm.z); + return norm.x * ::state::texture_tangent_u(uv.uv_space_index) + + norm.y * ::state::texture_tangent_v(uv.uv_space_index) + + norm.z * ::state::normal(); +} + + + +float3 vm_tex_normal_lookup_2x( + uniform texture_2d tex_a, + uniform texture_2d tex_b, + vm_coordinates uv_a = vm_coord(), + vm_coordinates uv_b = vm_coord(), + float strength_a = 1.0f, + float strength_b = 1.0f, + bool use_coord_a_only = false // when set to 'false, tex_b share coordinates from 'uv_a' +) +{ + float rot_a = uv_a.rotation; + float rot_b = use_coord_a_only ? uv_a.rotation : uv_b.rotation; + uv_b.uv = use_coord_a_only ? uv_a.uv : uv_b.uv; + + // Lookup and convert normal textures a and b to -1 ... 1 range + float3 norm_a = (::tex::lookup_float3(tex_a, uv_a.uv, ::tex::wrap_repeat, ::tex::wrap_repeat) - float3(.5f)) * 2.0f; + norm_a = ::math::normalize(norm_a * float3(strength_a, strength_a, 1.0)); + float3 norm_b = (::tex::lookup_float3(tex_b, uv_b.uv, ::tex::wrap_repeat, ::tex::wrap_repeat) - float3(.5f)) * 2.0f; + norm_b = ::math::normalize(norm_b * float3(strength_b, strength_b, 1.0)); + + // if any rotation happened prior to the lookup, compensate for it + norm_a = float3(::math::cos(rot_a) * norm_a.x - ::math::sin(rot_a) * norm_a.y, + ::math::sin(rot_a) * norm_a.x + ::math::cos(rot_a) * norm_a.y, + norm_a.z); + norm_b = float3(::math::cos(rot_b) * norm_b.x - ::math::sin(rot_b) * norm_b.y, + ::math::sin(rot_b) * norm_b.x + ::math::cos(rot_b) * norm_b.y, + norm_b.z); + + // http://blog.selfshadow.com/publications/blending-in-detail/ + norm_a=norm_a + float3(0.,0.,1.); + norm_b = norm_b * float3(-1.,-1.,1.); + float3 norm = norm_a*math::dot(norm_a, norm_b)/norm_a.z - norm_b; + + return norm.x * ::state::texture_tangent_u(uv_a.uv_space_index) + + norm.y * ::state::texture_tangent_v(uv_a.uv_space_index) + + norm.z * ::state::normal(); +} + +float2x2 invert_2x2(float2x2 M) +{ + float det = M[0][0]*M[1][1] - M[0][1]*M[1][0]; + //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/ + return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]); +} + + +float3 rgb2srgb(float3 val) [[ anno::unused() ]] { + return ::math::pow( ::math::max(val, float3(0.f)), float3(1./2.2) ); +} + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float2 rnd22(int2 p) { + float2 ret_val = float2( + uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f, + uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f + ); + return ret_val; +} + + + + +float3 vm_tex_infinite( + uniform texture_2d tex = texture_2d(), + vm_coordinates uv = vm_coord(), + float3 average_color = float3(0.5f, 0.5f, .5f), + float patch_size = 1.0, + bool gamma_correct = true, + float gamma = 2.2f +) +{ + float2 uv_in = uv.uv; + + float3 O = float3(0.f); + float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); + float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space + + float2 U = uv_in; + float2 V = M * (uv.uv / patch_size); //pre-tilted hexa coordinates + int2 I = int2(::math::floor(V))+int2(935); // hexa-tile id + + // The mean color needs to be determined in Photoshop then to make the + // average color work out, take the float value and calculate the apropriate + // mean value as (value^(1/2.2)) + + float3 m = average_color; + + float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; + F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates + + if( F[2] > 0.f ) + O = (W[0] = F[2]) * (( ::tex::lookup_float3(tex, U-rnd22(I))) - m) + + (W[1] = F[1]) * (( ::tex::lookup_float3(tex, U-rnd22(I+int2(0,1)))) - m) + + (W[2] = F[0]) * (( ::tex::lookup_float3(tex, U-rnd22(I+int2(1,0)))) - m); + else + O = (W[0] = -F[2]) * (( ::tex::lookup_float3(tex, U-rnd22(I+int2(1)))) - m) + + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(tex, U-rnd22(I+int2(1, 0)))) - m) + + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(tex, U-rnd22(I+int2(0, 1)))) - m); + O = m + O/::math::length(W); + O = ::math::clamp( (O), 0.0f, 1.0f); + + return gamma_correct? ::math::pow(::math::max(O, float3(0.0f)), gamma) : float3(O); +} + +float3 vm_tex_infinite_normal( + uniform texture_2d tex = texture_2d(), + vm_coordinates uv = vm_coord(), + float3 average_color = float3(0.5f), + float patch_size = 1.0, + float normal_strength = 1.0 +) +{ + float2 uv_in = uv.uv; + + float3 O = float3(0.f); + float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); + float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space + + float2 U = uv_in; + float2 V = M * (uv.uv / patch_size); //pre-tilted hexa coordinates + int2 I = int2(::math::floor(V))+int2(935); // hexa-tile id + + // The mean color needs to be determined in Photoshop then to make the + // average color work out, take the float value and calculate the apropriate + // mean value as (value^(1/2.2)) + + float3 m = average_color; + + float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; + F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates + + if( F[2] > 0.f ) + O = (W[0] = F[2]) * (( ::tex::lookup_float3(tex, U-rnd22(I))) - m) + + (W[1] = F[1]) * (( ::tex::lookup_float3(tex, U-rnd22(I+int2(0,1)))) - m) + + (W[2] = F[0]) * (( ::tex::lookup_float3(tex, U-rnd22(I+int2(1,0)))) - m); + else + O = (W[0] = -F[2]) * (( ::tex::lookup_float3(tex, U-rnd22(I+int2(1)))) - m) + + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(tex, U-rnd22(I+int2(1, 0)))) - m) + + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(tex, U-rnd22(I+int2(0, 1)))) - m); + O = m + O/::math::length(W); + O = ::math::clamp( (O), 0.0, 1.0); + + float3 norm = (O - float3(.5f)) * 2.0f; + norm = ::math::normalize(norm * float3(normal_strength, normal_strength, 1.0)); + // if any rotation happened prior to the lookup, compensate for it + norm = float3(::math::cos(uv.rotation) * norm.x - ::math::sin(uv.rotation) * norm.y, + ::math::sin(uv.rotation) * norm.x + ::math::cos(uv.rotation) * norm.y, + norm.z); + return norm.x * ::state::texture_tangent_u(uv.uv_space_index) + + norm.y * ::state::texture_tangent_v(uv.uv_space_index) + + norm.z * ::state::normal(); +} + + + +// ----------------------------------------------------------------- + +float screen(float base, float layer, float weight) +{ + return base + (1.0f - base) * layer * weight; +} + +float histogram_scan_big(float input, float width, float position) +{ + return ::math::clamp( + remap_xy_to_0_1(input, + ::math::lerp(-width, 1.0, position), + position * (1.0 + width)), // special case of ::math::lerp(0.0, 1.0 + width, position)), + 0.0, + 1.0); +} + +float histogram_range(float input, float range = 1.0f, float position = 0.5f) +{ + float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); + float high = ::math::clamp(math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); + return ::math::lerp(low, high, input); +} + +// Returns the normal n in tangent space, given n is in internal space. +float3 transform_internal_to_tangent(float3 n) +[[ + anno::hidden() +]] +{ + return + n.x* float3(state::texture_tangent_u(0).x,state::texture_tangent_v(0).x,state::normal().x)+ + n.y* float3(state::texture_tangent_u(0).y,state::texture_tangent_v(0).y,state::normal().y)+ + n.z* float3(state::texture_tangent_u(0).z,state::texture_tangent_v(0).z,state::normal().z); +} + +// Returns the normal n in internal space, given n is in tangent space. +float3 transform_tangent_to_internal(float3 n) +[[ + anno::hidden() +]] +{ + return state::texture_tangent_u(0) * n.x + + state::texture_tangent_v(0) * n.y + + state::normal() * n.z ; +} + + + +// Returns a normal by adding a detail normal to a global normal. +// If detail blending of two normal maps gives visual artifacts, check if texture_2d are loaded +// correctly with tex::gamma_linear +float3 add_detail_normal(float3 nd = state::normal(), float3 n = state::normal()) +{ + // http://blog.selfshadow.com/publications/blending-in-detail/ + float3 n_t = transform_internal_to_tangent(n); + float3 nd_t = transform_internal_to_tangent(nd); + + n_t=n_t + float3(0.,0.,1.); + nd_t = nd_t * float3(-1.,-1.,1.); + n = n_t*math::dot(n_t, nd_t)/n_t.z - nd_t; + return ::math::normalize(transform_tangent_to_internal(n)); +} + +export material Steel_Painted( + uniform bool infinite_tiling = false [[ + ::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."), + ::anno::display_name("Infinite Tiling"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + color paint_color = color(0.491021f, 0.318547f, 0.024158f) [[ + ::anno::description("Choose the color of the paint."), + ::anno::display_name("Paint Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(1) + ]], + float paint_roughness = 0.16f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Paint Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float paint_roughness_variation = 0.1f [[ + ::anno::description("Amount of variation applied to the roughness, higher numbers lead to non-uniform reflections of the material."), + ::anno::display_name("Paint Roughness Variation"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float dirt_weight = 0.04f [[ + ::anno::description("Adjusts the amount of dirty stains on the surface."), + ::anno::display_name("Dirt Weight"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + float wash_weight = 0.0f [[ + ::anno::description("Adjusts the amount of washed dirty stains on the paint."), + ::anno::display_name("Wash Dirt Weight"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 1.f), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(5) + ]], + float paint_stroke_normal_strength = 0.2f [[ + ::anno::description("Specifies the strength of the bump that shows the paint strokes."), + ::anno::display_name("Paint Stroke Normal Strength"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 1.f), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(6) + ]], + float uneven_normal_strength = 0.2f [[ + ::anno::description("Specifies the strength of the bump that shows signs of being aleady overpainted."), + ::anno::display_name("Overpaint Normal Strength"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.f, 1.f), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(7) + ]], + uniform bool enable_rust_damage = false [[ + ::anno::description("Enables the damaged rust spots."), + ::anno::display_name("Enable Rust Damage"), + ::anno::in_group("Appearance", "Damage"), + ::anno::ui_order(8) + ]], + float bare_metal_darkness = 0.65f [[ + ::anno::description("Adjusts the brightness of the bare metal where the paint has peeled away."), + ::anno::display_name("Bare Metal Darkness"), + ::anno::in_group("Appearance", "Damage"), + ::anno::hard_range(0.f, 1.f), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(9) + ]], + float damages_scale = 1.f [[ + ::anno::description("Adjusts the size of the damages."), + ::anno::display_name("Damages Scale"), + ::anno::in_group("Appearance", "Damage"), + ::anno::hard_range(0.f, 1.f), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(10) + ]], + float2 texture_translate = 0.f [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform"), + ::anno::ui_order(11) + ]], + float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f), + ::anno::ui_order(12) + ]], + float2 texture_scale = 1.f [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::anno::ui_order(13) + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Uses selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Transform"), + ::anno::ui_order(14) + ]], + uniform bool roundcorners_enable = false [[ + ::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."), + ::anno::display_name("Enable Round Corners"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(15) + ]], + uniform float roundcorners_radius_mm = 0.5f [[ + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::display_name("Round Corner Radius (mm)"), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f), + ::anno::ui_order(16) + ]], + uniform bool roundcorners_across_materials = false [[ + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::display_name("Across Materials"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(17) + ]]) +[[ + ::anno::display_name("Steel Painted - Yellow New"), + ::anno::author("Nvidia vMaterials"), + ::anno::description(DESCRIPTION), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Steel_Painted.Steel_Painted.png"), + ::anno::key_words(string[]("steel", "metal", "paint", "coated", "construction", "urban", "architecture", "naval", "automotive", "multimaterial", "interior", "exterior", "new", "yellow", "saturated", "warm")) +]] + = + let { + bool tmp0 = false; + material_surface tmp1(::df::weighted_layer(dirt_weight * float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).x, ::df::diffuse_reflection_bsdf(color(0.174647003f, 0.146449998f, 0.0981639996f), 1.f), ::df::weighted_layer(enable_rust_damage ? histogram_scan_big(float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x, 0.0500000007f, 0.0700000003f) : 0.f, ::df::directional_factor((enable_rust_damage ? nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(paint_color, color(0.f, 0.f, 0.f), ::base::color_layer_blend, wash_weight * ::math::pow(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).z, 0.439999998f), true).tint, color(0.0843759999f, 0.0367299989f, 0.00778200012f), ::base::color_layer_blend, (1.f - float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x) * ::math::pow(float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).y, 0.729999959f) * 1.13f, true).tint, ::math::pow(vm_tex_lookup(texture_2d("./cracked_paint_surface_bare_metal_albedo.jpg", ::tex::gamma_srgb), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint, bare_metal_darkness), ::base::color_layer_blend, histogram_scan_big(float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x, 0.0500000007f, 0.0700000003f), true).tint, color(0.f, 0.f, 0.f), ::base::color_layer_multiply, ::math::pow(1.f - float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).z, 1.f), true) : nvidia::core_definitions::blend_colors(paint_color, color(0.f, 0.f, 0.f), ::base::color_layer_blend, wash_weight * ::math::pow(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).z, 0.439999998f), true)).tint, color(1.f, 1.f, 1.f), 3.f, ::df::microfacet_ggx_smith_bsdf((enable_rust_damage ? ::math::lerp(screen(histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).x, paint_roughness_variation * 0.699999988f, ::math::clamp(paint_roughness * 0.75f + 0.0500000007f + paint_roughness_variation * 0.25f, 0.f, 0.899999976f)), ::math::pow(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).z, 0.439999998f), wash_weight) + float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).x * dirt_weight, ::math::lerp(0.25f, histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).y, 1.f, 0.579999983f), ::math::pow(float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).z, 1.13f)), histogram_scan_big(float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x, 0.0500000007f, 0.0700000003f)) : screen(histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).x, paint_roughness_variation * 0.699999988f, ::math::clamp(paint_roughness * 0.75f + 0.0500000007f + paint_roughness_variation * 0.25f, 0.f, 0.899999976f)), ::math::pow(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).z, 0.439999998f), wash_weight) + float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).x * dirt_weight) * (enable_rust_damage ? ::math::lerp(screen(histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).x, paint_roughness_variation * 0.699999988f, ::math::clamp(paint_roughness * 0.75f + 0.0500000007f + paint_roughness_variation * 0.25f, 0.f, 0.899999976f)), ::math::pow(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).z, 0.439999998f), wash_weight) + float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).x * dirt_weight, ::math::lerp(0.25f, histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).y, 1.f, 0.579999983f), ::math::pow(float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).z, 1.13f)), histogram_scan_big(float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x, 0.0500000007f, 0.0700000003f)) : screen(histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).x, paint_roughness_variation * 0.699999988f, ::math::clamp(paint_roughness * 0.75f + 0.0500000007f + paint_roughness_variation * 0.25f, 0.f, 0.899999976f)), ::math::pow(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).z, 0.439999998f), wash_weight) + float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).x * dirt_weight), (enable_rust_damage ? ::math::lerp(screen(histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).x, paint_roughness_variation * 0.699999988f, ::math::clamp(paint_roughness * 0.75f + 0.0500000007f + paint_roughness_variation * 0.25f, 0.f, 0.899999976f)), ::math::pow(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).z, 0.439999998f), wash_weight) + float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).x * dirt_weight, ::math::lerp(0.25f, histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).y, 1.f, 0.579999983f), ::math::pow(float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).z, 1.13f)), histogram_scan_big(float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x, 0.0500000007f, 0.0700000003f)) : screen(histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).x, paint_roughness_variation * 0.699999988f, ::math::clamp(paint_roughness * 0.75f + 0.0500000007f + paint_roughness_variation * 0.25f, 0.f, 0.899999976f)), ::math::pow(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).z, 0.439999998f), wash_weight) + float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).x * dirt_weight) * (enable_rust_damage ? ::math::lerp(screen(histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).x, paint_roughness_variation * 0.699999988f, ::math::clamp(paint_roughness * 0.75f + 0.0500000007f + paint_roughness_variation * 0.25f, 0.f, 0.899999976f)), ::math::pow(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).z, 0.439999998f), wash_weight) + float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).x * dirt_weight, ::math::lerp(0.25f, histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).y, 1.f, 0.579999983f), ::math::pow(float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).z, 1.13f)), histogram_scan_big(float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x, 0.0500000007f, 0.0700000003f)) : screen(histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).x, paint_roughness_variation * 0.699999988f, ::math::clamp(paint_roughness * 0.75f + 0.0500000007f + paint_roughness_variation * 0.25f, 0.f, 0.899999976f)), ::math::pow(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).z, 0.439999998f), wash_weight) + float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).x * dirt_weight), color(1.f, 1.f, 1.f), color(0.f, 0.f, 0.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((enable_rust_damage ? ::math::lerp(screen(histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).x, paint_roughness_variation * 0.699999988f, ::math::clamp(paint_roughness * 0.75f + 0.0500000007f + paint_roughness_variation * 0.25f, 0.f, 0.899999976f)), ::math::pow(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).z, 0.439999998f), wash_weight) + float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).x * dirt_weight, ::math::lerp(0.25f, histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).y, 1.f, 0.579999983f), ::math::pow(float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).z, 1.13f)), histogram_scan_big(float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x, 0.0500000007f, 0.0700000003f)) : screen(histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).x, paint_roughness_variation * 0.699999988f, ::math::clamp(paint_roughness * 0.75f + 0.0500000007f + paint_roughness_variation * 0.25f, 0.f, 0.899999976f)), ::math::pow(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).z, 0.439999998f), wash_weight) + float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).x * dirt_weight) * (enable_rust_damage ? ::math::lerp(screen(histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).x, paint_roughness_variation * 0.699999988f, ::math::clamp(paint_roughness * 0.75f + 0.0500000007f + paint_roughness_variation * 0.25f, 0.f, 0.899999976f)), ::math::pow(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).z, 0.439999998f), wash_weight) + float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).x * dirt_weight, ::math::lerp(0.25f, histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).y, 1.f, 0.579999983f), ::math::pow(float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).z, 1.13f)), histogram_scan_big(float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x, 0.0500000007f, 0.0700000003f)) : screen(histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).x, paint_roughness_variation * 0.699999988f, ::math::clamp(paint_roughness * 0.75f + 0.0500000007f + paint_roughness_variation * 0.25f, 0.f, 0.899999976f)), ::math::pow(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).z, 0.439999998f), wash_weight) + float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).x * dirt_weight), (enable_rust_damage ? ::math::lerp(screen(histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).x, paint_roughness_variation * 0.699999988f, ::math::clamp(paint_roughness * 0.75f + 0.0500000007f + paint_roughness_variation * 0.25f, 0.f, 0.899999976f)), ::math::pow(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).z, 0.439999998f), wash_weight) + float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).x * dirt_weight, ::math::lerp(0.25f, histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).y, 1.f, 0.579999983f), ::math::pow(float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).z, 1.13f)), histogram_scan_big(float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x, 0.0500000007f, 0.0700000003f)) : screen(histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).x, paint_roughness_variation * 0.699999988f, ::math::clamp(paint_roughness * 0.75f + 0.0500000007f + paint_roughness_variation * 0.25f, 0.f, 0.899999976f)), ::math::pow(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).z, 0.439999998f), wash_weight) + float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).x * dirt_weight) * (enable_rust_damage ? ::math::lerp(screen(histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).x, paint_roughness_variation * 0.699999988f, ::math::clamp(paint_roughness * 0.75f + 0.0500000007f + paint_roughness_variation * 0.25f, 0.f, 0.899999976f)), ::math::pow(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).z, 0.439999998f), wash_weight) + float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).x * dirt_weight, ::math::lerp(0.25f, histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).y, 1.f, 0.579999983f), ::math::pow(float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).z, 1.13f)), histogram_scan_big(float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x, 0.0500000007f, 0.0700000003f)) : screen(histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).x, paint_roughness_variation * 0.699999988f, ::math::clamp(paint_roughness * 0.75f + 0.0500000007f + paint_roughness_variation * 0.25f, 0.f, 0.899999976f)), ::math::pow(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).z, 0.439999998f), wash_weight) + float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).x * dirt_weight), color(1.f, 1.f, 1.f), color(0.f, 0.f, 0.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf((enable_rust_damage ? nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(paint_color, color(0.f, 0.f, 0.f), ::base::color_layer_blend, wash_weight * ::math::pow(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).z, 0.439999998f), true).tint, color(0.0843759999f, 0.0367299989f, 0.00778200012f), ::base::color_layer_blend, (1.f - float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x) * ::math::pow(float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).y, 0.729999959f) * 1.13f, true).tint, ::math::pow(vm_tex_lookup(texture_2d("./cracked_paint_surface_bare_metal_albedo.jpg", ::tex::gamma_srgb), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint, bare_metal_darkness), ::base::color_layer_blend, histogram_scan_big(float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x, 0.0500000007f, 0.0700000003f), true).tint, color(0.f, 0.f, 0.f), ::base::color_layer_multiply, ::math::pow(1.f - float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).z, 1.f), true) : nvidia::core_definitions::blend_colors(paint_color, color(0.f, 0.f, 0.f), ::base::color_layer_blend, wash_weight * ::math::pow(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.100000001f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint).z, 0.439999998f), true)).tint, 0.f), bsdf(), enable_rust_damage ? add_detail_normal(vm_tex_normal_lookup(texture_2d("./cracked_paint_surface_bare_norm.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), 1.f), ::math::lerp(infinite_tiling ? add_detail_normal(vm_tex_infinite_normal(texture_2d("./cracked_paint_surface_paint_bg_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.5f), 0.100000001f, (enable_rust_damage ? 1.f - float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x : 1.f) * uneven_normal_strength), vm_tex_infinite_normal(texture_2d("./cracked_paint_surface_chaotic_paint_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.5f), 0.100000001f, (enable_rust_damage ? 1.f - float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x : 1.f) * paint_stroke_normal_strength)) : vm_tex_normal_lookup_2x(texture_2d("./cracked_paint_surface_paint_bg_norm.jpg", ::tex::gamma_linear), texture_2d("./cracked_paint_surface_chaotic_paint_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), vm_coord(0.f, 0.f, 1.f, 0), (enable_rust_damage ? 1.f - float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x : 1.f) * uneven_normal_strength, (enable_rust_damage ? 1.f - float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x : 1.f) * paint_stroke_normal_strength, false), vm_tex_normal_lookup(texture_2d("./cracked_paint_surface_met_norm.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f) * 0.5f)), 0.870000005f), histogram_scan_big(float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x, 0.0500000007f, 0.0700000003f))) : infinite_tiling ? add_detail_normal(vm_tex_infinite_normal(texture_2d("./cracked_paint_surface_paint_bg_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.5f), 0.100000001f, (enable_rust_damage ? 1.f - float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x : 1.f) * uneven_normal_strength), vm_tex_infinite_normal(texture_2d("./cracked_paint_surface_chaotic_paint_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.5f), 0.100000001f, (enable_rust_damage ? 1.f - float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x : 1.f) * paint_stroke_normal_strength)) : vm_tex_normal_lookup_2x(texture_2d("./cracked_paint_surface_paint_bg_norm.jpg", ::tex::gamma_linear), texture_2d("./cracked_paint_surface_chaotic_paint_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), vm_coord(0.f, 0.f, 1.f, 0), (enable_rust_damage ? 1.f - float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x : 1.f) * uneven_normal_strength, (enable_rust_damage ? 1.f - float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x : 1.f) * paint_stroke_normal_strength, false)), enable_rust_damage ? add_detail_normal(vm_tex_normal_lookup(texture_2d("./cracked_paint_surface_bare_norm.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), 1.f), ::math::lerp(infinite_tiling ? add_detail_normal(vm_tex_infinite_normal(texture_2d("./cracked_paint_surface_paint_bg_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.5f), 0.100000001f, (enable_rust_damage ? 1.f - float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x : 1.f) * uneven_normal_strength), vm_tex_infinite_normal(texture_2d("./cracked_paint_surface_chaotic_paint_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.5f), 0.100000001f, (enable_rust_damage ? 1.f - float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x : 1.f) * paint_stroke_normal_strength)) : vm_tex_normal_lookup_2x(texture_2d("./cracked_paint_surface_paint_bg_norm.jpg", ::tex::gamma_linear), texture_2d("./cracked_paint_surface_chaotic_paint_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), vm_coord(0.f, 0.f, 1.f, 0), (enable_rust_damage ? 1.f - float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x : 1.f) * uneven_normal_strength, (enable_rust_damage ? 1.f - float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x : 1.f) * paint_stroke_normal_strength, false), vm_tex_normal_lookup(texture_2d("./cracked_paint_surface_met_norm.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f) * 0.5f)), 0.870000005f), histogram_scan_big(float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x, 0.0500000007f, 0.0700000003f))) : infinite_tiling ? add_detail_normal(vm_tex_infinite_normal(texture_2d("./cracked_paint_surface_paint_bg_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.5f), 0.100000001f, (enable_rust_damage ? 1.f - float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x : 1.f) * uneven_normal_strength), vm_tex_infinite_normal(texture_2d("./cracked_paint_surface_chaotic_paint_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.5f), 0.100000001f, (enable_rust_damage ? 1.f - float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x : 1.f) * paint_stroke_normal_strength)) : vm_tex_normal_lookup_2x(texture_2d("./cracked_paint_surface_paint_bg_norm.jpg", ::tex::gamma_linear), texture_2d("./cracked_paint_surface_chaotic_paint_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), vm_coord(0.f, 0.f, 1.f, 0), (enable_rust_damage ? 1.f - float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x : 1.f) * uneven_normal_strength, (enable_rust_damage ? 1.f - float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x : 1.f) * paint_stroke_normal_strength, false)), enable_rust_damage ? add_detail_normal(vm_tex_normal_lookup(texture_2d("./cracked_paint_surface_bare_norm.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), 1.f), ::math::lerp(infinite_tiling ? add_detail_normal(vm_tex_infinite_normal(texture_2d("./cracked_paint_surface_paint_bg_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.5f), 0.100000001f, (enable_rust_damage ? 1.f - float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x : 1.f) * uneven_normal_strength), vm_tex_infinite_normal(texture_2d("./cracked_paint_surface_chaotic_paint_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.5f), 0.100000001f, (enable_rust_damage ? 1.f - float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x : 1.f) * paint_stroke_normal_strength)) : vm_tex_normal_lookup_2x(texture_2d("./cracked_paint_surface_paint_bg_norm.jpg", ::tex::gamma_linear), texture_2d("./cracked_paint_surface_chaotic_paint_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), vm_coord(0.f, 0.f, 1.f, 0), (enable_rust_damage ? 1.f - float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x : 1.f) * uneven_normal_strength, (enable_rust_damage ? 1.f - float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x : 1.f) * paint_stroke_normal_strength, false), vm_tex_normal_lookup(texture_2d("./cracked_paint_surface_met_norm.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f) * 0.5f)), 0.870000005f), histogram_scan_big(float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x, 0.0500000007f, 0.0700000003f))) : infinite_tiling ? add_detail_normal(vm_tex_infinite_normal(texture_2d("./cracked_paint_surface_paint_bg_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.5f), 0.100000001f, (enable_rust_damage ? 1.f - float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x : 1.f) * uneven_normal_strength), vm_tex_infinite_normal(texture_2d("./cracked_paint_surface_chaotic_paint_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.5f), 0.100000001f, (enable_rust_damage ? 1.f - float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x : 1.f) * paint_stroke_normal_strength)) : vm_tex_normal_lookup_2x(texture_2d("./cracked_paint_surface_paint_bg_norm.jpg", ::tex::gamma_linear), texture_2d("./cracked_paint_surface_chaotic_paint_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), vm_coord(0.f, 0.f, 1.f, 0), (enable_rust_damage ? 1.f - float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x : 1.f) * uneven_normal_strength, (enable_rust_damage ? 1.f - float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x : 1.f) * paint_stroke_normal_strength, false)), enable_rust_damage ? add_detail_normal(vm_tex_normal_lookup(texture_2d("./cracked_paint_surface_bare_norm.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), 1.f), ::math::lerp(infinite_tiling ? add_detail_normal(vm_tex_infinite_normal(texture_2d("./cracked_paint_surface_paint_bg_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.5f), 0.100000001f, (enable_rust_damage ? 1.f - float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x : 1.f) * uneven_normal_strength), vm_tex_infinite_normal(texture_2d("./cracked_paint_surface_chaotic_paint_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.5f), 0.100000001f, (enable_rust_damage ? 1.f - float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x : 1.f) * paint_stroke_normal_strength)) : vm_tex_normal_lookup_2x(texture_2d("./cracked_paint_surface_paint_bg_norm.jpg", ::tex::gamma_linear), texture_2d("./cracked_paint_surface_chaotic_paint_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), vm_coord(0.f, 0.f, 1.f, 0), (enable_rust_damage ? 1.f - float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x : 1.f) * uneven_normal_strength, (enable_rust_damage ? 1.f - float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x : 1.f) * paint_stroke_normal_strength, false), vm_tex_normal_lookup(texture_2d("./cracked_paint_surface_met_norm.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f) * 0.5f)), 0.870000005f), histogram_scan_big(float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x, 0.0500000007f, 0.0700000003f))) : infinite_tiling ? add_detail_normal(vm_tex_infinite_normal(texture_2d("./cracked_paint_surface_paint_bg_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.5f), 0.100000001f, (enable_rust_damage ? 1.f - float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x : 1.f) * uneven_normal_strength), vm_tex_infinite_normal(texture_2d("./cracked_paint_surface_chaotic_paint_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(0.5f), 0.100000001f, (enable_rust_damage ? 1.f - float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x : 1.f) * paint_stroke_normal_strength)) : vm_tex_normal_lookup_2x(texture_2d("./cracked_paint_surface_paint_bg_norm.jpg", ::tex::gamma_linear), texture_2d("./cracked_paint_surface_chaotic_paint_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), vm_coord(0.f, 0.f, 1.f, 0), (enable_rust_damage ? 1.f - float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x : 1.f) * uneven_normal_strength, (enable_rust_damage ? 1.f - float3(vm_tex_lookup(texture_2d("./cracked_paint_surface_met_damage_multi_R_mask_G_trans1_B_trans2.png", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(::math::clamp(damages_scale, 9.99999975e-05f, 1.f))), mono_a, float4(1.f)).tint).x : 1.f) * paint_stroke_normal_strength, false)), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + 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), emission_intensity: color(0.f, 0.f, 0.f)); + 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()); + hair_bsdf tmp6 = hair_bsdf(); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5, + hair: tmp6); + + +export material Steel_Painted_Yellow_Paint_Strokes(*) +[[ + ::anno::display_name("Steel Painted - Yellow Paint Strokes"), + ::anno::author("Nvidia vMaterials"), + ::anno::description(DESCRIPTION), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Steel_Painted.Steel_Painted_Yellow_Paint_Strokes.png"), + ::anno::key_words(string[]("steel", "metal", "paint", "coated", "construction", "urban", "architecture", "naval", "automotive", "multimaterial", "interior", "exterior", "new", "bumped" "yellow", "saturated", "warm")) +]] = Steel_Painted( + infinite_tiling: false, + paint_color: color(0.491021f, 0.318547f, 0.024158f), + paint_roughness: 0.3f, + paint_roughness_variation: 0.0f, + dirt_weight: 0.05f, + wash_weight: 0.0f, + paint_stroke_normal_strength: 0.95f, + uneven_normal_strength: 0.0f, + enable_rust_damage: false, + bare_metal_darkness: 0.65f, + damages_scale: 1.0f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + + +export material Steel_Painted_Yellow_Damaged(*) +[[ + ::anno::display_name("Steel Painted - Yellow Damaged"), + ::anno::author("Nvidia vMaterials"), + ::anno::description(DESCRIPTION), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Steel_Painted.Steel_Painted_Yellow_Damaged.png"), + ::anno::key_words(string[]("steel", "metal", "paint", "coated", "construction", "urban", "architecture", "naval", "automotive", "multimaterial", "interior", "exterior", "damaged", "worn", "rust", "yellow", "saturated", "warm")) +]] = Steel_Painted( + infinite_tiling: false, + paint_color: color(0.491021f, 0.318547f, 0.024158f), + paint_roughness: 0.42f, + paint_roughness_variation: 0.5f, + dirt_weight: 0.18f, + wash_weight: 0.0f, + paint_stroke_normal_strength: 0.43f, + uneven_normal_strength: 1.0f, + enable_rust_damage: true, + bare_metal_darkness: 0.65f, + damages_scale: 1.0f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + + +export material Steel_Painted_Yellow_Overpainted(*) +[[ + ::anno::display_name("Steel Painted - Yellow Overpainted"), + ::anno::author("Nvidia vMaterials"), + ::anno::description(DESCRIPTION), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Steel_Painted.Steel_Painted_Yellow_Overpainted.png"), + ::anno::key_words(string[]("steel", "metal", "paint", "coated", "construction", "urban", "architecture", "naval", "automotive", "multimaterial", "interior", "exterior", "new", "bumped", "yellow", "saturated", "warm")) +]] = Steel_Painted( + infinite_tiling: false, + paint_color: color(0.491021f, 0.318547f, 0.024158f), + paint_roughness: 0.3f, + paint_roughness_variation: 0.5f, + dirt_weight: 0.04f, + wash_weight: 0.0f, + paint_stroke_normal_strength: 0.43f, + uneven_normal_strength: 1.0f, + enable_rust_damage: false, + bare_metal_darkness: 0.65f, + damages_scale: 1.0f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + + +export material Steel_Painted_Yellow_Slightly_Weathered(*) +[[ + ::anno::display_name("Steel Painted - Yellow Slightly Weathered"), + ::anno::author("Nvidia vMaterials"), + ::anno::description(DESCRIPTION), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Steel_Painted.Steel_Painted_Yellow_Slightly_Weathered.png"), + ::anno::key_words(string[]("steel", "metal", "paint", "coated", "construction", "urban", "architecture", "naval", "automotive", "multimaterial", "interior", "exterior", "weathered", "old", "bumped", "yellow", "saturated", "warm")) +]] = Steel_Painted( + infinite_tiling: false, + paint_color: color(0.491021f, 0.318547f, 0.024158f), + paint_roughness: 0.31f, + paint_roughness_variation: 0.46f, + dirt_weight: 0.24f, + wash_weight: 0.54f, + paint_stroke_normal_strength: 0.46f, + uneven_normal_strength: 0.39f, + enable_rust_damage: false, + bare_metal_darkness: 0.65f, + damages_scale: 1.0f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + + +export material Steel_Painted_Yellow_Dirty(*) +[[ + ::anno::display_name("Steel Painted - Dirty"), + ::anno::author("Nvidia vMaterials"), + ::anno::description(DESCRIPTION), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Steel_Painted.Steel_Painted_Yellow_Dirty.png"), + ::anno::key_words(string[]("steel", "metal", "paint", "coated", "construction", "urban", "architecture", "naval", "automotive", "multimaterial", "interior", "exterior", "dirty", "old", "bumped", "yellow", "saturated", "warm")) +]] = Steel_Painted( + infinite_tiling: false, + paint_color: color(0.491021f, 0.318547f, 0.024158f), + paint_roughness: 0.3f, + paint_roughness_variation: 0.5f, + dirt_weight: 0.86f, + wash_weight: 0.0f, + paint_stroke_normal_strength: 0.43f, + uneven_normal_strength: 0.88f, + enable_rust_damage: false, + bare_metal_darkness: 0.65f, + damages_scale: 1.0f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + + +export material Steel_Painted_Heavy_Dirt(*) +[[ + ::anno::display_name("Steel Painted - Yellow Heavy Dirt"), + ::anno::author("Nvidia vMaterials"), + ::anno::description(DESCRIPTION), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Steel_Painted.Steel_Painted_Heavy_Dirt.png"), + ::anno::key_words(string[]("steel", "metal", "paint", "coated", "construction", "urban", "architecture", "naval", "automotive", "multimaterial", "exterior", "dirty", "old", "weathered", "matte", "yellow", "saturated", "warm")) +]] = Steel_Painted( + infinite_tiling: false, + paint_color: color(0.491021f, 0.318547f, 0.024158f), + paint_roughness: 0.58f, + paint_roughness_variation: 0.5f, + dirt_weight: 0.86f, + wash_weight: 1.0f, + paint_stroke_normal_strength: 0.43f, + uneven_normal_strength: 1.0f, + enable_rust_damage: false, + bare_metal_darkness: 0.65f, + damages_scale: 1.0f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + +// What other colors should we still provide along with the catalog? +export material Steel_Painted_White(*) +[[ + ::anno::display_name("Steel Painted - White"), + ::anno::author("Nvidia vMaterials"), + ::anno::description(DESCRIPTION), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Steel_Painted.Steel_Painted_White.png"), + ::anno::key_words(string[]("steel", "metal", "paint", "coated", "construction", "urban", "architecture", "naval", "automotive", "interior", "exterior", "new", "white", "bright", "neutral")) +]] = Steel_Painted( + infinite_tiling: false, + paint_color: color(0.603827f, 0.603827f, 0.603827f), + paint_roughness: 0.12f, + paint_roughness_variation: 0.23f, + dirt_weight: 0.04f, + wash_weight: 0.0f, + paint_stroke_normal_strength: 0.27f, + uneven_normal_strength: 0.0f, + enable_rust_damage: false, + bare_metal_darkness: 0.65f, + damages_scale: 1.0f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + + +export material Steel_Painted_Gray(*) +[[ + ::anno::display_name("Steel Painted - Gray"), + ::anno::author("Nvidia vMaterials"), + ::anno::description(DESCRIPTION), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Steel_Painted.Steel_Painted_Gray.png"), + ::anno::key_words(string[]("steel", "metal", "paint", "coated", "construction", "urban", "architecture", "naval", "automotive", "interior", "exterior", "new", "gray", "neutral")) +]] = Steel_Painted( + infinite_tiling: false, + paint_color: color(0.187821f, 0.187821f, 0.187821f), + paint_roughness: 0.16f, + paint_roughness_variation: 0.23f, + dirt_weight: 0.04f, + wash_weight: 0.0f, + paint_stroke_normal_strength: 0.27f, + uneven_normal_strength: 0.16f, + enable_rust_damage: false, + bare_metal_darkness: 0.65f, + damages_scale: 1.0f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + + +export material Steel_Painted_Dark_Gray(*) +[[ + ::anno::display_name("Steel Painted - Dark Gray"), + ::anno::author("Nvidia vMaterials"), + ::anno::description(DESCRIPTION), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Steel_Painted.Steel_Painted_Dark_Gray.png"), + ::anno::key_words(string[]("steel", "metal", "paint", "coated", "construction", "urban", "architecture", "naval", "automotive","interior", "exterior", "new", "gray", "dark", "neutral")) +]] = Steel_Painted( + infinite_tiling: false, + paint_color: color(0.076185f, 0.076185f, 0.076185), + paint_roughness: 0.16f, + paint_roughness_variation: 0.12f, + dirt_weight: 0.04f, + wash_weight: 0.0f, + paint_stroke_normal_strength: 0.27f, + uneven_normal_strength: 0.0f, + enable_rust_damage: false, + bare_metal_darkness: 0.65f, + damages_scale: 1.0f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + + +export material Steel_Painted_Black(*) +[[ + ::anno::display_name("Steel Painted - Black"), + ::anno::author("Nvidia vMaterials"), + ::anno::description(DESCRIPTION), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Steel_Painted.Steel_Painted_Black.png"), + ::anno::key_words(string[]("steel", "metal", "paint", "coated", "construction", "urban", "architecture", "naval", "automotive","interior", "exterior", "new", "black", "dark", "neutral")) +]] = Steel_Painted( + infinite_tiling: false, + paint_color: color(0.026241f), + paint_roughness: 0.11f, + paint_roughness_variation: 0.12f, + dirt_weight: 0.04f, + wash_weight: 0.0f, + paint_stroke_normal_strength: 0.08f, + uneven_normal_strength: 0.015f, + enable_rust_damage: false, + bare_metal_darkness: 0.65f, + damages_scale: 1.0f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + + +export material Steel_Painted_Russet_Matte(*) +[[ + ::anno::display_name("Steel Painted - Russet Matte"), + ::anno::author("Nvidia vMaterials"), + ::anno::description(DESCRIPTION), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Steel_Painted.Steel_Painted_Russet_Matte.png"), + ::anno::key_words(string[]("steel", "metal", "paint", "coated", "construction", "urban", "architecture", "naval", "automotive","interior", "exterior", "new", "russet", "warm", "red", "brown")) +]] = Steel_Painted( + infinite_tiling: false, + paint_color: color(0.283149f, 0.066626f, 0.061246f), + paint_roughness: 0.32f, + paint_roughness_variation: 0.2f, + dirt_weight: 0.2f, + wash_weight: 0.1f, + paint_stroke_normal_strength: 0.18f, + uneven_normal_strength: 0.0f, + enable_rust_damage: false, + bare_metal_darkness: 0.65f, + damages_scale: 1.0f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + + + +export material Steel_Painted_Dark_Blue(*) +[[ + ::anno::display_name("Steel Painted - Dark Blue"), + ::anno::author("Nvidia vMaterials"), + ::anno::description(DESCRIPTION), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Steel_Painted.Steel_Painted_Dark_Blue.png"), + ::anno::key_words(string[]("steel", "metal", "paint", "coated", "construction", "urban", "architecture", "naval", "automotive","interior", "exterior", "new", "blue", "dark", "cool", "saturated")) +]] = Steel_Painted( + infinite_tiling: false, + paint_color: color(0.021219f, 0.063010f, 0.208637f), + paint_roughness: 0.12f, + paint_roughness_variation: 0.1f, + dirt_weight: 0.04f, + wash_weight: 0.0f, + paint_stroke_normal_strength: 0.18f, + uneven_normal_strength: 0.0f, + enable_rust_damage: false, + bare_metal_darkness: 0.65f, + damages_scale: 1.0f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + + +export material Steel_Painted_Light_Blue_Weathered(*) +[[ + ::anno::display_name("Steel Painted - Light Blue Weathered"), + ::anno::author("Nvidia vMaterials"), + ::anno::description(DESCRIPTION), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Steel_Painted.Steel_Painted_Light_Blue_Weathered.png"), + ::anno::key_words(string[]("steel", "metal", "paint", "coated", "construction", "urban", "architecture", "naval", "automotive","interior", "exterior", "old", "aged", "bleached", "weathered", "blue", "light", "pastel", "cool")) +]] = Steel_Painted( + infinite_tiling: false, + paint_color: color(0.174647f, 0.391572f, 0.467784f), + paint_roughness: 0.45f, + paint_roughness_variation: 1.0f, + dirt_weight: 0.1f, + wash_weight: 0.72f, + paint_stroke_normal_strength: 0.36f, + uneven_normal_strength: 0.91f, + enable_rust_damage: false, + bare_metal_darkness: 0.65f, + damages_scale: 1.0f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + + +export material Steel_Painted_Orange(*) +[[ + ::anno::display_name("Steel Painted - Orange"), + ::anno::author("Nvidia vMaterials"), + ::anno::description(DESCRIPTION), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Steel_Painted.Steel_Painted_Orange.png"), + ::anno::key_words(string[]("steel", "metal", "paint", "coated", "construction", "urban", "architecture", "naval", "automotive","interior", "exterior", "new", "orange", "warm", "saturated")) +]] = Steel_Painted( + infinite_tiling: false, + paint_color: color(0.467784f, 0.107023f, 0.019382f), + paint_roughness: 0.16f, + paint_roughness_variation: 0.23f, + dirt_weight: 0.04f, + wash_weight: 0.0f, + paint_stroke_normal_strength: 0.18f, + uneven_normal_strength: 0.0f, + enable_rust_damage: false, + bare_metal_darkness: 0.65f, + damages_scale: 1.0f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + + +export material Steel_Painted_Arcadia_Green(*) +[[ + ::anno::display_name("Steel Painted - Arcadia Green"), + ::anno::author("Nvidia vMaterials"), + ::anno::description(DESCRIPTION), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Steel_Painted.Steel_Painted_Arcadia_Green.png"), + ::anno::key_words(string[]("steel", "metal", "paint", "coated", "construction", "urban", "architecture", "naval", "automotive","interior", "exterior", "new", "arcadia green", "green", "cool")) +]] = Steel_Painted( + infinite_tiling: false, + paint_color: color(0.119538f, 0.262251f, 0.223228f), + paint_roughness: 0.16f, + paint_roughness_variation: 0.23f, + dirt_weight: 0.04f, + wash_weight: 0.0f, + paint_stroke_normal_strength: 0.18f, + uneven_normal_strength: 0.0f, + enable_rust_damage: false, + bare_metal_darkness: 0.65f, + damages_scale: 1.0f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + + +export material Steel_Painted_Dark_Brown(*) +[[ + ::anno::display_name("Steel Painted - Dark Brown"), + ::anno::author("Nvidia vMaterials"), + ::anno::description(DESCRIPTION), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Steel_Painted.Steel_Painted_Dark_Brown.png"), + ::anno::key_words(string[]("steel", "metal", "paint", "coated", "construction", "urban", "architecture", "naval", "automotive","interior", "exterior", "new", "brown", "warm", "saturated", "dark")) +]] = Steel_Painted( + infinite_tiling: false, + paint_color: color(0.109462f, 0.045186f, 0.024158f), + paint_roughness: 0.16f, + paint_roughness_variation: 0.0f, + dirt_weight: 0.04f, + wash_weight: 0.0f, + paint_stroke_normal_strength: 0.18f, + uneven_normal_strength: 0.0f, + enable_rust_damage: false, + bare_metal_darkness: 0.65f, + damages_scale: 1.0f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + + +export material Steel_Painted_Khaki(*) +[[ + ::anno::display_name("Steel Painted - Khaki"), + ::anno::author("Nvidia vMaterials"), + ::anno::description(DESCRIPTION), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Steel_Painted.Steel_Painted_Khaki.png"), + ::anno::key_words(string[]("steel", "metal", "paint", "coated", "construction", "urban", "architecture", "naval", "automotive","interior", "exterior", "new", "khaki", "brown", "light", "warm", "pastel")) +]] = Steel_Painted( + infinite_tiling: false, + paint_color: color(0.396755f, 0.346704f, 0.165132f), + paint_roughness: 0.16f, + paint_roughness_variation: 0.12f, + dirt_weight: 0.04f, + wash_weight: 0.0f, + paint_stroke_normal_strength: 0.18f, + uneven_normal_strength: 0.0f, + enable_rust_damage: false, + bare_metal_darkness: 0.65f, + damages_scale: 1.0f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + + +export material Steel_Painted_Army_Green(*) +[[ + ::anno::display_name("Steel Painted - Army Green"), + ::anno::author("Nvidia vMaterials"), + ::anno::description(DESCRIPTION), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Steel_Painted.Steel_Painted_Army_Green.png"), + ::anno::key_words(string[]("steel", "metal", "paint", "coated", "construction", "urban", "architecture", "naval", "automotive","interior", "exterior", "new", "army", "green", "dark", "cool")) +]] = Steel_Painted( + infinite_tiling: false, + paint_color: color(0.066626f, 0.080220f, 0.012983f), + paint_roughness: 0.32f, + paint_roughness_variation: 0.07f, + dirt_weight: 0.11f, + wash_weight: 0.05f, + paint_stroke_normal_strength: 0.18f, + uneven_normal_strength: 0.0f, + enable_rust_damage: false, + bare_metal_darkness: 0.65f, + damages_scale: 1.0f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + + +// export material Steel_Painted_(*) +// [[ + // ::anno::display_name("Steel Painted - "), + // ::anno::author("Nvidia vMaterials"), + // ::anno::description(DESCRIPTION), + // ::anno::contributor("Maik Rohland"), + // ::anno::contributor("Ruediger Raab"), + // ::anno::copyright_notice(COPYRIGHT), + // ::anno::thumbnail("./.thumbs/Steel_Painted.Steel_Painted.png"), + // ::anno::key_words(string[]("steel", "metal", "paint", "coated", "construction", "urban", "architecture", "naval", "automotive","interior", "exterior", "new")) +// ]] = Steel_Painted( + // infinite_tiling: false, + // paint_color: color(), + // paint_roughness: 0.12f, + // paint_roughness_variation: 0.0f, + // dirt_weight: 0.04f, + // wash_weight: 0.0f, + // paint_stroke_normal_strength: 0.2f, + // uneven_normal_strength: 0.0f, + // enable_rust_damage: false, + // bare_metal_darkness: 0.65f, + // damages_scale: 1.0f, + // texture_translate: 0.0f, + // texture_rotate: 0.0f, + // texture_scale: 1.0f, + // uv_space_index: 0, + // roundcorners_enable: false, + // roundcorners_radius_mm: 0.5f, + // roundcorners_across_materials: false +// ); + diff --git a/Material/material_0486/Titanium_Scratched.mdl b/Material/material_0486/Titanium_Scratched.mdl new file mode 100644 index 0000000000000000000000000000000000000000..614c811d981647634870c1d50ebf4e25e2fd52bc --- /dev/null +++ b/Material/material_0486/Titanium_Scratched.mdl @@ -0,0 +1,596 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. * + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + + +mdl 1.5; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + +const string DESCRIPTION = "A scratched metal material"; + +float3 srgb2rgb(float3 val) +{ + return ::math::pow(::math::max(val, float3(0.0f)), 2.2); +} + + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float2 rnd22(int2 p) { + float2 ret_val = float2( + uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f, + uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f + ); + return ret_val; +} + +::base::texture_coordinate_info vmat_transform( + uniform float2 translation = float2(0.0, 0.0), + uniform float rotation = 0.0, + uniform float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation); + float c = ::math::cos(rotation); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + +float2x2 invert_2x2(float2x2 M) +{ + float det = M[0][0]*M[1][1] - M[0][1]*M[1][0]; + //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/ + return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]); +} + +float3 nonrepeat_lookup( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5), + float patch_size = 8.0 +) +{ + + float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale; + float Z = patch_size; // patch scale inside example texture + float CON = 1.0f; + + float3 O = float3(0.f); + float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); + float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space + + float2 U = uv_in; + float2 V = M * uv_in; //pre-tilted hexa coordinates + int2 I = int2(::math::floor(V)); // hexa-tile id + + // The mean color needs to be determined in Photoshop then to make the + // average color work out, take the float value and calculate the apropriate + // mean value as (value^(1/2.2)) + + float3 m = average_color; + + float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; + F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates + + if( F[2] > 0.f ) + + O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON)) + + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON)) + + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON)); + else + O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON)) + + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON)) + + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON)); + O = m + O/::math::length(W); + O = ::math::clamp( (O), 0.0, 1.0); + + return float3(O); +} + + +float histogram_range(float input, float range, float position) +{ + float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); + float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); + return ::math::lerp(low, high, input); +} + +float remap_xy_to_0_1(float input, float x, float y) +{ + return (input - x)/(y - x); +} + +float histogram_scan_big(float input, float width, float position) +{ + return ::math::clamp( + remap_xy_to_0_1(input, + ::math::lerp(-width, 1.0, position), + ::math::lerp(0.0, 1.0 + width, position)), + 0.0, + 1.0); +} + +color endless_texture( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 10.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0, + bool gamma_correct_lookup = true +) +{ + return gamma_correct_lookup ? color(srgb2rgb( + nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )) + ) : color(nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )); +} + +float3 endless_normal( + uniform texture_2d texture = texture_2d(), + float factor = 1.0, + bool flip_tangent_u = false, + bool flip_tangent_v = false, + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0 +) +{ + float3 transformed_tangent_u = flip_tangent_u ? uvw.tangent_u : - uvw.tangent_u; + float3 transformed_tangent_v = flip_tangent_v ? uvw.tangent_v : - uvw.tangent_v; + + if (flip_tangent_u) + transformed_tangent_u=-transformed_tangent_u; + if (flip_tangent_v) + transformed_tangent_v=-transformed_tangent_v; + + // normalized Lookup + float3 tangent_space_normal = + (nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + ) - 0.5) * (2.0 * factor); + + return ::math::normalize(uvw.tangent_u * tangent_space_normal.x + + uvw.tangent_v * tangent_space_normal.y + + ::state::normal()*1.0); +} + + +// Returns the normal n in tangent space, given n is in internal space. +float3 transform_internal_to_tangent(float3 n) +[[ + ::anno::hidden() +]] +{ + return + n.x* float3(::state::texture_tangent_u(0).x,::state::texture_tangent_v(0).x,::state::normal().x)+ + n.y* float3(::state::texture_tangent_u(0).y,::state::texture_tangent_v(0).y,::state::normal().y)+ + n.z* float3(::state::texture_tangent_u(0).z,::state::texture_tangent_v(0).z,::state::normal().z); +} + +// Returns the normal n in internal space, given n is in tangent space. +float3 transform_tangent_to_internal(float3 n) +[[ + ::anno::hidden() +]] +{ + return ::state::texture_tangent_u(0) * n.x + + ::state::texture_tangent_v(0) * n.y + + ::state::normal() * n.z ; +} + + + +// Returns a normal by adding a detail normal to a global normal. +// If detail blending of two normal maps gives visual artifacts, check if texture_2d are loaded +// correctly with ::tex::gamma_linear +float3 add_detail_normal(float3 nd = ::state::normal(), float3 n = ::state::normal()) +{ + // http://blog.selfshadow.com/publications/blending-in-detail/ + float3 n_t = transform_internal_to_tangent(n); + float3 nd_t = transform_internal_to_tangent(nd); + + n_t=n_t + float3(0.,0.,1.); + nd_t = nd_t * float3(-1.,-1.,1.); + + n = n_t*::math::dot(n_t, nd_t)/n_t.z - nd_t; + return ::math::normalize(transform_tangent_to_internal(n)); +} + + + + +export material Titanium_Scratched( + uniform bool infinite_tiling = false [[ + ::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."), + ::anno::display_name("Infinite Tiling"), + ::anno::in_group("Appearance") + ]], + float roughness_metal_surface = 1.0f [[ + ::anno::description("The overall roughness of the metal surface."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance", "Metal"), + ::anno::hard_range(0.f, 1.f) + ]], + float roughness_variation = 0.208f [[ + ::anno::description("Adds more roughness variation to the scratched metal material ."), + ::anno::display_name("Roughness Variation"), + ::anno::in_group("Appearance", "Metal"), + ::anno::hard_range(0.f, 1.f) + ]], + float brightness = 0.55f [[ + ::anno::display_name("Brightness"), + ::anno::in_group("Appearance", "Metal"), + ::anno::hard_range(0.f, 1.f) + ]], + float brightness_variation = 0.3f [[ + ::anno::description("Adds brightness variation to the metal . Has no effect as soon as the of the material is full on."), + ::anno::display_name("Brightness Variation"), + ::anno::in_group("Appearance", "Metal"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float bump_factor = 0.187f [[ + ::anno::display_name("Bump Factor"), + ::anno::in_group("Appearance", "Metal"), + ::anno::soft_range(0.f, 2.f) + ]], + +// Scratches + float roughness_scratches = 0.145f [[ + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance", "Scratches"), + ::anno::hard_range(0.f, 1.f) + ]], + float scratches_variation = 0.3f [[ + ::anno::display_name("Variation"), + ::anno::in_group("Appearance", "Scratches"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float scratches_bump_factor = 0.435f [[ + ::anno::display_name("Bump Factor"), + ::anno::in_group("Appearance", "Scratches"), + ::anno::soft_range(0.f, 2.f) + ]], + +// Dirt + float dirt_transition_softness = 0.85f [[ + ::anno::description("Controls the softness of the dirt-metal transition."), + ::anno::display_name("Dirt Transition Softness"), + ::anno::in_group("Appearance", "Dirt Layer"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_amount = 0.212f [[ + ::anno::description("Adds dirt and grime on top of the scratched metal. Note that the dirt layer also infoences the roughness of the material."), + ::anno::display_name("Dirt Amount"), + ::anno::in_group("Appearance", "Dirt Layer"), + ::anno::hard_range(0.f, 1.f) + ]], + + +// Transform + uniform float2 texture_translate = 0.f [[ + ::anno::display_name("Translate"), + ::anno::description("Offsets the position of the material."), + ::anno::in_group("Transform") + ]], + uniform float texture_rotate = 0.f [[ + ::anno::description("Rotates the material."), + ::anno::display_name("Rotate"), + ::anno::in_group("Transform") + ]], + uniform float2 texture_scale = 1.0f [[ + ::anno::description("Scales the material."), + ::anno::display_name("Scale"), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::anno::in_group("Transform") + ]], + + + +// Round Corners + uniform bool enable_round_corners = false [[ + ::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."), + ::anno::display_name("Round Corners"), + ::anno::in_group("Round Corners") + ]], + uniform float radius_mm = 0.f [[ + ::anno::description("Radius of the rounded corners."), + ::anno::display_name("Corner Radius"), + ::anno::in_group("Round Corners") + ]], + uniform bool across_materials = true [[ + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::display_name("Across Materials"), + ::anno::in_group("Round Corners") + ]], + +// Advanced + uniform int uv_space_index = 0 [[ + ::anno::description("Uses selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced") + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Scratched Titanium"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "titanium", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped")), + ::anno::thumbnail("./.thumbs/Titanium_Scratched.Titanium_Scratched.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = + let { + float brush_scratches_weight = 0.5f; + // Titanium Reflection Color + color reflection_color = color(0.618264052974f, 0.579396264956f, 0.542545225681f); // Titanium + float radius = radius_mm * 0.001; + bool tmp0 = false; + material_surface tmp1( + ::df::weighted_layer(::math::pow(1.f - float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.455000013f, 0.50999999f, 0.73299998f), 8.f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.537f) * (histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.455000013f, 0.50999999f, 0.73299998f), 8.f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], dirt_transition_softness, ::math::lerp(0.782999992f, 0.305999994f, dirt_amount)) * 0.899999976f), ::df::diffuse_reflection_bsdf(color(0.0116450004f, 0.00893499982f, 0.00379400002f), 0.f, ""), ::df::color_custom_curve_layer(reflection_color, color(1.f, 1.f, 1.f), 5.f, color(::math::clamp(::math::lerp(0.f, ::math::max(float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.52000022f, float3(0.109999999f, 0.105999999f, 0.184f), 3.52000022f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), color(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], float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.52000022f, float3(0.109999999f, 0.105999999f, 0.184f), 3.52000022f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), color(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_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.455000013f, 0.50999999f, 0.73299998f), 8.f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.666000009f, ::math::lerp(0.159999996f, 0.600000024f, scratches_variation))) + histogram_range(::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.455000013f, 0.50999999f, 0.73299998f), 8.f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 2.20000005f), brightness_variation, ::math::lerp(0.173000008f, 0.850000024f, brightness)), 0.f, 1.f)), ::df::microfacet_ggx_smith_bsdf((::math::lerp(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.455000013f, 0.50999999f, 0.73299998f), 8.f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], roughness_variation, ::math::lerp(0.f, 0.588999987f, roughness_metal_surface)), roughness_scratches, ::math::lerp(0.f, ::math::max(brush_scratches_weight * float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.52000022f, float3(0.109999999f, 0.105999999f, 0.184f), 3.52000022f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), color(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::max(float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.52000022f, float3(0.109999999f, 0.105999999f, 0.184f), 3.52000022f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), color(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], float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.52000022f, float3(0.109999999f, 0.105999999f, 0.184f), 3.52000022f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), color(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_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.455000013f, 0.50999999f, 0.73299998f), 8.f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.666000009f, ::math::lerp(0.159999996f, 0.600000024f, scratches_variation)))) + histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.455000013f, 0.50999999f, 0.73299998f), 8.f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], dirt_transition_softness, ::math::lerp(0.782999992f, 0.305999994f, dirt_amount)) * 0.400000006f) * (::math::lerp(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.455000013f, 0.50999999f, 0.73299998f), 8.f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], roughness_variation, ::math::lerp(0.f, 0.588999987f, roughness_metal_surface)), roughness_scratches, ::math::lerp(0.f, ::math::max(brush_scratches_weight * float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.52000022f, float3(0.109999999f, 0.105999999f, 0.184f), 3.52000022f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), color(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::max(float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.52000022f, float3(0.109999999f, 0.105999999f, 0.184f), 3.52000022f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), color(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], float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.52000022f, float3(0.109999999f, 0.105999999f, 0.184f), 3.52000022f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), color(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_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.455000013f, 0.50999999f, 0.73299998f), 8.f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.666000009f, ::math::lerp(0.159999996f, 0.600000024f, scratches_variation)))) + histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.455000013f, 0.50999999f, 0.73299998f), 8.f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], dirt_transition_softness, ::math::lerp(0.782999992f, 0.305999994f, dirt_amount)) * 0.400000006f), (::math::lerp(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.455000013f, 0.50999999f, 0.73299998f), 8.f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], roughness_variation, ::math::lerp(0.f, 0.588999987f, roughness_metal_surface)), roughness_scratches, ::math::lerp(0.f, ::math::max(brush_scratches_weight * float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.52000022f, float3(0.109999999f, 0.105999999f, 0.184f), 3.52000022f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), color(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::max(float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.52000022f, float3(0.109999999f, 0.105999999f, 0.184f), 3.52000022f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), color(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], float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.52000022f, float3(0.109999999f, 0.105999999f, 0.184f), 3.52000022f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), color(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_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.455000013f, 0.50999999f, 0.73299998f), 8.f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.666000009f, ::math::lerp(0.159999996f, 0.600000024f, scratches_variation)))) + histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.455000013f, 0.50999999f, 0.73299998f), 8.f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], dirt_transition_softness, ::math::lerp(0.782999992f, 0.305999994f, dirt_amount)) * 0.400000006f) * (::math::lerp(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.455000013f, 0.50999999f, 0.73299998f), 8.f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], roughness_variation, ::math::lerp(0.f, 0.588999987f, roughness_metal_surface)), roughness_scratches, ::math::lerp(0.f, ::math::max(brush_scratches_weight * float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.52000022f, float3(0.109999999f, 0.105999999f, 0.184f), 3.52000022f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), color(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::max(float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.52000022f, float3(0.109999999f, 0.105999999f, 0.184f), 3.52000022f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), color(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], float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.52000022f, float3(0.109999999f, 0.105999999f, 0.184f), 3.52000022f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_scratch1_G_scratch2_B_scratch3.jpg", ::tex::gamma_linear), color(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_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.455000013f, 0.50999999f, 0.73299998f), 8.f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.666000009f, ::math::lerp(0.159999996f, 0.600000024f, scratches_variation)))) + histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.455000013f, 0.50999999f, 0.73299998f), 8.f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], dirt_transition_softness, ::math::lerp(0.782999992f, 0.305999994f, dirt_amount)) * 0.400000006f), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), bsdf(), add_detail_normal(::math::lerp(::state::normal(), infinite_tiling ? endless_normal(texture_2d("./metal_scratched_scratch_norm.jpg", ::tex::gamma_linear), scratches_bump_factor, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.52000022f, float3(0.497999996f, 0.497999996f, 0.991999984f), 3.52000022f) : ::base::tangent_space_normal_texture(texture_2d("./metal_scratched_scratch_norm.jpg", ::tex::gamma_linear), scratches_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(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.455000013f, 0.50999999f, 0.73299998f), 8.f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.666000009f, ::math::lerp(0.159999996f, 0.600000024f, scratches_variation))), infinite_tiling ? endless_normal(texture_2d("./metal_scratched_scratch_norm.jpg", ::tex::gamma_linear), bump_factor, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.52000022f, float3(0.497999996f, 0.497999996f, 0.995999992f), 3.52000022f) : ::base::tangent_space_normal_texture(texture_2d("./metal_scratched_scratch_norm.jpg", ::tex::gamma_linear), 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))), add_detail_normal(::math::lerp(::state::normal(), infinite_tiling ? endless_normal(texture_2d("./metal_scratched_scratch_norm.jpg", ::tex::gamma_linear), scratches_bump_factor, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.52000022f, float3(0.497999996f, 0.497999996f, 0.991999984f), 3.52000022f) : ::base::tangent_space_normal_texture(texture_2d("./metal_scratched_scratch_norm.jpg", ::tex::gamma_linear), scratches_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(infinite_tiling ? endless_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.455000013f, 0.50999999f, 0.73299998f), 8.f, false) : ::base::file_texture(texture_2d("./metal_scratched_R_diff_G_scratchvar_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 0.666000009f, ::math::lerp(0.159999996f, 0.600000024f, scratches_variation))), infinite_tiling ? endless_normal(texture_2d("./metal_scratched_scratch_norm.jpg", ::tex::gamma_linear), bump_factor, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.52000022f, float3(0.497999996f, 0.497999996f, 0.995999992f), 3.52000022f) : ::base::tangent_space_normal_texture(texture_2d("./metal_scratched_scratch_norm.jpg", ::tex::gamma_linear), 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))), + material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + 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)); + material_geometry tmp5( + float3(0.f), + 1.f, + enable_round_corners ? ::state::rounded_corner_normal(radius, across_materials, 1.f) : ::state::normal()); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + +export material Titanium_Scratched_Light_Bumpy(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Scratched Titanium - Bright and Bumped"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "titanium", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "shiny")), + ::anno::thumbnail("./.thumbs/Titanium_Scratched.Titanium_Scratched_Light_Bumpy.png"), + ::anno::copyright_notice(COPYRIGHT) +]]= Titanium_Scratched( + infinite_tiling: true, + roughness_metal_surface: 1.0f, + roughness_variation: 0.21f, + brightness: 0.75f, + brightness_variation: 0.3f, + bump_factor: 1.0f, + roughness_scratches: 0.145f, + scratches_variation: 0.3f, + scratches_bump_factor: 0.25f, + dirt_transition_softness: 0.85f, + dirt_amount: 0.05f, + texture_translate: 1.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); + + + +export material Titanium_Scratched_Dark_Shiny(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Scratched Titanium - Dark Shiny"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "titanium", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "shiny", "dark")), + ::anno::thumbnail("./.thumbs/Titanium_Scratched.Titanium_Scratched_Dark_Shiny.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Titanium_Scratched( + infinite_tiling: true, + roughness_metal_surface: 0.28f, + roughness_variation: 0.517f, + brightness: 0.35f, + brightness_variation: 0.43f, + bump_factor: 0.26f, + roughness_scratches: 0.21f, + scratches_variation: 0.76f, + scratches_bump_factor: 0.23f, + dirt_transition_softness: 0.98f, + dirt_amount: 0.06f, + texture_translate: 1.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); + + +export material Titanium_Scratched_Dark_Matte(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Scratched Titanium - Dark Matte"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "titanium", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "matte", "dark")), + ::anno::thumbnail("./.thumbs/Titanium_Scratched.Titanium_Scratched_Dark_Matte.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Titanium_Scratched( + infinite_tiling: true, + roughness_metal_surface: 1.0f, + roughness_variation: 0.21f, + brightness: 0.023f, + brightness_variation: 0.119f, + bump_factor: 0.521f, + roughness_scratches: 0.28f, + scratches_variation: 0.86f, + scratches_bump_factor: 1.0f, + dirt_transition_softness: 0.85f, + dirt_amount: 0.057f, + texture_translate: 1.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); + + + + +export material Titanium_Scratched_Scuffs_and_Grime(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Scratched Titanium - Scuffs and Grime"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "titanium", "scratched", "worn", "dirty", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "matte", "dark")), + ::anno::thumbnail("./.thumbs/Titanium_Scratched.Titanium_Scratched_Scuffs_and_Grime.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Titanium_Scratched( + infinite_tiling: true, + roughness_metal_surface: 0.756f, + roughness_variation: 0.208f, + brightness: 0.948f, + brightness_variation: 0.119f, + bump_factor: 1.848f, + roughness_scratches: 0.099f, + scratches_variation: 0.075f, + scratches_bump_factor: 0.903f, + dirt_transition_softness: 0.85f, + dirt_amount: 1.0f, + texture_translate: 1.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); + + + + +export material Titanium_Scratched_Dirty_Rough(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Scratched Titanium - Dirty Rough"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "titanium", "scratched", "worn", "dirt", "dirty", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "matte", "dark")), + ::anno::thumbnail("./.thumbs/Titanium_Scratched.Titanium_Scratched_Dirty_Rough.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Titanium_Scratched( + infinite_tiling: true, + roughness_metal_surface: 1.0f, + roughness_variation: 0.208f, + brightness: 0.8f, + brightness_variation: 0.838f, + bump_factor: 1.914f, + roughness_scratches: 0.35f, + scratches_variation: 0.0f, + scratches_bump_factor: 0.903f, + dirt_transition_softness: 0.901f, + dirt_amount: 0.581f, + texture_translate: 1.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); diff --git a/Material/material_0489/Tungsten_Brushed.mdl b/Material/material_0489/Tungsten_Brushed.mdl new file mode 100644 index 0000000000000000000000000000000000000000..8275d158c105721a69bf6234dc258bef9a97bfd9 --- /dev/null +++ b/Material/material_0489/Tungsten_Brushed.mdl @@ -0,0 +1,300 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + +mdl 1.5; +import ::anno::*; +import ::base::*; +import ::math::*; +import ::state::*; +import ::std::*; +import ::tex::*; +import ::df::*; +import ::nvidia::core_definitions::*; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + +const string DESCRIPTION = "Brushed metal material with adjustable settings for the brushing"; + + +float histogram_range(float input, float range, float position) +{ + float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); + float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); + return ::math::lerp(low, high, input); +} + +::base::texture_coordinate_info vmat_transform( + uniform float2 translation = float2(0.0, 0.0), + uniform float rotation = 0.0, + uniform float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation_rad); + float c = ::math::cos(rotation_rad); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + + +export material Tungsten_Brushed( + float brush_width = 1.0f [[ + ::anno::display_name("Roughness Width"), + ::anno::description("Widens the anisotropic metal reflections which leads to a stronger effect of " + "the metal brushing."), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance") + ]], + float brush_height_blur = 0.75f [[ + ::anno::display_name("Roughness Height"), + ::anno::description("Increases the anisotropy of the brushed metal, blurring the reflections."), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance") + ]], + float scratch_variation_amount = 1.f [[ + ::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."), + ::anno::display_name("Scratch Variation Amount"), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance") + ]], + float scratch_reflection_variation = 0.4f [[ + ::anno::description("Attenuates the reflection of the brushed metal which will also make the material appear darker."), + ::anno::display_name("Scratch Reflection Variation"), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance") + ]], + float scratches_bump = 0.65f [[ + ::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."), + ::anno::display_name("Scratches Bump Amount"), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance") + ]], + uniform bool enable_round_corners = false [[ + ::anno::display_name("Enable Round Corners"), + ::anno::in_group("Round Corners") + ]], + uniform float roundcorner_radius = 0.01f [[ + ::anno::display_name("Round Corner Radius"), + ::anno::description("Adjusts the radius of the round corner effect."), + ::anno::soft_range(0.0f, 0.1f), + ::anno::in_group("Round Corners") + ]], + uniform bool across_materials = false [[ + ::anno::display_name("Across Materials"), + ::anno::description("Applies the rounded corner effect also between other materials."), + ::anno::in_group("Round Corners") + ]], + uniform float2 texture_translate = 0.f [[ + ::anno::display_name("Translate"), + ::anno::description("Controls the position of the texture."), + ::anno::in_group("Transform") + ]], + uniform float texture_rotate = 0.f [[ + ::anno::display_name("Rotate"), + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::in_group("Transform") + ]], + uniform float2 texture_scale = 1.f [[ + ::anno::display_name("Scale"), + ::anno::description("Larger numbers increase the size."), + ::nvidia::core_definitions::dimension(float2(0.75f, 0.75f)), + ::anno::in_group("Transform") + ]], + uniform int uv_space_index = 0 [[ + ::anno::display_name("UV Space Index"), + ::anno::description("Use selected UV space for material."), + ::anno::in_group("Advanced") + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Brushed Tungsten - Strong Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Tungsten_Brushed.Tungsten_Brushed.png"), + ::anno::key_words(string[]("aec", "metal", "tungsten", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] + = + let { + color normal_reflectivity = color(0.951001417565f, 0.815051845356f, 0.751931718925f); // Tungsten + color grazing_reflectivity = color(0.99942f, 1.f, 1.f); + + bool tmp0 = false; + material_surface tmp1( + ::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)), + material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + 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)); + 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()); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + +export material Tungsten_Brushed_Light_Brushing(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Brushed Tungsten - Light Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Tungsten_Brushed.Tungsten_Brushed_Light_Brushing.png"), + ::anno::key_words(string[]("aec", "metal", "tungsten", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] + = Tungsten_Brushed ( + brush_width: 0.225f, + brush_height_blur: 0.035f, + scratch_variation_amount: 1.0f, + scratch_reflection_variation: 0.4f, + scratches_bump: 0.2f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0 +); + + + +export material Tungsten_Brushed_Medium_Light_Brushing(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Brushed Tungsten - Medium Light Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Tungsten_Brushed.Tungsten_Brushed_Medium_Light_Brushing.png"), + ::anno::key_words(string[]("aec", "metal", "tungsten", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] += Tungsten_Brushed ( + brush_width: 0.361f, + brush_height_blur: 0.204f, + scratch_variation_amount: 1.0f, + scratch_reflection_variation: 0.559f, + scratches_bump: 0.35f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0 +); + + + +export material Tungsten_Brushed_Medium_Brushing(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Brushed Tungsten - Medium Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Tungsten_Brushed.Tungsten_Brushed_Medium_Brushing.png"), + ::anno::key_words(string[]("aec", "metal", "tungsten", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] += Tungsten_Brushed ( + brush_width: 0.665f, + brush_height_blur: 0.471f, + scratch_variation_amount: 1.0f, + scratch_reflection_variation: 0.621f, + scratches_bump: 0.5f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0 +); + + +export material Tungsten_Brushed_Very_Strong_Brushing(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Brushed Tungsten - Very Strong Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Tungsten_Brushed.Tungsten_Brushed_Very_Strong_Brushing.png"), + ::anno::key_words(string[]("aec", "metal", "tungsten", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] += Tungsten_Brushed ( + brush_width: 1.0f, + brush_height_blur: 1.0f, + scratch_variation_amount: 1.0f, + scratch_reflection_variation: 0.824f, + scratches_bump: 1.0f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0 +); + + + + diff --git a/Material/material_0505/Retroreflective_Material.mdl b/Material/material_0505/Retroreflective_Material.mdl new file mode 100644 index 0000000000000000000000000000000000000000..7a795843d7fcf097eac34a8d2969b64f0073c3dc --- /dev/null +++ b/Material/material_0505/Retroreflective_Material.mdl @@ -0,0 +1,398 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. * + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + + +mdl 1.7; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + +const string DESCRIPTION = "A retroreflective tape material that is able to backscatter light towards the lightsource. " + "Useful for marking areas that require special attention, especially in dark situations"; + +float overlay(float base, float layer, float weight) +{ + return base + (1.0f - base) * layer * weight; +} + +float3 normalmap_normal( + uniform texture_2d texture, + float factor = 1.0, + ::base::texture_coordinate_info uvw = ::base::texture_coordinate_info() +) +{ + float3 lookup = (::tex::lookup_float3(texture, float2(uvw.position.x, uvw.position.y)) - float3(0.5)) * (factor * 2.0); + return ::math::normalize(uvw.tangent_u * lookup.x + uvw.tangent_v * lookup.y + ::state::normal() * (lookup.z + (1.0 - factor))); +} + + +::base::texture_coordinate_info transform_coordinate_2( + float4x4 transform + [[ ::anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix.") ]], + ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info() + [[ ::anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection.") ]] +) [[ + ::anno::description("Transform a texture coordinate by a matrix.") , + ::anno::noinline() + ]] +{ + + // Version 2 + float4 r_position = transform * float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1); + float4 u = transform[0]; + float3 ru = ::math::normalize(float3(u.x,u.y,u.z)); + float cos = ru.x; + float sin = -ru.y; + + return ::base::texture_coordinate_info( + float3(r_position.x,r_position.y,r_position.z), + ::math::normalize(cos * coordinate.tangent_u - sin * coordinate.tangent_v), + ::math::normalize(cos * coordinate.tangent_v + sin * coordinate.tangent_u)); +} + + +// Takes the standard input that every material has. It combines a couple of +// functions in one convenience function. +::base::texture_coordinate_info vmat_transform( + float2 translation = float2(0.0, 0.0), + float rotation = 0.0, // rotation in degrees + float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation_rad); + float c = ::math::cos(rotation_rad); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return transform_coordinate_2(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + +::base::texture_coordinate_info vmat_transform_post_scale( + ::base::texture_coordinate_info uvw, + float2 scale = 1.0f +) +{ + return ::base::texture_coordinate_info( + position: float3(uvw.position.x / scale.x, + uvw.position.y / scale.y, + uvw.position.z), + tangent_u: uvw.tangent_u, + tangent_v: uvw.tangent_v + ); +} + +export material Retroreflective_Material( + color material_color = color(0.223228f, 0.223228f, 0.223228f) [[ + ::anno::description("The color of the retroreflective print."), + ::anno::display_name("Material Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + color retroreflective_tint = color(1.f, 1.f, 1.f) [[ + ::anno::description("Tints the color of the retroreflection. Leave it bright, so the material keeps reflecting enough light."), + ::anno::display_name("Retroreflection Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(1) + ]], + float retroreflection_roughness = 0.2f [[ + ::anno::description("Spreads the angle of retroreflection which also comes with a reduction of intensity."), + ::anno::display_name("Retroreflection Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float smudges_amount = 0.0f [[ + ::anno::description("Add surface variation to the material to make the material appear to have been used before."), + ::anno::display_name("Smudges"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float roughness = 0.69f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + float bump_strength = 0.1f [[ + ::anno::description("Specifies the strength of the bump."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(5) + ]], + float2 texture_translate = 0.f [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform"), + ::anno::ui_order(6) + ]], + float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f), + ::anno::ui_order(7) + ]], + float2 texture_scale = 1.f [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::anno::ui_order(8) + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Uses selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Transform"), + ::anno::ui_order(9) + ]]) +[[ + ::anno::display_name("Retroreflective Material - Gray New"), + ::anno::author("Nvidia vMaterials"), + ::anno::description(DESCRIPTION), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Retroreflective_Material.Retroreflective_Material.png"), + ::anno::key_words(string[]("foil", "plastic", "new", "construction", "safety", "automotive", "retroreflective", "reflective", "interior", "exterior", "smooth", "gray", "neutral")) +]] + = + let { + bool tmp0 = false; + float2 texture_rescale = texture_scale * 0.5f; + material_surface tmp1(::df::custom_curve_layer(0.0799999982f, 1.f, 4.38000011f, 1.f, ::df::microfacet_ggx_smith_bsdf(overlay(::math::lerp(0.f, 0.639999986f, roughness), ::math::pow(::base::file_texture(texture_2d("./smudges_retro_paint.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_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).mono, 0.620000005f), smudges_amount) * overlay(::math::lerp(0.f, 0.639999986f, roughness), ::math::pow(::base::file_texture(texture_2d("./smudges_retro_paint.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_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).mono, 0.620000005f), smudges_amount), overlay(::math::lerp(0.f, 0.639999986f, roughness), ::math::pow(::base::file_texture(texture_2d("./smudges_retro_paint.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_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).mono, 0.620000005f), smudges_amount) * overlay(::math::lerp(0.f, 0.639999986f, roughness), ::math::pow(::base::file_texture(texture_2d("./smudges_retro_paint.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_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).mono, 0.620000005f), smudges_amount), color(1.f, 1.f, 1.f), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(0.319999993f, ::df::custom_curve_layer(0.f, 1.f, 1.29999995f, 1.f, ::df::diffuse_reflection_bsdf(material_color, 1.f), ::df::backscattering_glossy_reflection_bsdf((retroreflection_roughness * 0.25f + 0.199999988f) * (retroreflection_roughness * 0.25f + 0.199999988f), (retroreflection_roughness * 0.25f + 0.199999988f) * (retroreflection_roughness * 0.25f + 0.199999988f), nvidia::core_definitions::blend_colors(::base::file_texture(texture_2d("./glitter_noise_1k.png", ::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_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint, retroreflective_tint, ::base::color_layer_multiply, 1.f, true).tint, color(0.f, 0.f, 0.f), ::state::texture_tangent_u(0)), ::state::normal()), ::df::diffuse_reflection_bsdf(material_color, 1.f), ::state::normal()), ::state::normal()), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + 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), emission_intensity: color(0.f, 0.f, 0.f)); + material_geometry tmp5(float3(0.f), 1.f, normalmap_normal(texture_2d("./tape_patterns_norm.jpg", ::tex::gamma_linear), bump_strength, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 0.100000001f))); + hair_bsdf tmp6 = hair_bsdf(); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5, + hair: tmp6); + + +// 2 +export material Retroreflective_Material_Gray_Worn(*) +[[ + ::anno::display_name("Retroreflective Material - Gray Worn"), + ::anno::author("Nvidia vMaterials"), + ::anno::description(DESCRIPTION), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Retroreflective_Material.Retroreflective_Material_Gray_Worn.png"), + ::anno::key_words(string[]("foil", "plastic", "worn", "used", "construction", "safety", "automotive", "retroreflective", "reflective", "interior", "exterior", "smooth", "gray", "neutral")) +]] = Retroreflective_Material( + material_color: color(0.223228f, 0.223228f, 0.223228f), + retroreflective_tint: color(1.0f), + retroreflection_roughness: 0.25f, + smudges_amount: 1.0f, + roughness: 0.75f, + bump_strength: 0.1f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0 +); + + + +// 3 +export material Retroreflective_Material_White(*) +[[ + ::anno::display_name("Retroreflective Material - White"), + ::anno::author("Nvidia vMaterials"), + ::anno::description(DESCRIPTION), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Retroreflective_Material.Retroreflective_Material_White.png"), + ::anno::key_words(string[]("foil", "plastic", "new", "construction", "safety", "automotive", "retroreflective", "reflective", "interior", "exterior", "smooth", "white", "neutral")) +]] = Retroreflective_Material( + material_color: color(0.846873f, 0.846873f, 0.846873f), + retroreflective_tint: color(1.0f), + retroreflection_roughness: 0.25f, + smudges_amount: 0.22f, + roughness: 0.75f, + bump_strength: 0.1f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0 +); + + + +// 4 +export material Retroreflective_Material_Orange(*) +[[ + ::anno::display_name("Retroreflective Material - Orange"), + ::anno::author("Nvidia vMaterials"), + ::anno::description(DESCRIPTION), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Retroreflective_Material.Retroreflective_Material_Orange.png"), + ::anno::key_words(string[]("foil", "plastic", "new", "construction", "safety", "automotive", "retroreflective", "reflective", "interior", "exterior", "smooth", "orange", "warm", "saturated")) +]] = Retroreflective_Material( + material_color: color(1.000000f, 0.287441f, 0.000000f), + retroreflective_tint: color(1.000000f, 0.423268f, 0.054480f), + retroreflection_roughness: 0.25f, + smudges_amount: 0.22f, + roughness: 0.75f, + bump_strength: 0.1f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0 +); + + + +// 5 +export material Retroreflective_Material_Red(*) +[[ + ::anno::display_name("Retroreflective Material - Red"), + ::anno::author("Nvidia vMaterials"), + ::anno::description(DESCRIPTION), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Retroreflective_Material.Retroreflective_Material_Red.png"), + ::anno::key_words(string[]("foil", "plastic", "new", "construction", "safety", "automotive", "retroreflective", "reflective", "interior", "exterior", "smooth", "red", "saturated", "warm")) +]] = Retroreflective_Material( + material_color: color(0.814847f, 0.003035f, 0.003035f), + retroreflective_tint: color(1.000000f, 0.194618f, 0.194618f), + retroreflection_roughness: 0.25f, + smudges_amount: 0.22f, + roughness: 0.75f, + bump_strength: 0.1f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0 +); + + + +// 6 +export material Retroreflective_Material_Blue(*) +[[ + ::anno::display_name("Retroreflective Material - Blue"), + ::anno::author("Nvidia vMaterials"), + ::anno::description(DESCRIPTION), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Retroreflective_Material.Retroreflective_Material_Blue.png"), + ::anno::key_words(string[]("foil", "plastic", "new", "construction", "safety", "automotive", "retroreflective", "reflective", "interior", "exterior", "smooth", "blue", "cool", "saturated")) +]] = Retroreflective_Material( + material_color: color(0.012286f, 0.012286f, 0.737910f), + retroreflective_tint: color(0.149960f, 0.152926f, 1.000000f), + retroreflection_roughness: 0.25f, + smudges_amount: 0.22f, + roughness: 0.75f, + bump_strength: 0.1f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0 +); + + + +// 7 +export material Retroreflective_Material_Yellow(*) +[[ + ::anno::display_name("Retroreflective Material - Yellow"), + ::anno::author("Nvidia vMaterials"), + ::anno::description(DESCRIPTION), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Retroreflective_Material.Retroreflective_Material_Yellow.png"), + ::anno::key_words(string[]("foil", "plastic", "new", "construction", "safety", "automotive", "retroreflective", "reflective", "interior", "exterior", "smooth", "yellow", "warm", "saturated")) +]] = Retroreflective_Material( + material_color: color(1.000000f, 0.752942f, 0.000000f), + retroreflective_tint: color(1.000000f, 0.830770f, 0.082283f), + retroreflection_roughness: 0.25f, + smudges_amount: 0.22f, + roughness: 0.75f, + bump_strength: 0.1f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0 +); diff --git a/Material/material_0512/Carpaint_Shifting_Flakes.mdl b/Material/material_0512/Carpaint_Shifting_Flakes.mdl new file mode 100644 index 0000000000000000000000000000000000000000..3197c5a8d6b922c22c7a7ba9848a1858d210dd93 --- /dev/null +++ b/Material/material_0512/Carpaint_Shifting_Flakes.mdl @@ -0,0 +1,1626 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. * + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + + +mdl 1.6; +import ::df::*; +import ::math::*; +import ::anno::*; +import ::state::*; +import ::base::*; +import ::tex::*; +import ::nvidia::core_definitions::dimension; +import ::nvidia::core_definitions::blend_colors; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + + + +::base::texture_coordinate_info transform_coordinate_2( + float4x4 transform + [[ ::anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix.") ]], + ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info() + [[ ::anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection.") ]] +) [[ + ::anno::description("Transform a texture coordinate by a matrix.") , + ::anno::noinline() + ]] +{ + // Version 2 + float4 r_position = transform * float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1); + //Try aproximating it for the case that the rotation is only aroud z and assuming the texture layout is nice and z is ~constant. + //just pretend there is no other rotation happening + //get rid of scaling and translation. Then extract fields where sin and cos would be in a simple 2d transform around z. + float4 u = transform[0]; + float3 ru = ::math::normalize(float3(u.x,u.y,u.z)); + float cos = ru.x; + float sin = -ru.y; + + return ::base::texture_coordinate_info( + float3(r_position.x,r_position.y,r_position.z), + ::math::normalize(cos * coordinate.tangent_u - sin * coordinate.tangent_v), + ::math::normalize(cos * coordinate.tangent_v + sin * coordinate.tangent_u)); +} + +// Takes the standard input that every material has. It combines a couple of +// functions in one convenience function. +::base::texture_coordinate_info vmat_transform( + float2 translation = float2(0.0f, 0.0f), + float rotation = 0.0f, // rotation in degrees + float2 scaling = float2(1.0f, 1.0f), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + float4x4 scale = + float4x4(1.0f /scaling.x, 0.f , 0.f , 0.f, + 0.f , 1.0f /scaling.y , 0.f , 0.f, + 0.f , 0.f , 1.0f, 0.f, + translation.x , translation.y , 0.0f, 1.f); + + float s = ::math::sin(rotation_rad); + float c = ::math::cos(rotation_rad); + float4x4 rotate = + float4x4( c , -s , 0.0f , 0.0f, + s , c , 0.0f , 0.0f, + 0.0f, 0.0f , 1.0f , 0.0f, + 0.f , 0.0f , 0.0f , 1.f); + + return transform_coordinate_2(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + + + +float histogram_range(float input, float range = 1.0f, float position = 0.5f) +{ + float low = ::math::clamp(1.0f - ::math::min(((1.0f - position) + range * 0.5f), (1.0f - position) * 2), 0.0f, 1.0f); + float high = ::math::clamp(::math::min((position + range * 0.5f ), position * 2.0f), 0.0f, 1.0f); + return ::math::lerp(low, high, input); +} + +// +// flake noise utilities +// +int hash(int seed, int i) +{ + return (i ^ seed) * 1075385539; +} +int rnd_init(int3 pos) +{ + return hash(hash(hash(0, pos.x), pos.y), pos.z); +} + +int rnd_next(int seed) { + // xorshift32 using signed int + seed ^= seed << 13; + seed ^= seed >>> 17; + seed ^= seed << 5; + return seed; +} + +float rnd_value(int seed) +{ + //return ::math::abs(float(seed) * 4.6566fe-10f); + return ::math::abs(float(seed) * 0.00000000046566f); +} + +// apply random rotation (using "Fast Random Rotation Matrices" by James Arvo) +float3 rotate_pos(float3 pos, float3 xi) +{ + float theta = ::math::PI * 2.0f * xi.x; + float phi = ::math::PI * 2.0f * xi.y; + float z = xi.z * 2.0f; + + float r = ::math::sqrt(z); + float[2] sp_cp = ::math::sincos(phi); + float Vx = sp_cp[0] * r; + float Vy = sp_cp[1] * r; + float Vz = ::math::sqrt(2.0f - z); + + float[2] st_ct = ::math::sincos(theta); + float Sx = Vx * st_ct[1] - Vy * st_ct[0]; + float Sy = Vx * st_ct[0] + Vy * st_ct[1]; + + float3x3 M( + Vx * Sx - st_ct[1], Vx * Sy - st_ct[0], Vx * Vz, + Vy * Sx + st_ct[0], Vy * Sy - st_ct[1], Vy * Vz, + Vz * Sx, Vz * Sy, 1.0f - z); + + return M * pos; +} + +struct flake_noise_value { + // flake priority (in [0..1], 0: no flake, flakes with higher priority shadow flakes "below" them) + float priority; + // Stores values from the functions (once normal, another time the color) + // current pseudo random number generator seed + int rnd_seed; + float4 carrier; +}; + +// flake noise function with controllable regularity, flake size, and probability +flake_noise_value flake_noise( + float3 pos, + float jitter_scale = 1.0f, + float flake_diameter = 0.75f, + float flake_probability = 1.0f) +{ + float3 base_pos = ::math::floor(pos); + int3 base_pos_i = int3(base_pos); + + // limit the flake size to the allowed maximum (such that looking at all neighbors is sufficient) + flake_diameter = ::math::min(flake_diameter, (1.5f - 0.5f * jitter_scale) / ::math::sqrt(3.0f)); + + flake_noise_value val(0.0f, 0, float4(0.0f)); + + for (int i = -1; i < 2; ++i) { + for (int j = -1; j < 2; ++j) { + for (int k = -1; k < 2; ++k) { + + int seed = rnd_init(base_pos_i + int3(i, j, k)); + + seed = rnd_next(seed); + if (rnd_value(seed) > flake_probability) + continue; + + seed = rnd_next(seed); + float priority = rnd_value(seed); + if (priority < val.priority) + continue; + + float3 flake_pos = base_pos + float3(i, j, k) + float3(0.5f); + + if (jitter_scale > 0.0f) { + seed = rnd_next(seed); + flake_pos.x += (rnd_value(seed) - 0.5f) * jitter_scale; + seed = rnd_next(seed); + flake_pos.y += (rnd_value(seed) - 0.5f) * jitter_scale; + seed = rnd_next(seed); + flake_pos.z += (rnd_value(seed) - 0.5f) * jitter_scale; + } + + float3 p = pos - flake_pos; + if (::math::dot(p, p) >= flake_diameter * flake_diameter * 4.0f) + continue; + + float3 xi_rot; + seed = rnd_next(seed); + xi_rot.x = rnd_value(seed); + seed = rnd_next(seed); + xi_rot.y = rnd_value(seed); + seed = rnd_next(seed); + xi_rot.z = rnd_value(seed); + p = rotate_pos(p, xi_rot); + + if (::math::abs(p.x) <= flake_diameter && + ::math::abs(p.y) <= flake_diameter && + ::math::abs(p.z) <= flake_diameter) + { + val.priority = priority; + val.rnd_seed = seed; + } + } + } + } + + return val; +} + +// create a flake normal by importance sampling the Beckmann distribution with given roughness +flake_noise_value flake_normal( + flake_noise_value val, + float spread) +{ + if (val.priority <= 0.0f) + { + val.carrier = float4(::state::normal().x, ::state::normal().y, ::state::normal().z, 1.0f); + return val; + } + + int seed = rnd_next(val.rnd_seed); + float xi0 = rnd_value(seed); + seed = rnd_next(seed); + float xi1 = rnd_value(seed); + + float phi = ::math::PI * 2.0f * xi0; + + float roughness = spread * spread; + + float tantheta = ::math::sqrt(-roughness * roughness * ::math::log(1.0f - xi1)); + float sintheta = tantheta / ::math::sqrt(1.0f + tantheta * tantheta); + float costheta = ::math::sqrt(1.0f - sintheta * sintheta); + + float[2] scphi = ::math::sincos(phi); + + val.rnd_seed = seed; + + float3 normal = ::state::texture_tangent_u(0) * scphi[1] * sintheta + + ::state::texture_tangent_v(0) * scphi[0] * sintheta + + ::state::normal() * costheta; + + val.carrier = float4(normal.x, normal.y, normal.z, 1.0f); + + + return val; +} + +export material Carpaint_Shifting_Flakes( + color base_color = color(0.846873f, 0.846873f, 0.846873f) [[ + ::anno::description("Sets the base color of the carpaint."), + ::anno::display_name("Base"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + float ground_coat_influence = 0.24f [[ + ::anno::description("The ground coat layer is a metallic base layer over which the base color coat, the flakes and the clearcoat are applied. Use the parameter 'Ground Coat Brightness' to adjust its brightness."), + ::anno::display_name("Base Coat Influence"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float ground_coat_brightness = 0.93f [[ + ::anno::description("Adjusts the brightness of the metallic ground coat over which the base color coat, the flakes and the clearcoat are applied. Only has an effect, if the Ground Coat Influence is greater than 0.0f."), + ::anno::display_name("Base Coat Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float edge_darkening = 0.97f [[ + ::anno::description("The amount how much colors fade to darker color when looking at the carpaint at grazing angles. Low values make the carpaint look more flat."), + ::anno::display_name("Edge Darkening"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float flakes_reflectivity = 1.0f [[ + ::anno::description("The reflectivity of the flakes."), + ::anno::display_name("Flakes Reflectivity"), + ::anno::in_group("Flakes"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + uniform float flakes_density = 0.29f [[ + ::anno::description("Adjusts the density of the flakes. Lower number means less flake particles being applied."), + ::anno::display_name("Flakes Density"), + ::anno::in_group("Flakes"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(5) + ]], + float spread = 0.37f [[ + ::anno::description("The amount how much flakes are pointing to random directions. It is strongly discouraged using a value of 0.0f as the flakes will be oriented exactly as the surface normal, which will result in an unnatural look. Higher values lead to a more scintillating look of the flakes."), + ::anno::display_name("Flakes Spread"), + ::anno::enable_if("flakes_density > 0.0f"), + ::anno::in_group("Flakes"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(6) + ]], + float flakes_roughness = 0.44f [[ + ::anno::description("The roughness of the flakes itself. Higher values smoothen out the look of the flakes. Depending on the flakes being used in carpaints, use low values for a sparkling flake effect while mica flakes tend to have a higher roughness, leading to a smoother more pearlescent look on the final carpaint."), + ::anno::display_name("Flakes Roughness"), + ::anno::enable_if("flakes_density > 0.0f"), + ::anno::in_group("Flakes"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(7) + ]], + float flakes_size = 0.1f [[ + ::anno::description("Size of the metal flakes in millimeters."), + ::anno::display_name("Flakes Size (mm)"), + ::anno::enable_if("flakes_density > 0.0f"), + ::anno::soft_range(0.f, 1.f), + ::anno::in_group("Flakes"), + ::anno::ui_order(8) + ]], + + // Flakes colorshift colors + color flakes_paint_color_1 = color(1.000000f, 0.043735f,0.672443f) //color(0.297f, 0.66f, 0.875f) + [[ + ::anno::display_name("Paint Color 1"), + ::anno::description("First Color of the effect paint."), + ::anno::in_group("Flakes", "Flakes Gradient Colors"), + ::anno::ui_order(9) + ]], + color flakes_paint_color_2 = color(0.982251f, 0.407240f, 1.000000f) //color(0.392f, 0.36f, 1.f) + [[ + ::anno::display_name("Paint Color 2"), + ::anno::description("Second color of the effect paint."), + ::anno::in_group("Flakes", "Flakes Gradient Colors"), + ::anno::ui_order(10) + ]], + color flakes_paint_color_3 = color(0.830770f, 0.830770f, 0.830770f) //color(0.75f, 0.225f, 0.64f) + [[ + ::anno::display_name("Paint Color 3"), + ::anno::description("Third color of the effect paint."), + ::anno::in_group("Flakes", "Flakes Gradient Colors"), + ::anno::ui_order(11) + ]], + color flakes_paint_color_4 = color(0.806952f, 0.806952f, 0.806952f) //color(0.750f, 0.508f, 0.0f) + [[ + ::anno::display_name("Paint Color 4"), + ::anno::description("Fourth Color of the effect paint."), + ::anno::in_group("Flakes", "Flakes Gradient Colors"), + ::anno::ui_order(12) + ]], + color flakes_paint_color_5 = color(00.830770f, 0.830770f, 0.830770f) //color(0.553f, 0.75f, 0.232f) + [[ + ::anno::display_name("Paint Color 5"), + ::anno::description("Fifth color of the effect paint."), + ::anno::in_group("Flakes", "Flakes Gradient Colors"), + ::anno::ui_order(13) + ]], + + float flake_layer_visibility = 1.0f [[ + ::anno::description("Adjusts how much the flakes contribute to the final look. Lowering the value makes the flakes appear more transparent. At value of 0.0f no flakes are not rendered at all."), + ::anno::display_name("Flakes Visibility"), + ::anno::enable_if("flakes_density > 0.0f"), + ::anno::in_group("Flakes"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(14) + ]], + uniform texture_2d roughness_texture = texture_2d("./smudges_scratches_A_rough.jpg", ::tex::gamma_linear) [[ + ::anno::description("Texture to use for adding variation to the roughness on the clearcoat."), + ::anno::display_name("Roughness Texture"), + ::anno::in_group("Clearcoat"), + ::anno::ui_order(15) + ]], + float clearcoat_rough = 0.05f [[ + ::anno::description("The roughness of the clearcoat."), + ::anno::display_name("Clearcoat Roughness"), + ::anno::in_group("Clearcoat"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(16) + ]], + float roughness_variation = 0.3f [[ + ::anno::description("The amount of variation to apply to the roughness. This parameter only has an effect when the clearcoat roughness is not zero or one."), + ::anno::display_name("Clearcoat Roughness Variation"), + ::anno::in_group("Clearcoat"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(17) + ]], + float clearcoat_ior = 1.600f [[ + ::anno::description("The index of refraction for the clearcoat layer."), + ::anno::display_name("Clearcoat Index of Refraction"), + ::anno::in_group("Clearcoat"), + ::anno::soft_range(1.f, 3.f), + ::anno::hard_range(1.f, 5.f), + ::anno::ui_order(18) + ]], + float clearcoat_visibility = 1.f [[ + ::anno::description("While the full value is the correct physical behavior of the clearcoat, lowering the value to reduce the amount of reflection for artistic purposes."), + ::anno::display_name("Clearcoat Visibility"), + ::anno::in_group("Clearcoat"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(19) + ]], + uniform float orange_peel_strength = 0.f [[ + ::anno::description("Strength of the bump mapping effect."), + ::anno::display_name("Coat Orange Peel Strength"), + ::anno::in_group("Clearcoat"), + ::anno::soft_range(0.f, 1.f), + ::anno::hard_range(0.f, 2.f), + ::anno::ui_order(20) + ]], + uniform float orange_peel_size = 1.f [[ + ::anno::description("Size of the biggest feature of the pattern."), + ::anno::display_name("Coat Orange Peel Size"), + ::anno::soft_range(0.f, 1.f), + ::anno::in_group("Clearcoat"), + ::anno::ui_order(21) + ]], + float2 texture_translate = 0.f [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform"), + ::anno::ui_order(22) + ]], + float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f), + ::anno::ui_order(23) + ]], + float2 texture_scale = 1.f [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::anno::ui_order(24) + ]], + uniform bool roundcorners_enable = false [[ + ::anno::description("Enables the round corneer effect. Comes at a slight performance cost as additional raytracing calls are required to evaluate the round corner effect."), + ::anno::display_name("Enable Round Corners"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(25) + ]], + uniform float roundcorners_radius_mm = 1.5f [[ + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::display_name("Round Corner Radius (mm)"), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f), + ::anno::ui_order(26) + ]], + uniform bool roundcorners_across_materials = false [[ + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::display_name("Across Materials"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(27) + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Use selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced"), + ::anno::ui_order(28) + ]] +) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Chameleon - Gloss White to Pink"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "chameleon", "flipflop", "colorshift", "reflective", "artificial", "multilayer", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "clearcoat", "automotive", "design", "white", "multicolor")), + ::anno::thumbnail("./.thumbs/Carpaint_Shifting_Flakes.Carpaint_Shifting_Flakes.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = + let { + bool tmp0 = false; + // Tried Scaling factors for flakes to fit 1mm size both in Substance Designer and (Iray for) Rhino + // Rhino scaling factor: 1492.537313432835f + // Substance Designer Scaling factor: 1158.6829010512f + float flakes_size_m = (1492.537313432835f/flakes_size); // Flake scaling adjustment, so that flake size is in mm + float flake_layer_visibility_m = 1.0f - flake_layer_visibility; + + ::base::texture_coordinate_info coord_info = ::base::coordinate_source(::base::texture_coordinate_object, 0); + + float scale_trans = ::state::transform_scale(::state::coordinate_object, ::state::coordinate_world, 1.0f); + + float3 source_coord = coord_info.position * ::state::meters_per_scene_unit() * scale_trans; + + ::base::texture_coordinate_info transformed_coord = ::base::transform_coordinate( + ::base::rotation_translation_scale(float3(0.0f), float3(0.0f), float3(scale_trans)), + coord_info + ); + + material_surface tmp1(::df::fresnel_layer(clearcoat_ior, clearcoat_visibility, ::df::simple_glossy_bsdf(histogram_range(::base::file_texture(roughness_texture, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, roughness_variation, clearcoat_rough) * histogram_range(::base::file_texture(roughness_texture, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, roughness_variation, clearcoat_rough), histogram_range(::base::file_texture(roughness_texture, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, roughness_variation, clearcoat_rough) * histogram_range(::base::file_texture(roughness_texture, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, roughness_variation, clearcoat_rough), color(1.0f) /* flakes tint */, color(1.0f) /* flakes_tint */, ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::directional_factor(color(1.f, 1.f, 1.f), color(1.f - edge_darkening), 1.f, flakes_density > 0.f ? ::df::weighted_layer(::math::lerp(flake_noise(source_coord * flakes_size_m, 0.5f, 1.f, flakes_density * flakes_density).priority > 0.001f ? 1.0f : 0.0f , 0.f, flake_layer_visibility_m), + + // Artist-friendly color shift with custom colors + ::df::measured_curve_factor( + curve_values: color[](flakes_paint_color_1, flakes_paint_color_1, flakes_paint_color_2, flakes_paint_color_3, flakes_paint_color_4, flakes_paint_color_5, flakes_paint_color_5), //applying 5th color twice, since grazing angles are seen proportinally less + base: ::df::microfacet_ggx_smith_bsdf( + flakes_roughness * flakes_roughness, + flakes_roughness * flakes_roughness, + color(flakes_reflectivity), + color(flakes_reflectivity), + ::state::texture_tangent_u(0), + ::df::scatter_reflect + ) + ), + + + // ::df::thin_film( + // thickness: flakes_coating_thickness * 300.0f, // Does a user understand how the thickness in thin film even works!? + // ior: color(2.5f, 2.6f, 2.7f), //flakes_coating_ior, + // base: ::df::fresnel_factor( + // ior: color(1.25f, 1.35f, 1.4f), // Needs proper IOR of base substrates + // extinction_coefficient: color(1.0f, 2.5f, 4.0f), // Needs proper IOR of base substrates + // base: ::df::microfacet_ggx_smith_bsdf( + // flakes_roughness * flakes_roughness, + // flakes_roughness * flakes_roughness, + // color(flakes_reflectivity), + // color(flakes_reflectivity), + // ::state::texture_tangent_u(0), + // ::df::scatter_reflect + // ) + // ) + // ), + + ::df::directional_factor(base_color, color(1.f - edge_darkening), 1.f, ::df::weighted_layer(ground_coat_influence * 0.5f, ::df::microfacet_ggx_vcavities_bsdf(0.40959999f, 0.40959999f, color(ground_coat_brightness * 0.949999988f + 0.0500000007f), color(ground_coat_brightness * 0.949999988f + 0.0500000007f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::diffuse_reflection_bsdf(base_color, 0.f), ::state::normal())), float3(flake_normal(flake_noise(source_coord * flakes_size_m, 0.5f, 1.f, flakes_density * flakes_density ), spread).carrier.x, flake_normal(flake_noise(source_coord * flakes_size_m, 0.5f, 1.f, flakes_density * flakes_density ), spread).carrier.y, flake_normal(flake_noise(source_coord * flakes_size_m, 0.5f, 1.f, flakes_density * flakes_density ), spread).carrier.z)) : ::df::directional_factor(base_color, color(1.f - edge_darkening), 1.f, ::df::weighted_layer(ground_coat_influence * 0.5f, ::df::microfacet_ggx_vcavities_bsdf(0.40959999f, 0.40959999f, color(ground_coat_brightness * 0.95f + 0.05f), color(ground_coat_brightness * 0.949999988f + 0.0500000007f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::diffuse_reflection_bsdf(base_color, 0.f), ::state::normal()))), orange_peel_strength > 0.f ? ::base::perlin_noise_bump_texture(transformed_coord, orange_peel_strength, orange_peel_size, false, false, 0.f, 2, false, false, float3(0.f), 1.f, 0.f, 1.f, ::state::normal()) : ::state::normal()), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + 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)); + 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()); + hair_bsdf tmp6 = hair_bsdf(); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5, + hair: tmp6); + + +// ------------------- 2 White to Purple ------------------- +export material White_to_Purple(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Chameleon - White to Purple"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "chameleon", "flipflop", "colorshift", "reflective", "artificial", "multilayer", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "clearcoat", "automotive", "design", "white", "multicolor")), + ::anno::thumbnail("./.thumbs/Carpaint_Shifting_Flakes.White_to_Purple.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Shifting_Flakes( + base_color: color(0.846873f, 0.846873f, 0.846873f), + ground_coat_influence: 0.20f, + ground_coat_brightness: 0.93f, + edge_darkening: 0.97f, + flakes_reflectivity: 1.00f, + flakes_density: 0.29f, + spread: 0.37f, + flakes_roughness: 0.44f, + flakes_size: 0.1f, + flakes_paint_color_1: color(0.337164f, 0.043735f, 1.000000f), + flakes_paint_color_2: color(0.737910f, 0.407240f, 1.000000f), + flakes_paint_color_3: color(0.830770f, 0.830770f, 0.830770f), + flakes_paint_color_4: color(0.806952f, 0.806952f, 0.806952f), + flakes_paint_color_5: color(0.830770f, 0.830770f, 0.830770f), + flake_layer_visibility: 0.95f, + clearcoat_rough: 0.06f, + roughness_variation: 0.14f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.00f, + orange_peel_size: 0.01f +); + + +// ------------------- 3 White to Blue ------------------- +export material White_to_Blue(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Chameleon - White to Blue"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "chameleon", "flipflop", "colorshift", "reflective", "artificial", "multilayer", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "clearcoat", "automotive", "design", "white", "multicolor")), + ::anno::thumbnail("./.thumbs/Carpaint_Shifting_Flakes.White_to_Blue.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Shifting_Flakes( + base_color: color(0.846873f, 0.846873f, 0.846873f), + ground_coat_influence: 0.24f, + ground_coat_brightness: 0.93f, + edge_darkening: 0.97f, + flakes_reflectivity: 1.00f, + flakes_density: 0.29f, + spread: 0.37f, + flakes_roughness: 0.44f, + flakes_size: 0.1f, + flakes_paint_color_1: color(0.027321f, 0.029557f, 0.871367f), + flakes_paint_color_2: color(0.052861f, 0.029557f, 0.871367f), + flakes_paint_color_3: color(0.830770f, 0.830770f, 0.830770f), + flakes_paint_color_4: color(0.806952f, 0.806952f, 0.806952f), + flakes_paint_color_5: color(0.830770f, 0.830770f, 0.830770f), + flake_layer_visibility: 0.95f, + clearcoat_rough: 0.06f, + roughness_variation: 0.14f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.00f, + orange_peel_size: 0.01f +); + + +// ------------------- 4 White to Gold ------------------- +export material White_to_Gold(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Chameleon - White to Gold"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "chameleon", "flipflop", "colorshift", "reflective", "artificial", "multilayer", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "clearcoat", "automotive", "design", "white", "multicolor")), + ::anno::thumbnail("./.thumbs/Carpaint_Shifting_Flakes.White_to_Gold.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Shifting_Flakes( + base_color: color(0.846873f, 0.846873f, 0.846873f), + ground_coat_influence: 0.00f, + ground_coat_brightness: 0.34f, + edge_darkening: 0.57f, + flakes_reflectivity: 1.00f, + flakes_density: 0.16f, + spread: 0.52f, + flakes_roughness: 0.19f, + flakes_size: 0.1f, + flakes_paint_color_1: color(1.000000f, 0.552011f, 0.024158f), + flakes_paint_color_2: color(1.000000f, 0.752942f, 0.187821f), + flakes_paint_color_3: color(1.000000f, 1.000000f, 1.000000f), + flakes_paint_color_4: color(1.000000f, 1.000000f, 1.000000f), + flakes_paint_color_5: color(0.955973f, 0.955973f, 0.955973f), + flake_layer_visibility: 0.95f, + clearcoat_rough: 0.06f, + roughness_variation: 0.14f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.00f, + orange_peel_size: 0.01f +); + +// ------------------- 5 White Chameleon ------------------- +export material White_Chameleon(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Chameleon - White Chameleon"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "chameleon", "flipflop", "colorshift", "reflective", "artificial", "multilayer", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "clearcoat", "automotive", "design", "white", "multicolor")), + ::anno::thumbnail("./.thumbs/Carpaint_Shifting_Flakes.White_Chameleon.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Shifting_Flakes( + base_color: color(0.846873f, 0.846873f, 0.846873f), + ground_coat_influence: 0.00f, + ground_coat_brightness: 0.34f, + edge_darkening: 0.57f, + flakes_reflectivity: 1.00f, + flakes_density: 0.16f, + spread: 0.52f, + flakes_roughness: 0.19f, + flakes_size: 0.1f, + flake_layer_visibility: 0.95f, + flakes_paint_color_1: color(0.072272f, 0.737910f, 0.737910f), + flakes_paint_color_2: color(0.127438f, 0.107023f, 1.000000f), + flakes_paint_color_3: color(0.520996f, 0.040915f, 0.366253f), + flakes_paint_color_4: color(0.520996f, 0.223228f, 0.000000f), + flakes_paint_color_5: color(0.266356f, 0.520996f, 0.043735f), + clearcoat_rough: 0.06f, + roughness_variation: 0.14f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.00f, + orange_peel_size: 0.01f +); + + +// ------------------- 6 Green Aquatic ------------------- +export material Green_Aquatic(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Chameleon - Green Aquatic"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "chameleon", "flipflop", "colorshift", "reflective", "artificial", "multilayer", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "clearcoat", "automotive", "design", "green", "multicolor", "intense", "saturated")), + ::anno::thumbnail("./.thumbs/Carpaint_Shifting_Flakes.Green_Aquatic.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Shifting_Flakes( + base_color: color(0.010960f, 0.296138f, 0.031896f), + ground_coat_influence: 0.76f, + ground_coat_brightness: 0.93f, + edge_darkening: 0.1f, + flakes_reflectivity: 1.0f, + flakes_density: 0.57f, + spread: 0.37f, + flakes_roughness: 0.27f, + flakes_size: 0.1f, + flake_layer_visibility: 1.00f, + flakes_paint_color_1: color(0.174647f, 0.407240f, 0.031896f), + flakes_paint_color_2: color(0.031896f, 0.300544f, 0.009134f), + flakes_paint_color_3: color(0.035601f, 0.610496f, 0.270498f), + flakes_paint_color_4: color(0.042311f, 0.479320f, 0.644480f), + flakes_paint_color_5: color(0.000304f, 0.158961f, 0.171441f), + clearcoat_rough: 0.06f, + roughness_variation: 0.14f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.00f, + orange_peel_size: 0.01f +); + + +// ------------------- 7 Dimmed Green ------------------- +export material Dimmed_Green(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Chameleon - Dimmed Green"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "chameleon", "flipflop", "colorshift", "reflective", "artificial", "multilayer", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "clearcoat", "automotive", "design")), + ::anno::thumbnail("./.thumbs/Carpaint_Shifting_Flakes.Dimmed_Green.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Shifting_Flakes( + base_color: color(0.177888f, 0.296138f, 0.109462f), + ground_coat_influence: 0.76f, + ground_coat_brightness: 0.93f, + edge_darkening: 1.00f, + flakes_reflectivity: 1.00f, + flakes_density: 0.50f, + spread: 0.40f, + flakes_roughness: 0.19f, + flakes_size: 0.1f, + flakes_paint_color_1: color(0.274677f, 0.149960f, 0.021219f), + flakes_paint_color_2: color(0.467784f, 0.434154f, 0.013702f), + flakes_paint_color_3: color(0.063010f, 0.174647f, 0.341914f), + flakes_paint_color_4: color(0.194618f, 0.080220f, 0.520996f), + flakes_paint_color_5: color(0.296138f, 0.074214f, 0.552011f), + flake_layer_visibility: 1.00f, + clearcoat_rough: 0.06f, + roughness_variation: 0.14f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.00f, + orange_peel_size: 0.01f +); + + +// ------------------- 8 Goblin Fire ------------------- +export material Goblin_Fire(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Chameleon - Goblin Fire"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "chameleon", "flipflop", "colorshift", "reflective", "artificial", "multilayer", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "clearcoat", "automotive", "design", "multicolor", "green", "red", "saturated", "intense")), + ::anno::thumbnail("./.thumbs/Carpaint_Shifting_Flakes.Goblin_Fire.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Shifting_Flakes( + base_color: color(0.010960f, 0.250158f, 0.015996f), + ground_coat_influence: 0.24f, + ground_coat_brightness: 0.93f, + edge_darkening: 0.99f, + flakes_reflectivity: 1.00f, + flakes_density: 1.00f, + spread: 0.37f, + flakes_roughness: 0.29f, + flakes_size: 0.1f, + flake_layer_visibility: 0.82f, + flakes_paint_color_1: color(0.491021f, 0.022174f, 0.022174f), + flakes_paint_color_2: color(0.467784f, 0.491021f, 0.016807f), + flakes_paint_color_3: color(0.165132f, 0.491021f, 0.039546f), + flakes_paint_color_4: color(0.035601f, 0.479320f, 0.102242f), + flakes_paint_color_5: color(0.034340f, 0.407240f, 0.033105f), + clearcoat_rough: 0.06f, + roughness_variation: 0.14f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.00f, + orange_peel_size: 0.01f +); + + +// ------------------- 9 Emerald to Blue------------------- +export material Emerald_to_Blue(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Chameleon - Emerald to Blue"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "chameleon", "flipflop", "colorshift", "reflective", "artificial", "multilayer", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "clearcoat", "automotive", "design", "intense", "saturated", "blue", "cool")), + ::anno::thumbnail("./.thumbs/Carpaint_Shifting_Flakes.Emerald_to_Blue.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Shifting_Flakes( + base_color: color(0.017642f, 0.171441f, 0.262251f), + ground_coat_influence: 0.76f, + ground_coat_brightness: 0.93f, + edge_darkening: 0.99f, + flakes_reflectivity: 1.00f, + flakes_density: 1.00f, + spread: 0.31f, + flakes_roughness: 0.28f, + flakes_size: 0.1f, + flake_layer_visibility: 0.82f, + flakes_paint_color_1: color(0.054480f, 0.381326f, 0.162029f), + flakes_paint_color_2: color(0.029557f, 0.194618f, 0.051269f), + flakes_paint_color_3: color(0.076185f, 0.381326f, 0.603827f), + flakes_paint_color_4: color(0.141263f, 0.064803f, 0.571125f), + flakes_paint_color_5: color(0.102242f, 0.068478f, 0.539479f), + clearcoat_rough: 0.06f, + roughness_variation: 0.14f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.00f, + orange_peel_size: 0.01f +); + + +// ------------------- 10 Nebular ------------------- +export material Nebular(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Chameleon - Nebular"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "chameleon", "flipflop", "colorshift", "reflective", "artificial", "multilayer", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "clearcoat", "automotive", "design", "intense", "saturated", "multicolor")), + ::anno::thumbnail("./.thumbs/Carpaint_Shifting_Flakes.Nebular.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Shifting_Flakes( + base_color: color(0.033105f, 0.086500f, 0.212231f), + ground_coat_influence: 0.24f, + ground_coat_brightness: 0.93f, + edge_darkening: 0.60f, + flakes_reflectivity: 1.00f, + flakes_density: 1.00f, + spread: 0.32f, + flakes_roughness: 0.29f, + flakes_size: 0.1f, + clearcoat_rough: 0.06f, + flakes_paint_color_1: color(0.467784f, 0.491021f, 0.016807f), + flakes_paint_color_2: color(0.822786f, 0.171441f, 0.000000f), + flakes_paint_color_3: color(0.165132f, 0.491021f, 0.039546f), + flakes_paint_color_4: color(0.012286f, 0.630757f, 0.723055f), + flakes_paint_color_5: color(0.011612f, 0.072272f, 0.760525f), + flake_layer_visibility: 1.00f, + roughness_variation: 0.14f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.00f, + orange_peel_size: 0.01f +); + + +// ------------------- 11 Elegant Emerald ------------------- +export material Elegant_Emerald(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Chameleon - Elegant Emerald"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "chameleon", "flipflop", "colorshift", "reflective", "artificial", "multilayer", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "clearcoat", "automotive", "design", "emerald", "green")), + ::anno::thumbnail("./.thumbs/Carpaint_Shifting_Flakes.Elegant_Emerald.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Shifting_Flakes( + base_color: color(0.017642f, 0.262251f, 0.088656f), + ground_coat_influence: 0.76f, + ground_coat_brightness: 0.93f, + edge_darkening: 1.00f, + flakes_reflectivity: 1.00f, + flakes_density: 0.33f, + spread: 0.31f, + flakes_roughness: 0.28f, + flakes_size: 0.1f, + flake_layer_visibility: 0.95f, + flakes_paint_color_1: color(0.054480f, 0.381326f, 0.162029f), + flakes_paint_color_2: color(0.029557f, 0.194618f, 0.051269f), + flakes_paint_color_3: color(0.076185f, 0.381326f, 0.603827f), + flakes_paint_color_4: color(0.141263f, 0.064803f, 0.571125f), + flakes_paint_color_5: color(0.102242f, 0.068478f, 0.539479f), + clearcoat_rough: 0.06f, + roughness_variation: 0.14f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.00f, + orange_peel_size: 0.01f +); + + +// ------------------- 12 Purple Red Orange ------------------- +export material Purple_Red_Orange(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Chameleon - Purple Red Orange"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "chameleon", "flipflop", "colorshift", "reflective", "artificial", "multilayer", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "clearcoat", "automotive", "design", "purple", "multicolor")), + ::anno::thumbnail("./.thumbs/Carpaint_Shifting_Flakes.Purple_Red_Orange.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Shifting_Flakes( + base_color: color(0.097587f, 0.017642f, 0.262251f), + ground_coat_influence: 0.76f, + ground_coat_brightness: 0.93f, + edge_darkening: 0.7f, + flakes_reflectivity: 1.00f, + flakes_density: 1.00f, + spread: 0.31f, + flakes_roughness: 0.28f, + flakes_size: 0.1f, + flake_layer_visibility: 0.95f, + flakes_paint_color_1: color(0.212231f, 0.076185f, 0.623960f), + flakes_paint_color_2: color(0.318547f, 0.038204f, 0.038204f), + flakes_paint_color_3: color(0.242281f, 0.063010f, 0.491021f), + flakes_paint_color_4: color(0.806952f, 0.371238f, 0.088656f), + flakes_paint_color_5: color(0.730461f, 0.428690f, 0.088656f), + clearcoat_rough: 0.06f, + roughness_variation: 0.14f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.00f, + orange_peel_size: 0.01f +); + + +// ------------------- 13 Golden Green Intense------------------- +export material Golden_Green_Intense(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Chameleon - Golden Green Intense"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "chameleon", "flipflop", "colorshift", "reflective", "artificial", "multilayer", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "clearcoat", "automotive", "design")), + ::anno::thumbnail("./.thumbs/Carpaint_Shifting_Flakes.Golden_Green_Intense.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Shifting_Flakes( + base_color: color(0.023153f, 0.283149f, 0.102242f), + ground_coat_influence: 0.76f, + ground_coat_brightness: 0.93f, + edge_darkening: 0.99f, + flakes_reflectivity: 1.00f, + flakes_density: 0.58f, + spread: 0.24f, + flakes_roughness: 0.27f, + flakes_size: 0.1f, + flake_layer_visibility: 0.93f, + flakes_paint_color_1: color(0.571125f, 0.434154f, 0.042311f), + flakes_paint_color_2: color(0.462077f, 0.351533f, 0.035601f), + flakes_paint_color_3: color(0.496933f, 0.610496f, 0.068478f), + flakes_paint_color_4: color(0.165132f, 0.644480f, 0.242281f), + flakes_paint_color_5: color(0.048172f, 0.171441f, 0.086500f), + clearcoat_rough: 0.06f, + roughness_variation: 0.14f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.00f, + orange_peel_size: 0.01f +); + + +// ------------------- 14 Soft Golden Green ------------------- +export material Soft_Golden_Green(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Chameleon - Soft Golden Green"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "chameleon", "flipflop", "colorshift", "reflective", "artificial", "multilayer", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "clearcoat", "automotive", "design", "green", "multicolor")), + ::anno::thumbnail("./.thumbs/Carpaint_Shifting_Flakes.Soft_Golden_Green.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Shifting_Flakes( + base_color: color(0.029557f, 0.124772f, 0.052861f), + ground_coat_influence: 0.76f, + ground_coat_brightness: 0.93f, + edge_darkening: 1.00f, + flakes_reflectivity: 1.00f, + flakes_density: 0.53f, + spread: 0.37f, + flakes_roughness: 0.27f, + flakes_size: 0.1f, + flake_layer_visibility: 0.53f, + flakes_paint_color_1: color(0.571125f, 0.434154f, 0.042311f), + flakes_paint_color_2: color(0.327778f, 0.462077f, 0.035601f), + flakes_paint_color_3: color(0.450786f, 0.610496f, 0.198069f), + flakes_paint_color_4: color(0.165132f, 0.644480f, 0.177888f), + flakes_paint_color_5: color(0.048172f, 0.171441f, 0.086500f), + clearcoat_rough: 0.06f, + roughness_variation: 0.14f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.00f, + orange_peel_size: 0.01f +); + + +// ------------------- 15 ------------------- +export material Gold_Green_Purple(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Chameleon - Blue Gold Green Purple"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "chameleon", "flipflop", "colorshift", "reflective", "artificial", "multilayer", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "clearcoat", "automotive", "design", "multicolor", "blue", "cool", "intense")), + ::anno::thumbnail("./.thumbs/Carpaint_Shifting_Flakes.Gold_Green_Purple.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Shifting_Flakes( + base_color: color(0.029557f, 0.097587f, 0.141263f), + ground_coat_influence: 0.76f, + ground_coat_brightness: 0.93f, + edge_darkening: 0.70f, + flakes_reflectivity: 1.00f, + flakes_density: 0.35f, + spread: 0.31f, + flakes_roughness: 0.36f, + flakes_size: 0.1f, + flake_layer_visibility: 0.95f, + flakes_paint_color_1: color(0.491021f, 0.258183f, 0.029557f), + flakes_paint_color_2: color(0.024158f, 0.445201f, 0.119538f), + flakes_paint_color_3: color(0.042311f, 0.479320f, 0.584078f), + flakes_paint_color_4: color(0.147027f, 0.049707f, 0.806952f), + flakes_paint_color_5: color(0.318547f, 0.088656f, 0.730461f), + clearcoat_rough: 0.06f, + roughness_variation: 0.14f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.00f, + orange_peel_size: 0.01f +); + + +// ------------------- 16 ------------------- +export material Electric_Shimmer(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Chameleon - Electric Shimmer"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "chameleon", "flipflop", "colorshift", "reflective", "artificial", "multilayer", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "clearcoat", "automotive", "design", "blue", "saturated", "intense", "multicolor", "cool")), + ::anno::thumbnail("./.thumbs/Carpaint_Shifting_Flakes.Electric_Shimmer.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Shifting_Flakes( + base_color: color(0.029557f, 0.309469f, 0.479320f), + ground_coat_influence: 0.76f, + ground_coat_brightness: 0.93f, + edge_darkening: 1.00f, + flakes_reflectivity: 1.00f, + flakes_density: 0.45f, + spread: 0.31f, + flakes_roughness: 0.28f, + flakes_size: 0.1f, + flake_layer_visibility: 0.95f, + flakes_paint_color_1: color(0.054480f, 0.351533f, 0.381326f), + flakes_paint_color_2: color(0.029557f, 0.138432f, 0.194618f), + flakes_paint_color_3: color(0.076185f, 0.381326f, 0.603827f), + flakes_paint_color_4: color(0.141263f, 0.064803f, 0.571125f), + flakes_paint_color_5: color(0.102242f, 0.068478f, 0.539479f), + clearcoat_rough: 0.06f, + roughness_variation: 0.14f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.00f, + orange_peel_size: 0.01f +); + + +// ------------------- 17 ------------------- +export material Blue_Purple_Emerald(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Chameleon - Blue Purple Emerald"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "chameleon", "flipflop", "colorshift", "reflective", "artificial", "multilayer", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "clearcoat", "automotive", "design", "blue", "purple", "cool", "intense", "multicolor")), + ::anno::thumbnail("./.thumbs/Carpaint_Shifting_Flakes.Blue_Purple_Emerald.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Shifting_Flakes( + base_color: color(0.011612f, 0.147027f, 0.109462f), + ground_coat_influence: 0.76f, + ground_coat_brightness: 0.93f, + edge_darkening: 1.00f, + flakes_reflectivity: 1.00f, + flakes_density: 0.73f, + spread: 0.49f, + flakes_roughness: 0.23f, + flakes_size: 0.1f, + flake_layer_visibility: 0.95f, + flakes_paint_color_1: color(0.082283f, 0.539479f, 0.584078f), + flakes_paint_color_2: color(0.144128f, 0.040915f, 0.283149f), + flakes_paint_color_3: color(0.278894f, 0.078187f, 0.479320f), + flakes_paint_color_4: color(0.051269f, 0.462077f, 0.181164f), + flakes_paint_color_5: color(0.052861f, 0.462077f, 0.141263f), + clearcoat_rough: 0.06f, + roughness_variation: 0.14f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.00f, + orange_peel_size: 0.01f +); + + +// ------------------- 18 ------------------- +export material Petrol_Purple(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Chameleon - Petrol Purple"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "chameleon", "flipflop", "colorshift", "reflective", "artificial", "multilayer", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "clearcoat", "automotive", "design", "blue", "intense", "cool", "multicolor")), + ::anno::thumbnail("./.thumbs/Carpaint_Shifting_Flakes.Petrol_Purple.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Shifting_Flakes( + base_color: color(0.013702f, 0.086500f, 0.187821f), + ground_coat_influence: 0.76f, + ground_coat_brightness: 0.93f, + edge_darkening: 1.00f, + flakes_reflectivity: 1.00f, + flakes_density: 0.30f, + spread: 0.31f, + flakes_roughness: 0.25f, + flakes_size: 0.1f, + flake_layer_visibility: 0.95f, + flakes_paint_color_1: color(0.201556f, 0.258183f, 0.539479f), + flakes_paint_color_2: color(0.095307f, 0.270498f, 0.508881f), + flakes_paint_color_3: color(0.107023f, 0.439657f, 0.637597f), + flakes_paint_color_4: color(0.283149f, 0.093059f, 0.520996f), + flakes_paint_color_5: color(0.423268f, 0.155926f, 0.745404f), + clearcoat_rough: 0.06f, + roughness_variation: 0.14f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.00f, + orange_peel_size: 0.01f +); + + +// ------------------- 19 ------------------- +export material Deep_Blue_Purple(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Chameleon - Deep Blue Purple"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "chameleon", "flipflop", "colorshift", "reflective", "artificial", "multilayer", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "clearcoat", "automotive", "design", "blue", "purple", "multicolor", "cool", "intense", "saturated")), + ::anno::thumbnail("./.thumbs/Carpaint_Shifting_Flakes.Deep_Blue_Purple.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Shifting_Flakes( + base_color: color(0.013702f, 0.086500f, 0.187821f), + ground_coat_influence: 0.76f, + ground_coat_brightness: 0.93f, + edge_darkening: 1.00f, + flakes_reflectivity: 1.00f, + flakes_density: 0.3f, + spread: 0.31f, + flakes_roughness: 0.25f, + flakes_size: 0.1f, + flake_layer_visibility: 0.95f, + flakes_paint_color_1: color(0.201556f, 0.258183f, 0.539479f), + flakes_paint_color_2: color(0.095307f, 0.270498f, 0.508881f), + flakes_paint_color_3: color(0.107023f, 0.439657f, 0.637597f), + flakes_paint_color_4: color(0.283149f, 0.093059f, 0.520996f), + flakes_paint_color_5: color(0.423268f, 0.155926f, 0.745404f), + clearcoat_rough: 0.06f, + roughness_variation: 0.14f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.00f, + orange_peel_size: 0.01f +); + + +// ------------------- 20 Turquoise Purple ------------------- +export material Turquoise_Purple(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Chameleon - Turquoise Purple"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "chameleon", "flipflop", "colorshift", "reflective", "artificial", "multilayer", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "clearcoat", "automotive", "design", "turquoise", "blue", "cool", "multicolor", "intense")), + ::anno::thumbnail("./.thumbs/Carpaint_Shifting_Flakes.Turquoise_Purple.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Shifting_Flakes( + base_color: color(0.017642f, 0.004025f, 0.051269f), + ground_coat_influence: 0.76f, + ground_coat_brightness: 0.93f, + edge_darkening: 0.50f, + flakes_reflectivity: 1.00f, + flakes_density: 0.40f, + spread: 0.35f, + flakes_roughness: 0.24f, + flakes_size: 0.1f, + flake_layer_visibility: 0.95f, + flakes_paint_color_1: color(0.022174f, 0.571125f, 0.309469f), + flakes_paint_color_2: color(0.028426f, 0.571125f, 0.278894f), + flakes_paint_color_3: color(0.012286f, 0.033105f, 0.155926f), + flakes_paint_color_4: color(0.356400f, 0.022174f, 0.366253f), + flakes_paint_color_5: color(0.318547f, 0.031896f, 0.162029f), + clearcoat_rough: 0.06f, + roughness_variation: 0.14f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.00f, + orange_peel_size: 0.01f +); + + +// ------------------- 21 ------------------- +export material Desert_Wind(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Chameleon - Desert Wind"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "chameleon", "flipflop", "colorshift", "reflective", "artificial", "multilayer", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "clearcoat", "automotive", "design", "red", "warm", "multicolor", "intense")), + ::anno::thumbnail("./.thumbs/Carpaint_Shifting_Flakes.Desert_Wind.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Shifting_Flakes( + base_color: color(0.366253f, 0.023153f, 0.023153f), + ground_coat_influence: 0.3f, + ground_coat_brightness: 0.8f, + edge_darkening: 0.54f, + flakes_reflectivity: 1.00f, + flakes_density: 0.25f, + spread: 0.28f, + flakes_roughness: 0.33f, + flakes_size: 0.1f, + flake_layer_visibility: 0.95f, + flakes_paint_color_1: color(0.745404f, 0.571125f, 0.111932f), + flakes_paint_color_2: color(0.637597f, 0.456411f, 0.070360f), + flakes_paint_color_3: color(0.658375f, 0.039546f, 0.391572f), + flakes_paint_color_4: color(0.479320f, 0.035601f, 0.174647f), + flakes_paint_color_5: color(0.407240f, 0.033105f, 0.250158f), + clearcoat_rough: 0.06f, + roughness_variation: 0.14f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.00f, + orange_peel_size: 0.01f +); + + +// ------------------- 22 ------------------- +export material Green_Dragon_Monsterflakes(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Chameleon - Green Dragon Monsterflakes"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "chameleon", "flipflop", "colorshift", "reflective", "artificial", "multilayer", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "clearcoat", "automotive", "design", "green", "intense", "multicolor")), + ::anno::thumbnail("./.thumbs/Carpaint_Shifting_Flakes.Green_Dragon_Monsterflakes.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Shifting_Flakes( + base_color: color(0.042311f, 0.296138f, 0.010960f), + ground_coat_influence: 0.76f, + ground_coat_brightness: 0.93f, + edge_darkening: 1.00f, + flakes_reflectivity: 1.00f, + flakes_density: 0.44f, + spread: 0.37f, + flakes_roughness: 0.27f, + flakes_size: 0.85f, + flake_layer_visibility: 1.00f, + flakes_paint_color_1: color(0.099899f, 0.318547f, 0.462077f), + flakes_paint_color_2: color(0.107023f, 0.318547f, 0.462077f), + flakes_paint_color_3: color(0.116971f, 0.450786f, 0.672443f), + flakes_paint_color_4: color(0.107023f, 0.708376f, 0.242281f), + flakes_paint_color_5: color(0.078187f, 0.434154f, 0.099899f), + clearcoat_rough: 0.06f, + roughness_variation: 0.14f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.00f, + orange_peel_size: 0.01f +); + + +// ------------------- 23 ------------------- +export material Andromeda(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Chameleon - Andromeda"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "chameleon", "flipflop", "colorshift", "reflective", "artificial", "multilayer", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "clearcoat", "automotive", "design", "multicolor", "intense")), + ::anno::thumbnail("./.thumbs/Carpaint_Shifting_Flakes.Andromeda.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Shifting_Flakes( + base_color: color(0.010330f, 0.010330f, 0.010330f), + ground_coat_influence: 0.76f, + ground_coat_brightness: 0.93f, + edge_darkening: 1.00f, + flakes_reflectivity: 1.00f, + flakes_density: 0.36f, + spread: 0.47f, + flakes_roughness: 0.27f, + flakes_size: 0.1f, + flake_layer_visibility: 1.00f, + flakes_paint_color_1: color(0.637597f, 0.144128f, 0.070360f), + flakes_paint_color_2: color(0.198069f, 0.730461f, 0.016807f), + flakes_paint_color_3: color(0.017642f, 0.658375f, 0.049707f), + flakes_paint_color_4: color(0.017642f, 0.034340f, 0.904661f), + flakes_paint_color_5: color(0.278894f, 0.018500f, 1.000000f), + clearcoat_rough: 0.06f, + roughness_variation: 0.14f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.00f, + orange_peel_size: 0.01f +); + + +// ------------------- 24 ------------------- +export material Blue_Saphire(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Chameleon - Blue Saphire"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "chameleon", "flipflop", "colorshift", "reflective", "artificial", "multilayer", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "clearcoat", "automotive", "design", "blue", "purple", "multicolor", "cool", "intense")), + ::anno::thumbnail("./.thumbs/Carpaint_Shifting_Flakes.Blue_Saphire.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Shifting_Flakes( + base_color: color(0.016807f, 0.026241f, 0.144128f), + ground_coat_influence: 0.76f, + ground_coat_brightness: 0.93f, + edge_darkening: 1.00f, + flakes_reflectivity: 1.00f, + flakes_density: 0.36f, + spread: 0.47f, + flakes_roughness: 0.27f, + flakes_size: 0.1f, + flake_layer_visibility: 1.00f, + flakes_paint_color_1: color(0.082283f, 0.122139f, 0.708376f), + flakes_paint_color_2: color(0.074214f, 0.074214f, 0.708376f), + flakes_paint_color_3: color(0.019382f, 0.033105f, 0.124772f), + flakes_paint_color_4: color(0.381326f, 0.054480f, 0.904661f), + flakes_paint_color_5: color(0.270498f, 0.042311f, 0.623960f), + clearcoat_rough: 0.06f, + roughness_variation: 0.14f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.00f, + orange_peel_size: 0.01f +); + + +// ------------------- 25 ------------------- +export material Bionic_Flare(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Chameleon - Bionic Flare"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "chameleon", "flipflop", "colorshift", "reflective", "artificial", "multilayer", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "clearcoat", "automotive", "design", "green", "multicolor", "saturated", "intense")), + ::anno::thumbnail("./.thumbs/Carpaint_Shifting_Flakes.Bionic_Flare.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Shifting_Flakes( + base_color: color(0.019382f, 0.017642f, 0.003677f), + ground_coat_influence: 0.76f, + ground_coat_brightness: 0.93f, + edge_darkening: 1.00f, + flakes_reflectivity: 1.00f, + flakes_density: 0.43f, + spread: 0.47f, + flakes_roughness: 0.27f, + flakes_size: 0.1f, + flake_layer_visibility: 1.00f, + flakes_paint_color_1: color(0.527115f, 0.708376f, 0.082283f), + flakes_paint_color_2: color(0.423268f, 0.708376f, 0.074214f), + flakes_paint_color_3: color(0.019382f, 0.124772f, 0.025187f), + flakes_paint_color_4: color(0.104616f, 0.904661f, 0.054480f), + flakes_paint_color_5: color(0.042311f, 0.623960f, 0.177888f), + clearcoat_rough: 0.06f, + roughness_variation: 0.14f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.00f, + orange_peel_size: 0.01f +); + + +// ------------------- 26 ------------------- +export material Aquatic(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Chameleon - Aquatic"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "chameleon", "flipflop", "colorshift", "reflective", "artificial", "multilayer", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "clearcoat", "automotive", "design", "blue", "green", "cool", "multicolor", "intense")), + ::anno::thumbnail("./.thumbs/Carpaint_Shifting_Flakes.Aquatic.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Shifting_Flakes( + base_color: color(0.017642f, 0.171441f, 0.262251f), + ground_coat_influence: 0.76f, + ground_coat_brightness: 0.93f, + edge_darkening: 1.00f, + flakes_reflectivity: 1.00f, + flakes_density: 0.42f, + spread: 0.23f, + flakes_roughness: 0.30f, + flakes_size: 0.1f, + flake_layer_visibility: 0.95f, + flakes_paint_color_1: color(0.054480f, 0.445201f, 0.059511f), + flakes_paint_color_2: color(0.019382f, 0.283149f, 0.059511f), + flakes_paint_color_3: color(0.141263f, 0.603827f, 0.187821f), + flakes_paint_color_4: color(0.111932f, 0.571125f, 0.491021f), + flakes_paint_color_5: color(0.090842f, 0.539479f, 0.462077f), + clearcoat_rough: 0.06f, + roughness_variation: 0.14f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.00f, + orange_peel_size: 0.01f +); + + +// ------------------- 27 ------------------- +export material Poseidon(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Chameleon - Poseidon"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "chameleon", "flipflop", "colorshift", "reflective", "artificial", "multilayer", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "clearcoat", "automotive", "design", "blue", "multicolor", "intense", "cool")), + ::anno::thumbnail("./.thumbs/Carpaint_Shifting_Flakes.Poseidon.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Shifting_Flakes( + base_color: color(0.017642f, 0.171441f, 0.262251f), + ground_coat_influence: 0.76f, + ground_coat_brightness: 0.93f, + edge_darkening: 1.00f, + flakes_reflectivity: 1.00f, + flakes_density: 0.44f, + spread: 0.23f, + flakes_roughness: 0.30f, + flakes_size: 0.1f, + flake_layer_visibility: 0.95f, + flakes_paint_color_1: color(0.114435f, 0.215861f, 0.445201f), + flakes_paint_color_2: color(0.068478f, 0.158961f, 0.283149f), + flakes_paint_color_3: color(0.158961f, 0.219526f, 0.242281f), + flakes_paint_color_4: color(0.346704f, 0.147027f, 0.571125f), + flakes_paint_color_5: color(0.258183f, 0.141263f, 0.539479f), + clearcoat_rough: 0.06f, + roughness_variation: 0.14f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.00f, + orange_peel_size: 0.01f +); + + +// ------------------- 28 ------------------- +export material Red_Elegance(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Chameleon - Red Elegance"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "chameleon", "flipflop", "colorshift", "reflective", "artificial", "multilayer", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "clearcoat", "automotive", "design", "red", "warm", "multicolor", "intense")), + ::anno::thumbnail("./.thumbs/Carpaint_Shifting_Flakes.Red_Elegance.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Shifting_Flakes( + base_color: color(0.262251f, 0.080220f, 0.017642f), + ground_coat_influence: 0.76f, + ground_coat_brightness: 0.93f, + edge_darkening: 1.00f, + flakes_reflectivity: 1.00f, + flakes_density: 0.44f, + spread: 0.23f, + flakes_roughness: 0.30f, + flakes_size: 0.1f, + flake_layer_visibility: 0.95f, + flakes_paint_color_1: color(0.407240f, 0.008568f, 0.152926f), + flakes_paint_color_2: color(0.300544f, 0.009134f, 0.109462f), + flakes_paint_color_3: color(0.610496f, 0.080220f, 0.010330f), + flakes_paint_color_4: color(0.644480f, 0.381326f, 0.010960f), + flakes_paint_color_5: color(0.552011f, 0.341914f, 0.009134f), + clearcoat_rough: 0.06f, + roughness_variation: 0.14f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.00f, + orange_peel_size: 0.01f +); + + +// ------------------- 29 ------------------- +export material Princess_Fire(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Chameleon - Pink Fire"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "chameleon", "flipflop", "colorshift", "reflective", "artificial", "multilayer", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "clearcoat", "automotive", "design", "pink", "rose", "intense", "warm", "multicolor")), + ::anno::thumbnail("./.thumbs/Carpaint_Shifting_Flakes.Princess_Fire.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Shifting_Flakes( + base_color: color(0.417885f, 0.198069f, 0.187821f), + ground_coat_influence: 0.76f, + ground_coat_brightness: 0.93f, + edge_darkening: 0.57f, + flakes_reflectivity: 1.00f, + flakes_density: 0.39f, + spread: 0.23f, + flakes_roughness: 0.30f, + flakes_size: 0.1f, + flake_layer_visibility: 0.95f, + flakes_paint_color_1: color(0.508881f, 0.270498f, 0.396755f), + flakes_paint_color_2: color(0.462077f, 0.012286f, 0.162029f), + flakes_paint_color_3: color(0.610496f, 0.381326f, 0.102242f), + flakes_paint_color_4: color(0.644480f, 0.371238f, 0.007499f), + flakes_paint_color_5: color(0.552011f, 0.337164f, 0.006995f), + clearcoat_rough: 0.06f, + roughness_variation: 0.14f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.00f, + orange_peel_size: 0.01f +); + + +// ------------------- 30 ------------------- +export material Magic_Green(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Chameleon - Magic Green"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "chameleon", "flipflop", "colorshift", "reflective", "artificial", "multilayer", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "clearcoat", "automotive", "design", "green", "intense", "saturated", "multicolor")), + ::anno::thumbnail("./.thumbs/Carpaint_Shifting_Flakes.Magic_Green.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Shifting_Flakes( + base_color: color(0.630757f, 0.520996f, 0.111932f), + ground_coat_influence: 0.76f, + ground_coat_brightness: 0.93f, + edge_darkening: 0.57f, + flakes_reflectivity: 1.00f, + flakes_density: 0.66f, + spread: 0.23f, + flakes_roughness: 0.3f, + flakes_size: 0.1f, + flakes_paint_color_1: color(0.238398f, 0.637597f, 0.004025f), + flakes_paint_color_2: color(0.003677f, 0.407240f, 0.003677f), + flakes_paint_color_3: color(0.012983f, 0.351533f, 0.223228f), + flakes_paint_color_4: color(0.006049f, 0.174647f, 0.130136f), + flakes_paint_color_5: color(0.003677f, 0.024158f, 0.191202f), + flake_layer_visibility: 0.95f, + clearcoat_rough: 0.06f, + roughness_variation: 0.14f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.00f, + orange_peel_size: 0.01f +); + + +// ------------------- 31 ------------------- +export material Voodoo(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Chameleon - Voodoo"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "chameleon", "flipflop", "colorshift", "reflective", "artificial", "multilayer", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "clearcoat", "automotive", "design")), + ::anno::thumbnail("./.thumbs/Carpaint_Shifting_Flakes.Voodoo.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Shifting_Flakes( + base_color: color(0.009134f, 0.045186f, 0.111932f), + ground_coat_influence: 0.00f, + ground_coat_brightness: 0.34f, + edge_darkening: 0.57f, + flakes_reflectivity: 1.00f, + flakes_density: 0.16f, + spread: 0.52f, + flakes_roughness: 0.19f, + flakes_size: 0.1f, + flakes_paint_color_1: color(0.212231f, 0.025187f, 0.637597f), + flakes_paint_color_2: color(0.407240f, 0.010960f, 0.323143f), + flakes_paint_color_3: color(0.351533f, 0.021219f, 0.038204f), + flakes_paint_color_4: color(0.174647f, 0.006049f, 0.007499f), + flakes_paint_color_5: color(0.191202f, 0.141263f, 0.008023f), + flake_layer_visibility: 0.82f, + clearcoat_rough: 0.06f, + roughness_variation: 0.14f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.00f, + orange_peel_size: 0.01f +); + + diff --git a/Material/material_0513/Carpaint_Solid.mdl b/Material/material_0513/Carpaint_Solid.mdl new file mode 100644 index 0000000000000000000000000000000000000000..50f38d2a66c38937bc5190b1cab2cf6b6aa2b905 --- /dev/null +++ b/Material/material_0513/Carpaint_Solid.mdl @@ -0,0 +1,1112 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. * + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + +mdl 1.6; +import ::df::*; +import ::math::*; +import ::anno::*; +import ::state::*; +import ::base::*; +import ::tex::*; +import ::nvidia::core_definitions::dimension; +import ::nvidia::core_definitions::blend_colors; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + + +::base::texture_coordinate_info transform_coordinate_2( + float4x4 transform + [[ ::anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix.") ]], + ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info() + [[ ::anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection.") ]] +) [[ + ::anno::description("Transform a texture coordinate by a matrix.") , + ::anno::noinline() + ]] +{ + // Version 2 + float4 r_position = transform * float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1); + //Try aproximating it for the case that the rotation is only aroud z and assuming the texture layout is nice and z is ~constant. + //just pretend there is no other rotation happening + //get rid of scaling and translation. Then extract fields where sin and cos would be in a simple 2d transform around z. + float4 u = transform[0]; + float3 ru = ::math::normalize(float3(u.x,u.y,u.z)); + float cos = ru.x; + float sin = -ru.y; + + return ::base::texture_coordinate_info( + float3(r_position.x,r_position.y,r_position.z), + ::math::normalize(cos * coordinate.tangent_u - sin * coordinate.tangent_v), + ::math::normalize(cos * coordinate.tangent_v + sin * coordinate.tangent_u)); +} + +// Takes the standard input that every material has. It combines a couple of +// functions in one convenience function. +::base::texture_coordinate_info vmat_transform( + float2 translation = float2(0.0f, 0.0f), + float rotation = 0.0f, // rotation in degrees + float2 scaling = float2(1.0f, 1.0f), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + float4x4 scale = + float4x4(1.0f /scaling.x, 0.f , 0.f , 0.f, + 0.f , 1.0f /scaling.y , 0.f , 0.f, + 0.f , 0.f , 1.0f, 0.f, + translation.x , translation.y , 0.0f, 1.f); + + float s = ::math::sin(rotation_rad); + float c = ::math::cos(rotation_rad); + float4x4 rotate = + float4x4( c , -s , 0.0f , 0.0f, + s , c , 0.0f , 0.0f, + 0.0f, 0.0f , 1.0f , 0.0f, + 0.f , 0.0f , 0.0f , 1.f); + + return transform_coordinate_2(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + + + +float histogram_range(float input, float range = 1.0f, float position = 0.5f) +{ + float low = ::math::clamp(1.0f - ::math::min(((1.0f - position) + range * 0.5f), (1.0f - position) * 2), 0.0f, 1.0f); + float high = ::math::clamp(::math::min((position + range * 0.5f ), position * 2.0f), 0.0f, 1.0f); + return ::math::lerp(low, high, input); +} + +// +// flake noise utilities +// +int hash(int seed, int i) +{ + return (i ^ seed) * 1075385539; +} +int rnd_init(int3 pos) +{ + return hash(hash(hash(0, pos.x), pos.y), pos.z); +} + +int rnd_next(int seed) { + // xorshift32 using signed int + seed ^= seed << 13; + seed ^= seed >>> 17; + seed ^= seed << 5; + return seed; +} + +float rnd_value(int seed) +{ + //return ::math::abs(float(seed) * 4.6566fe-10f); + return ::math::abs(float(seed) * 0.00000000046566f); +} + +// apply random rotation (using "Fast Random Rotation Matrices" by James Arvo) +float3 rotate_pos(float3 pos, float3 xi) +{ + float theta = ::math::PI * 2.0f * xi.x; + float phi = ::math::PI * 2.0f * xi.y; + float z = xi.z * 2.0f; + + float r = ::math::sqrt(z); + float[2] sp_cp = ::math::sincos(phi); + float Vx = sp_cp[0] * r; + float Vy = sp_cp[1] * r; + float Vz = ::math::sqrt(2.0f - z); + + float[2] st_ct = ::math::sincos(theta); + float Sx = Vx * st_ct[1] - Vy * st_ct[0]; + float Sy = Vx * st_ct[0] + Vy * st_ct[1]; + + float3x3 M( + Vx * Sx - st_ct[1], Vx * Sy - st_ct[0], Vx * Vz, + Vy * Sx + st_ct[0], Vy * Sy - st_ct[1], Vy * Vz, + Vz * Sx, Vz * Sy, 1.0f - z); + + return M * pos; +} + +struct flake_noise_value { + // flake priority (in [0..1], 0: no flake, flakes with higher priority shadow flakes "below" them) + float priority; + // Stores values from the functions (once normal, another time the color) + // current pseudo random number generator seed + int rnd_seed; + float4 carrier; +}; + +// flake noise function with controllable regularity, flake size, and probability +flake_noise_value flake_noise( + float3 pos, + float jitter_scale = 1.0f, + float flake_diameter = 0.75f, + float flake_probability = 1.0f) +{ + float3 base_pos = ::math::floor(pos); + int3 base_pos_i = int3(base_pos); + + // limit the flake size to the allowed maximum (such that looking at all neighbors is sufficient) + flake_diameter = ::math::min(flake_diameter, (1.5f - 0.5f * jitter_scale) / ::math::sqrt(3.0f)); + + flake_noise_value val(0.0f, 0, float4(0.0f)); + + for (int i = -1; i < 2; ++i) { + for (int j = -1; j < 2; ++j) { + for (int k = -1; k < 2; ++k) { + + int seed = rnd_init(base_pos_i + int3(i, j, k)); + + seed = rnd_next(seed); + if (rnd_value(seed) > flake_probability) + continue; + + seed = rnd_next(seed); + float priority = rnd_value(seed); + if (priority < val.priority) + continue; + + float3 flake_pos = base_pos + float3(i, j, k) + float3(0.5f); + + if (jitter_scale > 0.0f) { + seed = rnd_next(seed); + flake_pos.x += (rnd_value(seed) - 0.5f) * jitter_scale; + seed = rnd_next(seed); + flake_pos.y += (rnd_value(seed) - 0.5f) * jitter_scale; + seed = rnd_next(seed); + flake_pos.z += (rnd_value(seed) - 0.5f) * jitter_scale; + } + + float3 p = pos - flake_pos; + if (::math::dot(p, p) >= flake_diameter * flake_diameter * 4.0f) + continue; + + float3 xi_rot; + seed = rnd_next(seed); + xi_rot.x = rnd_value(seed); + seed = rnd_next(seed); + xi_rot.y = rnd_value(seed); + seed = rnd_next(seed); + xi_rot.z = rnd_value(seed); + p = rotate_pos(p, xi_rot); + + if (::math::abs(p.x) <= flake_diameter && + ::math::abs(p.y) <= flake_diameter && + ::math::abs(p.z) <= flake_diameter) + { + val.priority = priority; + val.rnd_seed = seed; + } + } + } + } + + return val; +} + +// create a flake normal by importance sampling the Beckmann distribution with given roughness +flake_noise_value flake_normal( + flake_noise_value val, + float spread) +{ + if (val.priority <= 0.0f) + { + val.carrier = float4(::state::normal().x, ::state::normal().y, ::state::normal().z, 1.0f); + return val; + } + + int seed = rnd_next(val.rnd_seed); + float xi0 = rnd_value(seed); + seed = rnd_next(seed); + float xi1 = rnd_value(seed); + + float phi = ::math::PI * 2.0f * xi0; + + float roughness = spread * spread; + + float tantheta = ::math::sqrt(-roughness * roughness * ::math::log(1.0f - xi1)); + float sintheta = tantheta / ::math::sqrt(1.0f + tantheta * tantheta); + float costheta = ::math::sqrt(1.0f - sintheta * sintheta); + + float[2] scphi = ::math::sincos(phi); + + val.rnd_seed = seed; + + float3 normal = ::state::texture_tangent_u(0) * scphi[1] * sintheta + + ::state::texture_tangent_v(0) * scphi[0] * sintheta + + ::state::normal() * costheta; + + val.carrier = float4(normal.x, normal.y, normal.z, 1.0f); + + + return val; +} + + +export material Carpaint_Solid( + color base_color = color(0.002125f, 0.051269f, 0.046665f) [[ + ::anno::description("Sets the base color of the carpaint."), + ::anno::display_name("Base"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + float ground_coat_influence = 0.9f [[ + ::anno::description("The ground coat layer is a metallic base layer over which the base color coat, the flakes and the clearcoat are applied. Use the parameter 'Ground Coat Brightness' to adjust its brightness."), + ::anno::display_name("Base Coat Influence"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float ground_coat_brightness = 0.24f [[ + ::anno::description("Adjusts the brightness of the metallic ground coat over which the base color coat, the flakes and the clearcoat are applied. Only has an effect, if the Ground Coat Influence is greater than 0.0."), + ::anno::display_name("Base Coat Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float edge_darkening = 0.96f [[ + ::anno::description("The amount how much colors fade to darker color when looking at the carpaint at grazing angles. Low values make the carpaint look more flat."), + ::anno::display_name("Edge Darkening"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + color flakes_tint = color(0.016807f, 0.171441f, 0.417885f) [[ + ::anno::description("The color of the flakes."), + ::anno::display_name("Flakes Tint"), + ::anno::in_group("Flakes"), + ::anno::ui_order(4) + ]], + uniform float flakes_density = 0.29f [[ + ::anno::description("Adjusts the density of the flakes. Lower number means less flake particles being applied."), + ::anno::display_name("Flakes Density"), + ::anno::in_group("Flakes"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(5) + ]], + float spread = 0.12f [[ + ::anno::description("The amount how much flakes are pointing to random directions. It is strongly discouraged using a value of 0.0 as the flakes will be oriented exactly as the surface normal, which will result in an unnatural look. Higher values lead to a more scintillating look of the flakes."), + ::anno::display_name("Flakes Spread"), + ::anno::enable_if("flakes_density > 0.0f"), + ::anno::in_group("Flakes"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(6) + ]], + float flakes_roughness = 0.46f [[ + ::anno::description("The roughness of the flakes itself. Higher values smoothen out the look of the flakes. Depending on the flakes being used in carpaints, use low values for a sparkling flake effect while mica flakes tend to have a higher roughness, leading to a smoother more pearlescent look on the final carpaint."), + ::anno::display_name("Flakes Roughness"), + ::anno::enable_if("flakes_density > 0.0f"), + ::anno::in_group("Flakes"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(7) + ]], + float flakes_size = 0.1f [[ + ::anno::description("Size of the metal flakes in millimeters."), + ::anno::display_name("Flakes Size (mm)"), + ::anno::enable_if("flakes_density > 0.0f"), + ::anno::soft_range(0.f, 1.f), + ::anno::in_group("Flakes"), + ::anno::ui_order(8) + ]], + float candy_flip = 0.f [[ + ::anno::description("Changes the tint of the coating to fade towards the flake color to produce a candy paint effect."), + ::anno::display_name("Candy Coating"), + ::anno::in_group("Flakes"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(9) + ]], + float flake_layer_visibility = 0.f [[ + ::anno::description("Adjusts how much the flakes contribute to the final look. Lowering the value makes the flakes appear more transparent. At value of 0.0 no flakes are not rendered at all."), + ::anno::display_name("Flakes Visibility"), + ::anno::enable_if("flakes_density > 0.0f"), + ::anno::in_group("Flakes"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(10) + ]], + uniform texture_2d roughness_texture = texture_2d("./smudges_scratches_A_rough.jpg", ::tex::gamma_linear) [[ + ::anno::description("Texture to use for adding variation to the roughness on the clearcoat."), + ::anno::display_name("Roughness Texture"), + ::anno::in_group("Clearcoat"), + ::anno::ui_order(11) + ]], + float clearcoat_rough = 0.f [[ + ::anno::description("The roughness of the clearcoat."), + ::anno::display_name("Clearcoat Roughness"), + ::anno::in_group("Clearcoat"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(12) + ]], + float roughness_variation = 0.f [[ + ::anno::description("The amount of variation to apply to the roughness. This parameter only has an effect when the clearcoat roughness is not zero or one."), + ::anno::display_name("Clearcoat Roughness Variation"), + ::anno::in_group("Clearcoat"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(13) + ]], + float clearcoat_ior = 1.600f [[ + ::anno::description("The index of refraction for the clearcoat layer."), + ::anno::display_name("Clearcoat Index of Refraction"), + ::anno::in_group("Clearcoat"), + ::anno::soft_range(1.f, 3.f), + ::anno::hard_range(1.f, 5.f), + ::anno::ui_order(14) + ]], + float clearcoat_visibility = 1.f [[ + ::anno::description("While the full value is the correct physical behavior of the clearcoat, lowering the value to reduce the amount of reflection for artistic purposes."), + ::anno::display_name("Clearcoat Visibility"), + ::anno::in_group("Clearcoat"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(15) + ]], + uniform float orange_peel_strength = 0.f [[ + ::anno::description("Strength of the bump mapping effect."), + ::anno::display_name("Coat Orange Peel Strength"), + ::anno::in_group("Clearcoat"), + ::anno::soft_range(0.f, 1.f), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(16) + ]], + uniform float orange_peel_size = 1.f [[ + ::anno::description("Size of the biggest feature of the pattern."), + ::anno::display_name("Coat Orange Peel Size"), + ::anno::soft_range(0.f, 1.f), + ::anno::in_group("Clearcoat"), + ::anno::ui_order(17) + ]], + float2 texture_translate = 0.f [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform"), + ::anno::ui_order(18) + ]], + float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f), + ::anno::ui_order(19) + ]], + float2 texture_scale = 1.f [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(1.0, 1.0)), + ::anno::ui_order(20) + ]], + uniform bool roundcorners_enable = false [[ + ::anno::description("Enables the round corneer effect. Comes at a slight performance cost as additional raytracing calls are required to evaluate the round corner effect."), + ::anno::display_name("Enable Round Corners"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(22) + ]], + uniform float roundcorners_radius_mm = 1.5f [[ + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::display_name("Round Corner Radius (mm)"), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f), + ::anno::ui_order(23) + ]], + uniform bool roundcorners_across_materials = false [[ + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::display_name("Across Materials"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(27) + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Use selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced"), + ::anno::ui_order(28) + ]] + + +) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Solid"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "shiny", "flakes", "metallic", "glitter", "pigment", "clearcoat", "automotive", "design")), + ::anno::thumbnail("./.thumbs/Carpaint_Solid.Carpaint_Solid.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = + let { + bool tmp0 = false; + // Tried Scaling factors for flakes to fit 1mm size both in Substance Designer and (Iray for) Rhino + // Rhino scaling factor: 1492.537313432835 + // Substance Designer Scaling factor: 1158.6829010512 + float flakes_size_m = (1492.537313432835f/flakes_size); // Flake scaling adjustment, so that flake size is in mm + float flake_layer_visibility_m = 1.0f - flake_layer_visibility; + + ::base::texture_coordinate_info coord_info = ::base::coordinate_source(::base::texture_coordinate_object, 0); + + float scale_trans = ::state::transform_scale(::state::coordinate_object, ::state::coordinate_world, 1.0f); + + float3 source_coord = coord_info.position * ::state::meters_per_scene_unit() * scale_trans; + + ::base::texture_coordinate_info transformed_coord = ::base::transform_coordinate( + ::base::rotation_translation_scale(float3(0.0f), float3(0.0f), float3(scale_trans)), + coord_info + ); + + material_surface tmp1(::df::fresnel_layer(clearcoat_ior, clearcoat_visibility, ::df::simple_glossy_bsdf(histogram_range(::base::file_texture(roughness_texture, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, roughness_variation, clearcoat_rough) * histogram_range(::base::file_texture(roughness_texture, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, roughness_variation, clearcoat_rough), histogram_range(::base::file_texture(roughness_texture, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, roughness_variation, clearcoat_rough) * histogram_range(::base::file_texture(roughness_texture, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, roughness_variation, clearcoat_rough), nvidia::core_definitions::blend_colors(color(1.f, 1.f, 1.f), flakes_tint, ::base::color_layer_blend, candy_flip).tint, nvidia::core_definitions::blend_colors(color(1.f, 1.f, 1.f), flakes_tint, ::base::color_layer_blend, candy_flip).tint, ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::directional_factor(color(1.f, 1.f, 1.f), color(1.f - edge_darkening), 1.f, flakes_density > 0.f ? ::df::weighted_layer(::math::lerp(flake_noise(source_coord * flakes_size_m, 0.5f, 1.f, flakes_density * flakes_density).priority > 0.001f ? 1.0f : 0.0f , 0.f, flake_layer_visibility_m), ::df::microfacet_ggx_smith_bsdf(flakes_roughness * 0.340000004f, flakes_roughness * 0.340000004f, flakes_tint, color(0.f, 0.f, 0.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::directional_factor(base_color, color(1.f - edge_darkening), 1.f, ::df::weighted_layer(ground_coat_influence * 0.5f, ::df::microfacet_ggx_vcavities_bsdf(0.40959999f, 0.40959999f, color(ground_coat_brightness * 0.949999988f + 0.0500000007f), color(ground_coat_brightness * 0.949999988f + 0.0500000007f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::diffuse_reflection_bsdf(base_color, 0.f), ::state::normal())), float3(flake_normal(flake_noise(source_coord * flakes_size_m, 0.5f, 1.f, flakes_density * flakes_density ), spread).carrier.x, flake_normal(flake_noise(source_coord * flakes_size_m, 0.5f, 1.f, flakes_density * flakes_density ), spread).carrier.y, flake_normal(flake_noise(source_coord * flakes_size_m, 0.5f, 1.f, flakes_density * flakes_density ), spread).carrier.z)) : ::df::directional_factor(base_color, color(1.f - edge_darkening), 1.f, ::df::weighted_layer(ground_coat_influence * 0.5f, ::df::microfacet_ggx_vcavities_bsdf(0.40959999f, 0.40959999f, color(ground_coat_brightness * 0.949999988f + 0.0500000007f), color(ground_coat_brightness * 0.949999988f + 0.0500000007f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::diffuse_reflection_bsdf(base_color, 0.f), ::state::normal()))), orange_peel_strength > 0.f ? ::base::perlin_noise_bump_texture(transformed_coord, orange_peel_strength, orange_peel_size, false, false, 0.f, 2, false, false, float3(0.f), 1.f, 0.f, 1.f, ::state::normal()) : ::state::normal()), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + 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)); + 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()); + hair_bsdf tmp6 = hair_bsdf(); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5, + hair: tmp6); + + +// ------------------- 2 (Plain White) ------------------- +export material White(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Solid - White"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "white", "light", "neutral")), + ::anno::thumbnail("./.thumbs/Carpaint_Solid.White.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Solid( + base_color: color(0.768151f, 0.768151f, 0.768151f), + ground_coat_influence: 0.0f, + ground_coat_brightness: 0.24f, + edge_darkening: 0.56f, + flakes_tint: color(0.552011f, 0.552011f, 0.552011f), + flakes_density: 0.0f, + spread: 0.47f, + flakes_roughness: 0.34f, + flakes_size: 0.5f, + candy_flip: 0.0f, + flake_layer_visibility: 1.0f, + // roughness_texture: + clearcoat_rough: 0.05f, + roughness_variation: 0.34f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.0f, + orange_peel_size: 0.01f +); + +// ------------------- 3 (vintage White) ------------------- +export material Vintage_White(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Solid - Vintage White"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "vintage", "white", "light", "neutral")), + ::anno::thumbnail("./.thumbs/Carpaint_Solid.Vintage_White.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Solid( + base_color: color(0.672443f, 0.630757f, 0.502886f), + ground_coat_influence: 0.0f, + ground_coat_brightness: 0.24f, + edge_darkening: 0.28f, + flakes_tint: color(0.603827f, 0.665387f, 0.693872f), + flakes_density: 0.0f, + spread: 0.41f, + flakes_roughness: 0.32f, + flakes_size: 0.5f, + candy_flip: 0.0f, + flake_layer_visibility: 0.0f, + // roughness_texture: + clearcoat_rough: 0.05f, + roughness_variation: 0.34f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.06f, + orange_peel_size: 0.01f +); + + +// ------------------- 4 (Black) ------------------- +export material Black(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Solid - Black"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "black", "dark", "neutral")), + ::anno::thumbnail("./.thumbs/Carpaint_Solid.Black.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Solid( + base_color: color(0.006049f, 0.006049f, 0.006049f), + ground_coat_influence: 0.97f, + ground_coat_brightness: 0.17f, + edge_darkening: 0.57f, + flakes_tint: color(0.552011f, 0.552011f, 0.552011f), + flakes_density: 0.0f, + spread: 0.47f, + flakes_roughness: 0.34f, + flakes_size: 0.5f, + candy_flip: 0.0f, + flake_layer_visibility: 0.0f, + // roughness_texture: + clearcoat_rough: 0.05f, + roughness_variation: 0.36f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.0f, + orange_peel_size: 0.01f +); + +// ------------------- 5 (Black Matte) ------------------- +export material Black_Matte(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Solid - Black Matte"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "black", "dark", "neutral")), + ::anno::thumbnail("./.thumbs/Carpaint_Solid.Black_Matte.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Solid( + base_color: color(0.006995f, 0.006995f, 0.006995f), + ground_coat_influence: 0.11f, + ground_coat_brightness: 0.64f, + edge_darkening: 0.0f, + flakes_tint: color(0.577580f, 0.577580f, 0.577580f), + flakes_density: 0.12f, + spread: 0.39f, + flakes_roughness: 0.5f, + flakes_size: 0.5f, + candy_flip: 0.0f, + flake_layer_visibility: 0.0f, + // roughness_texture: + clearcoat_rough: 0.48f, + roughness_variation: 0.14f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.0f, + orange_peel_size: 0.01f +); + +// ------------------- 6 ------------------- +export material Agent_Gray(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Solid - Agent Gray"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "gray", "neutral")), + ::anno::thumbnail("./.thumbs/Carpaint_Solid.Agent_Gray.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Solid( + base_color: color(0.234551f, 0.254152f, 0.234551f), + ground_coat_influence: 0.11f, + ground_coat_brightness: 0.64f, + edge_darkening: 0.0f, + flakes_tint: color(0.644480f, 0.701102f, 0.644480f), + flakes_density: 0.2f, + spread: 0.25f, + flakes_roughness: 0.5f, + flakes_size: 0.5f, + candy_flip: 0.0f, + flake_layer_visibility: 0.0f, + // roughness_texture: + clearcoat_rough: 0.06f, + roughness_variation: 0.36f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.0f, + orange_peel_size: 0.01f +); + + +// ------------------- 7 (Agent Gray Matte)------------------- +export material Agent_Gray_Matte(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Solid - Agent Gray Matte"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "matte", "gray", "neutral")), + ::anno::thumbnail("./.thumbs/Carpaint_Solid.Agent_Gray_Matte.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Solid( + base_color: color(0.234551f, 0.254152f, 0.234551f), + ground_coat_influence: 0.11f, + ground_coat_brightness: 0.64f, + edge_darkening: 0.0f, + flakes_tint: color(0.644480f, 0.701102f, 0.644480f), + flakes_density: 0.21f, + spread: 0.25f, + flakes_roughness: 0.5f, + flakes_size: 0.5f, + candy_flip: 0.0f, + flake_layer_visibility: 0.0f, + // roughness_texture: + clearcoat_rough: 0.4f, + roughness_variation: 0.14f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.0f, + orange_peel_size: 0.01f +); + +// ------------------- 8 (Blood Red)------------------- +export material Blood_Red(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Solid - Blood Red"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "red", "warm", "saturated")), + ::anno::thumbnail("./.thumbs/Carpaint_Solid.Blood_Red.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Solid( + base_color: color(0.462077f, 0.022174f, 0.015209f), + ground_coat_influence: 0.03f, + ground_coat_brightness: 0.24f, + edge_darkening: 0.56f, + flakes_tint: color(0.552011f, 0.552011f, 0.552011f), + flakes_density: 0.0f, + spread: 0.47f, + flakes_roughness: 0.34f, + flakes_size: 0.5f, + candy_flip: 0.0f, + flake_layer_visibility: 0.0f, + // roughness_texture: + clearcoat_rough: 0.05f, + roughness_variation: 0.36f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.0f, + orange_peel_size: 0.01f +); + +// ------------------- 9 (Tarreri Red)------------------- +export material Tarreri_Red(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Solid - Tarreri Red"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "red", "warm", "saturated")), + ::anno::thumbnail("./.thumbs/Carpaint_Solid.Tarreri_Red.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Solid( + base_color: color(0.672443f, 0.038204f, 0.026241f), + ground_coat_influence: 0.03f, + ground_coat_brightness: 0.24f, + edge_darkening: 0.56f, + flakes_tint: color(0.672443f, 0.095307f, 0.078187f), + flakes_density: 0.0f, + spread: 0.47f, + flakes_roughness: 0.34f, + flakes_size: 0.5f, + candy_flip: 0.0f, + flake_layer_visibility: 0.0f, + // roughness_texture: + clearcoat_rough: 0.05f, + roughness_variation: 0.36f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.0f, + orange_peel_size: 0.01f +); + + +// ------------------- 10 (Dark Decent Red)------------------- +export material Dark_Decent_Red(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Solid - Dark Decent Red"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "red", "warm", "dark")), + ::anno::thumbnail("./.thumbs/Carpaint_Solid.Dark_Decent_Red.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Solid( + base_color: color(0.135633f, 0.012983f, 0.027321f), + ground_coat_influence: 0.19f, + ground_coat_brightness: 0.24f, + edge_darkening: 0.1f, + flakes_tint: color(0.135633f, 0.012983f, 0.027321f), + flakes_density: 0.0f, + spread: 0.38f, + flakes_roughness: 0.18f, + flakes_size: 0.5f, + candy_flip: 0.0f, + flake_layer_visibility: 0.0f, + // roughness_texture: + clearcoat_rough: 0.05f, + roughness_variation: 0.36f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.0f, + orange_peel_size: 0.01f +); + +// ------------------- 11 (Vintage Maroon)------------------- +export material Vintage_Maroon(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Solid - Vintage Maroon"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "dark", "brown", "red")), + ::anno::thumbnail("./.thumbs/Carpaint_Solid.Vintage_Maroon.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Solid( + base_color: color(0.283149f, 0.054480f, 0.063010f), + ground_coat_influence: 0.19f, + ground_coat_brightness: 0.24f, + edge_darkening: 0.1f, + flakes_tint: color(0.283149f, 0.054480f, 0.063010f), + flakes_density: 0.0f, + spread: 0.38f, + flakes_roughness: 0.3f, + flakes_size: 0.5f, + candy_flip: 0.0f, + flake_layer_visibility: 0.0f, + // roughness_texture: + clearcoat_rough: 0.05f, + roughness_variation: 0.36f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.0f, + orange_peel_size: 0.01f +); + +// ------------------- 12 ------------------- +export material Orange(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Solid - Orange"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "orange", "warm", "saturated")), + ::anno::thumbnail("./.thumbs/Carpaint_Solid.Orange.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Solid( + base_color: color(0.623960f, 0.262251f, 0.022174f), + ground_coat_influence: 0.11f, + ground_coat_brightness: 0.64f, + edge_darkening: 0.0f, + flakes_tint: color(0.017642f, 0.262251f, 0.623960f), + flakes_density: 0.59f, + spread: 0.25f, + flakes_roughness: 0.5f, + flakes_size: 0.5f, + candy_flip: 0.0f, + flake_layer_visibility: 0.0f, + // roughness_texture: + clearcoat_rough: 0.06f, + roughness_variation: 0.36f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.0f, + orange_peel_size: 0.01f +); + + +// ------------------- 13 (Brown Matte) ------------------- +export material Brown_Matte(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Solid - Brown Matte"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "brown", "matte")), + ::anno::thumbnail("./.thumbs/Carpaint_Solid.Brown_Matte.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Solid( + base_color: color(0.300544f, 0.250158f, 0.187821f), + ground_coat_influence: 0.11f, + ground_coat_brightness: 0.64f, + edge_darkening: 0.0f, + flakes_tint: color(0.300544f, 0.250158f, 0.187821f), + flakes_density: 0.0f, + spread: 0.39f, + flakes_roughness: 0.5f, + flakes_size: 0.5f, + candy_flip: 0.0f, + flake_layer_visibility: 0.0f, + // roughness_texture: + clearcoat_rough: 0.5f, + roughness_variation: 0.14f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.0f, + orange_peel_size: 0.01f +); + + +// ------------------- 14 (Bumblebee) ------------------- +export material Bumblebee(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Solid - Bumblebee"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "yellow", "warm", "light", "saturated")), + ::anno::thumbnail("./.thumbs/Carpaint_Solid.Bumblebee.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Solid( + base_color: color(0.775822f, 0.564712f, 0.030713f), + ground_coat_influence: 0.09f, + ground_coat_brightness: 0.64f, + edge_darkening: 0.1f, + flakes_tint: color(1.000000f, 0.479320f, 0.095307f), + flakes_density: 0.0f, + spread: 0.54f, + flakes_roughness: 0.37f, + flakes_size: 0.5f, + candy_flip: 0.0f, + flake_layer_visibility: 0.0f, + // roughness_texture: + clearcoat_rough: 0.06f, + roughness_variation: 0.14f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.0f, + orange_peel_size: 0.01f +); + + +// ------------------- 15 (Wasp) ------------------- +export material Wasp(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Solid - Wasp"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "yellow", "warm", "light", "saturated")), + ::anno::thumbnail("./.thumbs/Carpaint_Solid.Wasp.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Solid( + base_color: color(0.701102f, 0.603827f, 0.022174f), + ground_coat_influence: 0.0f, + ground_coat_brightness: 0.5f, + edge_darkening: 0.12f, + flakes_tint: color(1.000000f, 0.479320f, 0.076185f), + flakes_density: 0.0f, + spread: 0.54f, + flakes_roughness: 0.37f, + flakes_size: 0.5f, + candy_flip: 0.0f, + flake_layer_visibility: 0.0f, + // roughness_texture: + clearcoat_rough: 0.06f, + roughness_variation: 0.14f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.0f, + orange_peel_size: 0.01f +); + +// ------------------- 16 (Feline Dark Green)------------------- +export material Feline_Dark_Green(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Solid - Feline Dark Green"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "green", "dark")), + ::anno::thumbnail("./.thumbs/Carpaint_Solid.Feline_Dark_Green.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Solid( + base_color: color(0.010330f, 0.099899f, 0.043735f), + ground_coat_influence: 0.19f, + ground_coat_brightness: 0.24f, + edge_darkening: 0.1f, + flakes_tint: color(0.010330f, 0.099899f, 0.043735f), + flakes_density: 0.0f, + spread: 0.38f, + flakes_roughness: 0.3f, + flakes_size: 0.5f, + candy_flip: 0.0f, + flake_layer_visibility: 0.0f, + // roughness_texture: + clearcoat_rough: 0.05f, + roughness_variation: 0.36f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.0f, + orange_peel_size: 0.01f +); + + +// ------------------- 17 (Hunting Green Matte) ------------------- +export material Hunting_Green_Matte(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Solid - Hunting Green Matte"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "green", "dark", "matte")), + ::anno::thumbnail("./.thumbs/Carpaint_Solid.Hunting_Green_Matte.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Solid( + base_color: color(0.162029f, 0.187821f, 0.114435f), + ground_coat_influence: 0.11f, + ground_coat_brightness: 0.64f, + edge_darkening: 0.0f, + flakes_tint: color(0.318547f, 0.456411f, 0.127438f), + flakes_density: 0.0f, + spread: 0.3f, + flakes_roughness: 0.5f, + flakes_size: 0.5f, + candy_flip: 0.0f, + flake_layer_visibility: 0.0f, + // roughness_texture: + clearcoat_rough: 0.4f, + roughness_variation: 0.14f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.0f, + orange_peel_size: 0.01f +); + + +// ------------------- 18 (Vintage Sky Blue) ------------------- +export material Vintage_Sky_Blue(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Solid - Vintage Sky Blue"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "blue", "light", "cool")), + ::anno::thumbnail("./.thumbs/Carpaint_Solid.Vintage_Sky_Blue.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Solid( + base_color: color(0.318547f, 0.564712f, 0.603827f), + ground_coat_influence: 0.06f, + ground_coat_brightness: 0.24f, + edge_darkening: 0.0f, + flakes_tint: color(0.603827f, 127.338437f, 0.693872f), + flakes_density: 0.0f, + spread: 0.41f, + flakes_roughness: 0.32f, + flakes_size: 0.5f, + candy_flip: 0.0f, + flake_layer_visibility: 0.0f, + // roughness_texture: + clearcoat_rough: 0.06f, + roughness_variation: 0.34f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.06f, + orange_peel_size: 0.01f +); + + +// ------------------- 19 (Blue)------------------- +export material Blue(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Solid - Blue"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "blue", "cool", "saturated")), + ::anno::thumbnail("./.thumbs/Carpaint_Solid.Blue.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Solid( + base_color: color(0.012983f, 0.296138f, 0.462077f), + ground_coat_influence: 0.00f, + ground_coat_brightness: 0.24f, + edge_darkening: 0.0f, + flakes_tint: color(0.012983f, 0.234551f, 0.665387f), + flakes_density: 0.5f, + spread: 0.47f, + flakes_roughness: 0.34f, + flakes_size: 0.5f, + candy_flip: 0.0f, + flake_layer_visibility: 0.0f, + // roughness_texture: + clearcoat_rough: 0.06f, + roughness_variation: 0.36f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.0f, + orange_peel_size: 0.01f +); + + + +// ------------------- 20 (Dark Decent Blue) ------------------- +export material Dark_Decent_Blue(*) +[[ + ::anno::author("NVIDIA"), + ::anno::display_name("Carpaint Solid - Dark Decent Blue"), + ::anno::description("Multilayered carpaint material with metallic flakes."), + ::anno::key_words(string[]("carpaint", "reflective", "artificial", "multilayer", "new", "flat", "clearcoat", "automotive", "design", "blue", "cool", "dark")), + ::anno::thumbnail("./.thumbs/Carpaint_Solid.Dark_Decent_Blue.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Carpaint_Solid( + base_color: color(0.013702f, 0.046665f, 0.147027f), + ground_coat_influence: 0.19f, + ground_coat_brightness: 0.24f, + edge_darkening: 0.1f, + flakes_tint: color(0.012983f, 0.234551f, 0.665387f), + flakes_density: 0.5f, + spread: 0.25f, + flakes_roughness: 0.34f, + flakes_size: 0.5f, + candy_flip: 0.0f, + flake_layer_visibility: 0.0f, + // roughness_texture: + clearcoat_rough: 0.06f, + roughness_variation: 0.36f, + clearcoat_ior: 1.6f, + clearcoat_visibility: 1.0f, + orange_peel_strength: 0.0f, + orange_peel_size: 0.01f +); \ No newline at end of file diff --git a/Material/material_0518/Cardboard_Low_Quality.mdl b/Material/material_0518/Cardboard_Low_Quality.mdl new file mode 100644 index 0000000000000000000000000000000000000000..4f0a61659d5ac9c6b50acfd3b25ea90aca8f7086 --- /dev/null +++ b/Material/material_0518/Cardboard_Low_Quality.mdl @@ -0,0 +1,469 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. * + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA’s Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + + +mdl 1.5; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + + + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + +const string DESCRIPTION = "A paper material for cardboards"; + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + +float3 srgb2rgb(float3 val) +{ + return ::math::pow(::math::max(val, float3(0.0f)), 2.2); +} + +float2 rnd22(int2 p) { + float2 ret_val = float2( + uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f, + uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f + ); + return ret_val; +} + +float2x2 invert_2x2(float2x2 M) +{ + float det = M[0][0]*M[1][1] - M[0][1]*M[1][0]; + //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/ + return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]); +} + +float3 nonrepeat_lookup( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5), + float patch_size = 8.0 +) +{ + + float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale; + float Z = patch_size; // patch scale inside example texture + + float3 O = float3(0.f); + float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); + float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space + + float2 U = uv_in; + float2 V = M * uv_in; //pre-tilted hexa coordinates + int2 I = int2(::math::floor(V)); // hexa-tile id + + // The mean color needs to be determined in Photoshop then to make the + // average color work out, take the float value and calculate the apropriate + // mean value as (value^(1/2.2)) + + float3 m = average_color; + + float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; + F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates + + if( F[2] > 0.f ) + O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m) + + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m) + + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m); + else + O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m) + + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m) + + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m); + O = m + O/::math::length(W); + O = ::math::clamp( (O), 0.0, 1.0); + + return float3(O); +} + +color endless_texture( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 10.0, + float3 average_color = float3(0.5, 0.5, .5), + float patch_size = 8.0, + bool gamma_correct_lookup = true +) +{ + return gamma_correct_lookup ? color(srgb2rgb( + nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )) + ) : color(nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )); +} + +float3 normalmap_normal( + uniform texture_2d texture, + float factor = 1.0, + ::base::texture_coordinate_info uvw = ::base::texture_coordinate_info() +) +{ + float3 lookup = (::tex::lookup_float3(texture, float2(uvw.position.x, uvw.position.y)) - 0.5) * (factor * 2.0); + return ::math::normalize(uvw.tangent_u * lookup.x + uvw.tangent_v * lookup.y + ::state::normal()); +} + +::base::texture_coordinate_info vmat_transform( + uniform float2 translation = float2(0.0, 0.0), + uniform float rotation = 0.0, + uniform float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation_rad); + float c = ::math::cos(rotation_rad); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + +float3 transform_internal_to_tangent(float3 n) +[[ + ::anno::hidden() +]] +{ + return + n.x* float3(::state::texture_tangent_u(0).x,::state::texture_tangent_v(0).x,::state::normal().x)+ + n.y* float3(::state::texture_tangent_u(0).y,::state::texture_tangent_v(0).y,::state::normal().y)+ + n.z* float3(::state::texture_tangent_u(0).z,::state::texture_tangent_v(0).z,::state::normal().z); +} + +float3 transform_tangent_to_internal(float3 n) +[[ + ::anno::hidden() +]] +{ + return ::state::texture_tangent_u(0) * n.x + + ::state::texture_tangent_v(0) * n.y + + ::state::normal() * n.z ; +} + +float3 add_detail_normal(float3 nd = ::state::normal(), float3 n = ::state::normal()) +{ + // http://blog.selfshadow.com/publications/blending-in-detail/ + float3 n_t = transform_internal_to_tangent(n); + float3 nd_t = transform_internal_to_tangent(nd); + + n_t=n_t + float3(0.,0.,1.); + nd_t = nd_t * float3(-1.,-1.,1.); + n = n_t*::math::dot(n_t, nd_t)/n_t.z - nd_t; + return ::math::normalize(transform_tangent_to_internal(n)); +} + +float histogram_range(float input, float range, float position) +{ + float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); + float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); + return ::math::lerp(low, high, input); +} + +export material Cardboard_Low_Quality( + uniform float diffuse_brightness = 1.f [[ + ::anno::description("Adjusts the lightness of the material."), + ::anno::display_name("Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(0) + ]], + uniform float reflection_roughness = 1.f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections on the material."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + uniform float reflection_variation = 0.f [[ + ::anno::description("Amount of variation applied to the roughness, higher numbers lead to non uniform reflections of the material."), + ::anno::display_name("Reflection Variation"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + uniform float dirt = 0.f [[ + ::anno::description("Adds a layer of dirt on the cardboard."), + ::anno::display_name("Dirt Amount"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + uniform float corrugation_strength = 0.f [[ + ::anno::description("Adjusts the strength of the corrugation effect."), + ::anno::display_name("Corrugation Strength"), + ::anno::in_group("Appearance", "Corrugation"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + uniform float corrugation_variation = 0.f [[ + ::anno::description("Breaks up the corrugation by attenuating it at random places."), + ::anno::display_name("Corrugation Variation"), + ::anno::in_group("Appearance", "Corrugation"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(5) + ]], + uniform float2 texture_translate = 0.f [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Translate"), + ::anno::in_group("Transform"), + ::anno::ui_order(6) + ]], + uniform float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Rotate"), + ::anno::in_group("Transform"), + ::anno::ui_order(7) + ]], + uniform float2 texture_scale = 1.f [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Scale"), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(0.3f,0.3f)), + ::anno::ui_order(8) + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Use selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced"), + ::anno::ui_order(9) + ]], + uniform bool enable_round_corners = false [[ + ::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."), + ::anno::display_name("Round Corners"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(10) + ]], + uniform float radius = 1.5f [[ + ::anno::description("Radius of the rounded corners in millimeters (mm)."), + ::anno::display_name("Radius mm"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(11) + ]], + uniform bool across_materials = false [[ + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::display_name("Across Materials"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(12) + ]]) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Cardboard Low Quality"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "paper", "box", "brown", "yellow", "package", "delivery", "cardboard", "quality", "low", "cheap", "parcel")), + ::anno::thumbnail("./.thumbs/Cardboard_Low_Quality.Cardboard_Low_Quality.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] + = + let { + bool tmp0 = false; + material_surface tmp1(::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, nvidia::core_definitions::blend_colors(color(1.f, 1.f, 1.f), ::base::file_texture(texture_2d("./cardboard_norm2_ao.jpg", ::tex::gamma_srgb), 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, ::base::color_layer_blend, float3(endless_texture(texture_2d("./cardboard_normal_var.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.494118005f), 16.f, true))[0]).mono, ::df::microfacet_ggx_smith_bsdf((::math::lerp(reflection_variation * 0.199999988f, 0.189999998f, float3(endless_texture(texture_2d("./lq_simple_cardboard_multi.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.533333004f, 0.823529005f, 0.36470601f), 8.f, false))[2]) + histogram_range(float3(endless_texture(texture_2d("./lq_simple_cardboard_multi.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.533333004f, 0.823529005f, 0.36470601f), 8.f, false))[0], 0.310000002f, ::math::lerp(0.669999957f, 0.899999976f, reflection_roughness)) - ::math::lerp(::math::lerp(0.f, -1.f, dirt), 0.109999999f, float3(endless_texture(texture_2d("./lq_simple_cardboard_multi.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.533333004f, 0.823529005f, 0.36470601f), 8.f, false))[1])) * (::math::lerp(reflection_variation * 0.199999988f, 0.189999998f, float3(endless_texture(texture_2d("./lq_simple_cardboard_multi.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.533333004f, 0.823529005f, 0.36470601f), 8.f, false))[2]) + histogram_range(float3(endless_texture(texture_2d("./lq_simple_cardboard_multi.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.533333004f, 0.823529005f, 0.36470601f), 8.f, false))[0], 0.310000002f, ::math::lerp(0.669999957f, 0.899999976f, reflection_roughness)) - ::math::lerp(::math::lerp(0.f, -1.f, dirt), 0.109999999f, float3(endless_texture(texture_2d("./lq_simple_cardboard_multi.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.533333004f, 0.823529005f, 0.36470601f), 8.f, false))[1])), (::math::lerp(reflection_variation * 0.199999988f, 0.189999998f, float3(endless_texture(texture_2d("./lq_simple_cardboard_multi.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.533333004f, 0.823529005f, 0.36470601f), 8.f, false))[2]) + histogram_range(float3(endless_texture(texture_2d("./lq_simple_cardboard_multi.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.533333004f, 0.823529005f, 0.36470601f), 8.f, false))[0], 0.310000002f, ::math::lerp(0.669999957f, 0.899999976f, reflection_roughness)) - ::math::lerp(::math::lerp(0.f, -1.f, dirt), 0.109999999f, float3(endless_texture(texture_2d("./lq_simple_cardboard_multi.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.533333004f, 0.823529005f, 0.36470601f), 8.f, false))[1])) * (::math::lerp(reflection_variation * 0.199999988f, 0.189999998f, float3(endless_texture(texture_2d("./lq_simple_cardboard_multi.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.533333004f, 0.823529005f, 0.36470601f), 8.f, false))[2]) + histogram_range(float3(endless_texture(texture_2d("./lq_simple_cardboard_multi.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.533333004f, 0.823529005f, 0.36470601f), 8.f, false))[0], 0.310000002f, ::math::lerp(0.669999957f, 0.899999976f, reflection_roughness)) - ::math::lerp(::math::lerp(0.f, -1.f, dirt), 0.109999999f, float3(endless_texture(texture_2d("./lq_simple_cardboard_multi.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.533333004f, 0.823529005f, 0.36470601f), 8.f, false))[1])), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(color(::math::lerp(1.f, float3(endless_texture(texture_2d("./lq_simple_cardboard_multi.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.f, float3(0.533333004f, 0.823529005f, 0.36470601f), 8.f, false))[1], ::math::lerp(0.f, 1.5f, dirt))) * ::base::file_texture(texture_2d("./lq_simple_cardboard_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(diffuse_brightness), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, 0.f, ""), bsdf(), add_detail_normal(normalmap_normal(texture_2d("./lq_simple_cardboard_norm.jpg", ::tex::gamma_linear), 0.217000008f, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index)), normalmap_normal(texture_2d("./cardboard_norm_2.jpg", ::tex::gamma_linear), ::math::clamp((float3(endless_texture(texture_2d("./cardboard_normal_var.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.494118005f), 16.f, true))[0] - 0.5f) * (corrugation_strength * 3.f * corrugation_variation) + corrugation_strength, 0.f, 10.f), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index)))), add_detail_normal(normalmap_normal(texture_2d("./lq_simple_cardboard_norm.jpg", ::tex::gamma_linear), 0.217000008f, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index)), normalmap_normal(texture_2d("./cardboard_norm_2.jpg", ::tex::gamma_linear), ::math::clamp((float3(endless_texture(texture_2d("./cardboard_normal_var.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 3.f, float3(0.494118005f), 16.f, true))[0] - 0.5f) * (corrugation_strength * 3.f * corrugation_variation) + corrugation_strength, 0.f, 10.f), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index)))), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + material_geometry tmp5(float3(0.f), 1.f, enable_round_corners ? ::state::rounded_corner_normal(radius * 0.00499999989f, across_materials, 1.f) : ::state::normal()); + + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + geometry: tmp5); + +export material Cardboard_Low_Quality_Dirt(*) +[[ + ::anno::display_name("Cardboard Low Quality Dirt"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "paper", "box", "brown", "package", "delivery", "cardboard", "quality", "low", "cheap", "used", "parcel", "aged", "dirty")), + ::anno::thumbnail("./.thumbs/Cardboard_Low_Quality.Cardboard_Low_Quality_Dirt.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Cardboard_Low_Quality +( + diffuse_brightness: 0.5f, + reflection_roughness: 0.5f, + reflection_variation: 1.f, + dirt: 0.6f, + corrugation_strength: 0.5f, + corrugation_variation: 1.f, + texture_translate: 0.f, + texture_rotate: 0.f, + texture_scale: 1.f, + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: true +); + +export material Cardboard_Low_Quality_Corrugation(*) +[[ + ::anno::display_name("Cardboard Low Quality Corrugation"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "paper", "box", "brown", "corrugation", "package", "delivery", "cardboard", "quality", "low", "cheap", "used", "parcel", "aged")), + ::anno::thumbnail("./.thumbs/Cardboard_Low_Quality.Cardboard_Low_Quality_Corrugation.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Cardboard_Low_Quality +( + diffuse_brightness: 1.f, + reflection_roughness: 0.f, + reflection_variation: 1.f, + dirt: 0.f, + corrugation_strength: 1.f, + corrugation_variation: 0.f, + texture_translate: 0.f, + texture_rotate: 0.f, + texture_scale: 1.f, + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: true +); + +export material Cardboard_Low_Quality_Used(*) +[[ + ::anno::display_name("Cardboard Low Quality Used"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "paper", "box", "brown", "corrugation", "package", "delivery", "cardboard", "quality", "low", "cheap", "used", "parcel", "aged")), + ::anno::thumbnail("./.thumbs/Cardboard_Low_Quality.Cardboard_Low_Quality_Used.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Cardboard_Low_Quality +( + diffuse_brightness: 0.8f, + reflection_roughness: 0.3f, + reflection_variation: 0.f, + dirt: 0.4f, + corrugation_strength: 1.f, + corrugation_variation: 0.6f, + texture_translate: 0.f, + texture_rotate: 0.f, + texture_scale: 1.f, + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: true +); + +export material Cardboard_Low_Quality_Burnt(*) +[[ + ::anno::display_name("Cardboard Low Quality Burnt"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("dielectric", "paper", "box", "black", "brown", "corrugation", "package", "delivery", "cardboard", "quality", "low", "cheap", "used", "parcel", "aged", "burnt")), + ::anno::thumbnail("./.thumbs/Cardboard_Low_Quality.Cardboard_Low_Quality_Burnt.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Cardboard_Low_Quality +( + diffuse_brightness: 0.15f, + reflection_roughness: 0.f, + reflection_variation: 0.f, + dirt: 0.4f, + corrugation_strength: 1.f, + corrugation_variation: 1.f, + texture_translate: 0.f, + texture_rotate: 0.f, + texture_scale: 1.f, + uv_space_index: 0, + enable_round_corners: false, + radius: 1.5f, + across_materials: true +); \ No newline at end of file diff --git a/Material/material_0552/Stone_Natural_Black.mdl b/Material/material_0552/Stone_Natural_Black.mdl new file mode 100644 index 0000000000000000000000000000000000000000..ac6adb461a171138e8500cea4cee80c32f58c577 --- /dev/null +++ b/Material/material_0552/Stone_Natural_Black.mdl @@ -0,0 +1,366 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + + +mdl 1.4; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + + +const string DESCRIPTION = "A black stone material"; + + + +float histogram_range(float input, float range, float position) +{ + float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); + float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); + return ::math::lerp(low, high, input); +} + +float3 srgb2rgb(float3 val) +{ + return ::math::pow(::math::max(val, float3(0.0f)), 2.2); +} + + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float2 rnd22(int2 p) { + float2 ret_val = float2( + uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f, + uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f + ); + return ret_val; +} + +::base::texture_coordinate_info vmat_transform( + uniform float2 translation = float2(0.0, 0.0), + uniform float rotation = 0.0, + uniform float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation_rad); + float c = ::math::cos(rotation_rad); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + +float2x2 invert_2x2(float2x2 M) +{ + float det = M[0][0]*M[1][1] - M[0][1]*M[1][0]; + //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/ + return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]); +} + +float3 nonrepeat_lookup( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5), + float patch_size = 8.0 +) +{ + + float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale; + float Z = patch_size; // patch scale inside example texture + float CON = 1.0f; + + float3 O = float3(0.f); + float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); + float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space + + float2 U = uv_in; + float2 V = M * uv_in; //pre-tilted hexa coordinates + int2 I = int2(::math::floor(V)); // hexa-tile id + + // The mean color needs to be determined in Photoshop then to make the + // average color work out, take the float value and calculate the apropriate + // mean value as (value^(1/2.2)) + + float3 m = average_color; + + float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; + F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates + + if( F[2] > 0.f ) + + O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON)) + + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON)) + + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON)); + else + O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON)) + + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON)) + + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON)); + O = m + O/::math::length(W); + O = ::math::clamp( (O), 0.0, 1.0); + + return float3(O); +} + +color endless_texture( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 10.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0, + bool gamma_correct_lookup = true +) +{ + return gamma_correct_lookup ? color(srgb2rgb( + nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )) + ) : color(nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )); +} + +float3 endless_normal( + uniform texture_2d texture = texture_2d(), + float factor = 1.0, + bool flip_tangent_u = false, + bool flip_tangent_v = false, + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0 +) +{ + float3 transformed_tangent_u = flip_tangent_u ? uvw.tangent_u : - uvw.tangent_u; + float3 transformed_tangent_v = flip_tangent_v ? uvw.tangent_v : - uvw.tangent_v; + + if (flip_tangent_u) + transformed_tangent_u=-transformed_tangent_u; + if (flip_tangent_v) + transformed_tangent_v=-transformed_tangent_v; + + // normalized Lookup + float3 tangent_space_normal = + (nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + ) - 0.5) * (2.0 * factor); + + return ::math::normalize(uvw.tangent_u * tangent_space_normal.x + + uvw.tangent_v * tangent_space_normal.y + + ::state::normal()*1.0); +} + + + +export material Stone_Natural_Black( + uniform bool infinite_tiling = true [[ + ::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."), + ::anno::display_name("Infinite Tiling"), + ::anno::in_group("Appearance") + ]], + float patch_size = 2.7f [[ + ::anno::description("Determines the size of the sampled area in the texture. Larger values sample smaller areas, resulting in a more fragmented look of the source texture. Tweak the value so that the appearance of the infinite tiling looks good to you."), + ::anno::display_name("Infinite Tiling Patch Size"), + ::anno::in_group("Appearance") + ]], + float diffuse_brightness = 0.5f [[ + ::anno::description("Adjusts the lightness of the material."), + ::anno::display_name("Brightness"), + ::anno::hard_range(0.0f,1.0f), + ::anno::in_group("Appearance") + ]], + float roughness = 0.7f [[ + ::anno::display_name("Roughness"), + ::anno::hard_range(0.0f,1.0f), + ::anno::in_group("Appearance") + ]], + uniform float bump_strength = 0.752000034f [[ + ::anno::description("Specifies the strength of the bump."), + ::anno::display_name("Bump Strengh"), + ::anno::hard_range(0.0f,1.0f), + ::anno::in_group("Appearance") + ]], + uniform float2 texture_translate = 0.f [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Translate"), + ::anno::in_group("Transform") + ]], + uniform float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Rotate"), + ::anno::in_group("Transform") + ]], + uniform float2 texture_scale = 1.f [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Scale"), + ::nvidia::core_definitions::dimension(float2(0.8f, 0.8f)), + ::anno::in_group("Transform") + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Use selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced") + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Stone Natural Black Mustang"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Stone_Natural_Black.Stone_Natural_Black.png"), + ::anno::key_words(string[]("stone", "hard", "wall", "floor", "architecture", "kitchen", "infinite tiling", "bath", "bathroom", "exterior", "interior", "rough", "bumped", "black", "dark")) +]] + = + let { + bool tmp0 = false; + material_surface tmp1( + ::df::custom_curve_layer(0.0299999993f, 1.f, 5.f, ::math::lerp(0.154000014f, 1.f, ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./natural_stone_black_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), patch_size, float3(0.573000014f, 0.760999978f, 0.423999995f), patch_size, false) : ::base::file_texture(texture_2d("./natural_stone_black_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_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)), ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./natural_stone_black_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), patch_size, float3(0.573000014f, 0.760999978f, 0.423999995f), patch_size, false) : ::base::file_texture(texture_2d("./natural_stone_black_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_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], 1.f, ::math::lerp(0.400000006f, 0.75f, roughness)) * histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./natural_stone_black_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), patch_size, float3(0.573000014f, 0.760999978f, 0.423999995f), patch_size, false) : ::base::file_texture(texture_2d("./natural_stone_black_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_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], 1.f, ::math::lerp(0.400000006f, 0.75f, roughness)), histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./natural_stone_black_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), patch_size, float3(0.573000014f, 0.760999978f, 0.423999995f), patch_size, false) : ::base::file_texture(texture_2d("./natural_stone_black_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_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], 1.f, ::math::lerp(0.400000006f, 0.75f, roughness)) * histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./natural_stone_black_multi_R_rough_G_ao_B_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), patch_size, float3(0.573000014f, 0.760999978f, 0.423999995f), patch_size, false) : ::base::file_texture(texture_2d("./natural_stone_black_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_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], 1.f, ::math::lerp(0.400000006f, 0.75f, roughness)), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(::nvidia::core_definitions::blend_colors(infinite_tiling ? endless_texture(texture_2d("./natural_stone_black_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), patch_size, float3(0.26699999f, 0.263000011f, 0.254999995f), patch_size, true) : ::base::file_texture(texture_2d("./natural_stone_black_diff.jpg", ::tex::gamma_srgb), 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, color(0.f, 0.f, 0.f), ::base::color_layer_multiply, ::math::lerp(0.649999976f, 0.200000003f, diffuse_brightness)).tint, 0.f, ""), ::state::normal()), + material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + 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)); + material_geometry tmp5( + float3(0.f), + 1.f, + infinite_tiling ? endless_normal(texture_2d("./natural_stone_black_norm.jpg", ::tex::gamma_linear), ::math::lerp(0.f, 3.f, bump_strength), false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), patch_size, float3(0.5f, 0.5f, 1.f), patch_size) : ::base::tangent_space_normal_texture(texture_2d("./natural_stone_black_norm.jpg", ::tex::gamma_linear), ::math::lerp(0.f, 3.f, 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)); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + + + +export material Stone_Natural_Black_Matte(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Stone Natural Black Matte"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Stone_Natural_Black.Stone_Natural_Black_Matte.png"), + ::anno::key_words(string[]("stone", "hard", "wall", "floor", "architecture", "kitchen", "infinite tiling", "bath", "bathroom", "exterior", "interior", "rough", "bumped", "black", "dark")) +]] + = Stone_Natural_Black( + infinite_tiling: true, + patch_size: 3.0f, + diffuse_brightness: 0.5f, + roughness: 0.7f, + bump_strength: 0.30f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0 +); + + +export material Stone_Natural_Black_Shiny(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Stone Natural Black Shiny"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Stone_Natural_Black.Stone_Natural_Black_Shiny.png"), + ::anno::key_words(string[]("stone", "hard", "wall", "floor", "architecture", "kitchen", "infinite tiling", "bath", "bathroom", "exterior", "interior", "rough", "bumped", "black", "dark")) +]] + = Stone_Natural_Black( + infinite_tiling: true, + patch_size: 3.0f, + diffuse_brightness: 0.965f, + roughness: 0.0f, + bump_strength: 1.0f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + uv_space_index: 0 +); \ No newline at end of file diff --git a/Material/material_0555/Laminate_Oak.mdl b/Material/material_0555/Laminate_Oak.mdl new file mode 100644 index 0000000000000000000000000000000000000000..0cc1c0162268165bb7b4c23a40bfbd2d66928fc8 --- /dev/null +++ b/Material/material_0555/Laminate_Oak.mdl @@ -0,0 +1,435 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + + +mdl 1.4; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + + + + +::base::texture_coordinate_info vmat_transform( + uniform float2 translation = float2(0.0, 0.0), + uniform float rotation = 0.0, + uniform float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation_rad); + float c = ::math::cos(rotation_rad); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + +float histogram_range(float input, float range, float position) +{ + float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); + float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); + return ::math::lerp(low, high, input); +} + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float2 rnd22(int2 p) { + float2 ret_val = float2( + uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f, + uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f + ); + return ret_val; +} + +float3 srgb2rgb(float3 val) +{ + return ::math::pow(::math::max(val, float3(0.0f)), 2.2); +} + +float2x2 invert_2x2(float2x2 M) +{ + float det = M[0][0]*M[1][1] - M[0][1]*M[1][0]; + //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/ + return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]); +} + +float3 nonrepeat_lookup( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5), + float patch_size = 8.0 +) +{ + + float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale; + float Z = patch_size; // patch scale inside example texture + float CON = 1.0f; + + float3 O = float3(0.f); + float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); + float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space + + float2 U = uv_in; + float2 V = M * uv_in; //pre-tilted hexa coordinates + int2 I = int2(::math::floor(V)); // hexa-tile id + + // The mean color needs to be determined in Photoshop then to make the + // average color work out, take the float value and calculate the apropriate + // mean value as (value^(1/2.2)) + + float3 m = average_color; + + float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; + F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates + + if( F[2] > 0.f ) + + O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON)) + + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON)) + + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON)); + else + O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON)) + + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON)) + + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON)); + O = m + O/::math::length(W); + O = ::math::clamp( (O), 0.0, 1.0); + + return float3(O); +} + +color endless_texture( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 10.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0, + bool gamma_correct_lookup = true +) +{ + return gamma_correct_lookup ? color(srgb2rgb( + nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )) + ) : color(nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )); +} + +float3 endless_normal( + uniform texture_2d texture = texture_2d(), + float factor = 1.0, + bool flip_tangent_u = false, + bool flip_tangent_v = false, + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0 +) +{ + float3 transformed_tangent_u = flip_tangent_u ? uvw.tangent_u : - uvw.tangent_u; + float3 transformed_tangent_v = flip_tangent_v ? uvw.tangent_v : - uvw.tangent_v; + + if (flip_tangent_u) + transformed_tangent_u=-transformed_tangent_u; + if (flip_tangent_v) + transformed_tangent_v=-transformed_tangent_v; + + // normalized Lookup + float3 tangent_space_normal = + (nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + ) - 0.5) * (2.0 * factor); + + return ::math::normalize(uvw.tangent_u * tangent_space_normal.x + + uvw.tangent_v * tangent_space_normal.y + + ::state::normal()*1.0); +} + +float3 normalmap_normal( + uniform texture_2d texture, + float factor = 1.0, + ::base::texture_coordinate_info uvw = ::base::texture_coordinate_info() +) +{ + float3 lookup = (::tex::lookup_float3(texture, float2(uvw.position.x, uvw.position.y)) - 0.5) * (factor * 2.0); + return ::math::normalize(uvw.tangent_u * lookup.x + uvw.tangent_v * lookup.y + ::state::normal()); +} + + +export material Laminate_Oak( + uniform bool enable_infinite_tiling = false [[ + ::anno::description("Enables Infinite Tiling feature. Removes artifacts of repeating texture patterns when material is scaled."), + ::anno::display_name("Infinite Tiling"), + ::anno::in_group("Appearance") + ]], + float wood_brightness = 0.7f [[ + ::anno::description("Adjusts the brightness of the wood material."), + ::anno::display_name("Wood Brightness"), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Appearance") + ]], + float wood_fiber_roughness = 1.0f [[ + ::anno::description("Adjusts the roughness of the fibers. Lower values cause a more anisotropic appearance of the reflections."), + ::anno::display_name("Wood Fiber Roughness"), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Appearance") + ]], + float oak_bump_factor = 1.f [[ + ::anno::display_name("Oak Bump Strength"), + ::anno::description("Specifies the strength of the bump."), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Appearance") + ]], + float smudges_weight = 0.08f [[ + ::anno::description("Adds smudges on top of the material to create a more worn and used appearance of the material."), + ::anno::display_name("Smudges Weight"), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Appearance", "Wear") + ]], + float smudges_roughness = 0.68 [[ + ::anno::description("Adjusts the roughness of the smudges on top of the material."), + ::anno::display_name("Smudges Roughness"), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Appearance", "Wear") + ]], + float dirt_weight = 0.f [[ + ::anno::description("Adjusts the thickness of the dirt layer on top of the material."), + ::anno::display_name("Dirt Thickness"), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Appearance", "Wear") + ]], + uniform float2 texture_translate = 0.f [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Translate"), + ::anno::in_group("Transform") + ]], + uniform float texture_rotate = 0.f [[ + ::anno::description("Rotates the angle of the texture in degrees."), + ::anno::display_name("Rotate"), + ::anno::in_group("Transform") + ]], + uniform float2 texture_scale = 1.f [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Scale"), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::anno::in_group("Transform") + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Selects the UV texture space index to use for the material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced") + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Wood Laminate Oak - New"), + ::anno::description("A wood laminate material that features infinite tiling, smudges and a dirt layer."), + ::anno::key_words(string[]("aec", "wood", "oak", "laminate", "floor", "polished", "artificial", "infinite tiling", "new", "brown")), + ::anno::thumbnail("./.thumbs/Laminate_Oak.Laminate_Oak.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = + let { + bool tmp0 = false; + material_surface tmp1( + ::df::weighted_layer(histogram_range(1.f - float3(enable_infinite_tiling ? endless_texture(texture_2d("./laminate_oak_multi_R_rough_G_aniso.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.579999983f, 0.537f, 0.f), 8.f, true) : ::base::file_texture(texture_2d("./laminate_oak_multi_R_rough_G_aniso.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], 1.f, ::math::lerp(1.f, 0.721000016f, dirt_weight)), ::df::custom_curve_layer(0.0410000011f, 1.f, 5.f, smudges_weight, ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(enable_infinite_tiling ? endless_texture(texture_2d("./laminate_oak_multi_R_rough_G_aniso.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.579999983f, 0.537f, 0.f), 8.f, true) : ::base::file_texture(texture_2d("./laminate_oak_multi_R_rough_G_aniso.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.34800002f, ::math::lerp(0.300000012f, 0.649999976f, smudges_roughness)) * histogram_range(float3(enable_infinite_tiling ? endless_texture(texture_2d("./laminate_oak_multi_R_rough_G_aniso.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.579999983f, 0.537f, 0.f), 8.f, true) : ::base::file_texture(texture_2d("./laminate_oak_multi_R_rough_G_aniso.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.34800002f, ::math::lerp(0.300000012f, 0.649999976f, smudges_roughness)), histogram_range(float3(enable_infinite_tiling ? endless_texture(texture_2d("./laminate_oak_multi_R_rough_G_aniso.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.579999983f, 0.537f, 0.f), 8.f, true) : ::base::file_texture(texture_2d("./laminate_oak_multi_R_rough_G_aniso.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.34800002f, ::math::lerp(0.300000012f, 0.649999976f, smudges_roughness)) * histogram_range(float3(enable_infinite_tiling ? endless_texture(texture_2d("./laminate_oak_multi_R_rough_G_aniso.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.579999983f, 0.537f, 0.f), 8.f, true) : ::base::file_texture(texture_2d("./laminate_oak_multi_R_rough_G_aniso.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.34800002f, ::math::lerp(0.300000012f, 0.649999976f, smudges_roughness)), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::custom_curve_layer(0.0410000011f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(enable_infinite_tiling ? endless_texture(texture_2d("./laminate_oak_multi_R_rough_G_aniso.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.579999983f, 0.537f, 0.f), 8.f, true) : ::base::file_texture(texture_2d("./laminate_oak_multi_R_rough_G_aniso.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.445000023f, 0.398000032f) * histogram_range(float3(enable_infinite_tiling ? endless_texture(texture_2d("./laminate_oak_multi_R_rough_G_aniso.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.579999983f, 0.537f, 0.f), 8.f, true) : ::base::file_texture(texture_2d("./laminate_oak_multi_R_rough_G_aniso.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.445000023f, 0.398000032f), ::math::lerp(0.206000015f, 0.382000029f, wood_fiber_roughness) * ::math::lerp(0.206000015f, 0.382000029f, wood_fiber_roughness), color(0.491905004f, 0.491905004f, 0.491905004f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(::nvidia::core_definitions::blend_colors(enable_infinite_tiling ? endless_texture(texture_2d("./laminate_oak_diffuse.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.611000001f, 0.451999992f, 0.287f), 8.f, true) : ::base::file_texture(texture_2d("./laminate_oak_diffuse.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(0.767768979f, 0.767768979f, 0.767768979f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, color(::math::lerp(0.75f, 1.f, wood_brightness)), ::base::color_layer_multiply, 1.f).tint, 0.f, ""), ::state::normal()), ::state::normal()), ::df::diffuse_reflection_bsdf(color(0.0782879964f, 0.0712279975f, 0.0564489998f), 0.f, ""), ::state::normal()), + material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + 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)); + material_geometry tmp5( + float3(0.f), + 1.f, + enable_infinite_tiling ? endless_normal(texture_2d("./laminate_oak_normal.jpg", ::tex::gamma_linear), oak_bump_factor, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.5f, 0.5f, 1.f), 8.f) : normalmap_normal(texture_2d("./laminate_oak_normal.jpg", ::tex::gamma_linear), oak_bump_factor, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index))); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + +export material Laminate_Oak_Polished(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Wood Laminate Oak - Polished"), + ::anno::description("A wood laminate material with smudges and a dirt layer that features infinite tiling."), + ::anno::key_words(string[]("aec", "wood", "oak", "laminate", "floor", "polished", "artificial", "infinite tiling", "dust", "dirt", "brown", "warm")), + ::anno::thumbnail("./.thumbs/Laminate_Oak.Laminate_Oak_Polished.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Laminate_Oak( + enable_infinite_tiling: false, + wood_brightness: 0.7f, + wood_fiber_roughness: 1.0f, + oak_bump_factor: 0.5f, + smudges_weight: 0.0f, + smudges_roughness: 0.0f, + dirt_weight: 0.0f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0, + uv_space_index: 0 +); + +export material Laminate_Oak_Slight_Smudges(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Wood Laminate Oak - Smudges"), + ::anno::description("A wood laminate material with smudges and a dirt layer that features infinite tiling."), + ::anno::key_words(string[]("aec", "wood", "oak", "laminate", "floor", "polished", "artificial", "infinite tiling", "smudges", "dust", "dirt", "brown", "warm")), + ::anno::thumbnail("./.thumbs/Laminate_Oak.Laminate_Oak_Slight_Smudges.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Laminate_Oak( + enable_infinite_tiling: false, + wood_brightness: 0.7f, + wood_fiber_roughness: 1.0f, + oak_bump_factor: 1.0f, + smudges_weight: 0.8f, + smudges_roughness: 0.75f, + dirt_weight: 0.5f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0, + uv_space_index: 0 +); + +export material Laminate_Oak_Dirty(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Wood Laminate Oak - Dirty"), + ::anno::description("A wood laminate material with smudges and a dirt layer that features infinite tiling."), + ::anno::key_words(string[]("aec", "wood", "oak", "laminate", "floor", "polished", "artificial", "infinite tiling", "dust", "dirt", "brown", "warm")), + ::anno::thumbnail("./.thumbs/Laminate_Oak.Laminate_Oak_Dirty.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Laminate_Oak( + enable_infinite_tiling: false, + wood_brightness: 0.7f, + wood_fiber_roughness: 1.0f, + oak_bump_factor: 1.0f, + smudges_weight: 0.8f, + smudges_roughness: 0.75f, + dirt_weight: 0.85f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0, + uv_space_index: 0 +); + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Material/material_0556/OSB_Wood.mdl b/Material/material_0556/OSB_Wood.mdl new file mode 100644 index 0000000000000000000000000000000000000000..4761a312dfa2531b1ffd0e4e4f00d9f2b2722299 --- /dev/null +++ b/Material/material_0556/OSB_Wood.mdl @@ -0,0 +1,387 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + +mdl 1.5; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + + +::base::texture_coordinate_info vmat_transform( + uniform float2 translation = float2(0.0, 0.0), + uniform float rotation = 0.0, + uniform float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation_rad); + float c = ::math::cos(rotation_rad); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + +float remap(float input, float low_1, float high_1, float low_2, float high_2) +{ + return low_2 + ((input - low_1) * (high_2 - low_2))/(high_1 - low_1); +} + +float histogram_scan(float input, float width, float position) +{ + float low = ::math::clamp(1.0f - position * 2.0, 0.0f ,1.0f); + float high = ::math::clamp(position > 0.5f ? 1.0 : 2.0f - 2 * position, 0.0f, 1.0f); + //float center = (low + high)/2.0f); + float offset = ((high - low) / 2.0) * width; + low += offset; + high -= offset; + return ::math::clamp( + remap(input, + low, + high, + 0.0, + 1.0), + 0.0, + 1.0); +} + + +float histogram_range(float input, float range, float position) +{ + float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); + float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); + return ::math::lerp(low, high, input); +} + + + +float uint2float(int x) +{ + return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0); +} + +int lowbias32(int x) +{ + x ^= x >>> 16; + x *= 0x7feb352d; + x ^= x >>> 15; + x *= 0x846ca68b; + x ^= x >>> 16; + return x; +} + +float2 rnd22(int2 p) { + float2 ret_val = float2( + uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f, + uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f + ); + return ret_val; +} + +float3 srgb2rgb(float3 val) +{ + return ::math::pow(::math::max(val, float3(0.0f)), 2.2); +} + +float2x2 invert_2x2(float2x2 M) +{ + float det = M[0][0]*M[1][1] - M[0][1]*M[1][0]; + //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/ + return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]); +} + +float3 nonrepeat_lookup( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5), + float patch_size = 8.0 +) +{ + + float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale; + float Z = patch_size; // patch scale inside example texture + float CON = 1.0f; + + float3 O = float3(0.f); + float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); + float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space + + float2 U = uv_in; + float2 V = M * uv_in; //pre-tilted hexa coordinates + int2 I = int2(::math::floor(V)); // hexa-tile id + + // The mean color needs to be determined in Photoshop then to make the + // average color work out, take the float value and calculate the apropriate + // mean value as (value^(1/2.2)) + + float3 m = average_color; + + float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; + F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates + + if( F[2] > 0.f ) + + O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON)) + + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON)) + + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON)); + else + O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON)) + + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON)) + + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON)); + O = m + O/::math::length(W); + O = ::math::clamp( (O), 0.0, 1.0); + + return float3(O); +} + +color endless_texture( + uniform texture_2d texture = texture_2d(), + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 10.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0, + bool gamma_correct_lookup = true +) +{ + return gamma_correct_lookup ? color(srgb2rgb( + nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )) + ) : color(nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + )); +} + +float3 endless_normal( + uniform texture_2d texture = texture_2d(), + float factor = 1.0, + bool flip_tangent_u = false, + bool flip_tangent_v = false, + ::base::texture_coordinate_info uvw = ::base::coordinate_source(), + float texture_scale = 1.0, + float3 average_color = float3(0.5, 0.5, 1.0), + float patch_size = 8.0 +) +{ + float3 transformed_tangent_u = flip_tangent_u ? uvw.tangent_u : - uvw.tangent_u; + float3 transformed_tangent_v = flip_tangent_v ? uvw.tangent_v : - uvw.tangent_v; + + if (flip_tangent_u) + transformed_tangent_u=-transformed_tangent_u; + if (flip_tangent_v) + transformed_tangent_v=-transformed_tangent_v; + + // normalized Lookup + float3 tangent_space_normal = + (nonrepeat_lookup ( + texture: texture, + uvw: uvw, + texture_scale: texture_scale, + average_color: average_color, + patch_size: patch_size + ) - 0.5) * (2.0 * factor); + + return ::math::normalize(uvw.tangent_u * tangent_space_normal.x + + uvw.tangent_v * tangent_space_normal.y + + ::state::normal()*1.0); +} + + + +export material OSB_Wood( + uniform bool infinite_tiling = true [[ + ::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."), + ::anno::display_name("Infinite Tiling"), + ::anno::in_group("Appearance") + ]], + color wood_tint = color(0.5f, 0.5f, 0.5f) [[ + ::anno::description("Allows to adjusts the tint of the wood."), + ::anno::display_name("Wood Tint"), + ::anno::in_group("Appearance") + ]], + // float diffuse_brightness = 0.f [[ + // ::anno::description("Adjusts the lightness of the material."), + // ::anno::display_name("Brightness"), + // ::anno::in_group("Appearance"), + // ::anno::hard_range(0.f, 1.f) + // ]], + float roughness = 0.81f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float wood_bump_strength = 1.f [[ + ::anno::description("Adjusts the strength of the bump."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 3.f), + ::anno::soft_range(0.f, 1.f) + ]], + uniform float2 texture_translate = 0.f [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform") + ]], + uniform float texture_rotate = 0.f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(-360.f, 360.f) + ]], + uniform float2 texture_scale = 1.f [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::nvidia::core_definitions::dimension(float2(1.0, 1.0)), + ::anno::in_group("Transform") + ]], + uniform bool round_corners_enable = false [[ + ::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."), + ::anno::display_name("Round Corners"), + ::anno::in_group("Round Corners") + ]], + uniform float round_corners_radius_mm = 2.5f [[ + ::anno::description("Radius of the rounded corners in mm."), + ::anno::display_name("Radius"), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f) + ]], + uniform bool round_corners_across_materials = false [[ + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::display_name("Across Materials"), + ::anno::in_group("Round Corners") + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Uses selected UV space for material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced") + ]] +) +[[ + ::anno::description("OSB wood is composited from compressed wood strands, suitable for load-bearing constructions."), + ::anno::in_group("Wood"), + ::anno::display_name("OSB Wood - Rough"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/OSB_Wood.OSB_Wood.png"), + ::anno::key_words(string[]("wood", "OSB", "board", "particle", "construction", "wall", "interior", "exterior", "bumped", "rough", "brown")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] + = + let { + float diffuse_brightness = 0.f; + + bool tmp0 = false; + material_surface tmp1(::df::custom_curve_layer(0.0299999993f, 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.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)[1], 0.719999969f, 0.209999993f), ::df::microfacet_ggx_smith_bsdf(::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)) * ::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)), ::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)) * ::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)), 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("./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, color(0.f, 0.f, 0.f), ::base::color_layer_multiply, diffuse_brightness * -0.300000012f + 0.300000012f).tint, wood_tint, ::base::color_layer_overlay, 1.f).tint, 0.f), bsdf(), 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("./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)), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + color tmp3 = color(1.f, 1.f, 1.f); + 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)); + material_geometry tmp5(float3(0.f), 1.f, round_corners_enable ? ::state::rounded_corner_normal(round_corners_radius_mm * 0.001f, round_corners_across_materials, 1.f) : ::state::normal()); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + +export material OSB_Wood_Shiny(*) +[[ + ::anno::description("OSB wood is composited from compressed wood strands, suitable for load-bearing constructions."), + ::anno::in_group("Wood"), + ::anno::display_name("OSB Wood - Shiny"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/OSB_Wood.OSB_Wood_Shiny.png"), + ::anno::key_words(string[]("wood", "OSB", "board", "particle", "construction", "wall", "interior", "exterior", "bumped", "shiny", "brown")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Ruediger Raab"), + ::anno::contributor("Maik Rohland") +]] = OSB_Wood +( + infinite_tiling: false, + wood_tint: color(0.5f, 0.5f, 0.5f), + roughness: 0.15f, + wood_bump_strength: 1.0f, + texture_translate: 0.0f, + texture_rotate: 0.0f, + texture_scale: 1.0f, + round_corners_enable: false, + round_corners_radius_mm: 2.5f, + round_corners_across_materials: false, + uv_space_index: 0 +); diff --git a/Material/material_0565/Wood_Tiles_Fineline_Multicolor.mdl b/Material/material_0565/Wood_Tiles_Fineline_Multicolor.mdl new file mode 100644 index 0000000000000000000000000000000000000000..f72d585fe215d093f92a156b6465c9f75ffcdf37 --- /dev/null +++ b/Material/material_0565/Wood_Tiles_Fineline_Multicolor.mdl @@ -0,0 +1,1591 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + + +mdl 1.5; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + +const string DESCRIPTION = "A wooden tile material with adjustments to produce a rich variety of wooden floor styles ranging from new to worn."; + +annotation preview_scale( float f); + +struct vm_coordinates{ + float2 uv; + float rotation; + int uv_space_index; + float4 carry; +}; + +enum vm_mono_select +[[ + anno::description("Modes for the creation of a gray-scale value from a color."), + anno::hidden() +]] +{ + mono_r = 0, + mono_g = 1, + mono_b = 2, + mono_a = 3, + mono_average = 4 +}; + +vm_coordinates vm_coord +( + float2 translation = float2(0.0f, 0.0) [[ + ::anno::display_name("Translation"), + ::anno::description("Translates the coordinates.") + ]], + float rotation = 0.0f [[ + ::anno::display_name("Rotation"), + ::anno::description("Rotates the coordinates in degrees.") + ]], + float2 scaling = float2(1.0f, 1.0f) [[ + ::anno::display_name("Scaling"), + ::anno::description("Scales the coordinates.") + ]], + uniform int uv_space = 0 [[ + ::anno::display_name("UV Space"), + ::anno::description("Chose the UV space.") + ]] +) +[[ + ::anno::display_name("vm Transform"), + ::anno::description("Generates coordinates to be used in vm_lookup functions.") +]] +{ + vm_coordinates uv; + ::base::texture_coordinate_info info = ::base::coordinate_source( ::base::texture_coordinate_uvw, uv_space); + uv.rotation = (rotation * 3.1415926535897932384626433832f) / 180.f; + uv.uv = float2(info.position.x, info.position.y); + float sine = ::math::sin(uv.rotation); + float cosine = ::math::cos(uv.rotation); + float2x2 rot = float2x2(cosine, -sine, sine, cosine); + uv.uv = rot * uv.uv; + uv.uv /= scaling; + uv.uv += translation; + // Translation before or after rotation? + return uv; +} + +vm_coordinates vm_coord_post_scale( + vm_coordinates uv = vm_coord(), + float2 scale = 1.0f +) +{ + uv.uv /= scale; + return uv; +} + +::base::texture_return vm_tex_lookup( + uniform texture_2d tex, + vm_coordinates uv = vm_coord(), + uniform vm_mono_select mono_source = mono_a, + float4 scale = float4(1.0f)) +{ + float mono; + float4 lookup = ::tex::lookup_float4(tex, uv.uv, ::tex::wrap_repeat, ::tex::wrap_repeat) * scale; + switch( mono_source ) { + case mono_r: mono = lookup.x; + break; + case mono_g: mono = lookup.y; + break; + case mono_b: mono = lookup.z; + break; + case mono_a: mono = lookup.w; + break; + case mono_average: mono = ::math::average(float3(lookup.x, lookup.y, lookup.z)); + break; + } + return ::base::texture_return(color(lookup.x, lookup.y, lookup.z), mono); +} + +float3 vm_tex_normal_lookup( + uniform texture_2d tex, + vm_coordinates uv = vm_coord(), + float strength = 1.0f +) +{ + float rot = uv.rotation; + // Lookup and convert normal texture to -1 ... 1 range + float3 norm = (::tex::lookup_float3(tex, uv.uv, ::tex::wrap_repeat, ::tex::wrap_repeat) - float3(.5f)) * 2.0f; + norm = ::math::normalize(norm * float3(strength, strength, 1.0)); + // if any rotation happened prior to the lookup, compensate for it + norm = float3(::math::cos(rot) * norm.x - ::math::sin(rot) * norm.y, + ::math::sin(rot) * norm.x + ::math::cos(rot) * norm.y, + norm.z); + return norm.x * ::state::texture_tangent_u(uv.uv_space_index) + + norm.y * ::state::texture_tangent_v(uv.uv_space_index) + + norm.z * ::state::normal(); +} + + +// ---------------------------------------------------------------------------------------------------------------------- + + +float histogram_range(float input, float range = 1.0f, float position = 0.5f) +{ + float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); + float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); + return ::math::lerp(low, high, input); +} + +float remap_xy_to_0_1(float input, float x, float y) +{ + return (input - x)/(y - x); +} + +float histogram_scan_big(float input, float width, float position) +{ + return ::math::clamp( + remap_xy_to_0_1(input, + ::math::lerp(-width, 1.0, position), + ::math::lerp(0.0, 1.0 + width, position)), + 0.0, + 1.0); +} + +// ********** Randomization functions -I- ********** + +int random(int seed = 0, int modulus = 65536, int multiplier = 1664525, int increment = 1013904223) +{ + return (multiplier * seed + increment) % modulus; +} + + +// Returns the normal n in tangent space, given n is in internal space. +float3 transform_internal_to_tangent(float3 n) +[[ + ::anno::hidden() +]] +{ + return + n.x* float3(::state::texture_tangent_u(0).x,::state::texture_tangent_v(0).x,::state::normal().x)+ + n.y* float3(::state::texture_tangent_u(0).y,::state::texture_tangent_v(0).y,::state::normal().y)+ + n.z* float3(::state::texture_tangent_u(0).z,::state::texture_tangent_v(0).z,::state::normal().z); +} + +// Returns the normal n in internal space, given n is in tangent space. +float3 transform_tangent_to_internal(float3 n) +[[ + ::anno::hidden() +]] +{ + return ::state::texture_tangent_u(0) * n.x + + ::state::texture_tangent_v(0) * n.y + + ::state::normal() * n.z ; +} + + + +// Returns a normal by adding a detail normal to a global normal. +// If detail blending of two normal maps gives visual artifacts, check if texture_2d are loaded +// correctly with ::tex::gamma_linear +float3 add_detail_normal(float3 nd = ::state::normal(), float3 n = ::state::normal()) +{ + // http://blog.selfshadow.com/publications/blending-in-detail/ + float3 n_t = transform_internal_to_tangent(n); + float3 nd_t = transform_internal_to_tangent(nd); + + n_t=n_t + float3(0.,0.,1.); + nd_t = nd_t * float3(-1.,-1.,1.); + + n = n_t*::math::dot(n_t, nd_t)/n_t.z - nd_t; + return ::math::normalize(transform_tangent_to_internal(n)); +} + + +// For the rotated tangent I just used the code for the rotation of the tangent vector +// asselmbled from the former 'vmat_transform' and 'transform_coordinate_2' functions +float3 rotated_tangent( + float rotation = 0, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + float sin = ::math::sin(rotation_rad); + float cos = ::math::cos(rotation_rad); + + ::base::texture_coordinate_info coord = ::base::coordinate_source(::base::texture_coordinate_uvw, uv_space); + + return ::math::normalize(cos * coord.tangent_u - sin * coord.tangent_v); +} + + +// Returns 4 random IDs for a given pattern +float4 rand_tile_id( + vm_coordinates uv, + ::base::texture_return id_offset_map, // map containing the ID in r channel + //and the cell offset in g channel. + int seed = 0 + ) +[[ + ::anno::noinline() +]] +{ + float4 ret_val; + int offset_x, offset_y; + + + float3 id_offset_map_2 = float3(id_offset_map.tint); + float offset_id = id_offset_map_2.y; + int rand_id = int(id_offset_map_2.x * 254.f); // the more logical value of 255 causes sometimes rendering artifacts + // with the random number generator. Setting it to 254 apparently fixes it + + // Offset of overlapping tiles stored in G-channel + // [0 - 0.25[ : ( 0/ 0) Grayscale value: 0.1 + // [0.25 - 0.5 [ : (-1/ 0) Grayscale value: 0.37 + // [0.5 - 0.75[ : (-1/-1) Grayscale value: 0.62 + // [0.75 - 1.0 [ : ( 0/-1) Grayscale value: 0.87 + + offset_x = offset_id < 0.25f ? 0 : (offset_id < .75f) ? 1 : 0; + offset_y = offset_id < 0.5 ? 0 : 1; + + int2 cell_id = int2(int(::math::floor(uv.uv.x) - offset_x), int(::math::floor(uv.uv.y) - offset_y)); + + /* Using Linear congruential generator for pseudorandom numbers which is good enough */ + int rand_val_0 = random(seed); + int rand_val_1 = random(rand_val_0 + rand_id + random(cell_id.x + random(cell_id.y))); + int rand_val_2 = random(rand_val_1); + int rand_val_3 = random(rand_val_2); + int rand_val_4 = random(rand_val_3); + + ret_val = float4(rand_val_1, rand_val_2, rand_val_3, rand_val_4); + + return float4(ret_val/65535.0f); +} + + +// ****************************************************************************************************** +// Variation of the wood material which features another texture thats masks a secondary color +// Also the map includes a mask that prevents random color variations +export material Wood_Tiles_Fineline_Multicolor( + int seed = 0 [[ + ::anno::display_name("Randomization Seed"), + ::anno::description("Different seed values while causes different patterns of randomization on the tiles."), + ::anno::in_group("Randomization") + ]], + color wood_color = color(0.5319f, 0.36021f, 0.55172f) [[ + ::anno::display_name("Color Tint"), + ::anno::description("Applies an overlay color to tint the wood. A grayscale value of 0.5 has no effect, " + "brighter values brighten it while darker colors will have a darkening effect."), + ::anno::in_group("Appearance") + ]], + color wood_secondary_color = color(0.7586f, 0.0f, 1.0f) [[ + ::anno::description("Choose the secondary overlay color to tint the wood. A grayscale value of 0.5 has no effect, " + "brighter values brighten it while darker colors will have a darkening effect."), + ::anno::display_name("Secondary Color Tint"), + ::anno::in_group("Appearance") + ]], + float age_dirt = 0.4f [[ + ::anno::display_name("Age Dirt"), + ::anno::description("Adds dark dirt spots on top of the surface to create the appearance of a somewhat aged surface."), + ::anno::in_group("Appearance", "Tiles", "Coating"), + ::anno::enable_if("coating_reflectivity > 0.0f"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float wood_bump_strength = 0.5f // Determines the degree of bumpiness"), + [[ + ::anno::display_name("Wood Bump Strength"), + ::anno::description("Adjusts the strength of the wood bump map."), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 2.f) + ]], + float floor_brightness = 1.0f [[ + ::anno::description("Adjusts the general brightness of the wood."), + ::anno::display_name("Wood Brightness"), + ::anno::in_group("Appearance", "Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float wood_brightness_variation = 0.2f [[ + ::anno::display_name("Wood Brightness Variation"), + ::anno::description("Randomly darkens the tiles of the floor."), + ::anno::in_group("Appearance", "Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float wood_random_rotation = 0.015f [[ + ::anno::display_name("Wood Random Rotation"), + ::anno::description("Adds a random rotation around the main wood tile alignment direction."), + ::anno::in_group("Appearance", "Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + + float2 wood_scale = 1.f [[ + ::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."), + ::anno::display_name("Wood Scale"), + ::anno::in_group("Appearance", "Tiles"), + ::anno::soft_range(0.0f, 2.0f) + ]], + + + uniform float tiles_bump_strength = 0.31f [[ + ::anno::description("Determines the degree of bumpiness of the tiles texture (grooves and bent tiles)."), + ::anno::display_name("Tiles Bump Strength"), + ::anno::in_group("Appearance", "Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float tiles_random_slope_orientation = 0.15f [[ + ::anno::display_name("Tiles Random Slope Orientation"), + ::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."), + ::anno::in_group("Appearance", "Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float gaps_brightness = 0.3f [[ + ::anno::display_name("Grout Brightness"), + ::anno::description("Adjusts the brightness and roughness of the gaps between the tiles."), + ::anno::in_group("Appearance", "Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float tiles_base_roughness = 0.16f [[ + ::anno::description("Adjusts the roughness of the coating. Higher value leading to blurrier and softer reflections."), + ::anno::display_name("Coating Roughness"), + ::anno::in_group("Appearance", "Tiles", "Coating"), + ::anno::enable_if("coating_reflectivity > 0.0f"), + ::anno::hard_range(0.f, 1.f) + ]], + float base_roughness_range = 0.6f [[ + ::anno::description("Applies roughness variation to the coating, introducing signs of wear such as footprints and smudges."), + ::anno::display_name("Coating Roughness Variation"), + ::anno::in_group("Appearance", "Tiles", "Coating"), + ::anno::enable_if("coating_reflectivity > 0.0f"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float tiles_orange_peel_bump_factor = 0.1f [[ + ::anno::display_name("Coating Unevenness"), + ::anno::description("Applies an unevenness to the clear coat layer akin to orange peel."), + ::anno::in_group("Appearance", "Tiles", "Coating"), + ::anno::enable_if("coating_reflectivity > 0.0f"), + ::anno::hard_range(0.f, 1.f) + ]], + float coating_reflectivity = 1.f [[ + ::anno::display_name("Coating Reflectivity"), + ::anno::description("The overall reflectivity of the clearcoat layer. Note that other parameters will show no effect when the clearcoat reflectivity is 0."), + ::anno::in_group("Appearance", "Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + + float dirt_and_spots_amount = 0.0f [[ + ::anno::description("Adds random dirt and spots on top of the surface which adds variation to the clearcoat roughness."), + ::anno::display_name("Dirt and Spots"), + ::anno::in_group("Appearance", "Tiles", "Coating"), + ::anno::enable_if("coating_reflectivity > 0.0f"), + ::anno::hard_range(0.f, 1.f) + ]], + float edgewear_roughness_amount = 0.45f [[ + ::anno::description("Adds edgewear around the tile borders which results in a more worn and rough look of the clearcoat."), + ::anno::display_name("Edgewear Roughness Amount"), + ::anno::in_group("Appearance", "Tiles", "Coating"), + ::anno::enable_if("coating_reflectivity > 0.0f"), + ::anno::hard_range(0.f, 1.f) + ]], + + //----------------------------------------------- + + float2 texture_translate = 0.f [[ + ::anno::display_name("Texture Translate"), + ::anno::description("Controls the position of the texture."), + ::anno::in_group("Transform") + ]], + float texture_rotate = 0.f [[ + ::anno::display_name("Texture Rotate"), + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::in_group("Transform") + ]], + float2 texture_scale = 1.0f [[ + ::anno::display_name("Texture Scale"), + ::anno::description("Larger numbers increase the size."), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::anno::in_group("Transform") + ]], + uniform int uv_space_index = 0 [[ + ::anno::display_name("UV Space Index"), + ::anno::description("Uses selected UV space for material."), + ::anno::in_group("Transform") + ]], + uniform bool round_corners = false [[ + ::anno::display_name("Round Corners"), + ::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."), + ::anno::in_group("Round Corners") + ]], + uniform float roundcorner_radius_mm = 1.5f [[ + ::anno::display_name("Radius (mm)"), + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f) + ]], + uniform bool across_materials = false [[ + ::anno::display_name("Across Materials"), + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::in_group("Round Corners") + ]], + +// WOOD Highlights (Not accessible to regular users) + uniform bool preview_wood_highlights = false + [[ + ::anno::display_name("Preview Wood Specular"), + ::anno::description("Enables previewing of the wood specular highlights for tweaking."), + ::anno::in_group("Advanced", "Wood Highlight") + ]], // just previews the highlights of the wood material + float isotropic_roughness = 0.324f // The average roughness value of the isotropic highlight. When roughness variation is applied, the variation will go above and below those values.") + [[ + ::anno::display_name("Isotropic Roughness"), + ::anno::description("Sets the roughness of the isotropic component of the wood reflection."), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Advanced", "Wood Highlight") + ]], + float isotropic_roughness_range = 0.741f // 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") + [[ + ::anno::display_name("Isotropic Roughness Range"), + ::anno::description("Sets the degree roughness variation around the isotropic highlight."), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Advanced", "Wood Highlight") + ]], + float isotropic_specular_brightness = 0.833f // Sets how strong the isotropic specular highlight appears + [[ + ::anno::display_name("Isotropic Highlight Brightness"), + ::anno::description("Sets the brightness of the isotropic wood highlight."), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Advanced", "Wood Highlight") + ]], + float wood_specular_level = 1.f // Adjusts the specular level (PBR Style) + [[ + ::anno::display_name("Wood Specular Level"), + ::anno::description("Adjusts the falloff of the wood highlights."), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Advanced", "Wood Highlight") + ]], + float aniso_attenuation = 0.546f //Attenuates the the anisotropic highlight using a texture. Use the preview for exclusively previewing the wood hightligghts for properly adjusting this term" + [[ + ::anno::display_name("Anisotropic Attenuation"), + ::anno::description("Breaks up the reflection of the anisotropic highlight."), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Advanced", "Wood Highlight") + ]], + float aniso_bsdf_width = 0.287f //Controls the width of the anisotropic highlight" + [[ + ::anno::display_name("Anisotropic Width"), + ::anno::description("Adjusts the width of the anisotropic wood highlight."), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Advanced", "Wood Highlight") + ]], + float aniso_bsdf_height = 0.917f //Controls the height of the anisotropic highlight" + [[ + ::anno::display_name("Anisotropic Height"), + ::anno::description("Adjusts the height of the anisotropic highlight."), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Advanced", "Wood Highlight") + ]], + float anisotropic_isotropic_balance = 0.222f // Balances the Anisotropic vs. the isotropic wood highlight" + [[ + ::anno::display_name("Anisotropic - Isotropic Balance"), + ::anno::description("Blends between the contribution of isotropic and anisotropic highlight."), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Advanced", "Wood Highlight") + ]], + +// ------------------ TEXTURES (Not accessible to regular users) ------------------ + // Diffuse + uniform texture_2d tex_srgb_wood_color = texture_2d("./fineline_diff.jpg", ::tex::gamma_srgb) + [[ + ::anno::display_name("Diffuse Wood Texture"), + ::anno::description("The diffuse wood texture used to cover the tiles (srgb)."), + ::anno::in_group("Advanced", "Textures") + ]], + // Anisotropic Roughness AKA "Rough Detail" + uniform texture_2d tex_lin_wood_rough_detail = texture_2d("./fineline_rough_detail.jpg", ::tex::gamma_linear) + [[ + ::anno::display_name("Anisotropic Variation Texture"), + ::anno::description("Texture to add variation to the anisotropic reflections of the wood (linear space)."), + ::anno::in_group("Advanced", "Textures") + ]], + // Isotropic Roughness AKA "Rough Grain" + uniform texture_2d tex_lin_wood_rough_grain = texture_2d("./fineline_rough_grain.jpg", ::tex::gamma_linear) + [[ + ::anno::display_name("Isotropic Variation Texture"), + ::anno::description("Texture to add variation to the isotropic reflections of the wood (linear space)."), + ::anno::in_group("Advanced", "Textures") + ]], + // Wood detail Normal - Grain & Structure + uniform texture_2d tex_lin_wood_detail_norm = texture_2d("./fineline_norm.jpg", ::tex::gamma_linear) + [[ + ::anno::display_name("Wood Normal Texture"), + ::anno::description("Tangent Space Normal texture for defining the bumpiness of the wood."), + ::anno::in_group("Advanced", "Textures") + ]], + // Tiles ID, Offset & Rotation + uniform texture_2d tex_lin_tiles_id_offset_rotation = texture_2d("./melbury_R_id_G_offset_B_rotation.png", ::tex::gamma_linear) + [[ + ::anno::display_name("Tiles ID - Offset - Rotation Texture"), + ::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)."), + ::anno::in_group("Advanced", "Textures") + ]], + // Edgewear, Gaps(AO), Gaps Roughnesss + uniform texture_2d tex_lin_tiles_edgewear_gaps_gapsrough= texture_2d("./melbury_R_edgewear_G_gaps_B_gaps_rough.jpg", ::tex::gamma_linear) + [[ + ::anno::display_name("Edgewear - Gaps - Gap Rough"), + ::anno::description("Texture that holds maps for the edgewear roughness, the tile gaps and the gaps roughness (linear space)."), + ::anno::in_group("Advanced", "Textures") + ]], + // Tiles Normal (Grout and Bend) + uniform texture_2d tex_lin_tiles_normal = texture_2d("./melbury_norm.jpg", ::tex::gamma_linear) + [[ + ::anno::display_name("Tiles Normal Texture"), + ::anno::description("Texture that holds the normal map for the tiles (linear space)."), + ::anno::in_group("Advanced", "Textures") + ]], + // Secondary color (grayscale) mask, randomization mask + uniform texture_2d tex_lin_tiles_R_2nd_col_G_randmask = texture_2d("./melbury_R_2ndcol_G_randmask.png", ::tex::gamma_linear) + [[ + ::anno::display_name("2nd Color - Random Mask"), + ::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)."), + ::anno::in_group("Advanced", "Textures") + ]], + // Tiles Roughness, Dents and Spots + uniform texture_2d tex_lin_tiles_rough_dents_spots = texture_2d("./tiles_wood_R_rough_G_dents_B_spots.jpg", ::tex::gamma_linear) + [[ + ::anno::display_name("Tiles Rough - Dents - Spots"), + ::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)."), + ::anno::in_group("Advanced", "Textures") + ]], + // Tiles orange Peel + uniform texture_2d tex_lin_tiles_orange_peel = texture_2d("./tiles_wood_orangepeel_norm.jpg", ::tex::gamma_linear) + [[ + ::anno::display_name("Tiles Orange Peel"), + ::anno::description("Tangent Space Normal texture for the orange peel which is applied to the coating of the tiles."), + ::anno::in_group("Advanced", "Textures") + ]] + +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Wood Tiles Fineline - Multicolor Master"), + ::anno::description("Master template material. This material should be hidden." + "If you see this material, the integration is not hiding it correctly."), + // reflective, varnished, bumped, matte, natural, stained, exterior, new, aged, decayed, abstract, modern, classic + ::anno::key_words(string[]("wood", "master", "fineline", "tiles", "tiled", "pattern", "decorative", "multimaterial", "multicolor", "organic", "natural", "coated", "infinite tiling", "architecture", "interior")), + ::anno::thumbnail("./.thumbs/Wood_Tiles_Fineline_Multicolor.Wood_Tiles_Fineline_Multicolor.png"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::hidden() +]] + = + let { +/* + texture_2d tex_srgb_wood_color = texture_2d("./fineline_diff.jpg", ::tex::gamma_srgb); // Diffuse + texture_2d tex_lin_wood_rough_detail = texture_2d("./fineline_rough_detail.jpg", ::tex::gamma_linear); // Anisotropic Roughness AKA "Rough Detail" + texture_2d tex_lin_wood_rough_grain = texture_2d("./fineline_rough_grain.jpg", ::tex::gamma_linear); // Isotropic Roughness AKA "Rough Grain" + texture_2d tex_lin_wood_detail_norm = texture_2d("./fineline_norm.jpg", ::tex::gamma_linear); // Wood detail Normal - Grain & Structure + 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 + 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 + texture_2d tex_lin_tiles_normal = texture_2d("./brickbond_norm.png", ::tex::gamma_linear); // Tiles Normal (Grout and Bend) + 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 + texture_2d tex_lin_tiles_orange_peel = texture_2d("./tiles_wood_orangepeel_norm.jpg", ::tex::gamma_linear); // Tiles orange Peel +*/ +/* + // Wood Highlight tweaks + bool preview_wood_highlights = false; // just previews the highlights of the wood material + float wood_specular_level = 1.f; // Adjusts the specular level (PBR Style) + float isotropic_specular_brightness = 1.0f; // Sets how strong the isotropic specular highlight appears + 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" + float anisotropic_isotropic_balance = 0.467f; // Balances the Anisotropic vs. the isotropic wood highlight" + 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") + 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."), + + float aniso_bsdf_width = 0.36f; //Controls the width of the anisotropic highlight" + float aniso_bsdf_height = 0.50f; //Controls the height of the anisotropic highlight"), +*/ + float wood_scale_variation = 0.1f; + + // Prepare the UV coordinates for regular texture lookups + vm_coordinates base_uv = vm_coord( + translation:texture_translate, + rotation: texture_rotate, + scaling: texture_scale, + uv_space: uv_space_index + ); + + // Random tile transform + // R: tile_id + // G: tile_offset + // B: tile_rotation + // A: secondary color blend weight + + ::base::texture_return rand_id_offset_lookup = vm_tex_lookup( + tex: tex_lin_tiles_id_offset_rotation, + uv: base_uv, + mono_source: mono_a + ); + + 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) ; + + + + float4 rand_vals = rand_tile_id( + uv: base_uv, + id_offset_map: rand_id_offset_lookup, + seed: seed + ); + + float2 rand_translation = float2(rand_vals.x, rand_vals.y); + float rand_rotation = texture_rotate + (float3(rand_id_offset_lookup.tint).z + (rand_vals.z - 0.5) * wood_random_rotation) * 360; + float2 rand_scale = float2(wood_scale/(1.0 - wood_scale_variation * 0.5 * rand_vals.x)) * texture_scale; + +// *** TILE UV *** - The randomized UV lookup for the tiles + + + vm_coordinates tile_uv = vm_coord( + translation:rand_translation, + rotation: rand_rotation, + scaling: rand_scale, + uv_space: uv_space_index + ); + + + // Tiling Lookups and compositing + // R: Edgewear + // G: Gaps + // B: Gaps Damage Roughness + float3 egdewear_gaps_gapsrough_lookup = float3( vm_tex_lookup( + tex: tex_lin_tiles_edgewear_gaps_gapsrough, + uv: base_uv, + mono_source: mono_a + ).tint); + + // R: Coat Base Roughness (Footsteps, Grain, Wipe) + // G: Dents (Dirt/Ao) + // B: Spots (Liquid-alike) + float3 rough_dents_spots_lookup = float3( vm_tex_lookup( + tex: tex_lin_tiles_rough_dents_spots, + uv: base_uv, + mono_source: mono_a + ).tint); + + float dirt_and_spots_amount_remap = dirt_and_spots_amount * 0.5; + + float coat_roughness = egdewear_gaps_gapsrough_lookup.x * edgewear_roughness_amount + // edgewear + egdewear_gaps_gapsrough_lookup.z * dirt_and_spots_amount_remap + // Gaps Damage + histogram_range(rough_dents_spots_lookup.x, base_roughness_range, tiles_base_roughness) + // base roughness + rough_dents_spots_lookup.z * dirt_and_spots_amount + // Spots (rough) + (1.0 - rough_dents_spots_lookup.y) * dirt_and_spots_amount; // Dents + + float coat_roughness_squared = coat_roughness*coat_roughness; // roughness squared + + bsdf coating_bsdf = ::df::microfacet_ggx_smith_bsdf( + roughness_u: coat_roughness_squared, + roughness_v: coat_roughness_squared, + tint: color(1.0f), + mode: ::df::scatter_reflect + ); + +// ******** NORMALS ******** + + // Tiles normal + + + float3 tiles_normal = vm_tex_normal_lookup( + tex: tex_lin_tiles_normal, + strength: tiles_bump_strength, + uv: base_uv + ); + + float3 wood_detail_normal = vm_tex_normal_lookup( + tex: tex_lin_wood_detail_norm, + strength: wood_bump_strength, + uv: tile_uv + ); + + float3 orange_peel_normal = vm_tex_normal_lookup( + tex: tex_lin_tiles_orange_peel, + strength: tiles_orange_peel_bump_factor * 0.1f, + uv: base_uv + ); + + // Randomized Tiles normals - This needs to be probably rotated with the normal of the uv-tiles + float slope_amount = 0.07 * tiles_random_slope_orientation; + float3 slope = ::math::normalize( + ::state::texture_tangent_u(uv_space_index) * (rand_vals.y - 0.5) * slope_amount + + ::state::texture_tangent_v(uv_space_index) * (rand_vals.z - 0.5) * slope_amount + + ::state::normal() * ((1.0f - slope_amount) + 1.0f) + ); + + float3 tiles_slope_normal = add_detail_normal( + n: slope, + nd: tiles_normal + ); + + float3 tiles_slope_detail_normal = add_detail_normal( + n: tiles_slope_normal, + nd: wood_detail_normal + ); + + float3 normal_final = add_detail_normal( + n: tiles_slope_detail_normal, + nd: orange_peel_normal + ); + +// ******** Anisotropic Highlight ******** + // Lookup for anisotropic brightness variation + vm_coordinates aniso_brightnessvar_lookup_uv = vm_coord_post_scale( + uv: base_uv, + scale: texture_scale * 0.6 + ); + + ::base::texture_return aniso_brightnessvar_lookup = vm_tex_lookup( + tex: tex_lin_wood_rough_detail, + uv: aniso_brightnessvar_lookup_uv, + mono_source: mono_average + ); + + float aniso_brightnessvar = histogram_scan_big( + input: aniso_brightnessvar_lookup.mono, + width: 0.911, + position: aniso_attenuation + ); + + ::base::texture_return aniso_mod_lookup = vm_tex_lookup( + tex: tex_lin_wood_rough_detail, + uv: tile_uv, + mono_source: mono_average + ); + + float aniso_detail_u = histogram_range(aniso_mod_lookup.mono, 1.0, aniso_bsdf_width); + float aniso_detail_v = histogram_range(aniso_mod_lookup.mono, 1.0, aniso_bsdf_height); + + bsdf wood_highlight_aniso = ::df::weighted_layer( + layer: ::df::microfacet_ggx_smith_bsdf( + roughness_u: aniso_detail_u * aniso_detail_u, + roughness_v: aniso_detail_v * aniso_detail_v, + tint: color(aniso_brightnessvar), + tangent_u: rotated_tangent(texture_rotate, uv_space_index), + mode: ::df::scatter_reflect + ), + weight: 1.0f, + normal: tiles_slope_normal + ); + +// ******** Isotropic Highlight ******** + ::base::texture_return iso_mod_lookup = vm_tex_lookup( + tex: tex_lin_wood_rough_grain, + uv: tile_uv, + mono_source: mono_average + ); + + float iso_mod = histogram_range( + input: iso_mod_lookup.mono, + range: isotropic_roughness_range, + position: isotropic_roughness + ); + + float iso_mod_squared = iso_mod * iso_mod; + + bsdf wood_highlight_isotropic = ::df::microfacet_ggx_smith_bsdf( + roughness_u: iso_mod_squared, + roughness_v: iso_mod_squared, + tint: color(isotropic_specular_brightness), + mode: ::df::scatter_reflect + ); + +// ******** Comping Anisotropic and Isotropic Highlight ******** + + bsdf wood_highlight_isotropic_bumped = ::df::weighted_layer( + layer: wood_highlight_isotropic, + base: wood_highlight_aniso, + weight: anisotropic_isotropic_balance, + normal: tiles_slope_detail_normal + ); + + +// ******** Diffuse Comping ******** + + // Linear interpolation magic to keep brightness appear the same across different values for + // 'floor_brightness' and 'wood_brightness_variation' + + float floor_brightness_fix = ::math::lerp( + ::math::lerp(0.0f, 0.3f, floor_brightness), + ::math::lerp(0.42f, 1.0f, floor_brightness), + wood_brightness_variation); + + float floor_brightness_remap = floor_brightness_fix * 0.7f + 0.3f; // remapping from 0.3 to 0.7 + + + float4 diffuse_attenuation = float4(::math::lerp( + a: gaps_brightness, + b: floor_brightness_remap, + l: egdewear_gaps_gapsrough_lookup.y)); + + + ::base::texture_return diffuse_lookup = vm_tex_lookup( + tex: tex_srgb_wood_color, + uv: tile_uv, + mono_source: mono_a, + scale: diffuse_attenuation + ); + + // Randomly varies brightness from 0.73 - 1.0 which is a simplification from the two nested lerp calls used in a previous version + 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; + // float rand_tile_brightness = R_2nd_col_G_randmask.x; + + // adding the darkening of the dents texture channel + float rand_tile_brightness_dents = rand_tile_brightness * ::math::lerp(1.0f, rough_dents_spots_lookup.y, age_dirt); + + + ::base::texture_return tiles_rand_brightness = ::nvidia::core_definitions::blend_colors( + color_1: diffuse_lookup.tint, + color_2: color(::math::pow( a: rand_tile_brightness_dents, b: 2.2)), // do gamma compensation + mode: ::base::color_layer_multiply, + weight: 1.0f + ); + + // blend wood color and wood secondary color based on maps + ::base::texture_return wood_2_colored = ::nvidia::core_definitions::blend_colors( + color_1: wood_color, + color_2: wood_secondary_color, + mode: ::base::color_layer_blend, + weight: R_2nd_col_G_randmask.x + ); + + ::base::texture_return tiles_rand_brightness_tint = ::nvidia::core_definitions::blend_colors( + color_1: tiles_rand_brightness.tint, + color_2: wood_2_colored.tint, + mode: ::base::color_layer_overlay, + weight: .95f + ); + + bsdf diffuse = ::df::weighted_layer( + layer: ::df::diffuse_reflection_bsdf( + tint: tiles_rand_brightness_tint.tint + ), + normal: tiles_slope_detail_normal, + weight: 1.0 + ); + +// Diffuse + Highlights BSDF + + bsdf diffuse_and_highlights_bsdf = ::df::custom_curve_layer( + normal_reflectivity: wood_specular_level * 0.08, + grazing_reflectivity: 1.0f, + weight: aniso_brightnessvar , + layer: wood_highlight_isotropic_bumped, + base: diffuse + ); + +// DEBUG + bsdf debug_diffuse_and_highlights_bsdf = ::df::custom_curve_layer( + normal_reflectivity: wood_specular_level * 0.08, + grazing_reflectivity: 1.0f, + weight: aniso_brightnessvar , + layer: wood_highlight_isotropic_bumped + ); + +// Coating Layer + // separate controls for the reflectivity of the gaps and the general reflectivity of the coat + // Note that "gaps_brightness" also controls the diffuse texture (saving an additional parameter here) + float coating_weight = ::math::lerp( + a: gaps_brightness, + b: coating_reflectivity, + l: egdewear_gaps_gapsrough_lookup.y + ); + + // apply the coating layer + bsdf coated_wood_tiles_bsdf = ::df::custom_curve_layer( + normal_reflectivity: 0.03, //may as well be made adjustable (0.08 * specular_level) + grazing_reflectivity: 1.0f, + layer: coating_bsdf, + weight: coating_weight, + base: diffuse_and_highlights_bsdf, + normal: normal_final + ); + + +// ******** Round Corners ******** + float3 round_normal = round_corners ? + ::state::rounded_corner_normal( + radius: roundcorner_radius_mm * 0.001, // is in mm + across_materials: across_materials + ) : ::state::normal(); + +} in material( + surface: material_surface( + scattering: preview_wood_highlights ? debug_diffuse_and_highlights_bsdf : coated_wood_tiles_bsdf + ), + geometry: material_geometry( + normal: round_normal + ) +); + + +// ****************************************************************************************************** +// 01 + +export material Wood_Tiles_Fineline_Melbury( + int seed = 0 [[ + ::anno::display_name("Randomization Seed"), + ::anno::description("Different seed values while causes different patterns of randomization on the tiles."), + ::anno::in_group("Randomization") + ]], + color wood_color = color(0.5319f, 0.36021f, 0.55172f) [[ + ::anno::display_name("Color Tint"), + ::anno::description("Applies an overlay color to tint the wood. A grayscale value of 0.5 has no effect, " + "brighter values brighten it while darker colors will have a darkening effect."), + ::anno::in_group("Appearance") + ]], + color wood_secondary_color = color(0.7586f, 0.0f, 1.0f) [[ + ::anno::display_name("Secondary Color Tint"), + ::anno::description("Choose the secondary overlay color to tint the wood. A grayscale value of 0.5 has no effect, " + "brighter values brighten it while darker colors will have a darkening effect."), + ::anno::in_group("Appearance") + ]], + uniform float wood_bump_strength = 0.5f // Determines the degree of bumpiness"), + [[ + ::anno::display_name("Wood Bump Strength"), + ::anno::description("Adjusts the strength of the wood bump map."), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 2.f) + ]], + float floor_brightness = 1.0f [[ + ::anno::display_name("Wood Brightness"), + ::anno::description("Adjusts the general brightness of the wood."), + ::anno::in_group("Appearance", "Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float wood_brightness_variation = 0.25f [[ + ::anno::display_name("Wood Brightness Variation"), + ::anno::description("Adds a random brightness variation to the wooden tiles."), + ::anno::in_group("Appearance", "Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float2 wood_scale = 1.5f [[ + ::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."), + ::anno::display_name("Wood Scale"), + ::anno::in_group("Appearance", "Tiles"), + ::anno::soft_range(0.0f, 2.0f) + ]], + uniform float tiles_bump_strength = 0.4f [[ + ::anno::description("Determines the degree of bumpiness of the tiles texture (grooves and bent tiles)."), + ::anno::display_name("Tiles Bump Strength"), + ::anno::in_group("Appearance", "Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float tiles_random_slope_orientation = 0.05f [[ + ::anno::display_name("Tiles Random Slope Orientation"), + ::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."), + ::anno::in_group("Appearance", "Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float gaps_brightness = 0.3f [[ + ::anno::display_name("Grout Brightness"), + ::anno::description("Adjusts the brightness and roughness of the gaps between the tiles."), + ::anno::in_group("Appearance", "Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + + + float tiles_base_roughness = 0.15f [[ + ::anno::description("Adjusts the roughness of the coating. Higher value leading to blurrier and softer reflections."), + ::anno::display_name("Coating Roughness"), + ::anno::in_group("Appearance", "Tiles", "Coating"), + ::anno::enable_if("coating_reflectivity > 0.0f"), + ::anno::hard_range(0.f, 1.f) + ]], + float base_roughness_range = 0.6f [[ + ::anno::description("Applies roughness variation to the coating, introducing signs of wear such as footprints and smudges."), + ::anno::display_name("Coating Roughness Variation"), + ::anno::in_group("Appearance", "Tiles", "Coating"), + ::anno::enable_if("coating_reflectivity > 0.0f"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float tiles_orange_peel_bump_factor = 0.0f [[ + ::anno::display_name("Coating Unevenness"), + ::anno::description("Applies an unevenness to the clear coat layer akin to orange peel."), + ::anno::in_group("Appearance", "Tiles", "Coating"), + ::anno::enable_if("coating_reflectivity > 0.0f"), + ::anno::hard_range(0.f, 1.f) + ]], + float coating_reflectivity = 1.f [[ + ::anno::display_name("Coating Reflectivity"), + ::anno::description("The overall reflectivity of the clearcoat layer. Note that other parameters will show no effect when the clearcoat reflectivity is 0."), + ::anno::in_group("Appearance", "Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_and_spots_amount = 0.0f [[ + ::anno::description("Adds random dirt and spots on top of the surface which adds variation to the clearcoat roughness."), + ::anno::display_name("Dirt and Spots"), + ::anno::in_group("Appearance", "Tiles", "Coating"), + ::anno::enable_if("coating_reflectivity > 0.0f"), + ::anno::hard_range(0.f, 1.f) + ]], + float edgewear_roughness_amount = 0.0f [[ + ::anno::description("Adds edgewear around the tile borders which results in a more worn and rough look of the clearcoat."), + ::anno::display_name("Edgewear Roughness Amount"), + ::anno::in_group("Appearance", "Tiles", "Coating"), + ::anno::enable_if("coating_reflectivity > 0.0f"), + ::anno::hard_range(0.f, 1.f) + ]], + + //----------------------------------------------- + + float2 texture_translate = 0.f [[ + ::anno::display_name("Texture Translate"), + ::anno::description("Controls the position of the texture."), + ::anno::in_group("Transform") + ]], + float texture_rotate = 0.f [[ + ::anno::display_name("Texture Rotate"), + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::in_group("Transform") + ]], + float2 texture_scale = 1.0f [[ + ::anno::display_name("Texture Scale"), + ::anno::description("Larger numbers increase the size."), + ::nvidia::core_definitions::dimension(float2(.5f, .5f)), + ::anno::in_group("Transform") + ]], + uniform int uv_space_index = 0 [[ + ::anno::display_name("UV Space Index"), + ::anno::description("Uses selected UV space for material."), + ::anno::in_group("Transform") + ]], + uniform bool round_corners = false [[ + ::anno::display_name("Round Corners"), + ::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."), + ::anno::in_group("Round Corners") + ]], + uniform float roundcorner_radius_mm = 1.5f [[ + ::anno::display_name("Radius (mm)"), + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f) + ]], + uniform bool across_materials = false [[ + ::anno::display_name("Across Materials"), + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::in_group("Round Corners") + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Wood Tiles Fineline - Multi Color Melbury"), + ::anno::description(DESCRIPTION), + // reflective, varnished, bumped, matte, natural, stained, exterior, new, aged, decayed, abstract, modern, classic + ::anno::key_words(string[]("wood", "fineline", "tiles", "tiled", "pattern", "decorative", "multimaterial", "multicolor", "organic", "natural", "coated", "infinite tiling", "melbury", "architecture", "interior")), + ::anno::thumbnail("./.thumbs/Wood_Tiles_Fineline_Multicolor.Wood_Tiles_Fineline_Melbury.png"), + ::anno::copyright_notice(COPYRIGHT) +]] += Wood_Tiles_Fineline_Multicolor( + seed: seed, + wood_color: wood_color, + wood_secondary_color: wood_secondary_color, + wood_bump_strength: wood_bump_strength, + floor_brightness: floor_brightness, + wood_brightness_variation: wood_brightness_variation, + wood_random_rotation: 0.006f, + wood_scale: wood_scale, + + tiles_bump_strength: tiles_bump_strength, + tiles_random_slope_orientation: tiles_random_slope_orientation, + gaps_brightness: gaps_brightness, + tiles_orange_peel_bump_factor: tiles_orange_peel_bump_factor, + coating_reflectivity: coating_reflectivity, + tiles_base_roughness: tiles_base_roughness, + base_roughness_range: base_roughness_range, + dirt_and_spots_amount: dirt_and_spots_amount, + edgewear_roughness_amount: edgewear_roughness_amount, + + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + + round_corners: round_corners, + roundcorner_radius_mm: roundcorner_radius_mm, + across_materials: across_materials, + + preview_wood_highlights: false, + isotropic_roughness: 0.5f, + isotropic_roughness_range: 0.844f, + isotropic_specular_brightness: 1.0f, + wood_specular_level: 0.787f, + aniso_attenuation: 0.484f, + aniso_bsdf_width: 0.533f, + aniso_bsdf_height: 0.656f, + anisotropic_isotropic_balance: 0.361f, + + tex_srgb_wood_color: texture_2d("./fineline_diff.jpg", ::tex::gamma_srgb), + tex_lin_wood_rough_detail: texture_2d("./fineline_rough_detail.jpg", ::tex::gamma_linear), + tex_lin_wood_rough_grain: texture_2d("./fineline_rough_grain.jpg", ::tex::gamma_linear), + tex_lin_wood_detail_norm: texture_2d("./fineline_norm.jpg", ::tex::gamma_linear), + tex_lin_tiles_id_offset_rotation: texture_2d("./melbury_R_id_G_offset_B_rotation.png", ::tex::gamma_linear), + tex_lin_tiles_edgewear_gaps_gapsrough: texture_2d("./melbury_R_edgewear_G_gaps_B_gaps_rough.jpg", ::tex::gamma_linear), + tex_lin_tiles_normal: texture_2d("./melbury_norm.jpg", ::tex::gamma_linear), + tex_lin_tiles_R_2nd_col_G_randmask: texture_2d("./melbury_R_2ndcol_G_randmask.png", ::tex::gamma_linear), + tex_lin_tiles_rough_dents_spots: texture_2d("./tiles_wood_R_rough_G_dents_B_spots.jpg", ::tex::gamma_linear), + tex_lin_tiles_orange_peel: texture_2d("./tiles_wood_orangepeel_norm.jpg", ::tex::gamma_linear) +); + + + +// 02 + +export material Wood_Tiles_Fineline_Large_Star( + int seed = 0 [[ + ::anno::display_name("Randomization Seed"), + ::anno::description("Different seed values while causes different patterns of randomization on the tiles."), + ::anno::in_group("Randomization") + ]], + color wood_color = color(0.5319f, 0.36021f, 0.55172f) [[ + ::anno::display_name("Color Tint"), + ::anno::description("Applies an overlay color to tint the wood. A grayscale value of 0.5 has no effect, " + "brighter values brighten it while darker colors will have a darkening effect."), + ::anno::in_group("Appearance") + ]], + color wood_secondary_color = color(0.7586f, 0.0f, 1.0f) [[ + ::anno::display_name("Secondary Color Tint"), + ::anno::description("Choose the secondary overlay color to tint the wood. A grayscale value of 0.5 has no effect, " + "brighter values brighten it while darker colors will have a darkening effect."), + ::anno::in_group("Appearance") + ]], + uniform float wood_bump_strength = 0.8f // Determines the degree of bumpiness"), + [[ + ::anno::display_name("Wood Bump Strength"), + ::anno::description("Adjusts the strength of the wood bump map."), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 2.f) + ]], + float floor_brightness = 1.0f [[ + ::anno::display_name("Wood Brightness"), + ::anno::description("Adjusts the general brightness of the wood."), + ::anno::in_group("Appearance", "Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float wood_brightness_variation = .2f [[ + ::anno::display_name("Wood Brightness Variation"), + ::anno::description("Adds a random brightness variation to the wooden tiles."), + ::anno::in_group("Appearance", "Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float2 wood_scale = 1.5f [[ + ::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."), + ::anno::display_name("Wood Scale"), + ::anno::in_group("Appearance", "Tiles"), + ::anno::soft_range(0.0f, 2.0f) + ]], + uniform float tiles_bump_strength = 1.0f [[ + ::anno::description("Determines the degree of bumpiness of the tiles texture (grooves and bent tiles)."), + ::anno::display_name("Tiles Bump Strength"), + ::anno::in_group("Appearance", "Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float tiles_random_slope_orientation = 0.4f [[ + ::anno::display_name("Tiles Random Slope Orientation"), + ::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."), + ::anno::in_group("Appearance", "Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float gaps_brightness = 0.0f [[ + ::anno::display_name("Grout Brightness"), + ::anno::description("Adjusts the brightness and roughness of the gaps between the tiles."), + ::anno::in_group("Appearance", "Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float tiles_base_roughness = 0.14f [[ + ::anno::description("Adjusts the roughness of the coating. Higher value leading to blurrier and softer reflections."), + ::anno::display_name("Coating Roughness"), + ::anno::in_group("Appearance", "Tiles", "Coating"), + ::anno::enable_if("coating_reflectivity > 0.0f"), + ::anno::hard_range(0.f, 1.f) + ]], + float base_roughness_range = 1.0f [[ + ::anno::description("Applies roughness variation to the coating, introducing signs of wear such as footprints and smudges."), + ::anno::display_name("Coating Roughness Variation"), + ::anno::in_group("Appearance", "Tiles", "Coating"), + ::anno::enable_if("coating_reflectivity > 0.0f"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float tiles_orange_peel_bump_factor = 0.3f [[ + ::anno::display_name("Coating Unevenness"), + ::anno::description("Applies an unevenness to the clear coat layer akin to orange peel."), + ::anno::in_group("Appearance", "Tiles", "Coating"), + ::anno::enable_if("coating_reflectivity > 0.0f"), + ::anno::hard_range(0.f, 1.f) + ]], + float coating_reflectivity = 1.f [[ + ::anno::display_name("Coating Reflectivity"), + ::anno::description("The overall reflectivity of the clearcoat layer. Note that other parameters will show no effect when the clearcoat reflectivity is 0."), + ::anno::in_group("Appearance", "Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_and_spots_amount = 0.6f [[ + ::anno::description("Adds random dirt and spots on top of the surface which adds variation to the clearcoat roughness."), + ::anno::display_name("Dirt and Spots"), + ::anno::in_group("Appearance", "Tiles", "Coating"), + ::anno::enable_if("coating_reflectivity > 0.0f"), + ::anno::hard_range(0.f, 1.f) + ]], + float edgewear_roughness_amount = 0.4f [[ + ::anno::description("Adds edgewear around the tile borders which results in a more worn and rough look of the clearcoat."), + ::anno::display_name("Edgewear Roughness Amount"), + ::anno::in_group("Appearance", "Tiles", "Coating"), + ::anno::enable_if("coating_reflectivity > 0.0f"), + ::anno::hard_range(0.f, 1.f) + ]], + + //----------------------------------------------- + + float2 texture_translate = 0.f [[ + ::anno::display_name("Texture Translate"), + ::anno::description("Controls the position of the texture."), + ::anno::in_group("Transform") + ]], + float texture_rotate = 0.f [[ + ::anno::display_name("Texture Rotate"), + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::in_group("Transform") + ]], + float2 texture_scale = 1.0f [[ + ::anno::display_name("Texture Scale"), + ::anno::description("Larger numbers increase the size."), + ::nvidia::core_definitions::dimension(float2(0.3333f, 0.3333f)), + ::anno::in_group("Transform") + ]], + uniform int uv_space_index = 0 [[ + ::anno::display_name("UV Space Index"), + ::anno::description("Uses selected UV space for material."), + ::anno::in_group("Transform") + ]], + uniform bool round_corners = false [[ + ::anno::display_name("Round Corners"), + ::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."), + ::anno::in_group("Round Corners") + ]], + uniform float roundcorner_radius_mm = 1.5f [[ + ::anno::display_name("Radius (mm)"), + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f) + ]], + uniform bool across_materials = false [[ + ::anno::display_name("Across Materials"), + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::in_group("Round Corners") + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Wood Tiles Fineline - Multicolor Large Star"), + ::anno::description(DESCRIPTION), + // reflective, varnished, bumped, matte, natural, stained, exterior, new, aged, decayed, abstract, modern, classic + ::anno::key_words(string[]("wood", "fineline", "tiles", "tiled", "pattern", "decorative", "multimaterial", "multicolor", "organic", "natural", "coated", "infinite tiling", "star", "architecture", "interior")), + ::anno::thumbnail("./.thumbs/Wood_Tiles_Fineline_Multicolor.Wood_Tiles_Fineline_Large_Star.png"), + ::anno::copyright_notice(COPYRIGHT) + //::anno::hidden() +]] += Wood_Tiles_Fineline_Multicolor( + seed: seed, + wood_color: wood_color, + wood_secondary_color: wood_secondary_color, + wood_bump_strength: wood_bump_strength, + floor_brightness: floor_brightness, + wood_brightness_variation: wood_brightness_variation, + wood_random_rotation: 0.005f, + wood_scale: wood_scale, + + tiles_bump_strength: tiles_bump_strength, + tiles_random_slope_orientation: tiles_random_slope_orientation, + gaps_brightness: gaps_brightness, + tiles_orange_peel_bump_factor: tiles_orange_peel_bump_factor, + coating_reflectivity: coating_reflectivity, + tiles_base_roughness: tiles_base_roughness, + base_roughness_range: base_roughness_range, + dirt_and_spots_amount: dirt_and_spots_amount, + edgewear_roughness_amount: edgewear_roughness_amount, + + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + + round_corners: round_corners, + roundcorner_radius_mm: roundcorner_radius_mm, + across_materials: across_materials, + + preview_wood_highlights: false, + isotropic_roughness: 0.5f, + isotropic_roughness_range: 0.844f, + isotropic_specular_brightness: 1.0f, + wood_specular_level: 0.787f, + aniso_attenuation: 0.484f, + aniso_bsdf_width: 0.533f, + aniso_bsdf_height: 0.656f, + anisotropic_isotropic_balance: 0.361f, + + tex_srgb_wood_color: texture_2d("./fineline_diff.jpg", ::tex::gamma_srgb), + tex_lin_wood_rough_detail: texture_2d("./fineline_rough_detail.jpg", ::tex::gamma_linear), + tex_lin_wood_rough_grain: texture_2d("./fineline_rough_grain.jpg", ::tex::gamma_linear), + tex_lin_wood_detail_norm: texture_2d("./fineline_norm.jpg", ::tex::gamma_linear), + tex_lin_tiles_id_offset_rotation: texture_2d("./star_large_R_id_G_offset_B_rotation.png", ::tex::gamma_linear), + tex_lin_tiles_edgewear_gaps_gapsrough: texture_2d("./star_large_R_edgewear_G_gaps_B_gaps_rough.jpg", ::tex::gamma_linear), + tex_lin_tiles_normal: texture_2d("./star_large_norm.jpg", ::tex::gamma_linear), + tex_lin_tiles_R_2nd_col_G_randmask: texture_2d("./star_large_R_2ndcol_G_randmask.png", ::tex::gamma_linear), + tex_lin_tiles_rough_dents_spots: texture_2d("./tiles_wood_R_rough_G_dents_B_spots.jpg", ::tex::gamma_linear), + tex_lin_tiles_orange_peel: texture_2d("./tiles_wood_orangepeel_norm.jpg", ::tex::gamma_linear) +); + + + +// 03 + +export material Wood_Tiles_Fineline_Stars( + int seed = 0 [[ + ::anno::display_name("Randomization Seed"), + ::anno::description("Different seed values while causes different patterns of randomization on the tiles."), + ::anno::in_group("Randomization") + ]], + color wood_color = color(0.5319f, 0.36021f, 0.55172f) [[ + ::anno::display_name("Color Tint"), + ::anno::description("Applies an overlay color to tint the wood. A grayscale value of 0.5 has no effect, " + "brighter values brighten it while darker colors will have a darkening effect."), + ::anno::in_group("Appearance") + ]], + color wood_secondary_color = color(0.7586f, 0.0f, 1.0f) [[ + ::anno::display_name("Secondary Color Tint"), + ::anno::description("Choose the secondary overlay color to tint the wood. A grayscale value of 0.5 has no effect, " + "brighter values brighten it while darker colors will have a darkening effect."), + ::anno::in_group("Appearance") + ]], + uniform float wood_bump_strength = .5f // Determines the degree of bumpiness"), + [[ + ::anno::display_name("Wood Bump Strength"), + ::anno::description("Adjusts the strength of the wood bump map."), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 2.f) + ]], + float floor_brightness = 1.0f [[ + ::anno::display_name("Wood Brightness"), + ::anno::description("Adjusts the general brightness of the wood."), + ::anno::in_group("Appearance", "Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float wood_brightness_variation = .25f [[ + ::anno::display_name("Wood Brightness Variation"), + ::anno::description("Adds a random brightness variation to the wooden tiles."), + ::anno::in_group("Appearance", "Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float2 wood_scale = 0.7f [[ + ::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."), + ::anno::display_name("Wood Scale"), + ::anno::in_group("Appearance", "Tiles"), + ::anno::soft_range(0.0f, 2.0f) + ]], + uniform float tiles_bump_strength = 1.0f [[ + ::anno::description("Determines the degree of bumpiness of the tiles texture (grooves and bent tiles)."), + ::anno::display_name("Tiles Bump Strength"), + ::anno::in_group("Appearance", "Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float tiles_random_slope_orientation = 0.4f [[ + ::anno::display_name("Tiles Random Slope Orientation"), + ::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."), + ::anno::in_group("Appearance", "Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float gaps_brightness = 0.0f [[ + ::anno::display_name("Grout Brightness"), + ::anno::description("Adjusts the brightness and roughness of the gaps between the tiles."), + ::anno::in_group("Appearance", "Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float tiles_orange_peel_bump_factor = 0.3f [[ + ::anno::display_name("Coating Unevenness"), + ::anno::description("Applies an unevenness to the clear coat layer akin to orange peel."), + ::anno::in_group("Appearance", "Tiles", "Coating"), + ::anno::enable_if("coating_reflectivity > 0.0f"), + ::anno::hard_range(0.f, 1.f) + ]], + float coating_reflectivity = 1.f [[ + ::anno::display_name("Coating Reflectivity"), + ::anno::description("The overall reflectivity of the clearcoat layer. Note that other parameters will show no effect when the clearcoat reflectivity is 0."), + ::anno::in_group("Appearance", "Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + float tiles_base_roughness = 0.16f [[ + ::anno::description("Adjusts the roughness of the coating. Higher value leading to blurrier and softer reflections."), + ::anno::display_name("Coating Roughness"), + ::anno::in_group("Appearance", "Tiles", "Coating"), + ::anno::enable_if("coating_reflectivity > 0.0f"), + ::anno::hard_range(0.f, 1.f) + ]], + float base_roughness_range = 1.0f [[ + ::anno::description("Applies roughness variation to the coating, introducing signs of wear such as footprints and smudges."), + ::anno::display_name("Coating Roughness Variation"), + ::anno::in_group("Appearance", "Tiles", "Coating"), + ::anno::enable_if("coating_reflectivity > 0.0f"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_and_spots_amount = 0.6f [[ + ::anno::description("Adds random dirt and spots on top of the surface which adds variation to the clearcoat roughness."), + ::anno::display_name("Dirt and Spots"), + ::anno::in_group("Appearance", "Tiles", "Coating"), + ::anno::enable_if("coating_reflectivity > 0.0f"), + ::anno::hard_range(0.f, 1.f) + ]], + float edgewear_roughness_amount = 0.4f [[ + ::anno::description("Adds edgewear around the tile borders which results in a more worn and rough look of the clearcoat."), + ::anno::display_name("Edgewear Roughness Amount"), + ::anno::in_group("Appearance", "Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + + //----------------------------------------------- + + float2 texture_translate = 0.f [[ + ::anno::display_name("Texture Translate"), + ::anno::description("Controls the position of the texture."), + ::anno::in_group("Transform") + ]], + float texture_rotate = 0.f [[ + ::anno::display_name("Texture Rotate"), + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::in_group("Transform") + ]], + float2 texture_scale = 1.0f [[ + ::anno::display_name("Texture Scale"), + ::anno::description("Larger numbers increase the size."), + ::nvidia::core_definitions::dimension(float2(0.5f, 0.5f)), + ::preview_scale(0.33f), + ::anno::in_group("Transform") + ]], + uniform int uv_space_index = 0 [[ + ::anno::display_name("UV Space Index"), + ::anno::description("Uses selected UV space for material."), + ::anno::in_group("Transform") + ]], + uniform bool round_corners = false [[ + ::anno::display_name("Round Corners"), + ::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."), + ::anno::in_group("Round Corners") + ]], + uniform float roundcorner_radius_mm = 1.5f [[ + ::anno::display_name("Radius (mm)"), + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f) + ]], + uniform bool across_materials = false [[ + ::anno::display_name("Across Materials"), + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::in_group("Round Corners") + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Wood Tiles Fineline - Multicolor Stars"), + ::anno::description(DESCRIPTION), + // reflective, varnished, bumped, matte, natural, stained, exterior, new, aged, decayed, abstract, modern, classic + ::anno::key_words(string[]("wood", "fineline", "tiles", "tiled", "pattern", "decorative", "multimaterial", "multicolor", "organic", "natural", "coated", "infinite tiling", "stars", "architecture", "interior")), + ::anno::thumbnail("./.thumbs/Wood_Tiles_Fineline_Multicolor.Wood_Tiles_Fineline_Stars.png"), + ::anno::copyright_notice(COPYRIGHT) + //::anno::hidden() +]] += Wood_Tiles_Fineline_Multicolor( + seed: seed, + wood_color: wood_color, + wood_secondary_color: wood_secondary_color, + wood_bump_strength: wood_bump_strength, + floor_brightness: floor_brightness, + wood_brightness_variation: wood_brightness_variation, + wood_random_rotation: 0.00f, + wood_scale: wood_scale, + + tiles_bump_strength: tiles_bump_strength, + tiles_random_slope_orientation: tiles_random_slope_orientation, + gaps_brightness: gaps_brightness, + tiles_orange_peel_bump_factor: tiles_orange_peel_bump_factor, + coating_reflectivity: coating_reflectivity, + tiles_base_roughness: tiles_base_roughness, + base_roughness_range: base_roughness_range, + dirt_and_spots_amount: dirt_and_spots_amount, + edgewear_roughness_amount: edgewear_roughness_amount, + + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + + round_corners: round_corners, + roundcorner_radius_mm: roundcorner_radius_mm, + across_materials: across_materials, + + preview_wood_highlights: false, + isotropic_roughness: 0.5f, + isotropic_roughness_range: 0.844f, + isotropic_specular_brightness: 1.0f, + wood_specular_level: 0.787f, + aniso_attenuation: 0.484f, + aniso_bsdf_width: 0.533f, + aniso_bsdf_height: 0.656f, + anisotropic_isotropic_balance: 0.361f, + + tex_srgb_wood_color: texture_2d("./fineline_diff.jpg", ::tex::gamma_srgb), + tex_lin_wood_rough_detail: texture_2d("./fineline_rough_detail.jpg", ::tex::gamma_linear), + tex_lin_wood_rough_grain: texture_2d("./fineline_rough_grain.jpg", ::tex::gamma_linear), + tex_lin_wood_detail_norm: texture_2d("./fineline_norm.jpg", ::tex::gamma_linear), + tex_lin_tiles_id_offset_rotation: texture_2d("./stars_R_id_G_offset_B_rotation.png", ::tex::gamma_linear), + tex_lin_tiles_edgewear_gaps_gapsrough: texture_2d("./stars_R_edgewear_G_gaps_B_gaps_rough.jpg", ::tex::gamma_linear), + tex_lin_tiles_normal: texture_2d("./stars_norm.jpg", ::tex::gamma_linear), + tex_lin_tiles_R_2nd_col_G_randmask: texture_2d("./stars_R_2ndcol_G_randmask.png", ::tex::gamma_linear), + tex_lin_tiles_rough_dents_spots: texture_2d("./tiles_wood_R_rough_G_dents_B_spots.jpg", ::tex::gamma_linear), + tex_lin_tiles_orange_peel: texture_2d("./tiles_wood_orangepeel_norm.jpg", ::tex::gamma_linear) +); diff --git a/Material/material_0570/Wood_Tiles_Poplar.mdl b/Material/material_0570/Wood_Tiles_Poplar.mdl new file mode 100644 index 0000000000000000000000000000000000000000..a1ae9b1de06930b75976a0495eba32a3a2865186 --- /dev/null +++ b/Material/material_0570/Wood_Tiles_Poplar.mdl @@ -0,0 +1,2876 @@ +/****************************************************************************** + * Copyright 2024 NVIDIA Corporation. All rights reserved. + ****************************************************************************** + +Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, +to any person obtaining a copy of the sample definition code that uses our +Material Definition Language (the "MDL Materials"), to reproduce and distribute +the MDL Materials, including without limitation the rights to use, copy, merge, +publish, distribute, and sell modified and unmodified copies of the MDL +Materials, and to permit persons to whom the MDL Materials is furnished to do +so, in all cases solely for use with NVIDIA's Material Definition Language, +subject to the following further conditions: + +1. The above copyright notices, this list of conditions, and the disclaimer +that follows shall be retained in all copies of one or more of the MDL +Materials, including in any software with which the MDL Materials are bundled, +redistributed, and/or sold, and included either as stand-alone text files, +human-readable headers or in the appropriate machine-readable metadata fields +within text or binary files as long as those fields can be easily viewed by the +user, as applicable. +2. The name of NVIDIA shall not be used to promote, endorse or advertise any +Modified Version without specific prior written permission, except a) to comply + with the notice requirements otherwise contained herein; or b) to acknowledge +the contribution(s) of NVIDIA. + +THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE +THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. +*/ + + +mdl 1.5; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::nvidia::core_definitions::blend_colors; +import ::nvidia::core_definitions::dimension; + + +const string COPYRIGHT = +" Copyright 2024 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + +const string DESCRIPTION = "A wooden tile material with adjustments to produce a rich variety of wooden floor styles ranging from new to worn"; + + +// ---------------------------------------------------------------------------------------------------------------------- + + +float histogram_range(float input, float range = 1.0f, float position = 0.5f) +{ + float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); + float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); + return ::math::lerp(low, high, input); +} + +float remap_xy_to_0_1(float input, float x, float y) +{ + return (input - x)/(y - x); +} + +float histogram_scan_big(float input, float width, float position) +{ + return ::math::clamp( + remap_xy_to_0_1(input, + ::math::lerp(-width, 1.0, position), + ::math::lerp(0.0, 1.0 + width, position)), + 0.0, + 1.0); +} + +// ********** Randomization functions -I- ********** + +int random(int seed = 0, int modulus = 65536, int multiplier = 1664525, int increment = 1013904223) +{ + return (multiplier * seed + increment) % modulus; +} + +// Returns the normal n in tangent space, given n is in internal space. +float3 transform_internal_to_tangent(float3 n) +[[ + ::anno::hidden() +]] +{ + return + n.x* float3(::state::texture_tangent_u(0).x,::state::texture_tangent_v(0).x,::state::normal().x)+ + n.y* float3(::state::texture_tangent_u(0).y,::state::texture_tangent_v(0).y,::state::normal().y)+ + n.z* float3(::state::texture_tangent_u(0).z,::state::texture_tangent_v(0).z,::state::normal().z); +} + +// Returns the normal n in internal space, given n is in tangent space. +float3 transform_tangent_to_internal(float3 n) +[[ + ::anno::hidden() +]] +{ + return ::state::texture_tangent_u(0) * n.x + + ::state::texture_tangent_v(0) * n.y + + ::state::normal() * n.z ; +} + + + +// Returns a normal by adding a detail normal to a global normal. +// If detail blending of two normal maps gives visual artifacts, check if texture_2d are loaded +// correctly with ::tex::gamma_linear +float3 add_detail_normal(float3 nd = ::state::normal(), float3 n = ::state::normal()) +{ + // http://blog.selfshadow.com/publications/blending-in-detail/ + float3 n_t = transform_internal_to_tangent(n); + float3 nd_t = transform_internal_to_tangent(nd); + + n_t=n_t + float3(0.,0.,1.); + nd_t = nd_t * float3(-1.,-1.,1.); + + n = n_t*::math::dot(n_t, nd_t)/n_t.z - nd_t; + return ::math::normalize(transform_tangent_to_internal(n)); +} + +::base::texture_coordinate_info transform_coordinate_2( + float4x4 transform + [[ ::anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix.") ]], + ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info() + [[ ::anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection.") ]] +) [[ + ::anno::description("Transform a texture coordinate by a matrix.") , + ::anno::noinline() + ]] +{ + // Version 2 + float4 r_position = transform * float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1); + + float4 u = transform[0]; + float3 ru = ::math::normalize(float3(u.x,u.y,u.z)); + float cos = ru.x; + float sin = -ru.y; + + return ::base::texture_coordinate_info( + float3(r_position.x,r_position.y,r_position.z), + ::math::normalize(cos * coordinate.tangent_u - sin * coordinate.tangent_v), + ::math::normalize(cos * coordinate.tangent_v + sin * coordinate.tangent_u)); +} + + +// Takes the standard input that every material has. It combines a couple of +// functions in one convenience function. +::base::texture_coordinate_info vmat_transform( + float2 translation = float2(0.0, 0.0), + float rotation = 0.0, // rotation in degrees + float2 scaling = float2(1.0, 1.0), + uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, + uniform int uv_space = 0 +) +{ + float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; + float4x4 scale = + float4x4(1.0 /scaling.x, 0. , 0. , 0., + 0. , 1.0 /scaling.y , 0. , 0., + 0. , 0. , 1.0, 0., + translation.x , translation.y , 0.0, 1.); + + float s = ::math::sin(rotation_rad); + float c = ::math::cos(rotation_rad); + float4x4 rotate = + float4x4( c , -s , 0.0 , 0.0, + s , c , 0.0 , 0.0, + 0.0, 0.0 , 1.0 , 0.0, + 0. , 0.0 , 0.0 , 1.); + + return transform_coordinate_2(scale*rotate, ::base::coordinate_source(system, uv_space)); +} + + +// Returns 4 random IDs for a given pattern +// TODO: Describe how the whole things exactly works +float4 rand_tile_id( + ::base::texture_coordinate_info uvw, + ::base::texture_return id_offset_map // map containing the ID in r channel + //and the cell offset in g channel. + ) +[[ + ::anno::noinline() +]] +{ + float4 ret_val; + int offset_x, offset_y; + + + float3 id_offset_map_2 = float3(id_offset_map.tint); + float offset_id = id_offset_map_2.y; + int rand_id = int(id_offset_map_2.x * 254.f); // the more logical value of 255 causes sometimes rendering artifacts + // with the random number generator. Setting it to 254 apparently fixes it + + // Offset of overlapping tiles stored in G-channel + // [0 - 0.25[ : ( 0/ 0) Grayscale value: 0.1 + // [0.25 - 0.5 [ : (-1/ 0) Grayscale value: 0.37 + // [0.5 - 0.75[ : (-1/-1) Grayscale value: 0.62 + // [0.75 - 1.0 [ : ( 0/-1) Grayscale value: 0.87 + + offset_x = offset_id < 0.25f ? 0 : (offset_id < .75f) ? 1 : 0; + offset_y = offset_id < 0.5 ? 0 : 1; + + int2 cell_id = int2(int(::math::floor(uvw.position.x) - offset_x), int(::math::floor(uvw.position.y) - offset_y)); + + /* // ORIGINAL + int rand_val_1 = triple32(rand_id + triple32(cell_id.x + triple32(cell_id.y))); + int rand_val_2 = triple32(rand_val_1); + int rand_val_3 = triple32(rand_val_2); + int rand_val_4 = triple32(rand_val_3); + + ret_val = float4(uint2float(rand_val_1), + uint2float(rand_val_2), + uint2float(rand_val_3), + uint2float(rand_val_4)); + + return float4(ret_val/4294967296.f); + */ + + /* Simplified Version */ + int rand_val_1 = random(rand_id + random(cell_id.x + random(cell_id.y))); + int rand_val_2 = random(rand_val_1); + int rand_val_3 = random(rand_val_2); + int rand_val_4 = random(rand_val_3); + + ret_val = float4(rand_val_1, rand_val_2, rand_val_3, rand_val_4); + + return float4(ret_val/65535.0f); +} + + +// ****************************************************************************************************** + +export material Wood_Tiles_Poplar( + color wood_color = color(0.5f) [[ + ::anno::display_name("Wood Color"), + ::anno::description("Applies an overlay color to tint the wood. The color is used using the 'overlay' mode as known " + "from paint programs. A gray value of 0.5 has no effect, brighter values brighten it while darker colors will have a darkening effect."), + ::anno::in_group("Appearance") + ]], + float age_dirt = 0.0f [[ + ::anno::display_name("Age Dirt"), + ::anno::description("Adds dark dirt spots on top of the surface to create the appearance of a somewhat aged surface."), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float wood_bump_strength = 0.04f // Determines the degree of bumpiness"), + [[ + ::anno::display_name("Wood Bump Strength"), + ::anno::description("Adjusts the strength of the wood bump map."), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 2.f) + ]], + float floor_brightness = 0.5f [[ + ::anno::description("Adjusts the general brightness of the wood."), + ::anno::display_name("Floor Brightness"), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float wood_brightness_variation = 0.5f [[ + ::anno::display_name("Wood Brightness Variation"), + ::anno::description("Randomly darkens the tiles of the floor."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float wood_random_rotation = 0.03f [[ + ::anno::display_name("Wood Random Rotation"), + ::anno::description("Adds a random rotation around the main wood tile alignment direction."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + + float2 wood_scale = 1.f [[ + ::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."), + ::anno::display_name("Wood Scale"), + ::anno::in_group("Tiles") + ]], + float wood_scale_variation = 0.f [[ + ::anno::description("Adds random variation to size of the wood in each tile."), + ::anno::display_name("Wood Scale Variation"), + ::anno::in_group("Tiles"), + ::anno::soft_range(0.f, 2.f) + ]], + + + uniform float tiles_bump_strength = 0.4f [[ + ::anno::description("Determines the degree of bumpiness of the tiles texture (grooves and bent tiles)."), + ::anno::display_name("Tiles Bump Strength"), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float tiles_random_slope_orientation = 0.05f [[ + ::anno::display_name("Tiles Random Slope Orientation"), + ::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."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float gaps_brightness = 0.3f [[ + ::anno::display_name("Gaps Brightness"), + ::anno::description("Adjusts the brightness and roughness of the gaps between the tiles."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float tiles_orange_peel_bump_factor = 0.0f [[ + ::anno::display_name("Coating Unevenness"), + ::anno::description("Applies an unevenness to the clear coat layer akin to orange peel."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float coating_reflectivity = 1.f [[ + ::anno::display_name("Coating Reflectivity"), + ::anno::description("The overall reflectivity of the clearcoat layer. Note that other parameters will show no effect when the clearcoat reflectivity is 0."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + + + float tiles_base_roughness = 0.06f [[ + ::anno::description("Adjusts the roughness of the coating. Higher value leading to blurrier and softer reflections."), + ::anno::display_name("Coating Roughness"), + ::anno::in_group("Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + float base_roughness_range = 0.33f [[ + ::anno::description("Applies roughness variation to the coating, introducing signs of wear such as footprints and smudges."), + ::anno::display_name("Coating Roughness Variation"), + ::anno::in_group("Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_and_spots_amount = 0.0f [[ + ::anno::description("Adds random dirt and spots on top of the surface which adds variation to the clearcoat roughness."), + ::anno::display_name("Dirt and Spots"), + ::anno::in_group("Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + float edgewear_roughness_amount = 0.0f [[ + ::anno::description("Adds edgewear around the tile borders which results in a more worn and rough look of the clearcoat."), + ::anno::display_name("Edgewear Roughness Amount"), + ::anno::in_group("Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + + //----------------------------------------------- + + float2 texture_translate = 0.f [[ + ::anno::display_name("Texture Translate"), + ::anno::description("Controls the position of the texture."), + ::anno::in_group("Transform") + ]], + float texture_rotate = 0.f [[ + ::anno::display_name("Texture Rotate"), + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::in_group("Transform") + ]], + float2 texture_scale = 1.0f [[ + ::anno::display_name("Texture Scale"), + ::anno::description("Larger numbers increase the size."), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::anno::in_group("Transform") + ]], + uniform int uv_space_index = 0 [[ + ::anno::display_name("UV Space Index"), + ::anno::description("Uses selected UV space for material."), + ::anno::in_group("Transform") + ]], + uniform bool round_corners = false [[ + ::anno::display_name("Round Corners"), + ::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."), + ::anno::in_group("Round Corners") + ]], + uniform float roundcorner_radius_mm = 1.5f [[ + ::anno::display_name("Radius (mm)"), + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f) + ]], + uniform bool across_materials = false [[ + ::anno::display_name("Across Materials"), + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::in_group("Round Corners") + ]], + +// WOOD Highlights (Not accessible to regular users) + uniform bool preview_wood_highlights = false + [[ + ::anno::display_name("Preview Wood Specular"), + ::anno::description("Enables previewing of the wood specular highlights for tweaking."), + ::anno::in_group("Advanced", "Wood Highlight") + ]], // just previews the highlights of the wood material + float isotropic_roughness = 0.336f // The average roughness value of the isotropic highlight. When roughness variation is applied, the variation will go above and below those values.") + [[ + ::anno::display_name("Isotropic Roughness"), + ::anno::description("Sets the roughness of the isotropic component of the wood reflection."), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Advanced", "Wood Highlight") + ]], + float isotropic_roughness_range = 0.918f // 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") + [[ + ::anno::display_name("Isotropic Roughness Range"), + ::anno::description("Sets the degree roughness variation around the isotropic highlight."), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Advanced", "Wood Highlight") + ]], + float isotropic_specular_brightness = 0.787f // Sets how strong the isotropic specular highlight appears + [[ + ::anno::display_name("Isotropic Highlight Brightness"), + ::anno::description("Sets the brightness of the isotropic wood highlight."), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Advanced", "Wood Highlight") + ]], + float wood_specular_level = 1.f // Adjusts the specular level (PBR Style) + [[ + ::anno::display_name("Wood Specular Level"), + ::anno::description("Adjusts the falloff of the wood highlights."), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Advanced", "Wood Highlight") + ]], + float aniso_attenuation = 0.484f //Attenuates the the anisotropic highlight using a texture. Use the preview for exclusively previewing the wood hightligghts for properly adjusting this term" + [[ + ::anno::display_name("Anisotropic Attenuation"), + ::anno::description("Breaks up the reflection of the anisotropic highlight."), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Advanced", "Wood Highlight") + ]], + float aniso_bsdf_width = 0.443f //Controls the width of the anisotropic highlight" + [[ + ::anno::display_name("Anisotropic Width"), + ::anno::description("Adjusts the width of the anisotropic wood highlight."), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Advanced", "Wood Highlight") + ]], + float aniso_bsdf_height = 0.631f //Controls the height of the anisotropic highlight" + [[ + ::anno::display_name("Anisotropic Height"), + ::anno::description("Adjusts the height of the anisotropic highlight."), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Advanced", "Wood Highlight") + ]], + float anisotropic_isotropic_balance = 0.434f // Balances the Anisotropic vs. the isotropic wood highlight" + [[ + ::anno::display_name("Anisotropic - Isotropic Balance"), + ::anno::description("Blends between the contribution of isotropic and anisotropic highlight."), + ::anno::hard_range(0.f, 1.f), + ::anno::in_group("Advanced", "Wood Highlight") + ]], + +// TEXTURES (Not accessible to regular users) + uniform texture_2d tex_srgb_wood_color = texture_2d("./poplar_diff.jpg", ::tex::gamma_srgb) // Diffuse + [[ + ::anno::display_name("Diffuse Wood Texture"), + ::anno::description("The diffuse wood texture used to cover the tiles (srgb)."), + ::anno::in_group("Advanced", "Textures") + ]], + uniform texture_2d tex_lin_wood_rough_detail = texture_2d("./poplar_rough_detail.jpg", ::tex::gamma_linear) // Anisotropic Roughness AKA "Rough Detail" + [[ + ::anno::display_name("Anisotropic Variation Texture"), + ::anno::description("Texture to add variation to the anisotropic reflections of the wood (linear space)."), + ::anno::in_group("Advanced", "Textures") + ]], + uniform texture_2d tex_lin_wood_rough_grain = texture_2d("./poplar_rough_grain.jpg", ::tex::gamma_linear) // Isotropic Roughness AKA "Rough Grain" + [[ + ::anno::display_name("Isotropic Variation Texture"), + ::anno::description("Texture to add variation to the isotropic reflections of the wood (linear space)."), + ::anno::in_group("Advanced", "Textures") + ]], + uniform texture_2d tex_lin_wood_detail_norm = texture_2d("./poplar_norm.jpg", ::tex::gamma_linear) // Wood detail Normal - Grain & Structure + [[ + ::anno::display_name("Wood Normal Texture"), + ::anno::description("Tangent Space Normal texture for defining the bumpiness of the wood."), + ::anno::in_group("Advanced", "Textures") + ]], + uniform 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 + [[ + ::anno::display_name("Tiles ID - Offset - Rotation Texture"), + ::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)."), + ::anno::in_group("Advanced", "Textures") + ]], + uniform 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 + [[ + ::anno::display_name("Edgewear - Gaps - Gap Rough"), + ::anno::description("Texture that holds maps for the edgewear roughness, the tile gaps and the gaps roughness (linear space)."), + ::anno::in_group("Advanced", "Textures") + ]], + uniform texture_2d tex_lin_tiles_normal = texture_2d("./brickbond_norm.png", ::tex::gamma_linear) // Tiles Normal (Grout and Bend) + [[ + ::anno::display_name("Tiles Normal Texture"), + ::anno::description("Texture that holds the normal map for the tiles (linear space)."), + ::anno::in_group("Advanced", "Textures") + ]], + uniform 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 + [[ + ::anno::display_name("Tiles Rough - Dents - Spots"), + ::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)."), + ::anno::in_group("Advanced", "Textures") + ]], + uniform texture_2d tex_lin_tiles_orange_peel = texture_2d("./tiles_wood_orangepeel_norm.jpg", ::tex::gamma_linear) // Tiles orange Peel + [[ + ::anno::display_name("Tiles Orange Peel"), + ::anno::description("Tangent Space Normal texture for the orange peel which is applied to the coating of the tiles."), + ::anno::in_group("Advanced", "Textures") + ]] + +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Wood Tiles Poplar - Brick Bond Master"), + ::anno::description(DESCRIPTION), + // reflective, varnished, bumped, matte, natural, stained, exterior, new, aged, decayed, abstract, modern, classic + ::anno::key_words(string[]("wood", "master", "poplar", "tiles", "tiled", "pattern", "decorative", "multimaterial", "organic", "natural", "coated", "infinite tiling", "brick bond", "architecture", "interior")), + ::anno::thumbnail("./.thumbs/Wood_Tiles_Poplar.Wood_Tiles_Poplar.png"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::hidden() +]] + = + let { +/* + texture_2d tex_srgb_wood_color = texture_2d("./poplar_diff.jpg", ::tex::gamma_srgb); // Diffuse + texture_2d tex_lin_wood_rough_detail = texture_2d("./poplar_rough_detail.jpg", ::tex::gamma_linear); // Anisotropic Roughness AKA "Rough Detail" + texture_2d tex_lin_wood_rough_grain = texture_2d("./poplar_rough_grain.jpg", ::tex::gamma_linear); // Isotropic Roughness AKA "Rough Grain" + texture_2d tex_lin_wood_detail_norm = texture_2d("./poplar_norm.jpg", ::tex::gamma_linear); // Wood detail Normal - Grain & Structure + 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 + 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 + texture_2d tex_lin_tiles_normal = texture_2d("./brickbond_norm.png", ::tex::gamma_linear); // Tiles Normal (Grout and Bend) + 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 + texture_2d tex_lin_tiles_orange_peel = texture_2d("./tiles_wood_orangepeel_norm.jpg", ::tex::gamma_linear); // Tiles orange Peel +*/ +/* + // Wood Highlight tweaks + bool preview_wood_highlights = false; // just previews the highlights of the wood material + float wood_specular_level = 1.f; // Adjusts the specular level (PBR Style) + float isotropic_specular_brightness = 1.0f; // Sets how strong the isotropic specular highlight appears + 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" + float anisotropic_isotropic_balance = 0.467f; // Balances the Anisotropic vs. the isotropic wood highlight" + 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") + 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."), + + float aniso_bsdf_width = 0.36f; //Controls the width of the anisotropic highlight" + float aniso_bsdf_height = 0.50f; //Controls the height of the anisotropic highlight"), +*/ + + // Prepare the UV coordinates for regular texture lookups + ::base::texture_coordinate_info base_uvw = vmat_transform( + translation:texture_translate, + rotation: texture_rotate, + scaling: texture_scale, + system: ::base::texture_coordinate_uvw, + uv_space: uv_space_index + ); + + + // Random tile transform + // R: tile_id + // G: tile_offset + // B: tile_rotation + + ::base::texture_return rand_id_offset_lookup = ::base::file_texture( + texture: tex_lin_tiles_id_offset_rotation, + uvw: base_uvw, + mono_source: ::base::mono_alpha + ); + + + float4 rand_vals = rand_tile_id( + uvw: base_uvw, + id_offset_map: rand_id_offset_lookup + ); + + float2 rand_translation = float2(rand_vals.x, rand_vals.y); + float rand_rotation = (float3(rand_id_offset_lookup.tint).z + (rand_vals.z - 0.5) * wood_random_rotation) * 360; + float2 rand_scale = float2(wood_scale/(1.0 - wood_scale_variation * 0.5 * rand_vals.x)) * texture_scale; + +// *** TILE UV *** - The randomized UV lookup for the tiles + ::base::texture_coordinate_info tile_uvw = vmat_transform( + translation:rand_translation, + rotation: rand_rotation, + scaling: rand_scale, + system: ::base::texture_coordinate_uvw, + uv_space: uv_space_index + ); + + + // Tiling Lookups and compositing + // R: Edgewear + // G: Gaps + // B: Gaps Damage Roughness + float3 egdewear_gaps_gapsrough_lookup = float3( ::base::file_texture( + texture: tex_lin_tiles_edgewear_gaps_gapsrough, + uvw: base_uvw, + mono_source: ::base::mono_alpha + ).tint); + + // R: Coat Base Roughness (Footsteps, Grain, Wipe) + // G: Dents (Dirt/Ao) + // B: Spots (Liquid-alike) + float3 rough_dents_spots_lookup = float3( ::base::file_texture( + texture: tex_lin_tiles_rough_dents_spots, + uvw: base_uvw, + mono_source: ::base::mono_alpha + ).tint); + + float dirt_and_spots_amount_remap = dirt_and_spots_amount * 0.5; + + float coat_roughness = egdewear_gaps_gapsrough_lookup.x * edgewear_roughness_amount + // edgewear + egdewear_gaps_gapsrough_lookup.z * dirt_and_spots_amount_remap + // Gaps Damage + histogram_range(rough_dents_spots_lookup.x, base_roughness_range, tiles_base_roughness) + // base roughness + rough_dents_spots_lookup.z * dirt_and_spots_amount + // Spots (rough) + (1.0 - rough_dents_spots_lookup.y) * dirt_and_spots_amount; // Dents + + float coat_roughness_squared = coat_roughness*coat_roughness; // roughness squared + + bsdf coating_bsdf = ::df::microfacet_ggx_smith_bsdf( + roughness_u: coat_roughness_squared, + roughness_v: coat_roughness_squared, + tint: color(1.0f), + mode: ::df::scatter_reflect + ); + +// ******** NORMALS ******** + + // Tiles normal + float3 tiles_normal = ::base::tangent_space_normal_texture( + texture: tex_lin_tiles_normal, + factor: tiles_bump_strength, + uvw: base_uvw + ); + + float3 wood_detail_normal = ::base::tangent_space_normal_texture( + texture: tex_lin_wood_detail_norm, + factor: wood_bump_strength, + uvw: tile_uvw + ); + + float3 orange_peel_normal = ::base::tangent_space_normal_texture( + texture: tex_lin_tiles_orange_peel, + factor: tiles_orange_peel_bump_factor * 0.1f, + uvw: base_uvw + ); + + // Randomized Tiles normals - This needs to be probably rotated with the normal of the uv-tiles + float slope_amount = 0.07 * tiles_random_slope_orientation; + float3 slope = ::math::normalize( + ::state::texture_tangent_u(uv_space_index) * (rand_vals.y - 0.5) * slope_amount + + ::state::texture_tangent_v(uv_space_index) * (rand_vals.z - 0.5) * slope_amount + + ::state::normal() * ((1.0f - slope_amount) + 1.0f) + ); + + float3 tiles_slope_normal = add_detail_normal( + n: slope, + nd: tiles_normal + ); + + float3 tiles_slope_detail_normal = add_detail_normal( + n: tiles_slope_normal, + nd: wood_detail_normal + ); + + float3 normal_final = add_detail_normal( + n: tiles_slope_detail_normal, + nd: orange_peel_normal + ); + +// ******** Anisotropic Highlight ******** + // Lookup for anisotropic brightness variation + ::base::texture_coordinate_info aniso_brightnessvar_lookup_uvw = vmat_transform( + translation: texture_translate, + rotation: texture_rotate, + scaling: texture_scale * 0.6, + system: ::base::texture_coordinate_uvw + ); + + ::base::texture_return aniso_brightnessvar_lookup = ::base::file_texture( + texture: tex_lin_wood_rough_detail, + uvw: aniso_brightnessvar_lookup_uvw, + mono_source: ::base::mono_average + ); + + float aniso_brightnessvar = histogram_scan_big( + input: aniso_brightnessvar_lookup.mono, + width: 0.911, + position: aniso_attenuation + ); + + ::base::texture_return aniso_mod_lookup = ::base::file_texture( + texture: tex_lin_wood_rough_detail, + uvw: tile_uvw, + mono_source: ::base::mono_average + ); + + float aniso_detail_u = histogram_range(aniso_mod_lookup.mono, 1.0, aniso_bsdf_width); + float aniso_detail_v = histogram_range(aniso_mod_lookup.mono, 1.0, aniso_bsdf_height); + + bsdf wood_highlight_aniso = ::df::weighted_layer( + layer: ::df::microfacet_ggx_smith_bsdf( + roughness_u: aniso_detail_u * aniso_detail_u, + roughness_v: aniso_detail_v * aniso_detail_v, + tint: color(aniso_brightnessvar), + tangent_u: tile_uvw.tangent_u, + mode: ::df::scatter_reflect + ), + weight: 1.0f, + normal: tiles_slope_normal + ); + +// ******** Isotropic Highlight ******** + ::base::texture_return iso_mod_lookup = ::base::file_texture( + texture: tex_lin_wood_rough_grain, + uvw: tile_uvw, + mono_source: ::base::mono_average + ); + + float iso_mod = histogram_range( + input: iso_mod_lookup.mono, + range: isotropic_roughness_range, + position: isotropic_roughness + ); + + float iso_mod_squared = iso_mod * iso_mod; + + bsdf wood_highlight_isotropic = ::df::microfacet_ggx_smith_bsdf( + roughness_u: iso_mod_squared, + roughness_v: iso_mod_squared, + tint: color(isotropic_specular_brightness), + mode: ::df::scatter_reflect + ); + +// ******** Comping Anisotropic and Isotropic Highlight ******** + + bsdf wood_highlight_isotropic_bumped = ::df::weighted_layer( + layer: wood_highlight_isotropic, + base: wood_highlight_aniso, + weight: anisotropic_isotropic_balance, + normal: tiles_slope_detail_normal + ); + + +// ******** Diffuse Comping ******** + + float floor_brightness_remap = ::math::lerp( + a: 0.3f, + b: 1.0f, + l: floor_brightness); + + color diffuse_attenuation = ::math::lerp( + a: gaps_brightness, + b: floor_brightness_remap, + l: egdewear_gaps_gapsrough_lookup.y); + + ::base::texture_return diffuse_lookup = ::base::file_texture( + texture: tex_srgb_wood_color, + uvw: tile_uvw, + mono_source: ::base::mono_alpha, + color_scale: diffuse_attenuation + ); + + float rand_tile_brightness = ::math::lerp( + a: ::math::lerp(a: 1.0f, // range of maximum wood brightness variation + b: 0.73, /*max rand wood darkening */ + l: wood_brightness_variation), + b: 1.0f, + l: rand_vals.z // random value + ); + + // adding the darkening of the dents texture channel + float rand_tile_brightness_dents = rand_tile_brightness * ::math::lerp(1.0f, rough_dents_spots_lookup.y, age_dirt); + + + ::base::texture_return tiles_rand_brightness = ::nvidia::core_definitions::blend_colors( + color_1: diffuse_lookup.tint, + color_2: color(::math::pow( a: rand_tile_brightness_dents, b: 2.2)), // do gamma compensation + mode: ::base::color_layer_multiply, + weight: 1.0f + ); + + ::base::texture_return tiles_rand_brightness_tint = ::nvidia::core_definitions::blend_colors( + color_1: tiles_rand_brightness.tint, + color_2: wood_color, + mode: ::base::color_layer_overlay, + weight: .95f + ); + + bsdf diffuse = ::df::weighted_layer( + layer: ::df::diffuse_reflection_bsdf( + tint: tiles_rand_brightness_tint.tint + ), + normal: tiles_slope_detail_normal, + weight: 1.0 + ); + +// Diffuse + Highlights BSDF + + bsdf diffuse_and_highlights_bsdf = ::df::custom_curve_layer( + normal_reflectivity: wood_specular_level * 0.08, + grazing_reflectivity: 1.0f, + weight: aniso_brightnessvar , + layer: wood_highlight_isotropic_bumped, + base: diffuse + ); + +// DEBUG + bsdf debug_diffuse_and_highlights_bsdf = ::df::custom_curve_layer( + normal_reflectivity: wood_specular_level * 0.08, + grazing_reflectivity: 1.0f, + weight: aniso_brightnessvar , + layer: wood_highlight_isotropic_bumped + ); + +// Coating Layer + // separate controls for the reflectivity of the gaps and the general reflectivity of the coat + // Note that "gaps_brightness" also controls the diffuse texture (saving an additional parameter here) + float coating_weight = ::math::lerp( + a: gaps_brightness, + b: coating_reflectivity, + l: egdewear_gaps_gapsrough_lookup.y + ); + + // apply the coating layer + bsdf coated_wood_tiles_bsdf = ::df::custom_curve_layer( + normal_reflectivity: 0.03, //may as well be made adjustable (0.08 * specular_level) + grazing_reflectivity: 1.0f, + layer: coating_bsdf, + weight: coating_weight, + base: diffuse_and_highlights_bsdf, + normal: normal_final + ); + + +// ******** Round Corners ******** + float3 round_normal = round_corners ? + ::state::rounded_corner_normal( + radius: roundcorner_radius_mm * 0.001, // is in mm + across_materials: across_materials + ) : ::state::normal(); + +} in material( + surface: material_surface( + scattering: preview_wood_highlights ? debug_diffuse_and_highlights_bsdf : coated_wood_tiles_bsdf + ), + geometry: material_geometry( + normal: round_normal + ) +); + + +// ****************************************************************************************************** +// 01 + +export material Wood_Tiles_Poplar_Brickbond( + color wood_color = color(0.5f) [[ + ::anno::description("Applies an overlay color to tint the wood. The color is used using the 'overlay' mode as known " + "from paint programs. A gray value of 0.5 has no effect, brighter values brighten it while darker colors will have a darkening effect."), + ::anno::display_name("Wood Color"), + ::anno::in_group("Appearance") + ]], + uniform float wood_bump_strength = 0.2f // Determines the degree of bumpiness"), + [[ + ::anno::display_name("Wood Bump Strength"), + ::anno::description("Adjusts the strength of the wood bump map."), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 2.f) + ]], + float floor_brightness = 0.5f [[ + ::anno::description("Adjusts the general brightness of the wood."), + ::anno::display_name("Floor Brightness"), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float wood_brightness_variation = 0.5f [[ + ::anno::display_name("Wood Brightness Variation"), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float wood_random_rotation = 0.03f [[ + ::anno::display_name("Wood Random Rotation"), + ::anno::description("Adds a random rotation around the main wood tile alignment direction."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + + float2 wood_scale = 1.f [[ + ::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."), + ::anno::display_name("Wood Scale"), + ::anno::in_group("Tiles") + ]], + float wood_scale_variation = 0.f [[ + ::anno::description("Adds random variation to size of the wood in each tile."), + ::anno::display_name("Wood Scale Variation"), + ::anno::in_group("Tiles"), + ::anno::soft_range(0.f, 2.f) + ]], + uniform float tiles_bump_strength = 0.4f [[ + ::anno::description("Determines the degree of bumpiness of the tiles texture (grooves and bent tiles)."), + ::anno::display_name("Tiles Bump Strength"), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float tiles_random_slope_orientation = 0.05f [[ + ::anno::display_name("Tiles Random Slope Orientation"), + ::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."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float gaps_brightness = 0.3f [[ + ::anno::display_name("Gaps Brightness"), + ::anno::description("Adjusts the brightness and roughness of the gaps between the tiles."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float tiles_orange_peel_bump_factor = 0.0f [[ + ::anno::display_name("Coating Unevenness"), + ::anno::description("Applies an unevenness to the clear coat layer akin to orange peel."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float coating_reflectivity = 1.f [[ + ::anno::display_name("Coating Reflectivity"), + ::anno::description("The overall reflectivity of the clearcoat layer. Note that other parameters will show no effect when the clearcoat reflectivity is 0."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + + + float tiles_base_roughness = 0.04f [[ + ::anno::description("Adjusts the roughness of the coating. Higher value leading to blurrier and softer reflections."), + ::anno::display_name("Coating Roughness"), + ::anno::in_group("Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + float base_roughness_range = 0.6f [[ + ::anno::description("Applies roughness variation to the coating, introducing signs of wear such as footprints and smudges."), + ::anno::display_name("Coating Roughness Variation"), + ::anno::in_group("Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_and_spots_amount = 0.0f [[ + ::anno::description("Adds random dirt and spots on top of the surface which adds variation to the clearcoat roughness."), + ::anno::display_name("Dirt and Spots"), + ::anno::in_group("Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + float edgewear_roughness_amount = 0.0f [[ + ::anno::description("Adds edgewear around the tile borders which results in a more worn and rough look of the clearcoat."), + ::anno::display_name("Edgewear Roughness Amount"), + ::anno::in_group("Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + + //----------------------------------------------- + + float2 texture_translate = 0.f [[ + ::anno::display_name("Texture Translate"), + ::anno::description("Controls the position of the texture."), + ::anno::in_group("Transform") + ]], + float texture_rotate = 0.f [[ + ::anno::display_name("Texture Rotate"), + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::in_group("Transform") + ]], + float2 texture_scale = 1.0f [[ + ::anno::display_name("Texture Scale"), + ::anno::description("Larger numbers increase the size."), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::anno::in_group("Transform") + ]], + uniform int uv_space_index = 0 [[ + ::anno::display_name("UV Space Index"), + ::anno::description("Uses selected UV space for material."), + ::anno::in_group("Transform") + ]], + uniform bool round_corners = false [[ + ::anno::display_name("Round Corners"), + ::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."), + ::anno::in_group("Round Corners") + ]], + uniform float roundcorner_radius_mm = 1.5f [[ + ::anno::display_name("Radius (mm)"), + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f) + ]], + uniform bool across_materials = false [[ + ::anno::display_name("Across Materials"), + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::in_group("Round Corners") + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Wood Tiles Poplar - Brick Bond"), + ::anno::description(DESCRIPTION), + // reflective, varnished, bumped, matte, natural, stained, exterior, new, aged, decayed, abstract, modern, classic + ::anno::key_words(string[]("wood", "poplar", "tiles", "tiled", "pattern", "decorative", "multimaterial", "organic", "natural", "coated", "infinite tiling", "brick bond", "architecture", "interior")), + ::anno::thumbnail("./.thumbs/Wood_Tiles_Poplar.Wood_Tiles_Poplar_Brickbond.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Wood_Tiles_Poplar( + wood_color: wood_color, + wood_bump_strength: wood_bump_strength, + floor_brightness: floor_brightness, + wood_brightness_variation: wood_brightness_variation, + wood_random_rotation: wood_random_rotation, + wood_scale: wood_scale, + wood_scale_variation: wood_scale_variation, + + tiles_bump_strength: tiles_bump_strength, + tiles_random_slope_orientation: tiles_random_slope_orientation, + gaps_brightness: gaps_brightness, + tiles_orange_peel_bump_factor: tiles_orange_peel_bump_factor, + coating_reflectivity: coating_reflectivity, + tiles_base_roughness: tiles_base_roughness, + base_roughness_range: base_roughness_range, + dirt_and_spots_amount: dirt_and_spots_amount, + edgewear_roughness_amount: edgewear_roughness_amount, + + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + + round_corners: round_corners, + roundcorner_radius_mm: roundcorner_radius_mm, + across_materials: across_materials, + + preview_wood_highlights: false, + isotropic_roughness: 0.336f, + isotropic_roughness_range: 0.918f, + isotropic_specular_brightness: 0.787f, + wood_specular_level: 1.0f, + aniso_attenuation: 0.484f, + aniso_bsdf_width: 0.443f, + aniso_bsdf_height: 0.631f, + anisotropic_isotropic_balance: 0.434f, + + tex_srgb_wood_color: texture_2d("./poplar_diff.jpg", ::tex::gamma_srgb), + tex_lin_wood_rough_detail: texture_2d("./poplar_rough_detail.jpg", ::tex::gamma_linear), + tex_lin_wood_rough_grain: texture_2d("./poplar_rough_grain.jpg", ::tex::gamma_linear), + tex_lin_wood_detail_norm: texture_2d("./poplar_norm.jpg", ::tex::gamma_linear), + tex_lin_tiles_id_offset_rotation: texture_2d("./brickbond_R_id_G_offs_B_rotation.png", ::tex::gamma_linear), + tex_lin_tiles_edgewear_gaps_gapsrough: texture_2d("./brickbond_R_edgewear_G_gaps_B_gaps_rough.jpg", ::tex::gamma_linear), + tex_lin_tiles_normal: texture_2d("./brickbond_norm.png", ::tex::gamma_linear), + tex_lin_tiles_rough_dents_spots: texture_2d("./tiles_wood_R_rough_G_dents_B_spots.jpg", ::tex::gamma_linear), + tex_lin_tiles_orange_peel: texture_2d("./tiles_wood_orangepeel_norm.jpg", ::tex::gamma_linear) + +); + + +// ****************************************************************************************************** +// 02 + +export material Wood_Tiles_Poplar_Chantilly( + color wood_color = color(0.5f) [[ + ::anno::description("Applies an overlay color to tint the wood. The color is used using the 'overlay' mode as known " + "from paint programs. A gray value of 0.5 has no effect, brighter values brighten it while darker colors will have a darkening effect."), + ::anno::display_name("Wood Color"), + ::anno::in_group("Appearance") + ]], + uniform float wood_bump_strength = 0.2f // Determines the degree of bumpiness"), + [[ + ::anno::display_name("Wood Bump Strength"), + ::anno::description("Adjusts the strength of the wood bump map."), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 2.f) + ]], + float floor_brightness = 0.5f [[ + ::anno::description("Adjusts the general brightness of the wood."), + ::anno::display_name("Floor Brightness"), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float wood_brightness_variation = 0.5f [[ + ::anno::display_name("Wood Brightness Variation"), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float wood_random_rotation = 0.03f [[ + ::anno::display_name("Wood Random Rotation"), + ::anno::description("Adds a random rotation around the main wood tile alignment direction."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + + float2 wood_scale = 1.f [[ + ::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."), + ::anno::display_name("Wood Scale"), + ::anno::in_group("Tiles") + ]], + float wood_scale_variation = 0.f [[ + ::anno::description("Adds random variation to size of the wood in each tile."), + ::anno::display_name("Wood Scale Variation"), + ::anno::in_group("Tiles"), + ::anno::soft_range(0.f, 2.f) + ]], + uniform float tiles_bump_strength = 0.4f [[ + ::anno::description("Determines the degree of bumpiness of the tiles texture (grooves and bent tiles)."), + ::anno::display_name("Tiles Bump Strength"), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float tiles_random_slope_orientation = 0.05f [[ + ::anno::display_name("Tiles Random Slope Orientation"), + ::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."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float gaps_brightness = 0.3f [[ + ::anno::display_name("Gaps Brightness"), + ::anno::description("Adjusts the brightness and roughness of the gaps between the tiles."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float tiles_orange_peel_bump_factor = 0.0f [[ + ::anno::display_name("Coating Unevenness"), + ::anno::description("Applies an unevenness to the clear coat layer akin to orange peel."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float coating_reflectivity = 1.f [[ + ::anno::display_name("Coating Reflectivity"), + ::anno::description("The overall reflectivity of the clearcoat layer. Note that other parameters will show no effect when the clearcoat reflectivity is 0."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + + + float tiles_base_roughness = 0.04f [[ + ::anno::description("Adjusts the roughness of the coating. Higher value leading to blurrier and softer reflections."), + ::anno::display_name("Coating Roughness"), + ::anno::in_group("Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + float base_roughness_range = 0.6f [[ + ::anno::description("Applies roughness variation to the coating, introducing signs of wear such as footprints and smudges."), + ::anno::display_name("Coating Roughness Variation"), + ::anno::in_group("Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_and_spots_amount = 0.0f [[ + ::anno::description("Adds random dirt and spots on top of the surface which adds variation to the clearcoat roughness."), + ::anno::display_name("Dirt and Spots"), + ::anno::in_group("Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + float edgewear_roughness_amount = 0.0f [[ + ::anno::description("Adds edgewear around the tile borders which results in a more worn and rough look of the clearcoat."), + ::anno::display_name("Edgewear Roughness Amount"), + ::anno::in_group("Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + + //----------------------------------------------- + + float2 texture_translate = 0.f [[ + ::anno::display_name("Texture Translate"), + ::anno::description("Controls the position of the texture."), + ::anno::in_group("Transform") + ]], + float texture_rotate = 0.f [[ + ::anno::display_name("Texture Rotate"), + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::in_group("Transform") + ]], + float2 texture_scale = 1.0f [[ + ::anno::display_name("Texture Scale"), + ::anno::description("Larger numbers increase the size."), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::anno::in_group("Transform") + ]], + uniform int uv_space_index = 0 [[ + ::anno::display_name("UV Space Index"), + ::anno::description("Uses selected UV space for material."), + ::anno::in_group("Transform") + ]], + uniform bool round_corners = false [[ + ::anno::display_name("Round Corners"), + ::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."), + ::anno::in_group("Round Corners") + ]], + uniform float roundcorner_radius_mm = 1.5f [[ + ::anno::display_name("Radius (mm)"), + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f) + ]], + uniform bool across_materials = false [[ + ::anno::display_name("Across Materials"), + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::in_group("Round Corners") + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Wood Tiles Poplar - Chantilly"), + ::anno::description(DESCRIPTION), + // reflective, varnished, bumped, matte, natural, stained, exterior, new, aged, decayed, abstract, modern, classic + ::anno::key_words(string[]("wood", "poplar", "tiles", "tiled", "pattern", "decorative", "multimaterial", "organic", "natural", "coated", "infinite tiling", "chantilly", "architecture", "interior")), + ::anno::thumbnail("./.thumbs/Wood_Tiles_Poplar.Wood_Tiles_Poplar_Chantilly.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Wood_Tiles_Poplar( + wood_color: wood_color, + wood_bump_strength: wood_bump_strength, + floor_brightness: floor_brightness, + wood_brightness_variation: wood_brightness_variation, + wood_random_rotation: wood_random_rotation, + wood_scale: wood_scale, + wood_scale_variation: wood_scale_variation, + + tiles_bump_strength: tiles_bump_strength, + tiles_random_slope_orientation: tiles_random_slope_orientation, + gaps_brightness: gaps_brightness, + tiles_orange_peel_bump_factor: tiles_orange_peel_bump_factor, + coating_reflectivity: coating_reflectivity, + tiles_base_roughness: tiles_base_roughness, + base_roughness_range: base_roughness_range, + dirt_and_spots_amount: dirt_and_spots_amount, + edgewear_roughness_amount: edgewear_roughness_amount, + + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + + round_corners: round_corners, + roundcorner_radius_mm: roundcorner_radius_mm, + across_materials: across_materials, + + preview_wood_highlights: false, + isotropic_roughness: 0.336f, + isotropic_roughness_range: 0.918f, + isotropic_specular_brightness: 0.787f, + wood_specular_level: 1.0f, + aniso_attenuation: 0.484f, + aniso_bsdf_width: 0.443f, + aniso_bsdf_height: 0.631f, + anisotropic_isotropic_balance: 0.434f, + + tex_srgb_wood_color: texture_2d("./poplar_diff.jpg", ::tex::gamma_srgb), + tex_lin_wood_rough_detail: texture_2d("./poplar_rough_detail.jpg", ::tex::gamma_linear), + tex_lin_wood_rough_grain: texture_2d("./poplar_rough_grain.jpg", ::tex::gamma_linear), + tex_lin_wood_detail_norm: texture_2d("./poplar_norm.jpg", ::tex::gamma_linear), + tex_lin_tiles_id_offset_rotation: texture_2d("./chantilly_R_id_G_offs_B_rotation.png", ::tex::gamma_linear), + tex_lin_tiles_edgewear_gaps_gapsrough: texture_2d("./chantilly_R_edgewear_G_gaps_B_gaps_rough.jpg", ::tex::gamma_linear), + tex_lin_tiles_normal: texture_2d("./chantilly_norm.png", ::tex::gamma_linear), + tex_lin_tiles_rough_dents_spots: texture_2d("./tiles_wood_R_rough_G_dents_B_spots.jpg", ::tex::gamma_linear), + tex_lin_tiles_orange_peel: texture_2d("./tiles_wood_orangepeel_norm.jpg", ::tex::gamma_linear) + +); + +// ****************************************************************************************************** +// 03 + +export material Wood_Tiles_Poplar_Chevron( + color wood_color = color(0.5f) [[ + ::anno::description("Applies an overlay color to tint the wood. The color is used using the 'overlay' mode as known " + "from paint programs. A gray value of 0.5 has no effect, brighter values brighten it while darker colors will have a darkening effect."), + ::anno::display_name("Wood Color"), + ::anno::in_group("Appearance") + ]], + uniform float wood_bump_strength = 0.2f // Determines the degree of bumpiness"), + [[ + ::anno::display_name("Wood Bump Strength"), + ::anno::description("Adjusts the strength of the wood bump map."), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 2.f) + ]], + float floor_brightness = 0.5f [[ + ::anno::description("Adjusts the general brightness of the wood."), + ::anno::display_name("Floor Brightness"), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float wood_brightness_variation = 0.5f [[ + ::anno::display_name("Wood Brightness Variation"), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float wood_random_rotation = 0.03f [[ + ::anno::display_name("Wood Random Rotation"), + ::anno::description("Adds a random rotation around the main wood tile alignment direction."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + + float2 wood_scale = 1.f [[ + ::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."), + ::anno::display_name("Wood Scale"), + ::anno::in_group("Tiles") + ]], + float wood_scale_variation = 0.f [[ + ::anno::description("Adds random variation to size of the wood in each tile."), + ::anno::display_name("Wood Scale Variation"), + ::anno::in_group("Tiles"), + ::anno::soft_range(0.f, 2.f) + ]], + uniform float tiles_bump_strength = 0.4f [[ + ::anno::description("Determines the degree of bumpiness of the tiles texture (grooves and bent tiles)."), + ::anno::display_name("Tiles Bump Strength"), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float tiles_random_slope_orientation = 0.05f [[ + ::anno::display_name("Tiles Random Slope Orientation"), + ::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."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float gaps_brightness = 0.3f [[ + ::anno::display_name("Gaps Brightness"), + ::anno::description("Adjusts the brightness and roughness of the gaps between the tiles."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float tiles_orange_peel_bump_factor = 0.0f [[ + ::anno::display_name("Coating Unevenness"), + ::anno::description("Applies an unevenness to the clear coat layer akin to orange peel."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float coating_reflectivity = 1.f [[ + ::anno::display_name("Coating Reflectivity"), + ::anno::description("The overall reflectivity of the clearcoat layer. Note that other parameters will show no effect when the clearcoat reflectivity is 0."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + + + float tiles_base_roughness = 0.04f [[ + ::anno::description("Adjusts the roughness of the coating. Higher value leading to blurrier and softer reflections."), + ::anno::display_name("Coating Roughness"), + ::anno::in_group("Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + float base_roughness_range = 0.6f [[ + ::anno::description("Applies roughness variation to the coating, introducing signs of wear such as footprints and smudges."), + ::anno::display_name("Coating Roughness Variation"), + ::anno::in_group("Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_and_spots_amount = 0.0f [[ + ::anno::description("Adds random dirt and spots on top of the surface which adds variation to the clearcoat roughness."), + ::anno::display_name("Dirt and Spots"), + ::anno::in_group("Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + float edgewear_roughness_amount = 0.0f [[ + ::anno::description("Adds edgewear around the tile borders which results in a more worn and rough look of the clearcoat."), + ::anno::display_name("Edgewear Roughness Amount"), + ::anno::in_group("Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + + //----------------------------------------------- + + float2 texture_translate = 0.f [[ + ::anno::display_name("Texture Translate"), + ::anno::description("Controls the position of the texture."), + ::anno::in_group("Transform") + ]], + float texture_rotate = 0.f [[ + ::anno::display_name("Texture Rotate"), + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::in_group("Transform") + ]], + float2 texture_scale = 1.0f [[ + ::anno::display_name("Texture Scale"), + ::anno::description("Larger numbers increase the size."), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::anno::in_group("Transform") + ]], + uniform int uv_space_index = 0 [[ + ::anno::display_name("UV Space Index"), + ::anno::description("Uses selected UV space for material."), + ::anno::in_group("Transform") + ]], + uniform bool round_corners = false [[ + ::anno::display_name("Round Corners"), + ::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."), + ::anno::in_group("Round Corners") + ]], + uniform float roundcorner_radius_mm = 1.5f [[ + ::anno::display_name("Radius (mm)"), + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f) + ]], + uniform bool across_materials = false [[ + ::anno::display_name("Across Materials"), + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::in_group("Round Corners") + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Wood Tiles Poplar - Chevron"), + ::anno::description(DESCRIPTION), + // reflective, varnished, bumped, matte, natural, stained, exterior, new, aged, decayed, abstract, modern, classic + ::anno::key_words(string[]("wood", "poplar", "tiles", "tiled", "pattern", "decorative", "multimaterial", "organic", "natural", "coated", "infinite tiling", "chevron", "architecture", "interior")), + ::anno::thumbnail("./.thumbs/Wood_Tiles_Poplar.Wood_Tiles_Poplar_Chevron.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Wood_Tiles_Poplar( + wood_color: wood_color, + wood_bump_strength: wood_bump_strength, + floor_brightness: floor_brightness, + wood_brightness_variation: wood_brightness_variation, + wood_random_rotation: wood_random_rotation, + wood_scale: wood_scale, + wood_scale_variation: wood_scale_variation, + + tiles_bump_strength: tiles_bump_strength, + tiles_random_slope_orientation: tiles_random_slope_orientation, + gaps_brightness: gaps_brightness, + tiles_orange_peel_bump_factor: tiles_orange_peel_bump_factor, + coating_reflectivity: coating_reflectivity, + tiles_base_roughness: tiles_base_roughness, + base_roughness_range: base_roughness_range, + dirt_and_spots_amount: dirt_and_spots_amount, + edgewear_roughness_amount: edgewear_roughness_amount, + + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + + round_corners: round_corners, + roundcorner_radius_mm: roundcorner_radius_mm, + across_materials: across_materials, + + preview_wood_highlights: false, + isotropic_roughness: 0.336f, + isotropic_roughness_range: 0.918f, + isotropic_specular_brightness: 0.787f, + wood_specular_level: 1.0f, + aniso_attenuation: 0.484f, + aniso_bsdf_width: 0.443f, + aniso_bsdf_height: 0.631f, + anisotropic_isotropic_balance: 0.434f, + + tex_srgb_wood_color: texture_2d("./poplar_diff.jpg", ::tex::gamma_srgb), + tex_lin_wood_rough_detail: texture_2d("./poplar_rough_detail.jpg", ::tex::gamma_linear), + tex_lin_wood_rough_grain: texture_2d("./poplar_rough_grain.jpg", ::tex::gamma_linear), + tex_lin_wood_detail_norm: texture_2d("./poplar_norm.jpg", ::tex::gamma_linear), + tex_lin_tiles_id_offset_rotation: texture_2d("./chevron_R_id_G_offs_B_rotation.png", ::tex::gamma_linear), + tex_lin_tiles_edgewear_gaps_gapsrough: texture_2d("./chevron_R_edgewear_G_gaps_B_gaps_rough.jpg", ::tex::gamma_linear), + tex_lin_tiles_normal: texture_2d("./chevron_norm.png", ::tex::gamma_linear), + tex_lin_tiles_rough_dents_spots: texture_2d("./tiles_wood_R_rough_G_dents_B_spots.jpg", ::tex::gamma_linear), + tex_lin_tiles_orange_peel: texture_2d("./tiles_wood_orangepeel_norm.jpg", ::tex::gamma_linear) + +); + + +// ****************************************************************************************************** +// 04 + +export material Wood_Tiles_Poplar_Cubes( + color wood_color = color(0.5f) [[ + ::anno::description("Applies an overlay color to tint the wood. The color is used using the 'overlay' mode as known " + "from paint programs. A gray value of 0.5 has no effect, brighter values brighten it while darker colors will have a darkening effect."), + ::anno::display_name("Wood Color"), + ::anno::in_group("Appearance") + ]], + uniform float wood_bump_strength = 0.2f // Determines the degree of bumpiness"), + [[ + ::anno::display_name("Wood Bump Strength"), + ::anno::description("Adjusts the strength of the wood bump map."), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 2.f) + ]], + float floor_brightness = 0.5f [[ + ::anno::description("Adjusts the general brightness of the wood."), + ::anno::display_name("Floor Brightness"), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float wood_brightness_variation = 0.5f [[ + ::anno::display_name("Wood Brightness Variation"), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float wood_random_rotation = 0.03f [[ + ::anno::display_name("Wood Random Rotation"), + ::anno::description("Adds a random rotation around the main wood tile alignment direction."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + + float2 wood_scale = 1.f [[ + ::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."), + ::anno::display_name("Wood Scale"), + ::anno::in_group("Tiles") + ]], + float wood_scale_variation = 0.f [[ + ::anno::description("Adds random variation to size of the wood in each tile."), + ::anno::display_name("Wood Scale Variation"), + ::anno::in_group("Tiles"), + ::anno::soft_range(0.f, 2.f) + ]], + uniform float tiles_bump_strength = 0.4f [[ + ::anno::description("Determines the degree of bumpiness of the tiles texture (grooves and bent tiles)."), + ::anno::display_name("Tiles Bump Strength"), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float tiles_random_slope_orientation = 0.05f [[ + ::anno::display_name("Tiles Random Slope Orientation"), + ::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."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float gaps_brightness = 0.3f [[ + ::anno::display_name("Gaps Brightness"), + ::anno::description("Adjusts the brightness and roughness of the gaps between the tiles."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float tiles_orange_peel_bump_factor = 0.0f [[ + ::anno::display_name("Coating Unevenness"), + ::anno::description("Applies an unevenness to the clear coat layer akin to orange peel."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float coating_reflectivity = 1.f [[ + ::anno::display_name("Coating Reflectivity"), + ::anno::description("The overall reflectivity of the clearcoat layer. Note that other parameters will show no effect when the clearcoat reflectivity is 0."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + + + float tiles_base_roughness = 0.04f [[ + ::anno::description("Adjusts the roughness of the coating. Higher value leading to blurrier and softer reflections."), + ::anno::display_name("Coating Roughness"), + ::anno::in_group("Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + float base_roughness_range = 0.6f [[ + ::anno::description("Applies roughness variation to the coating, introducing signs of wear such as footprints and smudges."), + ::anno::display_name("Coating Roughness Variation"), + ::anno::in_group("Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_and_spots_amount = 0.0f [[ + ::anno::description("Adds random dirt and spots on top of the surface which adds variation to the clearcoat roughness."), + ::anno::display_name("Dirt and Spots"), + ::anno::in_group("Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + float edgewear_roughness_amount = 0.0f [[ + ::anno::description("Adds edgewear around the tile borders which results in a more worn and rough look of the clearcoat."), + ::anno::display_name("Edgewear Roughness Amount"), + ::anno::in_group("Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + + //----------------------------------------------- + + float2 texture_translate = 0.f [[ + ::anno::display_name("Texture Translate"), + ::anno::description("Controls the position of the texture."), + ::anno::in_group("Transform") + ]], + float texture_rotate = 0.f [[ + ::anno::display_name("Texture Rotate"), + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::in_group("Transform") + ]], + float2 texture_scale = 1.0f [[ + ::anno::display_name("Texture Scale"), + ::anno::description("Larger numbers increase the size."), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::anno::in_group("Transform") + ]], + uniform int uv_space_index = 0 [[ + ::anno::display_name("UV Space Index"), + ::anno::description("Uses selected UV space for material."), + ::anno::in_group("Transform") + ]], + uniform bool round_corners = false [[ + ::anno::display_name("Round Corners"), + ::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."), + ::anno::in_group("Round Corners") + ]], + uniform float roundcorner_radius_mm = 1.5f [[ + ::anno::display_name("Radius (mm)"), + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f) + ]], + uniform bool across_materials = false [[ + ::anno::display_name("Across Materials"), + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::in_group("Round Corners") + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Wood Tiles Poplar - Cubes"), + ::anno::description(DESCRIPTION), + // reflective, varnished, bumped, matte, natural, stained, exterior, new, aged, decayed, abstract, modern, classic + ::anno::key_words(string[]("wood", "poplar", "tiles", "tiled", "pattern", "decorative", "multimaterial", "organic", "natural", "coated", "infinite tiling", "cubes", "architecture", "interior")), + ::anno::thumbnail("./.thumbs/Wood_Tiles_Poplar.Wood_Tiles_Poplar_Cubes.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Wood_Tiles_Poplar( + wood_color: wood_color, + wood_bump_strength: wood_bump_strength, + floor_brightness: floor_brightness, + wood_brightness_variation: wood_brightness_variation, + wood_random_rotation: wood_random_rotation, + wood_scale: wood_scale, + wood_scale_variation: wood_scale_variation, + + tiles_bump_strength: tiles_bump_strength, + tiles_random_slope_orientation: tiles_random_slope_orientation, + gaps_brightness: gaps_brightness, + tiles_orange_peel_bump_factor: tiles_orange_peel_bump_factor, + coating_reflectivity: coating_reflectivity, + tiles_base_roughness: tiles_base_roughness, + base_roughness_range: base_roughness_range, + dirt_and_spots_amount: dirt_and_spots_amount, + edgewear_roughness_amount: edgewear_roughness_amount, + + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + + round_corners: round_corners, + roundcorner_radius_mm: roundcorner_radius_mm, + across_materials: across_materials, + + preview_wood_highlights: false, + isotropic_roughness: 0.336f, + isotropic_roughness_range: 0.918f, + isotropic_specular_brightness: 0.787f, + wood_specular_level: 1.0f, + aniso_attenuation: 0.484f, + aniso_bsdf_width: 0.443f, + aniso_bsdf_height: 0.631f, + anisotropic_isotropic_balance: 0.434f, + + tex_srgb_wood_color: texture_2d("./poplar_diff.jpg", ::tex::gamma_srgb), + tex_lin_wood_rough_detail: texture_2d("./poplar_rough_detail.jpg", ::tex::gamma_linear), + tex_lin_wood_rough_grain: texture_2d("./poplar_rough_grain.jpg", ::tex::gamma_linear), + tex_lin_wood_detail_norm: texture_2d("./poplar_norm.jpg", ::tex::gamma_linear), + tex_lin_tiles_id_offset_rotation: texture_2d("./cubes_R_id_G_offs_B_rotation.png", ::tex::gamma_linear), + tex_lin_tiles_edgewear_gaps_gapsrough: texture_2d("./cubes_R_edgewear_G_gaps_B_gaps_rough.jpg", ::tex::gamma_linear), + tex_lin_tiles_normal: texture_2d("./cubes_norm.png", ::tex::gamma_linear), + tex_lin_tiles_rough_dents_spots: texture_2d("./tiles_wood_R_rough_G_dents_B_spots.jpg", ::tex::gamma_linear), + tex_lin_tiles_orange_peel: texture_2d("./tiles_wood_orangepeel_norm.jpg", ::tex::gamma_linear) + +); + + +// ****************************************************************************************************** +// 05 + +export material Wood_Tiles_Poplar_Diagonal( + color wood_color = color(0.5f) [[ + ::anno::description("Applies an overlay color to tint the wood. The color is used using the 'overlay' mode as known " + "from paint programs. A gray value of 0.5 has no effect, brighter values brighten it while darker colors will have a darkening effect."), + ::anno::display_name("Wood Color"), + ::anno::in_group("Appearance") + ]], + uniform float wood_bump_strength = 0.2f // Determines the degree of bumpiness"), + [[ + ::anno::display_name("Wood Bump Strength"), + ::anno::description("Adjusts the strength of the wood bump map."), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 2.f) + ]], + float floor_brightness = 0.5f [[ + ::anno::description("Adjusts the general brightness of the wood."), + ::anno::display_name("Floor Brightness"), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float wood_brightness_variation = 0.5f [[ + ::anno::display_name("Wood Brightness Variation"), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float wood_random_rotation = 0.03f [[ + ::anno::display_name("Wood Random Rotation"), + ::anno::description("Adds a random rotation around the main wood tile alignment direction."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + + float2 wood_scale = 1.f [[ + ::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."), + ::anno::display_name("Wood Scale"), + ::anno::in_group("Tiles") + ]], + float wood_scale_variation = 0.f [[ + ::anno::description("Adds random variation to size of the wood in each tile."), + ::anno::display_name("Wood Scale Variation"), + ::anno::in_group("Tiles"), + ::anno::soft_range(0.f, 2.f) + ]], + uniform float tiles_bump_strength = 0.4f [[ + ::anno::description("Determines the degree of bumpiness of the tiles texture (grooves and bent tiles)."), + ::anno::display_name("Tiles Bump Strength"), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float tiles_random_slope_orientation = 0.05f [[ + ::anno::display_name("Tiles Random Slope Orientation"), + ::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."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float gaps_brightness = 0.3f [[ + ::anno::display_name("Gaps Brightness"), + ::anno::description("Adjusts the brightness and roughness of the gaps between the tiles."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float tiles_orange_peel_bump_factor = 0.0f [[ + ::anno::display_name("Coating Unevenness"), + ::anno::description("Applies an unevenness to the clear coat layer akin to orange peel."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float coating_reflectivity = 1.f [[ + ::anno::display_name("Coating Reflectivity"), + ::anno::description("The overall reflectivity of the clearcoat layer. Note that other parameters will show no effect when the clearcoat reflectivity is 0."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + + + float tiles_base_roughness = 0.04f [[ + ::anno::description("Adjusts the roughness of the coating. Higher value leading to blurrier and softer reflections."), + ::anno::display_name("Coating Roughness"), + ::anno::in_group("Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + float base_roughness_range = 0.6f [[ + ::anno::description("Applies roughness variation to the coating, introducing signs of wear such as footprints and smudges."), + ::anno::display_name("Coating Roughness Variation"), + ::anno::in_group("Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_and_spots_amount = 0.0f [[ + ::anno::description("Adds random dirt and spots on top of the surface which adds variation to the clearcoat roughness."), + ::anno::display_name("Dirt and Spots"), + ::anno::in_group("Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + float edgewear_roughness_amount = 0.0f [[ + ::anno::description("Adds edgewear around the tile borders which results in a more worn and rough look of the clearcoat."), + ::anno::display_name("Edgewear Roughness Amount"), + ::anno::in_group("Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + + //----------------------------------------------- + + float2 texture_translate = 0.f [[ + ::anno::display_name("Texture Translate"), + ::anno::description("Controls the position of the texture."), + ::anno::in_group("Transform") + ]], + float texture_rotate = 0.f [[ + ::anno::display_name("Texture Rotate"), + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::in_group("Transform") + ]], + float2 texture_scale = 1.0f [[ + ::anno::display_name("Texture Scale"), + ::anno::description("Larger numbers increase the size."), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::anno::in_group("Transform") + ]], + uniform int uv_space_index = 0 [[ + ::anno::display_name("UV Space Index"), + ::anno::description("Uses selected UV space for material."), + ::anno::in_group("Transform") + ]], + uniform bool round_corners = false [[ + ::anno::display_name("Round Corners"), + ::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."), + ::anno::in_group("Round Corners") + ]], + uniform float roundcorner_radius_mm = 1.5f [[ + ::anno::display_name("Radius (mm)"), + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f) + ]], + uniform bool across_materials = false [[ + ::anno::display_name("Across Materials"), + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::in_group("Round Corners") + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Wood Tiles Poplar - Diagonal"), + ::anno::description(DESCRIPTION), + // reflective, varnished, bumped, matte, natural, stained, exterior, new, aged, decayed, abstract, modern, classic + ::anno::key_words(string[]("wood", "poplar", "tiles", "tiled", "pattern", "decorative", "multimaterial", "organic", "natural", "coated", "infinite tiling", "diagonal", "architecture", "interior")), + ::anno::thumbnail("./.thumbs/Wood_Tiles_Poplar.Wood_Tiles_Poplar_Diagonal.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Wood_Tiles_Poplar( + wood_color: wood_color, + wood_bump_strength: wood_bump_strength, + floor_brightness: floor_brightness, + wood_brightness_variation: wood_brightness_variation, + wood_random_rotation: wood_random_rotation, + wood_scale: wood_scale, + wood_scale_variation: wood_scale_variation, + + tiles_bump_strength: tiles_bump_strength, + tiles_random_slope_orientation: tiles_random_slope_orientation, + gaps_brightness: gaps_brightness, + tiles_orange_peel_bump_factor: tiles_orange_peel_bump_factor, + coating_reflectivity: coating_reflectivity, + tiles_base_roughness: tiles_base_roughness, + base_roughness_range: base_roughness_range, + dirt_and_spots_amount: dirt_and_spots_amount, + edgewear_roughness_amount: edgewear_roughness_amount, + + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + + round_corners: round_corners, + roundcorner_radius_mm: roundcorner_radius_mm, + across_materials: across_materials, + + preview_wood_highlights: false, + isotropic_roughness: 0.336f, + isotropic_roughness_range: 0.918f, + isotropic_specular_brightness: 0.787f, + wood_specular_level: 1.0f, + aniso_attenuation: 0.484f, + aniso_bsdf_width: 0.443f, + aniso_bsdf_height: 0.631f, + anisotropic_isotropic_balance: 0.434f, + + tex_srgb_wood_color: texture_2d("./poplar_diff.jpg", ::tex::gamma_srgb), + tex_lin_wood_rough_detail: texture_2d("./poplar_rough_detail.jpg", ::tex::gamma_linear), + tex_lin_wood_rough_grain: texture_2d("./poplar_rough_grain.jpg", ::tex::gamma_linear), + tex_lin_wood_detail_norm: texture_2d("./poplar_norm.jpg", ::tex::gamma_linear), + tex_lin_tiles_id_offset_rotation: texture_2d("./diagonal_R_id_G_offs_B_rotation.png", ::tex::gamma_linear), + tex_lin_tiles_edgewear_gaps_gapsrough: texture_2d("./diagonal_R_edgewear_G_gaps_B_gaps_rough.jpg", ::tex::gamma_linear), + tex_lin_tiles_normal: texture_2d("./diagonal_norm.png", ::tex::gamma_linear), + tex_lin_tiles_rough_dents_spots: texture_2d("./tiles_wood_R_rough_G_dents_B_spots.jpg", ::tex::gamma_linear), + tex_lin_tiles_orange_peel: texture_2d("./tiles_wood_orangepeel_norm.jpg", ::tex::gamma_linear) + +); + + +// ****************************************************************************************************** +// 06 + +export material Wood_Tiles_Poplar_Herringbone( + color wood_color = color(0.5f) [[ + ::anno::description("Applies an overlay color to tint the wood. The color is used using the 'overlay' mode as known " + "from paint programs. A gray value of 0.5 has no effect, brighter values brighten it while darker colors will have a darkening effect."), + ::anno::display_name("Wood Color"), + ::anno::in_group("Appearance") + ]], + uniform float wood_bump_strength = 0.2f // Determines the degree of bumpiness"), + [[ + ::anno::display_name("Wood Bump Strength"), + ::anno::description("Adjusts the strength of the wood bump map."), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 2.f) + ]], + float floor_brightness = 0.5f [[ + ::anno::description("Adjusts the general brightness of the wood."), + ::anno::display_name("Floor Brightness"), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float wood_brightness_variation = 0.5f [[ + ::anno::display_name("Wood Brightness Variation"), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float wood_random_rotation = 0.03f [[ + ::anno::display_name("Wood Random Rotation"), + ::anno::description("Adds a random rotation around the main wood tile alignment direction."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + + float2 wood_scale = 1.f [[ + ::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."), + ::anno::display_name("Wood Scale"), + ::anno::in_group("Tiles") + ]], + float wood_scale_variation = 0.f [[ + ::anno::description("Adds random variation to size of the wood in each tile."), + ::anno::display_name("Wood Scale Variation"), + ::anno::in_group("Tiles"), + ::anno::soft_range(0.f, 2.f) + ]], + uniform float tiles_bump_strength = 0.4f [[ + ::anno::description("Determines the degree of bumpiness of the tiles texture (grooves and bent tiles)."), + ::anno::display_name("Tiles Bump Strength"), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float tiles_random_slope_orientation = 0.05f [[ + ::anno::display_name("Tiles Random Slope Orientation"), + ::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."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float gaps_brightness = 0.3f [[ + ::anno::display_name("Gaps Brightness"), + ::anno::description("Adjusts the brightness and roughness of the gaps between the tiles."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float tiles_orange_peel_bump_factor = 0.0f [[ + ::anno::display_name("Coating Unevenness"), + ::anno::description("Applies an unevenness to the clear coat layer akin to orange peel."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float coating_reflectivity = 1.f [[ + ::anno::display_name("Coating Reflectivity"), + ::anno::description("The overall reflectivity of the clearcoat layer. Note that other parameters will show no effect when the clearcoat reflectivity is 0."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + + + float tiles_base_roughness = 0.04f [[ + ::anno::description("Adjusts the roughness of the coating. Higher value leading to blurrier and softer reflections."), + ::anno::display_name("Coating Roughness"), + ::anno::in_group("Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + float base_roughness_range = 0.6f [[ + ::anno::description("Applies roughness variation to the coating, introducing signs of wear such as footprints and smudges."), + ::anno::display_name("Coating Roughness Variation"), + ::anno::in_group("Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_and_spots_amount = 0.0f [[ + ::anno::description("Adds random dirt and spots on top of the surface which adds variation to the clearcoat roughness."), + ::anno::display_name("Dirt and Spots"), + ::anno::in_group("Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + float edgewear_roughness_amount = 0.0f [[ + ::anno::description("Adds edgewear around the tile borders which results in a more worn and rough look of the clearcoat."), + ::anno::display_name("Edgewear Roughness Amount"), + ::anno::in_group("Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + + //----------------------------------------------- + + float2 texture_translate = 0.f [[ + ::anno::display_name("Texture Translate"), + ::anno::description("Controls the position of the texture."), + ::anno::in_group("Transform") + ]], + float texture_rotate = 0.f [[ + ::anno::display_name("Texture Rotate"), + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::in_group("Transform") + ]], + float2 texture_scale = 1.0f [[ + ::anno::display_name("Texture Scale"), + ::anno::description("Larger numbers increase the size."), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::anno::in_group("Transform") + ]], + uniform int uv_space_index = 0 [[ + ::anno::display_name("UV Space Index"), + ::anno::description("Uses selected UV space for material."), + ::anno::in_group("Transform") + ]], + uniform bool round_corners = false [[ + ::anno::display_name("Round Corners"), + ::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."), + ::anno::in_group("Round Corners") + ]], + uniform float roundcorner_radius_mm = 1.5f [[ + ::anno::display_name("Radius (mm)"), + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f) + ]], + uniform bool across_materials = false [[ + ::anno::display_name("Across Materials"), + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::in_group("Round Corners") + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Wood Tiles Poplar - Herringbone"), + ::anno::description(DESCRIPTION), + // reflective, varnished, bumped, matte, natural, stained, exterior, new, aged, decayed, abstract, modern, classic + ::anno::key_words(string[]("wood", "poplar", "tiles", "tiled", "pattern", "decorative", "multimaterial", "organic", "natural", "coated", "infinite tiling", "herringbone", "architecture", "interior")), + ::anno::thumbnail("./.thumbs/Wood_Tiles_Poplar.Wood_Tiles_Poplar_Herringbone.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Wood_Tiles_Poplar( + wood_color: wood_color, + wood_bump_strength: wood_bump_strength, + floor_brightness: floor_brightness, + wood_brightness_variation: wood_brightness_variation, + wood_random_rotation: wood_random_rotation, + wood_scale: wood_scale, + wood_scale_variation: wood_scale_variation, + + tiles_bump_strength: tiles_bump_strength, + tiles_random_slope_orientation: tiles_random_slope_orientation, + gaps_brightness: gaps_brightness, + tiles_orange_peel_bump_factor: tiles_orange_peel_bump_factor, + coating_reflectivity: coating_reflectivity, + tiles_base_roughness: tiles_base_roughness, + base_roughness_range: base_roughness_range, + dirt_and_spots_amount: dirt_and_spots_amount, + edgewear_roughness_amount: edgewear_roughness_amount, + + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + + round_corners: round_corners, + roundcorner_radius_mm: roundcorner_radius_mm, + across_materials: across_materials, + + preview_wood_highlights: false, + isotropic_roughness: 0.336f, + isotropic_roughness_range: 0.918f, + isotropic_specular_brightness: 0.787f, + wood_specular_level: 1.0f, + aniso_attenuation: 0.484f, + aniso_bsdf_width: 0.443f, + aniso_bsdf_height: 0.631f, + anisotropic_isotropic_balance: 0.434f, + + tex_srgb_wood_color: texture_2d("./poplar_diff.jpg", ::tex::gamma_srgb), + tex_lin_wood_rough_detail: texture_2d("./poplar_rough_detail.jpg", ::tex::gamma_linear), + tex_lin_wood_rough_grain: texture_2d("./poplar_rough_grain.jpg", ::tex::gamma_linear), + tex_lin_wood_detail_norm: texture_2d("./poplar_norm.jpg", ::tex::gamma_linear), + tex_lin_tiles_id_offset_rotation: texture_2d("./herringbone_R_id_G_offs_B_rotation.png", ::tex::gamma_linear), + tex_lin_tiles_edgewear_gaps_gapsrough: texture_2d("./herringbone_R_edgewear_G_gaps_B_gaps_rough.jpg", ::tex::gamma_linear), + tex_lin_tiles_normal: texture_2d("./herringbone_norm.png", ::tex::gamma_linear), + tex_lin_tiles_rough_dents_spots: texture_2d("./tiles_wood_R_rough_G_dents_B_spots.jpg", ::tex::gamma_linear), + tex_lin_tiles_orange_peel: texture_2d("./tiles_wood_orangepeel_norm.jpg", ::tex::gamma_linear) + +); + + +// ****************************************************************************************************** +// 07 + +export material Wood_Tiles_Poplar_Mosaic( + color wood_color = color(0.5f) [[ + ::anno::description("Applies an overlay color to tint the wood. The color is used using the 'overlay' mode as known " + "from paint programs. A gray value of 0.5 has no effect, brighter values brighten it while darker colors will have a darkening effect."), + ::anno::display_name("Wood Color"), + ::anno::in_group("Appearance") + ]], + uniform float wood_bump_strength = 0.2f // Determines the degree of bumpiness"), + [[ + ::anno::display_name("Wood Bump Strength"), + ::anno::description("Adjusts the strength of the wood bump map."), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 2.f) + ]], + float floor_brightness = 0.5f [[ + ::anno::description("Adjusts the general brightness of the wood."), + ::anno::display_name("Floor Brightness"), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float wood_brightness_variation = 0.5f [[ + ::anno::display_name("Wood Brightness Variation"), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float wood_random_rotation = 0.03f [[ + ::anno::display_name("Wood Random Rotation"), + ::anno::description("Adds a random rotation around the main wood tile alignment direction."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + + float2 wood_scale = 1.f [[ + ::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."), + ::anno::display_name("Wood Scale"), + ::anno::in_group("Tiles") + ]], + float wood_scale_variation = 0.f [[ + ::anno::description("Adds random variation to size of the wood in each tile."), + ::anno::display_name("Wood Scale Variation"), + ::anno::in_group("Tiles"), + ::anno::soft_range(0.f, 2.f) + ]], + uniform float tiles_bump_strength = 0.4f [[ + ::anno::description("Determines the degree of bumpiness of the tiles texture (grooves and bent tiles)."), + ::anno::display_name("Tiles Bump Strength"), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float tiles_random_slope_orientation = 0.05f [[ + ::anno::display_name("Tiles Random Slope Orientation"), + ::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."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float gaps_brightness = 0.3f [[ + ::anno::display_name("Gaps Brightness"), + ::anno::description("Adjusts the brightness and roughness of the gaps between the tiles."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float tiles_orange_peel_bump_factor = 0.0f [[ + ::anno::display_name("Coating Unevenness"), + ::anno::description("Applies an unevenness to the clear coat layer akin to orange peel."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float coating_reflectivity = 1.f [[ + ::anno::display_name("Coating Reflectivity"), + ::anno::description("The overall reflectivity of the clearcoat layer. Note that other parameters will show no effect when the clearcoat reflectivity is 0."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + + + float tiles_base_roughness = 0.04f [[ + ::anno::description("Adjusts the roughness of the coating. Higher value leading to blurrier and softer reflections."), + ::anno::display_name("Coating Roughness"), + ::anno::in_group("Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + float base_roughness_range = 0.6f [[ + ::anno::description("Applies roughness variation to the coating, introducing signs of wear such as footprints and smudges."), + ::anno::display_name("Coating Roughness Variation"), + ::anno::in_group("Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_and_spots_amount = 0.0f [[ + ::anno::description("Adds random dirt and spots on top of the surface which adds variation to the clearcoat roughness."), + ::anno::display_name("Dirt and Spots"), + ::anno::in_group("Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + float edgewear_roughness_amount = 0.0f [[ + ::anno::description("Adds edgewear around the tile borders which results in a more worn and rough look of the clearcoat."), + ::anno::display_name("Edgewear Roughness Amount"), + ::anno::in_group("Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + + //----------------------------------------------- + + float2 texture_translate = 0.f [[ + ::anno::display_name("Texture Translate"), + ::anno::description("Controls the position of the texture."), + ::anno::in_group("Transform") + ]], + float texture_rotate = 0.f [[ + ::anno::display_name("Texture Rotate"), + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::in_group("Transform") + ]], + float2 texture_scale = 1.0f [[ + ::anno::display_name("Texture Scale"), + ::anno::description("Larger numbers increase the size."), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::anno::in_group("Transform") + ]], + uniform int uv_space_index = 0 [[ + ::anno::display_name("UV Space Index"), + ::anno::description("Uses selected UV space for material."), + ::anno::in_group("Transform") + ]], + uniform bool round_corners = false [[ + ::anno::display_name("Round Corners"), + ::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."), + ::anno::in_group("Round Corners") + ]], + uniform float roundcorner_radius_mm = 1.5f [[ + ::anno::display_name("Radius (mm)"), + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f) + ]], + uniform bool across_materials = false [[ + ::anno::display_name("Across Materials"), + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::in_group("Round Corners") + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Wood Tiles Poplar - Mosaic"), + ::anno::description(DESCRIPTION), + // reflective, varnished, bumped, matte, natural, stained, exterior, new, aged, decayed, abstract, modern, classic + ::anno::key_words(string[]("wood", "poplar", "tiles", "tiled", "pattern", "decorative", "multimaterial", "organic", "natural", "coated", "infinite tiling", "mosaic", "architecture", "interior")), + ::anno::thumbnail("./.thumbs/Wood_Tiles_Poplar.Wood_Tiles_Poplar_Mosaic.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Wood_Tiles_Poplar( + wood_color: wood_color, + wood_bump_strength: wood_bump_strength, + floor_brightness: floor_brightness, + wood_brightness_variation: wood_brightness_variation, + wood_random_rotation: wood_random_rotation, + wood_scale: wood_scale, + wood_scale_variation: wood_scale_variation, + + tiles_bump_strength: tiles_bump_strength, + tiles_random_slope_orientation: tiles_random_slope_orientation, + gaps_brightness: gaps_brightness, + tiles_orange_peel_bump_factor: tiles_orange_peel_bump_factor, + coating_reflectivity: coating_reflectivity, + tiles_base_roughness: tiles_base_roughness, + base_roughness_range: base_roughness_range, + dirt_and_spots_amount: dirt_and_spots_amount, + edgewear_roughness_amount: edgewear_roughness_amount, + + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + + round_corners: round_corners, + roundcorner_radius_mm: roundcorner_radius_mm, + across_materials: across_materials, + + preview_wood_highlights: false, + isotropic_roughness: 0.336f, + isotropic_roughness_range: 0.918f, + isotropic_specular_brightness: 0.787f, + wood_specular_level: 1.0f, + aniso_attenuation: 0.484f, + aniso_bsdf_width: 0.443f, + aniso_bsdf_height: 0.631f, + anisotropic_isotropic_balance: 0.434f, + + tex_srgb_wood_color: texture_2d("./poplar_diff.jpg", ::tex::gamma_srgb), + tex_lin_wood_rough_detail: texture_2d("./poplar_rough_detail.jpg", ::tex::gamma_linear), + tex_lin_wood_rough_grain: texture_2d("./poplar_rough_grain.jpg", ::tex::gamma_linear), + tex_lin_wood_detail_norm: texture_2d("./poplar_norm.jpg", ::tex::gamma_linear), + tex_lin_tiles_id_offset_rotation: texture_2d("./mosaic_R_id_G_offs_B_rotation.png", ::tex::gamma_linear), + tex_lin_tiles_edgewear_gaps_gapsrough: texture_2d("./mosaic_R_edgewear_G_gaps_B_gaps_rough.jpg", ::tex::gamma_linear), + tex_lin_tiles_normal: texture_2d("./mosaic_norm.png", ::tex::gamma_linear), + tex_lin_tiles_rough_dents_spots: texture_2d("./tiles_wood_R_rough_G_dents_B_spots.jpg", ::tex::gamma_linear), + tex_lin_tiles_orange_peel: texture_2d("./tiles_wood_orangepeel_norm.jpg", ::tex::gamma_linear) + +); + +// ****************************************************************************************************** +// 08 + +export material Wood_Tiles_Poplar_Stackbond( + color wood_color = color(0.5f) [[ + ::anno::description("Applies an overlay color to tint the wood. The color is used using the 'overlay' mode as known " + "from paint programs. A gray value of 0.5 has no effect, brighter values brighten it while darker colors will have a darkening effect."), + ::anno::display_name("Wood Color"), + ::anno::in_group("Appearance") + ]], + uniform float wood_bump_strength = 0.2f // Determines the degree of bumpiness"), + [[ + ::anno::display_name("Wood Bump Strength"), + ::anno::description("Adjusts the strength of the wood bump map."), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 2.f) + ]], + float floor_brightness = 0.5f [[ + ::anno::description("Adjusts the general brightness of the wood."), + ::anno::display_name("Floor Brightness"), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float wood_brightness_variation = 0.5f [[ + ::anno::display_name("Wood Brightness Variation"), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float wood_random_rotation = 0.03f [[ + ::anno::display_name("Wood Random Rotation"), + ::anno::description("Adds a random rotation around the main wood tile alignment direction."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + + float2 wood_scale = 1.f [[ + ::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."), + ::anno::display_name("Wood Scale"), + ::anno::in_group("Tiles") + ]], + float wood_scale_variation = 0.f [[ + ::anno::description("Adds random variation to size of the wood in each tile."), + ::anno::display_name("Wood Scale Variation"), + ::anno::in_group("Tiles"), + ::anno::soft_range(0.f, 2.f) + ]], + uniform float tiles_bump_strength = 0.4f [[ + ::anno::description("Determines the degree of bumpiness of the tiles texture (grooves and bent tiles)."), + ::anno::display_name("Tiles Bump Strength"), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float tiles_random_slope_orientation = 0.05f [[ + ::anno::display_name("Tiles Random Slope Orientation"), + ::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."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float gaps_brightness = 0.3f [[ + ::anno::display_name("Gaps Brightness"), + ::anno::description("Adjusts the brightness and roughness of the gaps between the tiles."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float tiles_orange_peel_bump_factor = 0.0f [[ + ::anno::display_name("Coating Unevenness"), + ::anno::description("Applies an unevenness to the clear coat layer akin to orange peel."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float coating_reflectivity = 1.f [[ + ::anno::display_name("Coating Reflectivity"), + ::anno::description("The overall reflectivity of the clearcoat layer. Note that other parameters will show no effect when the clearcoat reflectivity is 0."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + + + float tiles_base_roughness = 0.04f [[ + ::anno::description("Adjusts the roughness of the coating. Higher value leading to blurrier and softer reflections."), + ::anno::display_name("Coating Roughness"), + ::anno::in_group("Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + float base_roughness_range = 0.6f [[ + ::anno::description("Applies roughness variation to the coating, introducing signs of wear such as footprints and smudges."), + ::anno::display_name("Coating Roughness Variation"), + ::anno::in_group("Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_and_spots_amount = 0.0f [[ + ::anno::description("Adds random dirt and spots on top of the surface which adds variation to the clearcoat roughness."), + ::anno::display_name("Dirt and Spots"), + ::anno::in_group("Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + float edgewear_roughness_amount = 0.0f [[ + ::anno::description("Adds edgewear around the tile borders which results in a more worn and rough look of the clearcoat."), + ::anno::display_name("Edgewear Roughness Amount"), + ::anno::in_group("Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + + //----------------------------------------------- + + float2 texture_translate = 0.f [[ + ::anno::display_name("Texture Translate"), + ::anno::description("Controls the position of the texture."), + ::anno::in_group("Transform") + ]], + float texture_rotate = 0.f [[ + ::anno::display_name("Texture Rotate"), + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::in_group("Transform") + ]], + float2 texture_scale = 1.0f [[ + ::anno::display_name("Texture Scale"), + ::anno::description("Larger numbers increase the size."), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::anno::in_group("Transform") + ]], + uniform int uv_space_index = 0 [[ + ::anno::display_name("UV Space Index"), + ::anno::description("Uses selected UV space for material."), + ::anno::in_group("Transform") + ]], + uniform bool round_corners = false [[ + ::anno::display_name("Round Corners"), + ::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."), + ::anno::in_group("Round Corners") + ]], + uniform float roundcorner_radius_mm = 1.5f [[ + ::anno::display_name("Radius (mm)"), + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f) + ]], + uniform bool across_materials = false [[ + ::anno::display_name("Across Materials"), + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::in_group("Round Corners") + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Wood Tiles Poplar - Stack Bond"), + ::anno::description(DESCRIPTION), + // reflective, varnished, bumped, matte, natural, stained, exterior, new, aged, decayed, abstract, modern, classic + ::anno::key_words(string[]("wood", "poplar", "tiles", "tiled", "pattern", "decorative", "multimaterial", "organic", "natural", "coated", "infinite tiling", "stack", "architecture", "interior")), + ::anno::thumbnail("./.thumbs/Wood_Tiles_Poplar.Wood_Tiles_Poplar_Stackbond.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Wood_Tiles_Poplar( + wood_color: wood_color, + wood_bump_strength: wood_bump_strength, + floor_brightness: floor_brightness, + wood_brightness_variation: wood_brightness_variation, + wood_random_rotation: wood_random_rotation, + wood_scale: wood_scale, + wood_scale_variation: wood_scale_variation, + + tiles_bump_strength: tiles_bump_strength, + tiles_random_slope_orientation: tiles_random_slope_orientation, + gaps_brightness: gaps_brightness, + tiles_orange_peel_bump_factor: tiles_orange_peel_bump_factor, + coating_reflectivity: coating_reflectivity, + tiles_base_roughness: tiles_base_roughness, + base_roughness_range: base_roughness_range, + dirt_and_spots_amount: dirt_and_spots_amount, + edgewear_roughness_amount: edgewear_roughness_amount, + + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + + round_corners: round_corners, + roundcorner_radius_mm: roundcorner_radius_mm, + across_materials: across_materials, + + preview_wood_highlights: false, + isotropic_roughness: 0.336f, + isotropic_roughness_range: 0.918f, + isotropic_specular_brightness: 0.787f, + wood_specular_level: 1.0f, + aniso_attenuation: 0.484f, + aniso_bsdf_width: 0.443f, + aniso_bsdf_height: 0.631f, + anisotropic_isotropic_balance: 0.434f, + + tex_srgb_wood_color: texture_2d("./poplar_diff.jpg", ::tex::gamma_srgb), + tex_lin_wood_rough_detail: texture_2d("./poplar_rough_detail.jpg", ::tex::gamma_linear), + tex_lin_wood_rough_grain: texture_2d("./poplar_rough_grain.jpg", ::tex::gamma_linear), + tex_lin_wood_detail_norm: texture_2d("./poplar_norm.jpg", ::tex::gamma_linear), + tex_lin_tiles_id_offset_rotation: texture_2d("./stackbond_R_id_G_offs_B_rotation.png", ::tex::gamma_linear), + tex_lin_tiles_edgewear_gaps_gapsrough: texture_2d("./stackbond_R_edgewear_G_gaps_B_gaps_rough.jpg", ::tex::gamma_linear), + tex_lin_tiles_normal: texture_2d("./stackbond_norm.png", ::tex::gamma_linear), + tex_lin_tiles_rough_dents_spots: texture_2d("./tiles_wood_R_rough_G_dents_B_spots.jpg", ::tex::gamma_linear), + tex_lin_tiles_orange_peel: texture_2d("./tiles_wood_orangepeel_norm.jpg", ::tex::gamma_linear) + +); + + +// ****************************************************************************************************** +// 09 + +export material Wood_Tiles_Poplar_Versailles( + color wood_color = color(0.5f) [[ + ::anno::description("Applies an overlay color to tint the wood. The color is used using the 'overlay' mode as known " + "from paint programs. A gray value of 0.5 has no effect, brighter values brighten it while darker colors will have a darkening effect."), + ::anno::display_name("Wood Color"), + ::anno::in_group("Appearance") + ]], + uniform float wood_bump_strength = 0.2f // Determines the degree of bumpiness"), + [[ + ::anno::display_name("Wood Bump Strength"), + ::anno::description("Adjusts the strength of the wood bump map."), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 2.f) + ]], + float floor_brightness = 0.5f [[ + ::anno::description("Adjusts the general brightness of the wood."), + ::anno::display_name("Floor Brightness"), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float wood_brightness_variation = 0.5f [[ + ::anno::display_name("Wood Brightness Variation"), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float wood_random_rotation = 0.03f [[ + ::anno::display_name("Wood Random Rotation"), + ::anno::description("Adds a random rotation around the main wood tile alignment direction."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + + float2 wood_scale = 1.f [[ + ::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."), + ::anno::display_name("Wood Scale"), + ::anno::in_group("Tiles") + ]], + float wood_scale_variation = 0.f [[ + ::anno::description("Adds random variation to size of the wood in each tile."), + ::anno::display_name("Wood Scale Variation"), + ::anno::in_group("Tiles"), + ::anno::soft_range(0.f, 2.f) + ]], + uniform float tiles_bump_strength = 0.4f [[ + ::anno::description("Determines the degree of bumpiness of the tiles texture (grooves and bent tiles)."), + ::anno::display_name("Tiles Bump Strength"), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float tiles_random_slope_orientation = 0.05f [[ + ::anno::display_name("Tiles Random Slope Orientation"), + ::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."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float gaps_brightness = 0.3f [[ + ::anno::display_name("Gaps Brightness"), + ::anno::description("Adjusts the brightness and roughness of the gaps between the tiles."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float tiles_orange_peel_bump_factor = 0.0f [[ + ::anno::display_name("Coating Unevenness"), + ::anno::description("Applies an unevenness to the clear coat layer akin to orange peel."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float coating_reflectivity = 1.f [[ + ::anno::display_name("Coating Reflectivity"), + ::anno::description("The overall reflectivity of the clearcoat layer. Note that other parameters will show no effect when the clearcoat reflectivity is 0."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + + + float tiles_base_roughness = 0.04f [[ + ::anno::description("Adjusts the roughness of the coating. Higher value leading to blurrier and softer reflections."), + ::anno::display_name("Coating Roughness"), + ::anno::in_group("Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + float base_roughness_range = 0.6f [[ + ::anno::description("Applies roughness variation to the coating, introducing signs of wear such as footprints and smudges."), + ::anno::display_name("Coating Roughness Variation"), + ::anno::in_group("Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_and_spots_amount = 0.0f [[ + ::anno::description("Adds random dirt and spots on top of the surface which adds variation to the clearcoat roughness."), + ::anno::display_name("Dirt and Spots"), + ::anno::in_group("Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + float edgewear_roughness_amount = 0.0f [[ + ::anno::description("Adds edgewear around the tile borders which results in a more worn and rough look of the clearcoat."), + ::anno::display_name("Edgewear Roughness Amount"), + ::anno::in_group("Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + + //----------------------------------------------- + + float2 texture_translate = 0.f [[ + ::anno::display_name("Texture Translate"), + ::anno::description("Controls the position of the texture."), + ::anno::in_group("Transform") + ]], + float texture_rotate = 0.f [[ + ::anno::display_name("Texture Rotate"), + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::in_group("Transform") + ]], + float2 texture_scale = 1.0f [[ + ::anno::display_name("Texture Scale"), + ::anno::description("Larger numbers increase the size."), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::anno::in_group("Transform") + ]], + uniform int uv_space_index = 0 [[ + ::anno::display_name("UV Space Index"), + ::anno::description("Uses selected UV space for material."), + ::anno::in_group("Transform") + ]], + uniform bool round_corners = false [[ + ::anno::display_name("Round Corners"), + ::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."), + ::anno::in_group("Round Corners") + ]], + uniform float roundcorner_radius_mm = 1.5f [[ + ::anno::display_name("Radius (mm)"), + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f) + ]], + uniform bool across_materials = false [[ + ::anno::display_name("Across Materials"), + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::in_group("Round Corners") + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Wood Tiles Poplar - Versailles"), + ::anno::description(DESCRIPTION), + // reflective, varnished, bumped, matte, natural, stained, exterior, new, aged, decayed, abstract, modern, classic + ::anno::key_words(string[]("wood", "poplar", "tiles", "tiled", "pattern", "decorative", "multimaterial", "organic", "natural", "coated", "infinite tiling", "versailles", "architecture", "interior")), + ::anno::thumbnail("./.thumbs/Wood_Tiles_Poplar.Wood_Tiles_Poplar_Versailles.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Wood_Tiles_Poplar( + wood_color: wood_color, + wood_bump_strength: wood_bump_strength, + floor_brightness: floor_brightness, + wood_brightness_variation: wood_brightness_variation, + wood_random_rotation: wood_random_rotation, + wood_scale: wood_scale, + wood_scale_variation: wood_scale_variation, + + tiles_bump_strength: tiles_bump_strength, + tiles_random_slope_orientation: tiles_random_slope_orientation, + gaps_brightness: gaps_brightness, + tiles_orange_peel_bump_factor: tiles_orange_peel_bump_factor, + coating_reflectivity: coating_reflectivity, + tiles_base_roughness: tiles_base_roughness, + base_roughness_range: base_roughness_range, + dirt_and_spots_amount: dirt_and_spots_amount, + edgewear_roughness_amount: edgewear_roughness_amount, + + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + + round_corners: round_corners, + roundcorner_radius_mm: roundcorner_radius_mm, + across_materials: across_materials, + + preview_wood_highlights: false, + isotropic_roughness: 0.336f, + isotropic_roughness_range: 0.918f, + isotropic_specular_brightness: 0.787f, + wood_specular_level: 1.0f, + aniso_attenuation: 0.484f, + aniso_bsdf_width: 0.443f, + aniso_bsdf_height: 0.631f, + anisotropic_isotropic_balance: 0.434f, + + tex_srgb_wood_color: texture_2d("./poplar_diff.jpg", ::tex::gamma_srgb), + tex_lin_wood_rough_detail: texture_2d("./poplar_rough_detail.jpg", ::tex::gamma_linear), + tex_lin_wood_rough_grain: texture_2d("./poplar_rough_grain.jpg", ::tex::gamma_linear), + tex_lin_wood_detail_norm: texture_2d("./poplar_norm.jpg", ::tex::gamma_linear), + tex_lin_tiles_id_offset_rotation: texture_2d("./versailles_R_id_G_offs_B_rotation.png", ::tex::gamma_linear), + tex_lin_tiles_edgewear_gaps_gapsrough: texture_2d("./versailles_R_edgewear_G_gaps_B_gaps_rough.jpg", ::tex::gamma_linear), + tex_lin_tiles_normal: texture_2d("./versailles_norm.png", ::tex::gamma_linear), + tex_lin_tiles_rough_dents_spots: texture_2d("./tiles_wood_R_rough_G_dents_B_spots.jpg", ::tex::gamma_linear), + tex_lin_tiles_orange_peel: texture_2d("./tiles_wood_orangepeel_norm.jpg", ::tex::gamma_linear) + +); + + +// ****************************************************************************************************** +// 10 + +export material Wood_Tiles_Poplar_Woodstrip( + color wood_color = color(0.5f) [[ + ::anno::description("Applies an overlay color to tint the wood. The color is used using the 'overlay' mode as known " + "from paint programs. A gray value of 0.5 has no effect, brighter values brighten it while darker colors will have a darkening effect."), + ::anno::display_name("Wood Color"), + ::anno::in_group("Appearance") + ]], + uniform float wood_bump_strength = 0.2f // Determines the degree of bumpiness"), + [[ + ::anno::display_name("Wood Bump Strength"), + ::anno::description("Adjusts the strength of the wood bump map."), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 2.f) + ]], + float floor_brightness = 0.5f [[ + ::anno::description("Adjusts the general brightness of the wood."), + ::anno::display_name("Floor Brightness"), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float wood_brightness_variation = 0.5f [[ + ::anno::display_name("Wood Brightness Variation"), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float wood_random_rotation = 0.03f [[ + ::anno::display_name("Wood Random Rotation"), + ::anno::description("Adds a random rotation around the main wood tile alignment direction."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + + float2 wood_scale = 1.f [[ + ::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."), + ::anno::display_name("Wood Scale"), + ::anno::in_group("Tiles") + ]], + float wood_scale_variation = 0.f [[ + ::anno::description("Adds random variation to size of the wood in each tile."), + ::anno::display_name("Wood Scale Variation"), + ::anno::in_group("Tiles"), + ::anno::soft_range(0.f, 2.f) + ]], + uniform float tiles_bump_strength = 0.4f [[ + ::anno::description("Determines the degree of bumpiness of the tiles texture (grooves and bent tiles)."), + ::anno::display_name("Tiles Bump Strength"), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float tiles_random_slope_orientation = 0.05f [[ + ::anno::display_name("Tiles Random Slope Orientation"), + ::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."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float gaps_brightness = 0.3f [[ + ::anno::display_name("Gaps Brightness"), + ::anno::description("Adjusts the brightness and roughness of the gaps between the tiles."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float tiles_orange_peel_bump_factor = 0.0f [[ + ::anno::display_name("Coating Unevenness"), + ::anno::description("Applies an unevenness to the clear coat layer akin to orange peel."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + float coating_reflectivity = 1.f [[ + ::anno::display_name("Coating Reflectivity"), + ::anno::description("The overall reflectivity of the clearcoat layer. Note that other parameters will show no effect when the clearcoat reflectivity is 0."), + ::anno::in_group("Tiles"), + ::anno::hard_range(0.f, 1.f) + ]], + + + float tiles_base_roughness = 0.04f [[ + ::anno::description("Adjusts the roughness of the coating. Higher value leading to blurrier and softer reflections."), + ::anno::display_name("Coating Roughness"), + ::anno::in_group("Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + float base_roughness_range = 0.6f [[ + ::anno::description("Applies roughness variation to the coating, introducing signs of wear such as footprints and smudges."), + ::anno::display_name("Coating Roughness Variation"), + ::anno::in_group("Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + float dirt_and_spots_amount = 0.0f [[ + ::anno::description("Adds random dirt and spots on top of the surface which adds variation to the clearcoat roughness."), + ::anno::display_name("Dirt and Spots"), + ::anno::in_group("Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + float edgewear_roughness_amount = 0.0f [[ + ::anno::description("Adds edgewear around the tile borders which results in a more worn and rough look of the clearcoat."), + ::anno::display_name("Edgewear Roughness Amount"), + ::anno::in_group("Tiles", "Coating"), + ::anno::hard_range(0.f, 1.f) + ]], + + //----------------------------------------------- + + float2 texture_translate = 0.f [[ + ::anno::display_name("Texture Translate"), + ::anno::description("Controls the position of the texture."), + ::anno::in_group("Transform") + ]], + float texture_rotate = 0.f [[ + ::anno::display_name("Texture Rotate"), + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::in_group("Transform") + ]], + float2 texture_scale = 1.0f [[ + ::anno::display_name("Texture Scale"), + ::anno::description("Larger numbers increase the size."), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::anno::in_group("Transform") + ]], + uniform int uv_space_index = 0 [[ + ::anno::display_name("UV Space Index"), + ::anno::description("Uses selected UV space for material."), + ::anno::in_group("Transform") + ]], + uniform bool round_corners = false [[ + ::anno::display_name("Round Corners"), + ::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."), + ::anno::in_group("Round Corners") + ]], + uniform float roundcorner_radius_mm = 1.5f [[ + ::anno::display_name("Radius (mm)"), + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 10.f) + ]], + uniform bool across_materials = false [[ + ::anno::display_name("Across Materials"), + ::anno::description("Applies the round corner effect across different materials when enabled."), + ::anno::in_group("Round Corners") + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Wood Tiles Poplar - Wood Strip"), + ::anno::description(DESCRIPTION), + // reflective, varnished, bumped, matte, natural, stained, exterior, new, aged, decayed, abstract, modern, classic + ::anno::key_words(string[]("wood", "poplar", "tiles", "tiled", "pattern", "decorative", "multimaterial", "organic", "natural", "coated", "infinite tiling", "strip", "architecture", "interior")), + ::anno::thumbnail("./.thumbs/Wood_Tiles_Poplar.Wood_Tiles_Poplar_Woodstrip.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Wood_Tiles_Poplar( + wood_color: wood_color, + wood_bump_strength: wood_bump_strength, + floor_brightness: floor_brightness, + wood_brightness_variation: wood_brightness_variation, + wood_random_rotation: wood_random_rotation, + wood_scale: wood_scale, + wood_scale_variation: wood_scale_variation, + + tiles_bump_strength: tiles_bump_strength, + tiles_random_slope_orientation: tiles_random_slope_orientation, + gaps_brightness: gaps_brightness, + tiles_orange_peel_bump_factor: tiles_orange_peel_bump_factor, + coating_reflectivity: coating_reflectivity, + tiles_base_roughness: tiles_base_roughness, + base_roughness_range: base_roughness_range, + dirt_and_spots_amount: dirt_and_spots_amount, + edgewear_roughness_amount: edgewear_roughness_amount, + + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + + round_corners: round_corners, + roundcorner_radius_mm: roundcorner_radius_mm, + across_materials: across_materials, + + preview_wood_highlights: false, + isotropic_roughness: 0.336f, + isotropic_roughness_range: 0.918f, + isotropic_specular_brightness: 0.787f, + wood_specular_level: 1.0f, + aniso_attenuation: 0.484f, + aniso_bsdf_width: 0.443f, + aniso_bsdf_height: 0.631f, + anisotropic_isotropic_balance: 0.434f, + + tex_srgb_wood_color: texture_2d("./poplar_diff.jpg", ::tex::gamma_srgb), + tex_lin_wood_rough_detail: texture_2d("./poplar_rough_detail.jpg", ::tex::gamma_linear), + tex_lin_wood_rough_grain: texture_2d("./poplar_rough_grain.jpg", ::tex::gamma_linear), + tex_lin_wood_detail_norm: texture_2d("./poplar_norm.jpg", ::tex::gamma_linear), + tex_lin_tiles_id_offset_rotation: texture_2d("./woodstrip_R_id_G_offs_B_rotation.png", ::tex::gamma_linear), + tex_lin_tiles_edgewear_gaps_gapsrough: texture_2d("./woodstrip_R_edgewear_G_gaps_B_gaps_rough.jpg", ::tex::gamma_linear), + tex_lin_tiles_normal: texture_2d("./woodstrip_norm.png", ::tex::gamma_linear), + tex_lin_tiles_rough_dents_spots: texture_2d("./tiles_wood_R_rough_G_dents_B_spots.jpg", ::tex::gamma_linear), + tex_lin_tiles_orange_peel: texture_2d("./tiles_wood_orangepeel_norm.jpg", ::tex::gamma_linear) + +); \ No newline at end of file