diff --git a/code/third_party/vMaterials_2/Carpet/Carpet_Woven.mdl b/code/third_party/vMaterials_2/Carpet/Carpet_Woven.mdl new file mode 100644 index 0000000000000000000000000000000000000000..33e20674b520f4c6f9e71e03593bce9394dcc543 --- /dev/null +++ b/code/third_party/vMaterials_2/Carpet/Carpet_Woven.mdl @@ -0,0 +1,404 @@ +/****************************************************************************** + * 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"; + +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 = 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 Carpet_Woven( + color color_diffuse = color(0.71f) [[ + ::anno::description("Sets the color of the fabric."), + ::anno::display_name("Color"), + ::anno::in_group("Appearance") + ]], + float color_variation = 0.175f [[ + ::anno::description("Increasing this value adds brightness variation to the material."), + ::anno::display_name("Color Variation"), + ::anno::hard_range(0.0, 1.0), + ::anno::in_group("Appearance") + ]], + float roughness = 0.60f [[ + ::anno::description("Increasing this value makes the material appear rougher."), + ::anno::display_name("Roughness"), + ::anno::hard_range(0.0, 1.0), + ::anno::in_group("Appearance") + ]], + float reflectivity = 1.f [[ + ::anno::description("Adjusts how much light is reflected from the material."), + ::anno::display_name("Reflectivity"), + ::anno::hard_range(0.0, 1.0), + ::anno::in_group("Appearance") + ]], + uniform float2 texture_translate = float2(0.f) [[ + ::anno::display_name("Translate"), + ::anno::description("Translates the material."), + ::anno::in_group("Transform") + ]], + uniform float texture_rotate = 0.f [[ + ::anno::display_name("Rotate"), + ::anno::description("Rotates the material."), + ::anno::soft_range(0.0, 360.0), + ::anno::in_group("Transform") + ]], + uniform float2 texture_scale = float2(1.f) [[ + ::anno::display_name("Scale"), + ::anno::description("Scales the material."), + ::nvidia::core_definitions::dimension(float2(1.0, 1.0)), + ::preview_scale(2.0f), + ::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_mm = 0.f [[ + ::anno::description("Radius of the rounded corners."), + ::anno::display_name("Round Corner Radius (mm)"), + ::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 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("Woven Carpet - White"), + ::anno::description("A roughly woven carpet."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Carpet_Woven.Carpet_Woven.png"), + ::anno::key_words(string[]("fabric", "woven", "carpet", "rough", "design", "interior", "floor", "white")) +]] + = + let { + bool tmp0 = false; + material_surface tmp1( + ::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, ::math::pow(histogram_scan_big(float3(::base::file_texture(texture_2d("./textures/carpet_rough_woven_multi_R_rough_G_ao_B_vari.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], ::math::lerp(0.406000018f, 1.f, reflectivity), ::math::lerp(0.721000016f, 0.431000024f, reflectivity)), 2.20000005f), ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(::base::file_texture(texture_2d("./textures/carpet_rough_woven_multi_R_rough_G_ao_B_vari.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.602000058f, 0.867000043f, roughness)) * histogram_range(float3(::base::file_texture(texture_2d("./textures/carpet_rough_woven_multi_R_rough_G_ao_B_vari.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.602000058f, 0.867000043f, roughness)), histogram_range(float3(::base::file_texture(texture_2d("./textures/carpet_rough_woven_multi_R_rough_G_ao_B_vari.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.602000058f, 0.867000043f, roughness)) * histogram_range(float3(::base::file_texture(texture_2d("./textures/carpet_rough_woven_multi_R_rough_G_ao_B_vari.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.602000058f, 0.867000043f, roughness)), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(::nvidia::core_definitions::blend_colors(::nvidia::core_definitions::blend_colors(::base::file_texture(texture_2d("./textures/carpet_rough_woven_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, color_diffuse, ::base::color_layer_multiply, 1.f, true).tint, color(::math::pow(float3(::base::file_texture(texture_2d("./textures/carpet_rough_woven_multi_R_rough_G_ao_B_vari.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 2.20000005f)), ::base::color_layer_overlay, color_variation * 0.699999988f, true).tint, 0.f), bsdf(), ::base::tangent_space_normal_texture(texture_2d("./textures/carpet_rough_woven_norm.jpg", ::tex::gamma_linear), 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), ::base::tangent_space_normal_texture(texture_2d("./textures/carpet_rough_woven_norm.jpg", ::tex::gamma_linear), 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), + 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 * 0.00100000005f, 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 Carpet_Woven_Orange(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Woven Carpet - Orange"), + ::anno::description("A roughly woven carpet."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Carpet_Woven.Carpet_Woven_Orange.png"), + ::anno::key_words(string[]("fabric", "woven", "carpet", "rough", "design", "interior", "floor", "orange", "saturated", "warm")) +]]= Carpet_Woven( + // Appearance + color_diffuse: color(0.673049f, 0.259027f, 0.031551f), + color_variation: 0.175f, + roughness: 0.60f, + reflectivity: 1.0f, + // Transform + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + // Round Corners + enable_round_corners: false, + radius_mm: 1.5f, + across_materials: false, + // Advanced + uv_space_index: 0 +); + +// 3 +export material Carpet_Woven_Cherry_Red(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Woven Carpet - Cherry Red"), + ::anno::description("A roughly woven carpet."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Carpet_Woven.Carpet_Woven_Cherry_Red.png"), + ::anno::key_words(string[]("fabric", "woven", "carpet", "rough", "design", "interior", "floor", "red", "cherry", "saturated", "warm")) +]]= Carpet_Woven( + // Appearance + color_diffuse: color(0.659224f, 0.054592, 0.030257f), + color_variation: 0.175f, + roughness: 0.60f, + reflectivity: 1.0f, + // Transform + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + // Round Corners + enable_round_corners: false, + radius_mm: 1.5f, + across_materials: false, + // Advanced + uv_space_index: 0 +); + +// 4 +export material Carpet_Woven_Bordeaux(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Woven Carpet - Bordeaux"), + ::anno::description("A roughly woven carpet."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Carpet_Woven.Carpet_Woven_Bordeaux.png"), + ::anno::key_words(string[]("fabric", "woven", "carpet", "rough", "design", "interior", "floor", "red", "bordeaux", "saturated", "warm")) +]]= Carpet_Woven( + // Appearance + color_diffuse: color(0.363604f, 0.016068f, 0.086901f), + color_variation: 0.175f, + roughness: 0.60f, + reflectivity: 1.0f, + // Transform + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + // Round Corners + enable_round_corners: false, + radius_mm: 1.5f, + across_materials: false, + // Advanced + uv_space_index: 0 +); + +// 5 +export material Carpet_Woven_Green(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Woven Carpet - Green"), + ::anno::description("A roughly woven carpet."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Carpet_Woven.Carpet_Woven_Green.png"), + ::anno::key_words(string[]("fabric", "woven", "carpet", "rough", "design", "interior", "floor", "green", "light")) +]]= Carpet_Woven( + // Appearance + color_diffuse: color(0.259027f, 0.529523f, 0.034230f), + color_variation: 0.175f, + roughness: 0.60f, + reflectivity: 1.0f, + // Transform + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + // Round Corners + enable_round_corners: false, + radius_mm: 1.5f, + across_materials: false, + // Advanced + uv_space_index: 0 +); + + +// 6 +export material Carpet_Woven_Dark_Blue_Gray(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Woven Carpet - Dark Blue Gray"), + ::anno::description("A roughly woven carpet."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Carpet_Woven.Carpet_Woven_Dark_Blue_Gray.png"), + ::anno::key_words(string[]("fabric", "woven", "carpet", "rough", "design", "interior", "floor", "blue", "dark", "cool")) +]]= Carpet_Woven( + // Appearance + color_diffuse: color(0.025371f, 0.058187f, 0.130352f), + color_variation: 0.175f, + roughness: 0.60f, + reflectivity: 1.0f, + // Transform + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + // Round Corners + enable_round_corners: false, + radius_mm: 1.5f, + across_materials: false, + // Advanced + uv_space_index: 0 +); + + +// 7 +export material Carpet_Woven_Sky_Blue(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Woven Carpet - Sky Blue"), + ::anno::description("A roughly woven carpet."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Carpet_Woven.Carpet_Woven_Sky_Blue.png"), + ::anno::key_words(string[]("fabric", "woven", "carpet", "rough", "design", "interior", "floor", "blue", "sky", "cool")) +]]= Carpet_Woven( + // Appearance + color_diffuse: color(0.069727f, 0.344026f, 0.632043f), + color_variation: 0.175f, + roughness: 0.60f, + reflectivity: 1.0f, + // Transform + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + // Round Corners + enable_round_corners: false, + radius_mm: 1.5f, + across_materials: false, + // Advanced + uv_space_index: 0 +); diff --git a/code/third_party/vMaterials_2/Carpet/Fabric_Carpet_Long_Floor.mdl b/code/third_party/vMaterials_2/Carpet/Fabric_Carpet_Long_Floor.mdl new file mode 100644 index 0000000000000000000000000000000000000000..eddd5c0d78ed8e00c0e0fe58e1341e47f9a4bed4 --- /dev/null +++ b/code/third_party/vMaterials_2/Carpet/Fabric_Carpet_Long_Floor.mdl @@ -0,0 +1,490 @@ +/****************************************************************************** + * 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 floor carpet material with long hair fibers."; + + + +float remap(float input, float low, float high) +{ + //return low + input * (high - low); + return ::math::lerp(low, high, input); +} + +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_pos_range(float input, float range, float position) +{ + float range_half = range/2.0; + float subtract_low = (position + range_half) > 1.0 ? (position + range/2.0) - 1.0 : 0.0; + float low = position - range_half - subtract_low; + + float add_high = (position - range_half) < 0.0 ? ::math::abs(position - range_half) : 0.0; + float high = position + range_half + add_high; + return remap(input, low, high); +} + +::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_Carpet_Long_Floor( + uniform bool infinite_tiling = true [[ + ::anno::description("Enables the infinite tiling feature which removes artifacts of repeating texture patterns."), + ::anno::display_name("Infinite Tiling"), + ::anno::in_group("Appearance") + ]], + color carpet_color = color(1.f, 1.f, 1.f) [[ + ::anno::description("Adjusts the overall color of the carpet."), + ::anno::display_name("Carpet Color"), + ::anno::in_group("Appearance") + ]], + float ao_amount = 0.5f [[ + ::anno::description("Produces a more contrasted appearance while also darkening the overall appearance."), + ::anno::display_name("Carpet Contrast"), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance") + ]], + float carpet_bump_factor = 1.f [[ + ::anno::description("Adjusts the bump factor of the material."), + ::anno::display_name("Carpet Bump Factor"), + ::anno::soft_range(0.0, 1.0), + ::anno::in_group("Appearance") + ]], + uniform float2 texture_translate = float2(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 = float2(1.0f) [[ + ::anno::description("Scales the material."), + ::anno::display_name("Scale"), + ::nvidia::core_definitions::dimension(float2(1.0, 1.0)), + ::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("Long Floor Carpet - Natural"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Fabric_Carpet_Long_Floor.Fabric_Carpet_Long_Floor.png"), + ::anno::key_words(string[]("carpet", "floor", "interior", "soft", "fabric", "long", "natural", "neutral")) +]] + = + let { + bool tmp0 = false; + + float2 corrected_scale = 0.33 * texture_scale; + + material_surface tmp1( + ::df::custom_curve_layer(0.0780000016f, 0.606000006f, 5.f, ::math::pow(::math::clamp(remap(float3(infinite_tiling ? endless_texture(texture_2d("./textures/long_floor_carpet_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, corrected_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.838999987f, 0.68f, 1.f), 8.f, false) : ::base::file_texture(texture_2d("./textures/long_floor_carpet_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, corrected_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, 0.653000057f, 0.f, 1.f), 0.f, 1.f), 2.20000005f), ::df::microfacet_ggx_smith_bsdf(histogram_pos_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/long_floor_carpet_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, corrected_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.838999987f, 0.68599999f, 1.f), 8.f, false) : ::base::file_texture(texture_2d("./textures/long_floor_carpet_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, corrected_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.830000043f, 0.745000064f) * histogram_pos_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/long_floor_carpet_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, corrected_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.838999987f, 0.68599999f, 1.f), 8.f, false) : ::base::file_texture(texture_2d("./textures/long_floor_carpet_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, corrected_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.830000043f, 0.745000064f), histogram_pos_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/long_floor_carpet_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, corrected_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.838999987f, 0.68599999f, 1.f), 8.f, false) : ::base::file_texture(texture_2d("./textures/long_floor_carpet_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, corrected_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.830000043f, 0.745000064f) * histogram_pos_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/long_floor_carpet_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, corrected_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.838999987f, 0.68599999f, 1.f), 8.f, false) : ::base::file_texture(texture_2d("./textures/long_floor_carpet_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, corrected_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.830000043f, 0.745000064f), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(::nvidia::core_definitions::blend_colors(::nvidia::core_definitions::blend_colors(carpet_color, infinite_tiling ? endless_texture(texture_2d("./textures/long_floor_carpet_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, corrected_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.596000016f, 0.549000025f, 0.493999988f), 8.f, true) : ::base::file_texture(texture_2d("./textures/long_floor_carpet_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, corrected_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, ::base::color_layer_multiply, 1.f).tint, color(::math::pow(::math::clamp(remap(float3(infinite_tiling ? endless_texture(texture_2d("./textures/long_floor_carpet_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, corrected_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.838999987f, 0.68599999f, 1.f), 8.f, false) : ::base::file_texture(texture_2d("./textures/long_floor_carpet_multi_R_rough_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, corrected_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, 0.736000061f, ::math::lerp(1.f, 0.349999994f, ao_amount), 1.f), 0.f, 1.f), 2.20000005f)), ::base::color_layer_multiply, 1.f).tint, 0.f, ""), ::state::normal()), + 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("./textures/long_floor_carpet_norm.jpg", ::tex::gamma_linear), 1.f, false, false, vmat_transform(texture_translate, texture_rotate, corrected_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.5f, 0.5f, 1.f), 8.f) : normalmap_normal(texture_2d("./textures/long_floor_carpet_norm.jpg", ::tex::gamma_linear), ::math::lerp(0.f, 0.699999988f, carpet_bump_factor), vmat_transform(texture_translate, texture_rotate, corrected_scale, ::base::texture_coordinate_uvw, uv_space_index))); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + +export material Fabric_Carpet_Long_Floor_Blue(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Long Floor Carpet - Blue"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Fabric_Carpet_Long_Floor.Fabric_Carpet_Long_Floor_Blue.png"), + ::anno::key_words(string[]("carpet", "floor", "interior", "soft", "fabric", "long", "blue", "cool")) +]] + = Fabric_Carpet_Long_Floor( + infinite_tiling: true, + carpet_color: color(0.160444f, 0.547994f, .9f), + ao_amount: 0.8f, + carpet_bump_factor: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0), + uv_space_index: 0 +); + +export material Fabric_Carpet_Long_Floor_Rose(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Long Floor Carpet - Rose"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Fabric_Carpet_Long_Floor.Fabric_Carpet_Long_Floor_Rose.png"), + ::anno::key_words(string[]("carpet", "floor", "interior", "soft", "fabric", "long", "rose", "warm")) +]] + = Fabric_Carpet_Long_Floor( + infinite_tiling: true, + carpet_color: color(0.744530f, 0.378676f, 0.715465f), + ao_amount: 0.8f, + carpet_bump_factor: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0), + uv_space_index: 0 +); + + +export material Fabric_Carpet_Long_Floor_Light_Green(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Long Floor Carpet - Light Green"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Fabric_Carpet_Long_Floor.Fabric_Carpet_Long_Floor_Light_Green.png"), + ::anno::key_words(string[]("carpet", "floor", "interior", "soft", "fabric", "long", "green", "light")) +]] + = Fabric_Carpet_Long_Floor( + infinite_tiling: true, + carpet_color: color(0.505432f, 0.827726f, 0.133209f), + ao_amount: 0.8f, + carpet_bump_factor: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Fabric_Carpet_Long_Floor_Yellow(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Long Floor Carpet - Yellow"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Fabric_Carpet_Long_Floor.Fabric_Carpet_Long_Floor_Yellow.png"), + ::anno::key_words(string[]("carpet", "floor", "interior", "soft", "fabric", "long", "yellow", "warm")) +]] + = Fabric_Carpet_Long_Floor( + infinite_tiling: true, + carpet_color: color(0.907547f, 0.907547f, 0.180144f), + ao_amount: 0.8f, + carpet_bump_factor: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Fabric_Carpet_Long_Floor_Orange(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Long Floor Carpet - Orange"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Fabric_Carpet_Long_Floor.Fabric_Carpet_Long_Floor_Orange.png"), + ::anno::key_words(string[]("carpet", "floor", "interior", "soft", "fabric", "long", "orange", "warm")) +]] + = Fabric_Carpet_Long_Floor( + infinite_tiling: true, + carpet_color: color(0.907547f, 0.293216f, 0.084642f), + ao_amount: 0.8f, + carpet_bump_factor: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Fabric_Carpet_Long_Floor_Green(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Long Floor Carpet - Green"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Fabric_Carpet_Long_Floor.Fabric_Carpet_Long_Floor_Green.png"), + ::anno::key_words(string[]("carpet", "floor", "interior", "soft", "fabric", "long", "green")) +]] + = Fabric_Carpet_Long_Floor( + infinite_tiling: true, + carpet_color: color(0.267358f, 0.464741f, 0.051122f), + ao_amount: 0.8f, + carpet_bump_factor: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Fabric_Carpet_Long_Floor_Bordeaux(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Long Floor Carpet - Bordeaux"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Fabric_Carpet_Long_Floor.Fabric_Carpet_Long_Floor_Bordeaux.png"), + ::anno::key_words(string[]("carpet", "floor", "interior", "soft", "fabric", "long", "bordeaux", "red", "warm")) +]] + = Fabric_Carpet_Long_Floor( + infinite_tiling: true, + carpet_color: color(0.618686f, 0.017936f, 0.141980f), + ao_amount: 0.8f, + carpet_bump_factor: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + diff --git a/code/third_party/vMaterials_2/Carpet/Rug_Carpet.mdl b/code/third_party/vMaterials_2/Carpet/Rug_Carpet.mdl new file mode 100644 index 0000000000000000000000000000000000000000..b8a11a03d8be085d86773cff46e327ef52a97b73 --- /dev/null +++ b/code/third_party/vMaterials_2/Carpet/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 = float2(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 = float2(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 = float2(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("./textures/rug_carpet_multi_fibers.jpg", ::tex::gamma_linear), + uniform texture_2d rug_aniso = texture_2d("./textures/rug_carpet_anisotropy.jpg", ::tex::gamma_linear), + uniform texture_2d rug_multi_R_rough_G_ao_B_patternao = texture_2d("./textures/rug_carpet_01_multi_R_rough_G_ao_B_bumpao.jpg", ::tex::gamma_linear), + uniform texture_2d rug_normal = texture_2d("./textures/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), float2(1.f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint, 2.20000005f)).x, true).tint, hsl2rgb(float3(rgb2hsl(float3(carpet_color)).x, rgb2hsl(float3(carpet_color)).y * 0.5f, remap(rgb2hsl(float3(carpet_color)).z, 0.519999981f, 1.f))), ::base::color_layer_blend, float3(::math::pow(::base::file_texture(rug_fibers, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index), float2(1.f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint, 2.20000005f)).y, true).tint, hsl2rgb(float3(rgb2hsl(float3(carpet_color)).x, rgb2hsl(float3(carpet_color)).y, remap(rgb2hsl(float3(carpet_color)).z, 0.5f, 1.f))), ::base::color_layer_blend, float3(::math::pow(::base::file_texture(rug_fibers, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index), float2(1.f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint, 2.20000005f)).z, true).tint, color(float3(::base::file_texture(rug_multi_R_rough_G_ao_B_patternao, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).z), ::base::color_layer_multiply, pattern_AO, true).tint, color(float3(::base::file_texture(rug_multi_R_rough_G_ao_B_patternao, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).y), ::base::color_layer_multiply, 0.550000012f, true).tint, 0.f), bsdf(), normalmap_normal(rug_normal, bump_strength, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index))), normalmap_normal(rug_normal, bump_strength, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index))), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + 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 = float2(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 = float2(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("./textures/rug_carpet_multi_fibers.jpg", ::tex::gamma_linear), + rug_aniso: texture_2d("./textures/rug_carpet_anisotropy.jpg", ::tex::gamma_linear), + rug_multi_R_rough_G_ao_B_patternao: texture_2d("./textures/rug_carpet_01_multi_R_rough_G_ao_B_bumpao.jpg", ::tex::gamma_linear), + rug_normal: texture_2d("./textures/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 = float2(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 = float2(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("./textures/rug_carpet_multi_fibers.jpg", ::tex::gamma_linear), + rug_aniso: texture_2d("./textures/rug_carpet_anisotropy.jpg", ::tex::gamma_linear), + rug_multi_R_rough_G_ao_B_patternao: texture_2d("./textures/rug_carpet_02_multi_R_rough_G_ao_B_bumpao.jpg", ::tex::gamma_linear), + rug_normal: texture_2d("./textures/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 = float2(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 = float2(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("./textures/rug_carpet_multi_fibers.jpg", ::tex::gamma_linear), + rug_aniso: texture_2d("./textures/rug_carpet_anisotropy.jpg", ::tex::gamma_linear), + rug_multi_R_rough_G_ao_B_patternao: texture_2d("./textures/rug_carpet_03_multi_R_rough_G_ao_B_bumpao.jpg", ::tex::gamma_linear), + rug_normal: texture_2d("./textures/rug_carpet_03_norm.jpg", ::tex::gamma_linear) +); + + + + + + + + + + + + + + + + + + + + diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..d0c1314e3720aeb029f202f4a0df628f0ea0189a --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c36c403b456bb0b6d5138b34e2900fbd18c9cb91a4d5bef4aab40899b3ef1593 +size 87730 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting.png new file mode 100644 index 0000000000000000000000000000000000000000..d0c1314e3720aeb029f202f4a0df628f0ea0189a --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c36c403b456bb0b6d5138b34e2900fbd18c9cb91a4d5bef4aab40899b3ef1593 +size 87730 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Amazon_Clay.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Amazon_Clay.png new file mode 100644 index 0000000000000000000000000000000000000000..318265abcdc22a272bffeecf9b294cb6d42e3fc2 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Amazon_Clay.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a1cb2434e3eb3f61a710acf3a384cd19d8ffd6b4107d6e86353ea710aa21c6c9 +size 80134 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Ash_Brown.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Ash_Brown.png new file mode 100644 index 0000000000000000000000000000000000000000..d7f085bf1d31bf778661489178f349eba1c692cb --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Ash_Brown.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dd769c5c84777dda911320c1a70f5b351c2b9d707fb213e42c2d3b35e5013254 +size 78244 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Autumn.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Autumn.png new file mode 100644 index 0000000000000000000000000000000000000000..6516f846de028a8a8c3a4449ce988f88f9430439 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Autumn.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2cc9a3545ff7119738c983c980a23e032b1ba8f450bfdfa4f1974dc8d7d7f679 +size 91415 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Black.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Black.png new file mode 100644 index 0000000000000000000000000000000000000000..8e3b35363779cb56c319ac84940b87e68a22d6b2 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Black.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4348250afc13d70fc37c132bb7ccb8961191767002be30cb4ca627a8043ff26d +size 75400 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Burgundy.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Burgundy.png new file mode 100644 index 0000000000000000000000000000000000000000..0643162fc300a9513da40d73deebd23e873a8b27 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Burgundy.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:759c87275bf896bf3ce4d8252dd2fde42878fa0481f1ad3ce784bda7ab80ecb4 +size 86300 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Champagne.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Champagne.png new file mode 100644 index 0000000000000000000000000000000000000000..5619e1464ceae5b8f32ce4790e4f0b895ed99449 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Champagne.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ff84886757f9606840f94b8a90a9f8fb2c04a9d9d11f2f70493e73b4df8bb362 +size 87523 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Chocolate.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Chocolate.png new file mode 100644 index 0000000000000000000000000000000000000000..2a78f2f9664918e485d007563c919c2c57cdf8ad --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Chocolate.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:661d44ca7e86e684a04ff4fe0c6b34b0be1c7e57267afb8588b3ac2756f228a2 +size 82923 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Crimson.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Crimson.png new file mode 100644 index 0000000000000000000000000000000000000000..ebc4dea060478ff327648a5c597e31a277907a7d --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Crimson.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d28e549df3d2a7f312fc4f883b12107d0dc9e35556fdfce2b0c1acf646547794 +size 89807 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Electric.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Electric.png new file mode 100644 index 0000000000000000000000000000000000000000..89822d78822173b710e0210b34507724e257a071 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Electric.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:21e0b706a56080e17296a99af5a5b2dba23f78e23cdf175d50b1c6330e4c8c89 +size 91821 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Flaxen.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Flaxen.png new file mode 100644 index 0000000000000000000000000000000000000000..5ab4515f1999c65795b5532325a122899dfe37dd --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Flaxen.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:89d11c663515a847599f8fd012e009b2463e13fd05758f5231069779d64544ab +size 90474 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Lavender.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Lavender.png new file mode 100644 index 0000000000000000000000000000000000000000..e66d853086af6b9a96f3e8144184216c0f9dc5ad --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Lavender.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a595e267c71cc66b23052e104e0f89d5fb3958969dccd00adb1e40e0a2f7da6e +size 88326 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Mint.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Mint.png new file mode 100644 index 0000000000000000000000000000000000000000..c5a454df74bc4303a6d473632ccee95af7fda784 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Mint.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2cf2c09658eb077690d0d74b4819ab5c2b13b8d232b949ef899855a874b4c31a +size 87303 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Mustard.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Mustard.png new file mode 100644 index 0000000000000000000000000000000000000000..e28ccb9695d7bfca88deb2b620dadf725111e690 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Mustard.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:459473432193f45f7fd8a65669593171d394be382f3989a9d18c749fec5b8fe0 +size 92742 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Olive.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Olive.png new file mode 100644 index 0000000000000000000000000000000000000000..29d896c2278eaeb40043ddbecbff5c712bbca35b --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Olive.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:79a71517149613a63d90d3ad99ca9accd94ec9fc79a89691088414884916a6c1 +size 80905 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Potters_Clay.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Potters_Clay.png new file mode 100644 index 0000000000000000000000000000000000000000..2becf5775694befc02bb47c1114c890992ecd9e9 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Potters_Clay.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4d9a701e53266e74f354eee49106d08fe99a36428220735951d46dce62a9296b +size 86937 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Purple.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Purple.png new file mode 100644 index 0000000000000000000000000000000000000000..c63a21e12bdd2d5630485aeedc283bda241f5cd5 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Purple.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:11b48f5e13337f17acb6b686b776f8797a58fcd986d26514441d1373e1e2fb55 +size 87406 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Rose.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Rose.png new file mode 100644 index 0000000000000000000000000000000000000000..1049b9b0597d824a2f75e965b5b8e232ec7e04ec --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Rose.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a7844c39742d199aa6c9bd28341313baf87e8c5da592e252539732c8c19c1f02 +size 93107 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Rosy_Peach.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Rosy_Peach.png new file mode 100644 index 0000000000000000000000000000000000000000..d9eef945e55cf3f117c30337e429838157681fc9 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Rosy_Peach.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8d3518fb1e8e23147dd6394b08a8d008bb01cf2615cc1c5ce280c1785e676332 +size 89892 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Silver.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Silver.png new file mode 100644 index 0000000000000000000000000000000000000000..c20e2ce7fe4551bcbe2a619a02cf5fbfdf5bdd39 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Silver.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aba8f8bee918c9e32c85852ef39d1209c7cb16702a308b33c9b19aaa69929648 +size 85992 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Sky_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Sky_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..3f1d09dba132862b29df5cf20d363b1210858e04 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Sky_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:79365652a491901bdf7581a86d7a3ca908cc3fcd7385cc66ea539e8e8c2978d1 +size 89839 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Smoke.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Smoke.png new file mode 100644 index 0000000000000000000000000000000000000000..e283906e46709c6ddde8960b1e6fe21303362a6d --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Smoke.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8a65c6f0e5b0f21b785ce1e9a65f9a6ab6805f4cb7adb53c3e2765a2f72f16ff +size 82665 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Teal.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Teal.png new file mode 100644 index 0000000000000000000000000000000000000000..9f8ae361270708097beb6b1c9716f03466dd2390 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cashmere_Wool_Suiting.mdl@Cashmere_Wool_Suiting_Teal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:78bbaa11db2da3af6144b55db1f300518af1122f70dc579eb705e0d838a311bf +size 83648 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..fb12e3d770fe5d961e21a5494e4fd144de8f7ff4 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1ef1c26afe35ad0cb917e97727148110651527d14e2ded6dbeccb027ba8d3522 +size 104673 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl@Cotton_Denim.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl@Cotton_Denim.png new file mode 100644 index 0000000000000000000000000000000000000000..fb12e3d770fe5d961e21a5494e4fd144de8f7ff4 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl@Cotton_Denim.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1ef1c26afe35ad0cb917e97727148110651527d14e2ded6dbeccb027ba8d3522 +size 104673 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl@Cotton_Denim_Black.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl@Cotton_Denim_Black.png new file mode 100644 index 0000000000000000000000000000000000000000..edf1d04064c76d57cd723576128b793a9860fe6c --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl@Cotton_Denim_Black.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:686a61a2ce698c6f911f72b0d205ec6830db8f4aa218fb8fca8f4e7a28ad9469 +size 100755 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl@Cotton_Denim_Bleached_Light_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl@Cotton_Denim_Bleached_Light_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..8db63519ec0275061c3220de22b57b8a3052ee7e --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl@Cotton_Denim_Bleached_Light_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:892881d316288e3991ef3b5151acab3cdeaca07ceb3489b59dff4f2779799c5a +size 110097 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl@Cotton_Denim_Carbon.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl@Cotton_Denim_Carbon.png new file mode 100644 index 0000000000000000000000000000000000000000..f2b2efcc8f0f87492d5d71f25b9ba253d7c0dda0 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl@Cotton_Denim_Carbon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eae70d67b4575bcfb174a1d4e5d7c4ded3df69738d291a8dd94e742af21c0a06 +size 99394 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl@Cotton_Denim_Independence_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl@Cotton_Denim_Independence_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..c688edc8515534418be28641fd06b00108b72a58 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl@Cotton_Denim_Independence_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:976a9cfe26190cb4850db2597c4849f0ca0b5b8aec976ea4ededc76a24e05d37 +size 101164 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl@Cotton_Denim_Light_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl@Cotton_Denim_Light_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..05fb6ebb8ec13f1560362362336450b0b5a83a3f --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl@Cotton_Denim_Light_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c956d7f17710bd0a582f44b7012c84eb366586b8dc0720d14007a0603ad293dd +size 107884 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl@Cotton_Denim_Washed_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl@Cotton_Denim_Washed_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..e0bea73d3f4c86c2883f6150e6ff5dba88a6efb6 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Denim.mdl@Cotton_Denim_Washed_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f1725e4dc9b590dd70d83eeab068ba12a50303b4975f31b509d1126184268af2 +size 109135 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..2d83f6e9b618f7480493ebf0d124882f8783e203 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d2ad70013d2ac91ac68441d5ed870b36c71602a1d43076f0d221ce7539dfb434 +size 91955 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry.png new file mode 100644 index 0000000000000000000000000000000000000000..2d83f6e9b618f7480493ebf0d124882f8783e203 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d2ad70013d2ac91ac68441d5ed870b36c71602a1d43076f0d221ce7539dfb434 +size 91955 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Brown.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Brown.png new file mode 100644 index 0000000000000000000000000000000000000000..d64ed87311cd08ad503176e64e661398b13ec2de --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Brown.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6eeaeb2d756c138cc53b7be41a6810a5684f8fa2d80089d6fda27a87c34b4013 +size 83272 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Burgundy.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Burgundy.png new file mode 100644 index 0000000000000000000000000000000000000000..57f6c7834d8a00ac28b3dafdbfc387e01f6b8f78 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Burgundy.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3139ab5592e83d1cc9cee09be417cbc032601f32bcf1b6ad2fd8de5421aedf20 +size 81066 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Dark_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Dark_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..f18aa28028ffdb1cfce07fa3ed748541d9ef61f1 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Dark_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d8641942218b943da251ac408f9b27d94084215ade5d5340cfd99a912c1c1e4b +size 78697 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Dark_Gray.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Dark_Gray.png new file mode 100644 index 0000000000000000000000000000000000000000..32385a477d6fc52c5ad00e36239bc4ce42df2afa --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Dark_Gray.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f640f6220775405e0beadc4d8872804669504700c99e589d49e5471a67565345 +size 71384 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Electric_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Electric_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..8c8353efd690e7e0186e1786a2d8a3dd1d67df0b --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Electric_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dac9972f25be4fec8568228fdbb89db2ec08f39178cb675a1f457df343e2b39e +size 91218 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Fox_Red.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Fox_Red.png new file mode 100644 index 0000000000000000000000000000000000000000..86bc208461d832d9c4ffaffce2b504d906bbeddd --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Fox_Red.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cc8e22a031e19a4091e7924d4fa5f38738ec647a91982c90ad818c5bbb72810d +size 86036 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Fuchsia.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Fuchsia.png new file mode 100644 index 0000000000000000000000000000000000000000..dcc2f3fbd45471848f5167435c9699b322682e67 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Fuchsia.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:47d462ccecf056e1a45e15b5200238f4b21eeaadb55266f9f9edcd6389e27c36 +size 90293 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Gray.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Gray.png new file mode 100644 index 0000000000000000000000000000000000000000..73f9192bf080c064239308e33d3e5f1ee209d9c4 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Gray.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0acdb6d2233be824e67f5d57042bbe990ed8ebc43dc4190d00b0d900d9d56962 +size 87068 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Harbor_Gray.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Harbor_Gray.png new file mode 100644 index 0000000000000000000000000000000000000000..d82918f128ce730d461a7d499918731843760c4f --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Harbor_Gray.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d3d6933e6d3ee8b5076e8941b44efb713858b314a6cf6f67f65c02f055b3ab8f +size 87439 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Mid_Gray.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Mid_Gray.png new file mode 100644 index 0000000000000000000000000000000000000000..ad1c8db4f22acbe44f0083b417b13e5e039d8399 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Mid_Gray.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1e553bd8bc485071d7eed438d41a0dc562c899dc90b1141f2efa8e8284434e09 +size 75742 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Olive_Green.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Olive_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..9756d544e267401a0b41c26d58cace0d432dcb0c --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Olive_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c43ff6bcbe955e66c7e5137b172b22de2a0200a2348150267292fd0b75443f08 +size 79675 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Petrol.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Petrol.png new file mode 100644 index 0000000000000000000000000000000000000000..4f7db8d6821a56d7616314d320afb222b58b6d6b --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Petrol.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f45fb4dacec0324457567bc2215f0ca1d540e516a2de2ed94e79cd1d6a40fc93 +size 86595 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Saffron.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Saffron.png new file mode 100644 index 0000000000000000000000000000000000000000..bd626e5b964e0763bd85dbd0f65154d772db4c11 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Saffron.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e5abaf30e856e1a5c1b59a4362c1b6710f92e25b6014e938850290c051a66d04 +size 89134 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Sand.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Sand.png new file mode 100644 index 0000000000000000000000000000000000000000..95ed4a4628d611dd2a5f123166b7fe871dcc9c60 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Sand.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b85472a246760b4e32fc848f9a02d585d2ffc3d67b7caea5bf390305fe9f6d02 +size 89433 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Shrimp.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Shrimp.png new file mode 100644 index 0000000000000000000000000000000000000000..e1070027edfafe155ca30ce23dc69c969ab4c49a --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Shrimp.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c08e103f5c8349acbebf3838e067abc11e2db2c37feccba6527a136209b619f1 +size 90177 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Terracotta.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Terracotta.png new file mode 100644 index 0000000000000000000000000000000000000000..7dc65083354e3f45c4504f56f4d3a5916c71a57f --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_French_Terry.mdl@Cotton_French_Terry_Terracotta.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:795941e3c2e7682da099beb4f70ab9b7253a93052bbaf635ad327517dc06bdba +size 90569 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..d88e79099c2e078f3d7922607f6e52d515971787 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2e3d8faba587fcfd2ccf557eaee598fb83659c68b8c6494e0c80b49afb2b8222 +size 102236 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford.png new file mode 100644 index 0000000000000000000000000000000000000000..d88e79099c2e078f3d7922607f6e52d515971787 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2e3d8faba587fcfd2ccf557eaee598fb83659c68b8c6494e0c80b49afb2b8222 +size 102236 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Blue_Jay.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Blue_Jay.png new file mode 100644 index 0000000000000000000000000000000000000000..d8efd8db82d42dc1eb9ce21b3019ead66f69adb3 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Blue_Jay.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2e4e096c239e7c2f24660a12f2d8be11ff4bfdf6d9a9441c4dce509f87a5b722 +size 108516 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Carbon.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Carbon.png new file mode 100644 index 0000000000000000000000000000000000000000..1006bb05698f7444247e9ed38b31424c8c9c62b8 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Carbon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:747d53d06c8676b6d3576b94fbc885146ddd3011811ecb854067541c731182f1 +size 89697 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Coffee_Bean.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Coffee_Bean.png new file mode 100644 index 0000000000000000000000000000000000000000..e816049d4c0240653d861aa4facdebe6674bb61a --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Coffee_Bean.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eb34a3eed7f391e6552a6c68f7e0fa6ac0657004f9f1ba5e532499592c1b0f9d +size 92696 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Fog.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Fog.png new file mode 100644 index 0000000000000000000000000000000000000000..3433c0cf77024524f0a349277802e985b7849c16 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Fog.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1b4f4e2c7730a578526a54686d6a9f1b34989407e7c117cee45fc3f750d50f4e +size 112026 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Fuchsia.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Fuchsia.png new file mode 100644 index 0000000000000000000000000000000000000000..12861a1f2bd0e582f4b5bda9313df0aacf40fa5e --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Fuchsia.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de4bc428c9cafaea75dbeae346cce47ce49f46c345027c0f658dbbd89db2e94b +size 111628 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Garnet.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Garnet.png new file mode 100644 index 0000000000000000000000000000000000000000..83e4d66223aaa455f98b90557696313fddffbf0c --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Garnet.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1d6cd63d34def1d519c30a2dfb91c20bbc893f0c297ee56d70eacc3a596ecc49 +size 108561 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Green_Tea.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Green_Tea.png new file mode 100644 index 0000000000000000000000000000000000000000..6118b74905ef0fb574c9cb60d65d2fff7a69e5c8 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Green_Tea.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fee0a38a72bf938f92d2ce74a678c8393eef995a9972b3460ca8df3fe97c344d +size 110115 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Ink.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Ink.png new file mode 100644 index 0000000000000000000000000000000000000000..2a431f753d0ef6271bc6f0deaed8486b54831037 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Ink.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:70cb7f645379814981ad8704245ab7da4b06016d95368cbe855752c67b7717ec +size 107442 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Jungle.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Jungle.png new file mode 100644 index 0000000000000000000000000000000000000000..3ed3ab95f872271b50fbc516746a6c3469f28b1d --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Jungle.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d89a9dc45fb57a804bc6e1af306e1cfbdcf0a349be153324212ad5a7f6521c0a +size 106288 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Paprika.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Paprika.png new file mode 100644 index 0000000000000000000000000000000000000000..809a490c5ad5a8b25c68a0def95a43f7ccb17a32 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Paprika.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c0d9f15f62f06a4c587a6b0c6790e83d6057abcf84862dbcd366484b4aeee00d +size 121742 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Peacock.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Peacock.png new file mode 100644 index 0000000000000000000000000000000000000000..ed77940a4f43c36029a2d99936e8fc97e800b8c6 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Peacock.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:319a9f570b7dd7bf880cd67935e6e6bbd11007f33a5ad80b6eea473903a54b65 +size 108980 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Pepper.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Pepper.png new file mode 100644 index 0000000000000000000000000000000000000000..157d5d296051d9ffa6263153eaabd671389f80b7 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Pepper.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d6907202aea5e11800fdad0e1cdb0de0264773136161760057de4f911ab198f2 +size 117264 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Plum.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Plum.png new file mode 100644 index 0000000000000000000000000000000000000000..fe994451f2d240dc102a84c6d843be252bb933b9 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Plum.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9705ccbaa3fe4afb4b452df0b7cc07b62bf0209083a32b4b773bbd1dd92298a7 +size 111691 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Saffron.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Saffron.png new file mode 100644 index 0000000000000000000000000000000000000000..ab21a73b0692c8a3ea900be6049a5d64dc4b330d --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Saffron.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5249261c12df0ba78f55b6d3f9dd27663854268ef76646019db1d50fe9476a18 +size 123564 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Sand.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Sand.png new file mode 100644 index 0000000000000000000000000000000000000000..a0a0dab4fc780eb33288e88784f0a5e055f75814 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Sand.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7ae9b49714971b9f9e88b62901727c24ead5b7092d616a66283a8e692b31639b +size 109222 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Tobacco.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Tobacco.png new file mode 100644 index 0000000000000000000000000000000000000000..cee67baa66b613aad38a951ce45f5d9b07312369 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Oxford.mdl@Cotton_Oxford_Tobacco.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bf4b584a8a4cf14ed6c4fcd0431bb870400889feb07f4fd4d0d9bbec7bd6d1a9 +size 108872 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Roughly_Woven.mdl.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Roughly_Woven.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..3ec89edd8cca19d1182328746ace74631d15b8f2 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Roughly_Woven.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5ee77342e27805445c650b04612cc87fafb5059cbc926c3227081dd0d4ddb139 +size 132893 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Roughly_Woven.mdl@Cotton_Roughly_Woven.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Roughly_Woven.mdl@Cotton_Roughly_Woven.png new file mode 100644 index 0000000000000000000000000000000000000000..3ec89edd8cca19d1182328746ace74631d15b8f2 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Roughly_Woven.mdl@Cotton_Roughly_Woven.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5ee77342e27805445c650b04612cc87fafb5059cbc926c3227081dd0d4ddb139 +size 132893 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Roughly_Woven.mdl@Fabric_Cotton_Roughly_Woven_Cheery_Red.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Roughly_Woven.mdl@Fabric_Cotton_Roughly_Woven_Cheery_Red.png new file mode 100644 index 0000000000000000000000000000000000000000..d8f94d5f64138719b0abfcbc35d466985cda96ee --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Roughly_Woven.mdl@Fabric_Cotton_Roughly_Woven_Cheery_Red.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:688002abb82bcb884a7fd4b99c0a0be4cde47d671d5a4ee31da41d04f7d84d07 +size 109768 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Roughly_Woven.mdl@Fabric_Cotton_Roughly_Woven_Dark_Ash.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Roughly_Woven.mdl@Fabric_Cotton_Roughly_Woven_Dark_Ash.png new file mode 100644 index 0000000000000000000000000000000000000000..09ab04db973e1a3b32cb88ef59537c811850e3ed --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Roughly_Woven.mdl@Fabric_Cotton_Roughly_Woven_Dark_Ash.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:316212c62b36bdb2f0e69812794e9640b1b5d065bb3b77a27585dafd27425757 +size 95531 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Roughly_Woven.mdl@Fabric_Cotton_Roughly_Woven_Dark_Red.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Roughly_Woven.mdl@Fabric_Cotton_Roughly_Woven_Dark_Red.png new file mode 100644 index 0000000000000000000000000000000000000000..5b2ad8e6c493d2475988f8dca0b246c61314259e --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Roughly_Woven.mdl@Fabric_Cotton_Roughly_Woven_Dark_Red.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dc7cc76161877ae23be83b25f53fa20cc1a2f2efba51bd599140ed435485331e +size 106218 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Roughly_Woven.mdl@Fabric_Cotton_Roughly_Woven_Green.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Roughly_Woven.mdl@Fabric_Cotton_Roughly_Woven_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..3dec2e207b28a4496a9ab948703a4cefd38c4615 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Roughly_Woven.mdl@Fabric_Cotton_Roughly_Woven_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b9d27fc8d5947884e3aa8766171147a10479476a01586864f87cea724b26b8b9 +size 119366 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Roughly_Woven.mdl@Fabric_Cotton_Roughly_Woven_Orange.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Roughly_Woven.mdl@Fabric_Cotton_Roughly_Woven_Orange.png new file mode 100644 index 0000000000000000000000000000000000000000..c7f1cf0f1feccb7100a5af7174b19a3d8516a379 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Roughly_Woven.mdl@Fabric_Cotton_Roughly_Woven_Orange.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:873e50ac1ad8489cb96f85593d03a0c3b05218ecfa21269023d5757758cd5352 +size 121099 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..c0fa5dd7ce102fe4ad40ed1a6bd97292fb013eba --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9afb8703cfd26492c4cdcef3bfe3017c3783ae03aa2a4881ea5ce7c8442252ec +size 87131 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey.png new file mode 100644 index 0000000000000000000000000000000000000000..c0fa5dd7ce102fe4ad40ed1a6bd97292fb013eba --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9afb8703cfd26492c4cdcef3bfe3017c3783ae03aa2a4881ea5ce7c8442252ec +size 87131 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Almond.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Almond.png new file mode 100644 index 0000000000000000000000000000000000000000..9f6af0e1bd00ce7c0ff707d89c5fdcd38f723592 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Almond.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a20dbc4a6ad9d94b446fa499cf921383aeb85a6317e25069a2105ede89b49f32 +size 90002 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Amethyst.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Amethyst.png new file mode 100644 index 0000000000000000000000000000000000000000..2ced19f8fd94fd0c97b650191e794a7f4008f026 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Amethyst.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:06a932b835806865b999ce911402e9e7303607d57bb8941452ba56bf537d1f98 +size 90082 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Black.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Black.png new file mode 100644 index 0000000000000000000000000000000000000000..92e7e6fd9dbb4981e0c7482dbaf413b63a818b80 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Black.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4243abefe42c9f367e826dc74e0485e7ca2f3d5f1090236e89474f52976e2135 +size 77228 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Brick_Red.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Brick_Red.png new file mode 100644 index 0000000000000000000000000000000000000000..486caf5072a16144a853de547471b2b35673a0a0 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Brick_Red.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c710e9518e03679d48f1aa9377de4cb316db768017f6dda1034a32f53bfe7dec +size 91994 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Bubblegum.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Bubblegum.png new file mode 100644 index 0000000000000000000000000000000000000000..418d672cf97c151529ce3b6e00ecbe099e15d567 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Bubblegum.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e153c862bc3e860d7e274cb5c8f03a6dc19fee756cf056592d315022d75bad18 +size 92506 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Burgundy.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Burgundy.png new file mode 100644 index 0000000000000000000000000000000000000000..dfca318a8dc38a2464a2a851c3b2593292d4eff2 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Burgundy.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e7a248c5688b6521ce2facac19775eeab100761d02f7e63c07b0c337a54a95fe +size 87936 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Charcoal.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Charcoal.png new file mode 100644 index 0000000000000000000000000000000000000000..7d88b2b81fb8d2765a2201cd9c2a88dd43e8cdc1 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Charcoal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9b8b4c0278a8aa7c8ced49c138ae73a1e1d82a4db3fc299d43a1cf8cf7fe8e48 +size 78335 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Cinnamon.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Cinnamon.png new file mode 100644 index 0000000000000000000000000000000000000000..53c914fd77178e1fe72c10f2542e1800e6d808f4 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Cinnamon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:01c5b1337970d10beccc420a490a28022f656673da86444ff3274adb05299978 +size 87293 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Grass_Green.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Grass_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..1de301541cb96407463547017ae1d17940895a5b --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Grass_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:030399dda4f7b8ba17d34aa8d731cc3915375fdc72528903bb3f9e7e76663cb9 +size 94192 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Gray.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Gray.png new file mode 100644 index 0000000000000000000000000000000000000000..83e0e72f47aef99991f4f87b894c5863b62cc42a --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Gray.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3b82b81965ca1de5bfd14c1eb51c8edc2ad0551a8e15092bd0a368514958fa3d +size 82177 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Hunter_Green.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Hunter_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..bcf91c0fc7498385d1a6474457868bebcf8a65f1 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Hunter_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:368ce7c0e5cb649bff4c2650d410ae18d4e29a3f828b885063f6b54ed61e5fe8 +size 88914 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Khaki.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Khaki.png new file mode 100644 index 0000000000000000000000000000000000000000..fb067c03c6052d42ef9b3d50af7c78a7a45d1ad8 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Khaki.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:08ac7d00c1afb3b42c8eff7ec00ee3bcea0e879eb86b6bb1ffddc4f15b64d09f +size 87649 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Lemon.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Lemon.png new file mode 100644 index 0000000000000000000000000000000000000000..abf14ab3fb5dc6d048a8cc4f2a403d5cbc923049 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Lemon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:edf6af52d39d984514b053268f08cd3f8a7a14082195e0f2b9f14bc5a7c46939 +size 97006 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Lime.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Lime.png new file mode 100644 index 0000000000000000000000000000000000000000..c0f36accaf9f62389150883c78651a5beebee6bc --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Lime.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:236b2133b1a61383ac1912b7f009f71fa5730a59c1b973dc43fe9cf2a85b18bd +size 96373 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Mint.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Mint.png new file mode 100644 index 0000000000000000000000000000000000000000..327c9391584655f0c4862212f4c7568d03955142 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Mint.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:759a19f8659e268d8230d310dc11860345b5da3a25cd0bda70be3e2c679f9efc +size 90339 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Navy_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Navy_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..b91ba9b22cad1dd0f78ae126f313fade68fafb4d --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Navy_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2a816793406d62c9b7a09ff43ffc6fe4c3ee4e28fefb9b75c4aaa349d1ce2419 +size 85477 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Orange.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Orange.png new file mode 100644 index 0000000000000000000000000000000000000000..c261fbc9378baab1b817d17a255152e9c0d4d626 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Orange.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:704ea75bdc46eeb11457ed9043f64c5d6aa5b74a789f43248873b5c1bb2e9ef1 +size 95554 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Plum.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Plum.png new file mode 100644 index 0000000000000000000000000000000000000000..dfe15ef2364ecd7c902ff32293b7b46193c19267 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Plum.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4f32fdc749c5579a545f1225aaf5d7b7ad5b18a16e50baa712beb079a2738a59 +size 94619 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Purple.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Purple.png new file mode 100644 index 0000000000000000000000000000000000000000..61668f513b9c98640b6b864366c3e1d9a9ec3437 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Purple.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:011275fb14cf857f60d5593064f46b3bd9532d2d318b5846eb487dc0f970cbe0 +size 88737 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Raspberry.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Raspberry.png new file mode 100644 index 0000000000000000000000000000000000000000..1b90902470c75f35ced7c1725bf4a17fd18c342e --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Raspberry.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:15fe04dd45ce887356d75ee034c19682d7c58979e6841b38535cc2c44ab93212 +size 91685 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Red.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Red.png new file mode 100644 index 0000000000000000000000000000000000000000..eaf6c11313252836d6a851540e383962eabd0345 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Red.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5b37bd318b2360ff7aba340e5eb6d738301b595f6ff8c1dfb55b4c1fb758c1b8 +size 94521 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Royal_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Royal_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..08e21ebd061dc8f8b8269b69296e356cc45aa9f9 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Royal_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:61f7773f11b244f8663e5eb46a1351edd916f901c2d0af9dc1fd1016e63e408e +size 90611 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Shrimp.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Shrimp.png new file mode 100644 index 0000000000000000000000000000000000000000..3e1c1d5b58bf5770f22968a8d1e858a6f48a8c2f --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Shrimp.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c055f3c7c7cb2cdba19e53c8500f7d49127f2d3a5de45ba4b9ddf61335f7cdfc +size 90612 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Silver.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Silver.png new file mode 100644 index 0000000000000000000000000000000000000000..4edb3e5cce3de84d0260517d0cfbd946c36eca10 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Silver.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3037bb39be00fcf3f6be55a0d823b368a9c91a8dea63a5e3e884f0440247c5cc +size 85339 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Slate.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Slate.png new file mode 100644 index 0000000000000000000000000000000000000000..6488a8d1b47762bacdfa08600f1dafaf13d412fd --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Slate.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fa4273ea5df364827c8de5b54ba1770ea3a8eefd99341ae986aff200b9b528a0 +size 91308 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Teal.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Teal.png new file mode 100644 index 0000000000000000000000000000000000000000..cc60bb358f3576a8fbd9f87c67868b8fac299886 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Teal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8800a3968f4be764dc71648aa009799cc86992b7d55912b128751adb3b298383 +size 94337 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Terracotta.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Terracotta.png new file mode 100644 index 0000000000000000000000000000000000000000..347d595c182b5de4412e778d42b2b49cec9a8124 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Terracotta.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5362aef7c8922d5f303f4ef3d12842fabfd499e53f4edfd86380af5be2a78e6f +size 92004 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Turquoise.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Turquoise.png new file mode 100644 index 0000000000000000000000000000000000000000..5c919f30da53967bc44d80c3b0b15782fc53db84 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Single_Jersey.mdl@Cotton_Single_Jersey_Turquoise.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7da452b25383730fced9a96581fbb678c2218deef9040733052eaaafef9b0df1 +size 96375 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..d04711cd751fc226bc24ea7cf6c9e13d448576c7 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c523ea6aaea0e55251c3ce8bf55cb2df3a872be6a14e69e105386aa06ee030ab +size 98776 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine.png new file mode 100644 index 0000000000000000000000000000000000000000..d04711cd751fc226bc24ea7cf6c9e13d448576c7 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c523ea6aaea0e55251c3ce8bf55cb2df3a872be6a14e69e105386aa06ee030ab +size 98776 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Aubergine.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Aubergine.png new file mode 100644 index 0000000000000000000000000000000000000000..b025f627005f60c1fd23a63fb46b1dab0f7e2324 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Aubergine.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8495e708176fabdcb88ed09ebf3c38ca9a930657b66efa511bb77f7cf7e90eb0 +size 91283 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Black_Pepper.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Black_Pepper.png new file mode 100644 index 0000000000000000000000000000000000000000..13a818ef50f91dd02affb45c6689a4f24c2b1cdb --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Black_Pepper.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:615310b2262614546c3b2493c0d6a9be59af856d992a66270d6e5a57180140ac +size 89659 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Blue_Jay.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Blue_Jay.png new file mode 100644 index 0000000000000000000000000000000000000000..2ecab05d9803d9fd29aba406847fee5170c97257 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Blue_Jay.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:df02e8cf52c58bff5c5f621983d29def3a6da248bbb9fb44be657629a4f0e8e7 +size 104390 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Carbon.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Carbon.png new file mode 100644 index 0000000000000000000000000000000000000000..5f6183fd7050186bff483dc774ccde172fc9f8b3 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Carbon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2e29303bd9363c01d8ce24ab2342c9cb57714eb4821cc88315fcb134dc38e6d9 +size 88998 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Charcoal.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Charcoal.png new file mode 100644 index 0000000000000000000000000000000000000000..8008d175148131eb7be38f4dac59eb73152676f6 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Charcoal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b593cddef22cfd946785abf82551aa89a83f555151df5ff16bde7da369a6af0c +size 89293 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Fog.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Fog.png new file mode 100644 index 0000000000000000000000000000000000000000..bf4f52b0a97da4cb3ee1ab1ecce85887ca30317a --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Fog.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:916982cd9f857e1f39a7fc0480376710c5cb48a3924fb846e3df8d3eb8ff9bfc +size 98332 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Fuchsia.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Fuchsia.png new file mode 100644 index 0000000000000000000000000000000000000000..66c6b69a560d359fcbc92966556b309aad5f0bc5 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Fuchsia.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:97790ccb9c92a97c963223bceacac1f64bd6353c36d9a64671830346118c54da +size 105456 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Garnet.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Garnet.png new file mode 100644 index 0000000000000000000000000000000000000000..7a10d73a842faff805e4c7d57639e102628c7cd8 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Garnet.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:22c2ddcbd92d92584372ba3aa79c62729e3345b896fc4a2359ebdb87fb0d83df +size 98745 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Jungle.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Jungle.png new file mode 100644 index 0000000000000000000000000000000000000000..3b79e80a95ea2add140a4741d10910d92dd33f32 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Jungle.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a51006328d226d3bd16df256e8c7bff56ad4e0298e0e4d56bb9e10216b77e724 +size 90209 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Morning_Glory.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Morning_Glory.png new file mode 100644 index 0000000000000000000000000000000000000000..f1fc8ea5cd44557c97e2c3b935dd69e3b2c3da45 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Morning_Glory.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5e7a21e9e5ff8d318143e47c4d969abbcf6c468577cbdc1bcaee68dc2b3df35d +size 97748 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Oyster.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Oyster.png new file mode 100644 index 0000000000000000000000000000000000000000..5abfe4f1ca149494f7ca5c386b79200375af6eb7 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Oyster.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d012534f9378dbbca49f2d6963501f78a819ed9fb16517837adbb4ff45837030 +size 100384 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Paprika.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Paprika.png new file mode 100644 index 0000000000000000000000000000000000000000..b674389fa7c1d1d1d32495289d89b2b425e9a7ee --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Paprika.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:77e18e24dfee669c604a0a63476e9e9581ef3fe3ef34931e2382d56f97ced894 +size 105760 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Saffron.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Saffron.png new file mode 100644 index 0000000000000000000000000000000000000000..d70b7b8d29f54f4d2819781c8b57466b44cb64b5 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Saffron.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1960e2afb1f5bcc62d6b0724b34a98b14123e6999e8e410267da9400990f4113 +size 107229 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Sand.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Sand.png new file mode 100644 index 0000000000000000000000000000000000000000..fc73c486a34d0f3a002564546f92a83885aa6fa6 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Sand.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:89179a01d198779aaddbc9b45c250b833d90600147fedbeaf5e8235550766694 +size 100624 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Tobacco.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Tobacco.png new file mode 100644 index 0000000000000000000000000000000000000000..37b240288345135489e32cb2f5c6c526b0f9803d --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Cotton_Twill_Gabardine.mdl@Cotton_Twill_Gabardine_Tobacco.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5a9c994292d057ae003ec6b0b0cf7f83ba640b2b20705c1c08c1a966c5a5d643 +size 97360 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Fine_Woven.mdl.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Fine_Woven.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..9ba4b24c149d5d0a190fdeffc54208c9ab5246f0 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Fine_Woven.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:094e4a896c8d88ccf8292ea97ebe9e5867932c2f8ef46c610ae6deadec761b1c +size 118139 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Fine_Woven.mdl@Fabric_Cotton_Fine_Woven.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Fine_Woven.mdl@Fabric_Cotton_Fine_Woven.png new file mode 100644 index 0000000000000000000000000000000000000000..9ba4b24c149d5d0a190fdeffc54208c9ab5246f0 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Fine_Woven.mdl@Fabric_Cotton_Fine_Woven.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:094e4a896c8d88ccf8292ea97ebe9e5867932c2f8ef46c610ae6deadec761b1c +size 118139 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Fine_Woven.mdl@Fabric_Cotton_Fine_Woven_Cheery_Red.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Fine_Woven.mdl@Fabric_Cotton_Fine_Woven_Cheery_Red.png new file mode 100644 index 0000000000000000000000000000000000000000..49256f7cf96036a2c683f1499ab3eb96f43e3efa --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Fine_Woven.mdl@Fabric_Cotton_Fine_Woven_Cheery_Red.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f306f4d9e189c935b5d44e7a02a6cdfab8a54bfbb83da360e980ec32e1dfeacf +size 125901 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Fine_Woven.mdl@Fabric_Cotton_Fine_Woven_Dark_Green.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Fine_Woven.mdl@Fabric_Cotton_Fine_Woven_Dark_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..c95ac76e6611967397395c6310d2e0208f761ac8 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Fine_Woven.mdl@Fabric_Cotton_Fine_Woven_Dark_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:efeaeaf34190b17740cceb315c3f07e3f687dc3eab9228ce7b41fd308e0f6461 +size 116883 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Fine_Woven.mdl@Fabric_Cotton_Fine_Woven_Dark_Red.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Fine_Woven.mdl@Fabric_Cotton_Fine_Woven_Dark_Red.png new file mode 100644 index 0000000000000000000000000000000000000000..e524b220dee224232f4eba6bbc847b9f94ed9bc0 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Fine_Woven.mdl@Fabric_Cotton_Fine_Woven_Dark_Red.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1397fdbf2e02247479c33a7ec48c3dfd251e32aec6096a20433df303f0e7f2f6 +size 119457 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Fine_Woven.mdl@Fabric_Cotton_Fine_Woven_Light_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Fine_Woven.mdl@Fabric_Cotton_Fine_Woven_Light_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..91e3502b63221e0b360d5e53300b1415a4e53d95 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Fine_Woven.mdl@Fabric_Cotton_Fine_Woven_Light_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2f9225e21dd43600d645273152059925fd9bb13258a31ed25425711ad22e294e +size 127624 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Fine_Woven.mdl@Fabric_Cotton_Fine_Woven_Orange.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Fine_Woven.mdl@Fabric_Cotton_Fine_Woven_Orange.png new file mode 100644 index 0000000000000000000000000000000000000000..8d91b332f0b31219ab4fccb25f44daad6f471134 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Fine_Woven.mdl@Fabric_Cotton_Fine_Woven_Orange.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c4d37733322ae703a5e1bdd628e7bcf48541cdfbb7565e08bb5b2c30bafeaee7 +size 128101 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Fine_Woven.mdl@Fabric_Cotton_Fine_Woven_Petrol.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Fine_Woven.mdl@Fabric_Cotton_Fine_Woven_Petrol.png new file mode 100644 index 0000000000000000000000000000000000000000..1abe7f72a076a7bf7bdedea67d09e19cf71daa95 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Fine_Woven.mdl@Fabric_Cotton_Fine_Woven_Petrol.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8cab0c490a35c1fd22aa7f8090ad2b53a3fc422c2d33f4094762feed0092a9ce +size 118606 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Fine_Woven.mdl@Fabric_Cotton_Fine_Woven_Yellow.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Fine_Woven.mdl@Fabric_Cotton_Fine_Woven_Yellow.png new file mode 100644 index 0000000000000000000000000000000000000000..24fe770c291b7328294df7b338ef2f47bae7eb33 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Fine_Woven.mdl@Fabric_Cotton_Fine_Woven_Yellow.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7a0793f64f6e27051db4c0fface453f712b2a16feb9dd6cce88877ec7a46262d +size 129361 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..1bde090eda0ecebe644ec8b4e8e0acb7a41a580b --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:68e64f410f126086ac17c98a2dc9201004c25a73c59ef73ee19495cacfbc442a +size 123213 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave.png new file mode 100644 index 0000000000000000000000000000000000000000..1bde090eda0ecebe644ec8b4e8e0acb7a41a580b --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:68e64f410f126086ac17c98a2dc9201004c25a73c59ef73ee19495cacfbc442a +size 123213 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Amethyst.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Amethyst.png new file mode 100644 index 0000000000000000000000000000000000000000..94639c2db7d87fbcf0627acdc218ecd7acc41ebd --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Amethyst.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f434ad0e7088d99cb089304c9882224011ce31237928959a2b8aa347f0a21e5a +size 117901 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Burnt_Coral.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Burnt_Coral.png new file mode 100644 index 0000000000000000000000000000000000000000..1ca9d3a12fb4ec1c9ec87c5298585e06c51dc8ad --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Burnt_Coral.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e0fbf1babfd5442fb9547771b86dfd2950bd3d4422fa0e0b15bfef923f89a970 +size 122675 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Buttercream.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Buttercream.png new file mode 100644 index 0000000000000000000000000000000000000000..10421991097bd43e753a3647afee404663236a5e --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Buttercream.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9ede31a82c4f6dd024820bf46eb4d3ed5834b2607e53fb805424a62ec4647d09 +size 118573 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Carulean.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Carulean.png new file mode 100644 index 0000000000000000000000000000000000000000..db9bf060c599c590135973f08215ef17b79dcaa7 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Carulean.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:80139d49c3262b09db47551795c80458c1a729d2c4be483d8cf2e802e550acab +size 118578 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Desert_Mist.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Desert_Mist.png new file mode 100644 index 0000000000000000000000000000000000000000..c00446be164692c460e8131bed7acb3162e2c01d --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Desert_Mist.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e69561b1ee5dde0b789b0b3ccbc1ac844da31e8d2938642fc1f89f859476e615 +size 120557 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_French_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_French_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..ae7280a4bd7d5023bdbe131df13339264d73070e --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_French_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aeff1024c0edd565bf35941816aac695923d64afa041a1ada60d1f21d2b195ff +size 118574 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Gray.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Gray.png new file mode 100644 index 0000000000000000000000000000000000000000..9169d4a22a2630ef074d5e777af8e2dcde93d821 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Gray.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2e50d386eccc46e6ee734fa605e528798de97ca4b66f8e365dcb528c505fba4e +size 113506 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Green_Ash.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Green_Ash.png new file mode 100644 index 0000000000000000000000000000000000000000..b6606060a6191351acfecb6d6727777714be8225 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Green_Ash.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:19bf66de070b4ea4073b74e7a9fdc4836a7096e9cfaf6a81b595a417344ee53b +size 121220 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Inkwell.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Inkwell.png new file mode 100644 index 0000000000000000000000000000000000000000..7ab202d0994d121fdeaee87741c9f4a565a94576 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Inkwell.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:49a0d4a26698cf0d5679bcda57034a5e45132b79b7c0862380fd15edcdd07328 +size 106992 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Mint.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Mint.png new file mode 100644 index 0000000000000000000000000000000000000000..666c16660f0fa0684f8950bc3ac87c62f9100b7a --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Mint.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:626f441cd6bd39baee5e6afd5bc594b5dfacbfb544fff7d3aff9f5163cb15030 +size 123654 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Raspberry.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Raspberry.png new file mode 100644 index 0000000000000000000000000000000000000000..fc55cb62adf775bc9986f061b930c815a8361bf2 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Raspberry.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6c30981d81937d0c7e3f74041dbf2f6bef2eb0d91d9917f1ca7a08774ff23ce0 +size 122365 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Rust.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Rust.png new file mode 100644 index 0000000000000000000000000000000000000000..aa239e375e20548ae5fc6d036091ea40b1a27df8 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Rust.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2dc08bf4b349d10af64872606d0a5d838863da50f97d02cdb5402e0636759e80 +size 118578 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Yellow.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Yellow.png new file mode 100644 index 0000000000000000000000000000000000000000..e0d57fcd9192c25e0ae3c326502a417e624667b6 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Fabric_Cotton_Pique_Weave.mdl@Fabric_Cotton_Pique_Weave_Yellow.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c0178ada0102096cca1b4fed5da8f3881c2f43a045688372581786a4d96a6d7f +size 126127 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..bdb1ab9f542f6a8869ff4b4ddaf9a4443ca181a9 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e4b51131ed6039826fe72b9b543d002533bfb5c4064b054e99ac40dca086621a +size 95414 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Academyblue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Academyblue.png new file mode 100644 index 0000000000000000000000000000000000000000..6c6598a16d0248d406b78915a685b114f37fd5cc --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Academyblue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d06951c365e598d838eb4987d06dacec7695d5806217f29d2fe87e744f2ddbf7 +size 92036 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Black.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Black.png new file mode 100644 index 0000000000000000000000000000000000000000..74ed3189d641d57f2688643c4da7c8dbd992c247 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Black.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:42b70bb22414cf03196ee1a9322dddc7baf6295b398fa7e952b1a88bb662fb60 +size 75728 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Brick.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Brick.png new file mode 100644 index 0000000000000000000000000000000000000000..352c9a3e11196ec8312dd7bac796af606f883306 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Brick.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:71d4bf9595c304ba8b4ec6441311f9a5cf2c756f3ce42d8f3a5d2a1bf1657d3f +size 90370 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Brown.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Brown.png new file mode 100644 index 0000000000000000000000000000000000000000..44e79b2ee31628845b339c191c07b9b1bb768572 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Brown.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0afdd1cf0d07dafab39ad4bab125308006111b52deba7a9d41a504f6b32a045e +size 85582 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Burgundy.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Burgundy.png new file mode 100644 index 0000000000000000000000000000000000000000..d520c34ecdc78bfbc3655c5d298ff55713e2cf8e --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Burgundy.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:51985534b42808d00dfc201980c268f316604872f3b789354cd69fd8149839f6 +size 90266 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Charcoal.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Charcoal.png new file mode 100644 index 0000000000000000000000000000000000000000..195c9e18bfca0b602994b6d02befbb97daf972be --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Charcoal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a8c5f0acd12fb774adde7ae2cdc5872df9270f800461209e0167da4432599687 +size 72943 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Darkgreen.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Darkgreen.png new file mode 100644 index 0000000000000000000000000000000000000000..e266a8e794fa3e352991f2f23f647778034557aa --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Darkgreen.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:be2781b8e175e8b14d6dcc3b98899c3d6bafe615308e7b2b0a729249fc8082e6 +size 82459 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Electricblue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Electricblue.png new file mode 100644 index 0000000000000000000000000000000000000000..fb53b3e30101a45c1fff92d68a14cdc6900a5a02 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Electricblue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ae7915ae1e7c1b7c7ad657e81bd5d852889761cb4bc0f52ab58a356e8b208614 +size 98208 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Euroblue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Euroblue.png new file mode 100644 index 0000000000000000000000000000000000000000..d74a1d1c68b03be904b8b3a337cdf813df0028e2 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Euroblue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1df06e27d4db316be15d05477cdb107d8cad1225b4f7393309091bbe72665f17 +size 91904 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Golden.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Golden.png new file mode 100644 index 0000000000000000000000000000000000000000..962007f2b3665442d1f8dfc9b44326380882e680 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Golden.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:58e889e0364affaed3ce6b8d030a4192a96af8519ddb95d1f0617d7f021bb763 +size 92827 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Khaki.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Khaki.png new file mode 100644 index 0000000000000000000000000000000000000000..fdc4e0fd0e217b8c22333e310953541d10da9512 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Khaki.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b32cf242d7faa8e52af1a54954cc77a9be22ea8fa498a392c581afcc12fcd2a3 +size 89244 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Navyblue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Navyblue.png new file mode 100644 index 0000000000000000000000000000000000000000..25cee0be81c32cb4d8b8e20be61b43e591e1c0c4 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Navyblue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7e5cbdb8a4f53af41ceba3495200e710a372d8b30552a8b1e4e47233404313aa +size 79813 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Red.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Red.png new file mode 100644 index 0000000000000000000000000000000000000000..7fba6b475f72809cc2d4591128660c4d6b1c6562 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Red.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e33e1b0c38f4a6d805f860f122b4e7607b6dc5cf3b2aad9159c8a78b31f6e26c +size 90593 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Steelgray.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Steelgray.png new file mode 100644 index 0000000000000000000000000000000000000000..7b1c001a249675a153e8e364777fffc89f53a3e9 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Steelgray.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:943b405d10b219cb8caef9b5e4df63a9b0517a0f1397f792484271d4cbe4faa1 +size 86531 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Taupe.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Taupe.png new file mode 100644 index 0000000000000000000000000000000000000000..c24ced3034a77cf8fbcd062b8577fbf8e8d2cf68 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Mat_Taupe.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2f6e3124997c216698fcbec7e6ad54673036426636b728e517f25a37dd57cfd0 +size 82497 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Plain.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Plain.png new file mode 100644 index 0000000000000000000000000000000000000000..bdb1ab9f542f6a8869ff4b4ddaf9a4443ca181a9 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Felt_Plain.mdl@Felt_Plain.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e4b51131ed6039826fe72b9b543d002533bfb5c4064b054e99ac40dca086621a +size 95414 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..5362e2753d3fefd08d1f23c57a00b36a9a6473e1 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:401013308451847aee5a83d2f02723c5101a710905c225c8781a3995d08848b4 +size 87610 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl@Polyester_Charmeuse.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl@Polyester_Charmeuse.png new file mode 100644 index 0000000000000000000000000000000000000000..5362e2753d3fefd08d1f23c57a00b36a9a6473e1 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl@Polyester_Charmeuse.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:401013308451847aee5a83d2f02723c5101a710905c225c8781a3995d08848b4 +size 87610 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl@Polyester_Charmeuse_Aqua_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl@Polyester_Charmeuse_Aqua_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..4b4f76da742aa0f95fb4f8e262274f9de58443f6 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl@Polyester_Charmeuse_Aqua_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:227133ea78e0fab96935cd4ee0a3a936c421eabc1285010492a4e35aae15b339 +size 83681 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl@Polyester_Charmeuse_Black.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl@Polyester_Charmeuse_Black.png new file mode 100644 index 0000000000000000000000000000000000000000..211a3e303bc996ff5615ed7ca246a6f1dfdab6be --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl@Polyester_Charmeuse_Black.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:06000e158cb69f91e5b632580098714a3f09d1d7d9f814d1c1d91485d768b086 +size 73770 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl@Polyester_Charmeuse_Gold.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl@Polyester_Charmeuse_Gold.png new file mode 100644 index 0000000000000000000000000000000000000000..6626ac0453436fe231fefa7c657327a9c2481be1 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl@Polyester_Charmeuse_Gold.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bbbfc5096dae89a693fb61be77e24413a41f2e8a9f24e5b779b93b42f3d300d8 +size 85439 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl@Polyester_Charmeuse_Lemon.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl@Polyester_Charmeuse_Lemon.png new file mode 100644 index 0000000000000000000000000000000000000000..4ba5129d3f7f2e10c3233e67ac1ee60d9bfe709e --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl@Polyester_Charmeuse_Lemon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5562d913f2a0fe6523bf3412979a4c030fb9830096063fb0192e269129fdadea +size 85543 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl@Polyester_Charmeuse_Lime_Green.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl@Polyester_Charmeuse_Lime_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..9fee96f6e80e1036a125d621cec63b8a52a9f1a9 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl@Polyester_Charmeuse_Lime_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a7ac2251a6646916d21b3796ecd546a98ce348d65e149bb740e5f3298f70d941 +size 83888 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl@Polyester_Charmeuse_Orange.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl@Polyester_Charmeuse_Orange.png new file mode 100644 index 0000000000000000000000000000000000000000..8da3194cd61febb31d458643e833ac91dbeea87b --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl@Polyester_Charmeuse_Orange.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:56eb2e87bce4c2bb0571b4bf1c795b7b0af82c5af18803f729b69803b166accb +size 83219 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl@Polyester_Charmeuse_Purple.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl@Polyester_Charmeuse_Purple.png new file mode 100644 index 0000000000000000000000000000000000000000..7d7ed3021d6b8a577db1e1881d83864b4120ed5c --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl@Polyester_Charmeuse_Purple.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:73fbc481f7d1239f4c4fd4bb282b37f61df551a9633252822d9bbb0f6d3ecf32 +size 82281 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl@Polyester_Charmeuse_Red.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl@Polyester_Charmeuse_Red.png new file mode 100644 index 0000000000000000000000000000000000000000..461c0e84c0d25e2d5485f42a963dd6c87ca464f7 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl@Polyester_Charmeuse_Red.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b7e12b92aa383e14b450d07a1f137946e4b1bd784d1c190d6ce3bd95b827b1af +size 79968 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl@Polyester_Charmeuse_Silver.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl@Polyester_Charmeuse_Silver.png new file mode 100644 index 0000000000000000000000000000000000000000..b34db5ca3ac6668506bcc11c9906ecfecf9627db --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl@Polyester_Charmeuse_Silver.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6206f15eac63cc34bbd078841062fa046027ad44d5e53804daebf247f6f33fee +size 84830 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl@Polyester_Charmeuse_Teal.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl@Polyester_Charmeuse_Teal.png new file mode 100644 index 0000000000000000000000000000000000000000..dfbccd1483ca40bf2f824fc386e517a0193082d3 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Charmeuse.mdl@Polyester_Charmeuse_Teal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:64b4707dff689f4927780103f12af8ea5fe1eb0a4def5a00e225589653dc5b87 +size 81035 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..91c2a6700cf3afbeccf26bf40d62695bf8c6d9a4 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bae24049c82c5a1b711fe99806dab9a30fbda374e2a33bd2b8d14d1c65f3c8ff +size 87894 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine.png new file mode 100644 index 0000000000000000000000000000000000000000..91c2a6700cf3afbeccf26bf40d62695bf8c6d9a4 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bae24049c82c5a1b711fe99806dab9a30fbda374e2a33bd2b8d14d1c65f3c8ff +size 87894 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine_Anthracite.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine_Anthracite.png new file mode 100644 index 0000000000000000000000000000000000000000..d53ee02c7e21e1c44ed27ec05b8e558293aa84d3 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine_Anthracite.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a9f8cd09a7d17664b023c796c77490cd056918dcc9188a9b2150a5299f355063 +size 81000 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine_Black.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine_Black.png new file mode 100644 index 0000000000000000000000000000000000000000..42695628739b85577459009a01fe2f949f7f0b96 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine_Black.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7e6c7fd8b270bf68eacf46f70148903134a1aeacc98497873b47aa0e1b97fc6c +size 79143 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine_Dark_Green.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine_Dark_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..698166d71096beeb10fc36114b66064bbb61dbf5 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine_Dark_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:17440052b3e3fd7ea9b4b21315eb9d11441a062a088978ad3110b70d40f20edc +size 81657 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine_Lime_Green.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine_Lime_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..b164469fe73625def5c5571edda4cdb2dc4028b5 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine_Lime_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:35b4b8537256af6dd327c02798d6512504038e33fb99a030c8d0de56c34791e2 +size 85680 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine_Orange.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine_Orange.png new file mode 100644 index 0000000000000000000000000000000000000000..a5bb511db2a17d31c673d9cfbaf8bc489a683453 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine_Orange.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bf96b3a4e341183df39fe0f7f937639dd739bae1488a4a9e44ff8125b127256c +size 86297 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine_Petrol.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine_Petrol.png new file mode 100644 index 0000000000000000000000000000000000000000..820bb243dc13baf8d48fb8158676ef7b217b68cb --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine_Petrol.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:69c68f90753700a7a87c3f78ea4b164e1a944034424348b1363ad512f461cc16 +size 83888 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine_Pink.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine_Pink.png new file mode 100644 index 0000000000000000000000000000000000000000..3fbf56f07a0c438476d6252fc4958b09ba16f0c2 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine_Pink.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e75b47a3fcc5e2476556b50bc96e2899bc94496ad300c3d0a5579238065cc400 +size 87258 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine_Purple.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine_Purple.png new file mode 100644 index 0000000000000000000000000000000000000000..b6b35bab6de19a964f8f905dcd66a774cee7f9b5 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine_Purple.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:79b947e9fa6b913e9e792e6f3359a18d316c4896599807517cb4747513911b09 +size 84514 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine_Red.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine_Red.png new file mode 100644 index 0000000000000000000000000000000000000000..29bcc9bbab37be5f52bcec993a47c2271acd8734 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine_Red.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e025fc7c5c58e6de9294c5e51c9d8f53b6d20df303e0d6da575108172e4fa962 +size 82763 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine_Rose.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine_Rose.png new file mode 100644 index 0000000000000000000000000000000000000000..47b9662c0eb7297c81de9a56770c93580438ee72 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine_Rose.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dadac089a2ad133fccba5e7f2c6a7b094006767f25e602ce4770ced2d3b86b6b +size 86774 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine_Sky_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine_Sky_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..8d1363d30d82dd3fb9332e4281e6efca9013810c --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Crepe_de_Chine.mdl@Polyester_Crepe_de_Chine_Sky_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e7520bfa85db2825229f54b7c9f24a17757cd0e96e575948655f3964314356d3 +size 86055 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..e0d9cf6c25055a18503758ddc493bf5007091657 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6153cfa4101c0f6f7559f1bd3cf0f5c72260779b2d3989449d4be152959fd99a +size 92865 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone.png new file mode 100644 index 0000000000000000000000000000000000000000..e0d9cf6c25055a18503758ddc493bf5007091657 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6153cfa4101c0f6f7559f1bd3cf0f5c72260779b2d3989449d4be152959fd99a +size 92865 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Beige.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Beige.png new file mode 100644 index 0000000000000000000000000000000000000000..e5a6e796b856f7f1bf62325172b2658823f23e29 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Beige.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:271e14410632c9a3f151ebc8cb69c5721987073876198bba1c7770fbf42e7279 +size 100113 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Brown.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Brown.png new file mode 100644 index 0000000000000000000000000000000000000000..f3025cf358ee7e6d49dac9ddd788938d0186edd4 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Brown.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7c34bfc4d34818db0137832b014f8b248a7258174f4ccf177e559834b56ff01c +size 97480 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Burgundy.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Burgundy.png new file mode 100644 index 0000000000000000000000000000000000000000..c27a8e03f8781b95f0ed0103a6e5ef6f55c7241f --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Burgundy.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6e3bf05b8943e6d06c80555352861bd416df40ebee3bdc56d3d3548b5ea74c81 +size 103591 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Green.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..f86b16f2e9e1e933d3ddfcb3e5feb9b768b26aff --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4691f1fa7fae3eac80a1ab7d6f0cb87b80ddcc8de134f55cfd8f3735bddd03c7 +size 99867 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Light_Brown.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Light_Brown.png new file mode 100644 index 0000000000000000000000000000000000000000..838c4e6104fb13628a0252c3eda0b502d2922522 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Light_Brown.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:45ec54af9cd0969b39232ed5fe44f01877abe7282621d447a272f913bb65a981 +size 103045 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Light_Grey.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Light_Grey.png new file mode 100644 index 0000000000000000000000000000000000000000..24677e54a402a948dcad41b3364febfd79e1d482 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Light_Grey.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:382537adb5d2ac1ec186965c42b946ee33f82351c65fed0c885410704a69b103 +size 110884 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Maroon.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Maroon.png new file mode 100644 index 0000000000000000000000000000000000000000..9c33593da95a6af32e351b7cc838f0806fcbcf64 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Maroon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a9e361f4840ee12fbaa240cd2c0a64cefa31f8ccac7a4b146e59e424b1f117ce +size 100698 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Orange.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Orange.png new file mode 100644 index 0000000000000000000000000000000000000000..a58d0a66320231af51bb34f0ddc028c7a1abdf15 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Orange.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3d36870998fc983d49ce4a282098573172500b15e165c0c298c676f72f0a26ae +size 111195 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Pastel_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Pastel_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..26440a7d6af573f8f961413ff2d8d582f0177e6e --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Pastel_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a056047e2a943f5951614783fc01236fbf24476879904aabc597dc70f6cae5da +size 99126 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Royal_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Royal_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..f3403becd7100aa41827dbd3eb4acc17225f4de7 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Royal_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f73adc815e3b539172416ae4130d485d6d504733e6b436a42c531b5c0211655e +size 102208 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Silver.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Silver.png new file mode 100644 index 0000000000000000000000000000000000000000..2f9096979e0be6761de1fe44eb41d108bd12d702 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Silver.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cc04d50aa465adbf8d36ee3cf56801ccdcc49bc0954cef5897dd39415d12cb87 +size 95857 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Tan.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Tan.png new file mode 100644 index 0000000000000000000000000000000000000000..20c0e0592c1f4c1b539ef0bb5bf9e1c2b6507f68 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Tan.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6d1ea4491227d19116dd4d6890380eeac11b9666a4bec62e2797f3d504adb0e1 +size 109950 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Yellow.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Yellow.png new file mode 100644 index 0000000000000000000000000000000000000000..fedbedf79a9bfc890ce8b5a6ebf563e5723c3db9 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Herringbone.mdl@Polyester_Herringbone_Yellow.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c2b1f8a6fefe300f58b221a243c7401c0c5bd3ad6a4dc7b479b05e30281c1b5f +size 111273 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Twill.mdl.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Twill.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..e13ebd807615b30edb6369dd1732798cbe97b34b --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Twill.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c6a79de188d3e2d99d2c9cb46d1f5681497ed7cccc67d878ad70d482012a882b +size 95842 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Twill.mdl@Polyester_Twill.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Twill.mdl@Polyester_Twill.png new file mode 100644 index 0000000000000000000000000000000000000000..e13ebd807615b30edb6369dd1732798cbe97b34b --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Twill.mdl@Polyester_Twill.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c6a79de188d3e2d99d2c9cb46d1f5681497ed7cccc67d878ad70d482012a882b +size 95842 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Twill.mdl@Polyester_Twill_Beige.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Twill.mdl@Polyester_Twill_Beige.png new file mode 100644 index 0000000000000000000000000000000000000000..8f5c1e122cd7208e02bc925d700d5a9fbe191e9b --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Twill.mdl@Polyester_Twill_Beige.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:33e8f511ad836f82a405e2100c3f2aac8f774e98fee1f07893dfc8dd31647906 +size 103971 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Twill.mdl@Polyester_Twill_Brown.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Twill.mdl@Polyester_Twill_Brown.png new file mode 100644 index 0000000000000000000000000000000000000000..105e87f2d5ff961b032ac3db8fb202fb18e379ab --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Twill.mdl@Polyester_Twill_Brown.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9eda65502a7ebd44cc7d157d787031169ca7782074bef86a9b7169dc799f8361 +size 101644 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Twill.mdl@Polyester_Twill_Light_Brown.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Twill.mdl@Polyester_Twill_Light_Brown.png new file mode 100644 index 0000000000000000000000000000000000000000..229aaca50455e67e5317de7efa39ca5a3e3acdea --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Twill.mdl@Polyester_Twill_Light_Brown.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e076e988f0fde45f40d9f47ff08efc3ad13dfe5a41436b3798790021192da6e4 +size 107304 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Twill.mdl@Polyester_Twill_Light_Grey.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Twill.mdl@Polyester_Twill_Light_Grey.png new file mode 100644 index 0000000000000000000000000000000000000000..f81034381e84eeef72b46b69847aa92ee0d0faae --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Twill.mdl@Polyester_Twill_Light_Grey.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9ea8b5099b1d5c0ac3edc6cedce3d672252c4b8b07ab045bd383f609f54799a8 +size 115430 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Twill.mdl@Polyester_Twill_Silver.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Twill.mdl@Polyester_Twill_Silver.png new file mode 100644 index 0000000000000000000000000000000000000000..a45107096d76302f99d56a8c80dcb186471dc354 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Twill.mdl@Polyester_Twill_Silver.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dafbc406ade60e56f7fdc918f1c009c86e30f578c65a69633c1850c6f79cecc2 +size 96953 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Twill.mdl@Polyester_Twill_Tan.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Twill.mdl@Polyester_Twill_Tan.png new file mode 100644 index 0000000000000000000000000000000000000000..cda6803d8008fde80d4270801e76237722b312fb --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Polyester_Twill.mdl@Polyester_Twill_Tan.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0decc1f470febff796b956c4fe564abdf7fa64eafb189f5af27f0eb842106fa1 +size 114121 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..db5b4d732b6abb6de788858c04373a569f7033de --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f2c9e0c0a31dcb6e66094c401a6fa30debec6ab3ea357e2d9e5dbf1f467ed38c +size 82195 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl@Silk_Charmeuse.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl@Silk_Charmeuse.png new file mode 100644 index 0000000000000000000000000000000000000000..db5b4d732b6abb6de788858c04373a569f7033de --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl@Silk_Charmeuse.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f2c9e0c0a31dcb6e66094c401a6fa30debec6ab3ea357e2d9e5dbf1f467ed38c +size 82195 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl@Silk_Charmeuse_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl@Silk_Charmeuse_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..422d8735608ce01c12b25c306351e5a77e6046ff --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl@Silk_Charmeuse_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a77fc1413d90fc08e78450f74d665e047d267aa3b756a59fd8b67a0e95abea52 +size 80708 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl@Silk_Charmeuse_Champagne.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl@Silk_Charmeuse_Champagne.png new file mode 100644 index 0000000000000000000000000000000000000000..c4a98f4116d2456f27556b61f04ac957c8bd7fe0 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl@Silk_Charmeuse_Champagne.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e416b0e01fdbd87df440ab95fdf7053fb296b89a21ff1963f5038b684fa4e2c9 +size 81238 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl@Silk_Charmeuse_Lavender.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl@Silk_Charmeuse_Lavender.png new file mode 100644 index 0000000000000000000000000000000000000000..48077475e1244870015f618821350cba9232cbab --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl@Silk_Charmeuse_Lavender.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8fb660d19ed3d6a75f4baccf43ceac00a0cfea8640180a988320f5bc7dee85a2 +size 80825 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl@Silk_Charmeuse_Light_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl@Silk_Charmeuse_Light_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..d537d2f369c1c6813ea694257b66259da6cca61a --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl@Silk_Charmeuse_Light_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2e4fb53cb16790f505a141b540249cc194ab7921c1f759104a85bec459028d60 +size 82242 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl@Silk_Charmeuse_Natural.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl@Silk_Charmeuse_Natural.png new file mode 100644 index 0000000000000000000000000000000000000000..5402f99675ed51f0a90290b045c7d0e5acd773b1 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl@Silk_Charmeuse_Natural.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:49b48bc6d05c96fd4329274a5a42559dbcce836893289d488a2e587580840fdb +size 82130 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl@Silk_Charmeuse_Orange.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl@Silk_Charmeuse_Orange.png new file mode 100644 index 0000000000000000000000000000000000000000..806bbe48a43f245b37bb710683b76d8b40679b34 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl@Silk_Charmeuse_Orange.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:deaae7f11e5540ba6421937b3febad0dfbc6440bd3adc11269337561e5402d04 +size 83020 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl@Silk_Charmeuse_Purple.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl@Silk_Charmeuse_Purple.png new file mode 100644 index 0000000000000000000000000000000000000000..04d395cffe3954c05c196db8ce7fb93185c96f72 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl@Silk_Charmeuse_Purple.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5d51f08a78b82a84eae8bd78aefeee17dbc3268000f5c0e67e064982163d2cd1 +size 79015 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl@Silk_Charmeuse_Rose.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl@Silk_Charmeuse_Rose.png new file mode 100644 index 0000000000000000000000000000000000000000..def033628dfd1ce8bf44b9e367ecb811ac75c052 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl@Silk_Charmeuse_Rose.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:da47c3375eed327219bae3f0966183c4fcd95d76dc7bb3785586f14dd246912f +size 81495 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl@Silk_Charmeuse_Sand.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl@Silk_Charmeuse_Sand.png new file mode 100644 index 0000000000000000000000000000000000000000..09abc3fa6efa9be8bc6dbed0230eff3f9be46190 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl@Silk_Charmeuse_Sand.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:776618da2434993ef14e058516f87b43ad95b3be089830166182c4d7e51a7bdc +size 80373 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl@Silk_Charmeuse_Silver.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl@Silk_Charmeuse_Silver.png new file mode 100644 index 0000000000000000000000000000000000000000..49234271c49aea69b1fcdf5e507d70b4bbf9579b --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Charmeuse.mdl@Silk_Charmeuse_Silver.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a5dab9b60974ab282c00a3368934ff3de881feb95295cb9c1474de0f22a2a643 +size 81212 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..4b9fb746262d8c774038555fd415ce7184a68aef --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:06e2b062eb940815d60292cdc6cd21d7048936f8f2d12783978638ecab0d6881 +size 104227 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin.png new file mode 100644 index 0000000000000000000000000000000000000000..4b9fb746262d8c774038555fd415ce7184a68aef --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:06e2b062eb940815d60292cdc6cd21d7048936f8f2d12783978638ecab0d6881 +size 104227 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin_Champagne.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin_Champagne.png new file mode 100644 index 0000000000000000000000000000000000000000..ddebacd09e0406f87762f8d94a8e10f2332736be --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin_Champagne.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e2a14b9146c75e5e0d95b5afa8eb572fa534ebccc176962d5edf5eac3383cbd2 +size 103897 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin_Electric_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin_Electric_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..8b42b04ba968c1d5d7448d76515668a5886ce42a --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin_Electric_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f54b7892905487c9d56a7c7cc4d90e55e8602ff96b3bac095af2121290ea800f +size 111117 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin_Forest_Green.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin_Forest_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..90ba85d714e8d9eaf2a8e5e70d1ea61287cd411b --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin_Forest_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:48c8ca184e71e9fba058ef712ba009f9dae04d923a19963e7932bcb2fbaff825 +size 100107 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin_Natural.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin_Natural.png new file mode 100644 index 0000000000000000000000000000000000000000..12b07c086227df747ef305452f0206b922c820b1 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin_Natural.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7b09ef365ad699881cd4dd1dc242902e1543945413ecec63d07fb887b33fd192 +size 103233 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin_Pink.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin_Pink.png new file mode 100644 index 0000000000000000000000000000000000000000..a9fba4c42bf37e282e2f572f48125941195063d5 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin_Pink.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:37c9f6326ead78bc875474653a56e3e538cec4ebfcf0ad6d9a4b6ae797b9d4e9 +size 110029 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin_Purple.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin_Purple.png new file mode 100644 index 0000000000000000000000000000000000000000..1456042fda3f8c78892dbb3824319084cfad92ca --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin_Purple.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:56dcd7bf3c22df4cad25b5baf5e1e164ae38c50ce1181ad1d5633e5ed06a2dd5 +size 109455 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin_Red.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin_Red.png new file mode 100644 index 0000000000000000000000000000000000000000..d7c414b8a68d0806c02c90895d1544c0e571feef --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin_Red.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3a3cb9740f43306c8b50f38585ba8c9e8f577bfc0a605f2d45e186caee7c2355 +size 113531 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin_Rose.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin_Rose.png new file mode 100644 index 0000000000000000000000000000000000000000..899bbefbbd538efd88550a26344386509470250d --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin_Rose.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:284bfaf3bfa99fbb4e17e04f20ae49f64ebd818824ce94e763a267207c8fd659 +size 106569 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin_Royal_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin_Royal_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..6ccd6547c8e40394e2dc70a447a4c28acf478efb --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin_Royal_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:525823254927e38ce9e063be5746fc4d8829f3e0f190ef349e1bf8a139a21cb6 +size 105821 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin_Shiny_Moss.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin_Shiny_Moss.png new file mode 100644 index 0000000000000000000000000000000000000000..303506e491f03e2bfa71420816052fec70d5cfc6 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin_Shiny_Moss.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:df15f7c58c20a8087d9020bbf2c8542da67279c1db2e62a5de54a283c1ee326e +size 105914 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin_Yellow.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin_Yellow.png new file mode 100644 index 0000000000000000000000000000000000000000..1c3b0d6ef49009286bf4ab30f1add090bb546eda --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_Back_Satin.mdl@Silk_Crepe_Back_Satin_Yellow.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7c0fdeb85c438dee0beefe788ca7c9ac67225c4f80c493f6c794bc13e8b2465f +size 109408 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..82805cb174865e1f4339d6fe60fa367c77c36b6b --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3e73c89e84f602d7fbed9c4da576c85391048e7b649590b54bd42c5e72119836 +size 88362 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine.png new file mode 100644 index 0000000000000000000000000000000000000000..82805cb174865e1f4339d6fe60fa367c77c36b6b --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3e73c89e84f602d7fbed9c4da576c85391048e7b649590b54bd42c5e72119836 +size 88362 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine_Champagne.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine_Champagne.png new file mode 100644 index 0000000000000000000000000000000000000000..4bfe5de1034ed648747e70e56a3ec1b71acd9091 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine_Champagne.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:287ec9003535791323be4257d6db9ad42f6a24f2cfa4f0c99fb35aca5216604b +size 87529 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine_Forest_Green.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine_Forest_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..9f13221d9a69744b3b6970511035ae3fd8394bab --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine_Forest_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f1f75509d4112e28bd501fbce0c320bdcfb9f26f9a722297204845ae1278e288 +size 82246 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine_Moss.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine_Moss.png new file mode 100644 index 0000000000000000000000000000000000000000..e0349f66f1fefc06f3116d054a777f86cf0b3a20 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine_Moss.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c8fd2e737900a1e5d1ea4edf4e547b9ab341b5e27a1edc6d5bc65e0dbd08f045 +size 86018 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine_Natural.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine_Natural.png new file mode 100644 index 0000000000000000000000000000000000000000..7faebce9a5e7214dd6783af7cdaadbd54c38ef75 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine_Natural.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5a7cb6824ca0c8576694e90acda6ddb469649576c1e49002ed68cb0fbe2cdbfc +size 88125 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine_Pink.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine_Pink.png new file mode 100644 index 0000000000000000000000000000000000000000..8e58cc30ee92bc718dae57db55a86892128c00a2 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine_Pink.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:418f043295b4a48ec1ddcdcfc92fbb75fa6ec608e78b2e584590969e93f4d912 +size 87577 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine_Purple.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine_Purple.png new file mode 100644 index 0000000000000000000000000000000000000000..d93939ef18540c3a0f2cf78e2caa03d8f4d254cd --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine_Purple.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:691baee8de4872b1b4ecf69dbe924128f919461545b33c9ae13344cebee5b295 +size 87163 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine_Red.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine_Red.png new file mode 100644 index 0000000000000000000000000000000000000000..47133755ed0acc9e67d1ec34ea7309736db0d338 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine_Red.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:03d0ae5f4b51868692a3ec57baa12e4bf4158b5567a90a73d74be9bbee989f08 +size 83311 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine_Rose.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine_Rose.png new file mode 100644 index 0000000000000000000000000000000000000000..e75a8c9ca236733b93faeec0c8aad172423f5e30 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine_Rose.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0dacc1941bd983b97aef28119fc34ec0dc8c4b75d2aebaf258224b608074f024 +size 88680 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine_Royal_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine_Royal_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..0bc80369cf9cddd9e45f5db71ca96d97039c5507 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine_Royal_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:839be273fd0c16af412184b5e7629d12c4641e0e530ea7e2f32d49e6cbb55e9e +size 82241 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine_Sky_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine_Sky_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..341d9f133c95baaaf43a4cf156ddfd88fad5315e --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine_Sky_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:acb6cd085f62f64e6395cb77b60cc859f509f1161c971988b2a7e9d12f240498 +size 87041 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine_Yellow.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine_Yellow.png new file mode 100644 index 0000000000000000000000000000000000000000..e1f8fb25895c53c7d0edb427e3406eeafa2f5c18 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Crepe_de_Chine.mdl@Silk_Crepe_de_Chine_Yellow.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e916891c86705af61c509d25c59897646cbfebec96f3d8ebef11b6276cfa48ff +size 86476 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..dbb092901d89ecd8887c128ee19b962836fb9396 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d5a83212cfe36a32e0bc1f8baff63178fe99103d74aae33b0beafcb218d15849 +size 110439 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette.png new file mode 100644 index 0000000000000000000000000000000000000000..dbb092901d89ecd8887c128ee19b962836fb9396 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d5a83212cfe36a32e0bc1f8baff63178fe99103d74aae33b0beafcb218d15849 +size 110439 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Beige.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Beige.png new file mode 100644 index 0000000000000000000000000000000000000000..b4f1dd7cfaa17c952a1bc4d104d75df93e9ddd34 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Beige.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f1209ab02de7809450f71dd8cc8b719f2c2b80326f44a3f1f4f8925d77231faa +size 107307 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Electric_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Electric_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..32c8c62bb5635aee77fbd5eb9bedd66e2e5b0989 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Electric_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:45d6157951ff695905aa821f1f9f6ddb182f068bb1ec8037713302662cc2bcdf +size 111440 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Fuchsia.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Fuchsia.png new file mode 100644 index 0000000000000000000000000000000000000000..6b4849c086f699476ec7f0683df8fddfcb0923f8 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Fuchsia.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fad8af748f22bd0e6387aeefbd2c3d8fedd11616a3ae97c83c2c05a017bdb0c8 +size 111172 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Green.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..09ff914c5a0591c86a2666465d66857879b35f16 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d1df77337b15978fa7ec68a1eb6165b43a4afe6434576da66d88241f649a55a5 +size 110650 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Lavender.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Lavender.png new file mode 100644 index 0000000000000000000000000000000000000000..01567723b62748a94f5528ebb0c8d20c3c6258b4 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Lavender.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4a98f37d21a522b2fdea87a9e132d70e40f7a792bd472b1c0071170f7335e83c +size 105366 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Mint_Green.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Mint_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..6e78428d2668b43c1ad709e06f5083b452ac6b6c --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Mint_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0b7cf4c4a3d769053c4f18e0ae6fac809cd70df4591aae0d20aadd3f43a9f66e +size 114171 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Orange.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Orange.png new file mode 100644 index 0000000000000000000000000000000000000000..95244c9884906b3622d2dd687b4b0e9d6f33e31c --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Orange.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8e54584df7edc9fa0f729a7d8bb4f60181e1d1c7f17c2e02f2c8d85d75802d5b +size 114854 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Purple.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Purple.png new file mode 100644 index 0000000000000000000000000000000000000000..8d6fbbcb36e3f6cb21b3c807a0d7f045050e34eb --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Purple.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3e5134bb961d7362f62df9027f0a8936897d1079809b56b3c0ecb4035100b478 +size 106567 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Red.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Red.png new file mode 100644 index 0000000000000000000000000000000000000000..45e2f91170cbf9aa339b895e5a1dc0f5b28d0ed2 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Red.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:831782f8fc51b59635a1464d4ef166d9fbbb0235c8d9d319d8eb3435999bc81e +size 110520 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Rose.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Rose.png new file mode 100644 index 0000000000000000000000000000000000000000..1c18626489752749fc7a9d18fa0dd53ae0dbee44 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Rose.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0bd8171d49b12906fcaa93b695d43d9d25b04f2c79d7bce8c0766c0522157cec +size 110266 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Silver.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Silver.png new file mode 100644 index 0000000000000000000000000000000000000000..7be37fb4a9557eb0ad341b6a1255ea132a0ca203 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Silver.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0c478cbd1285a9e28a142ad48605b5d69fee12670e3701c87a9885bd68790d26 +size 103811 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Sky_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Sky_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..ae55524b808a2d1b58ef3d84bb011a7b14615683 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Sky_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:adc6fd95775109c7c17c743a3af8c3e33b0f6a6207bfb53d04b3134d94f873a4 +size 114689 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Turquoise.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Turquoise.png new file mode 100644 index 0000000000000000000000000000000000000000..5cd622207e4d230cea007593de63fde24a6249b9 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Turquoise.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b706b048313abe42be44a73a9df5a631a1288fa4195c4597331f438df38044ac +size 110619 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Yellow.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Yellow.png new file mode 100644 index 0000000000000000000000000000000000000000..9962c74cc63cd8a3dc382fee7140e11be2236826 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Georgette.mdl@Silk_Georgette_Yellow.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cd70ec5e003164c53efbf3f6b86b3c6e575645c2e3b1bcee5fa1c9836efb63d5 +size 113856 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Plain_Chiffon.mdl.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Plain_Chiffon.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..36bf89196bb48b7c1f2bc8db5754b6c9cec4c0b2 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Plain_Chiffon.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bcc28bc4adfa96953c03f7bfee8a79bad0aa3f19185b8fc3788e4a1a29d2c56e +size 128123 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Plain_Chiffon.mdl@Silk_Plain_Chiffon.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Plain_Chiffon.mdl@Silk_Plain_Chiffon.png new file mode 100644 index 0000000000000000000000000000000000000000..36bf89196bb48b7c1f2bc8db5754b6c9cec4c0b2 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Plain_Chiffon.mdl@Silk_Plain_Chiffon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bcc28bc4adfa96953c03f7bfee8a79bad0aa3f19185b8fc3788e4a1a29d2c56e +size 128123 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Plain_Chiffon.mdl@Silk_Plain_Chiffon_Natural.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Plain_Chiffon.mdl@Silk_Plain_Chiffon_Natural.png new file mode 100644 index 0000000000000000000000000000000000000000..5ee55f2450e999f5e4d79a136ffdaa2ccc3d3ce9 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Plain_Chiffon.mdl@Silk_Plain_Chiffon_Natural.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a4e0fb2c39f7aeb889ecc0229eb5561a77973c4957a688d0678b9b0798cbfb5e +size 128165 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Plain_Chiffon.mdl@Silk_Plain_Chiffon_Shiny.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Plain_Chiffon.mdl@Silk_Plain_Chiffon_Shiny.png new file mode 100644 index 0000000000000000000000000000000000000000..d73b698b3206b44a774ae63c88e9bc48892b1520 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Silk_Plain_Chiffon.mdl@Silk_Plain_Chiffon_Shiny.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0e79910d69bc23b127f5600043e43a76827adb2a1f7dce0a85144cfeb83c86d0 +size 128179 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..d2e8b9a97d63444c3173b31d60ae779f2eba7323 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b670c93c974f4b9d5b610976da81efaabc48466f20849343f3c1fcbda9d5028a +size 127781 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone.png new file mode 100644 index 0000000000000000000000000000000000000000..d2e8b9a97d63444c3173b31d60ae779f2eba7323 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b670c93c974f4b9d5b610976da81efaabc48466f20849343f3c1fcbda9d5028a +size 127781 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Black_White.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Black_White.png new file mode 100644 index 0000000000000000000000000000000000000000..6ea0a2d2a603a1da07a4369a067fa31b6be2ec9e --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Black_White.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fce644978119ee87ffa61f2f4363d491320f706670f9e01f1253803097e73335 +size 110746 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Blue_Khaki.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Blue_Khaki.png new file mode 100644 index 0000000000000000000000000000000000000000..b55abc733db02f293e809197e61a4854e3e53299 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Blue_Khaki.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:421690899c618865ea4c57d8ba6f905566515821e439ad5e335435ce4401d161 +size 123599 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Brown.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Brown.png new file mode 100644 index 0000000000000000000000000000000000000000..e91c47a0b75a99798633cd07760a6277a4423cca --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Brown.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:252b96615d8131a2b1b043125b15f23abbb1f49d412a3274f0039c2856bd82cb +size 115398 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Dark_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Dark_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..16ea1d7adec82b8b987093dab78a5f2291e00944 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Dark_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:28f2bfb49b3a7ede5a5dbf966f2da951a2ec292a55403270428a924b5d8afcde +size 120149 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Dark_Brown.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Dark_Brown.png new file mode 100644 index 0000000000000000000000000000000000000000..5b488c50386b6a9e587bebba0c39e2107917f9fa --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Dark_Brown.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7468783c36900c83873b0654fdf024e453403f60e16a5dc1f545c10fc6a0a54f +size 118598 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Gray.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Gray.png new file mode 100644 index 0000000000000000000000000000000000000000..3a5595fad0606eaa2ff270cf016b0e75612eb4d6 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Gray.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:40ce4bb03edd5ec4eb1f9c548f9b2fac41809cc88c073cdd91e660a1adac17c7 +size 105225 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Green_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Green_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..d78f1bdc883808a9dc5c3a2473757ed36ee72f59 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Green_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:304ac2c6eb7c478776af70cb7fd42e1989182311cabc23b29e4de010c08d93e7 +size 125290 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Mustard.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Mustard.png new file mode 100644 index 0000000000000000000000000000000000000000..becad4636cc1f5b6c546002685e7f9a1b37cadf6 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Mustard.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dab92069ee2a13cba5d27a02fce0f15d3e90a893c3bee9fc6da86a064223be5e +size 124981 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Olive_Green.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Olive_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..2a7d088388b266c830691c34b0b7e1c94fd761d8 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Olive_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:21573f4909229a1a0a42a56e37ad41685f1332608eb1e13e722bd3fb366fc465 +size 116536 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Purple_Orange.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Purple_Orange.png new file mode 100644 index 0000000000000000000000000000000000000000..6821bcddedac23201a130c17e5423fc883514456 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Purple_Orange.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:42eff7798f5088f79cc44841a137f0d341f1941643dc1c210f4cb02867961bf7 +size 128950 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Red_Vanilla.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Red_Vanilla.png new file mode 100644 index 0000000000000000000000000000000000000000..999a4877dd463aadc885036a2456684144d633e4 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Red_Vanilla.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:889e46d917f483142416275a8c2751e8129fd6f36a053e0f8b1174f7777a88d0 +size 131117 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Saturated_Green.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Saturated_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..edab403296d1da60998c891dcdf780957954c8ed --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Tweed_Herringbone.mdl@Tweed_Herringbone_Saturated_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4abd9765207d0829d37bc7f4287efc963216a6a568273d8bb97f8a94730d1d45 +size 115592 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..012c29555c115e4e0b24c5a6233fe4d7ed25c4ab --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f98713246a2a039835a9ebc10e2984e625d8619664cefe72286b9a582b8b95a6 +size 83181 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet.png new file mode 100644 index 0000000000000000000000000000000000000000..012c29555c115e4e0b24c5a6233fe4d7ed25c4ab --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f98713246a2a039835a9ebc10e2984e625d8619664cefe72286b9a582b8b95a6 +size 83181 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Black.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Black.png new file mode 100644 index 0000000000000000000000000000000000000000..60aec4ab8bf0b323820b3fce5d85f18404375448 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Black.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:56ff710a00eb003b210c179d152d731b5175210097c4110f291564a221cd4701 +size 75623 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..efffc4bb3c5165f870d029852af3d84e10288a2a --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ceb1da50ec9d7a73895656694f7495ef948e2063fbad13045dfe2eaeadb11d4a +size 82837 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Bordeaux.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Bordeaux.png new file mode 100644 index 0000000000000000000000000000000000000000..33aa0ae8800fd11dbcc5b9ca5470491418017f52 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Bordeaux.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:58d3f195928d722df62c3d1b0465df39a231f8bc45229e444302ae874ba40ada +size 81551 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Dark_Grey.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Dark_Grey.png new file mode 100644 index 0000000000000000000000000000000000000000..aa2c29081600a7154f5f3c368fc6ce26e07868f1 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Dark_Grey.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3879e8f77f775e0c37e38a2a7caeba9065bc809af7587e887e52c309b76e82f2 +size 77254 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Eggplant.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Eggplant.png new file mode 100644 index 0000000000000000000000000000000000000000..6e118816fde5f2a17adba4f485804dffaf841389 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Eggplant.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eae3383ca9aa3529ea429512e08c6019dc12c3d42ed20e2bc6e4152654092f5c +size 78507 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Green.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..ed1c048bbcf13d7040d53a49f8257f44abf40889 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e7257235aaca2652b610cadd6bde520d452e00de2b17d4e99f9f9641c292053b +size 82608 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Ocean_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Ocean_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..68232f620a661bef04d5f633da83e239ebe711cf --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Ocean_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d8a4c9175b4160bb6767bdc5fa8693a28ebd01ac089701a72dc61717fc1ee695 +size 80083 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Orange.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Orange.png new file mode 100644 index 0000000000000000000000000000000000000000..6723875385e12a1d324319d54aab7f012904e07b --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Orange.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f91f4d46b931f07d3c941c6ea4782b51994bbc96fc6fae5ab6d3d4eea5fe2b6c +size 87141 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Shimmering_Dark_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Shimmering_Dark_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..905383186edcf3e1c505aad570898ad86e47443d --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Shimmering_Dark_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e581ec538c0b0ffabf3717ed3587b2435681675944106221256fe1ffe863f7bc +size 86062 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Shimmering_Dark_Red.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Shimmering_Dark_Red.png new file mode 100644 index 0000000000000000000000000000000000000000..f0593ad98a4f71cf2b32af3a1b18545e3b13f997 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Shimmering_Dark_Red.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0d782f59b304222f4941b772198a9f64b0d77e8c024065715e15dc7b9fb163e3 +size 79137 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Shimmering_Emerald.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Shimmering_Emerald.png new file mode 100644 index 0000000000000000000000000000000000000000..a7b2bde1c51af7f28d6042c2d5006e3cf48caab2 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Shimmering_Emerald.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:53aec0dc80296871b6622d57b8e4f5d429fd4693aa4ffcc09675e3ee8d4275a8 +size 79315 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Shimmering_Purple.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Shimmering_Purple.png new file mode 100644 index 0000000000000000000000000000000000000000..1be78526c6c8585e5b4ba45b161739e438814402 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Shimmering_Purple.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:75a759ea5af09eb5fc82c6d717fc3091ad4657dca2597a2b57622ab6d5afb318 +size 80479 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Turquoise.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Turquoise.png new file mode 100644 index 0000000000000000000000000000000000000000..bfd67b2668fc2ee752975720bec1b5cc6a5f4af0 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_Turquoise.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7729c60d353ad1aad22ea2a68e1803388a04443de0057a2b44583d6749f95cc2 +size 83557 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_White.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_White.png new file mode 100644 index 0000000000000000000000000000000000000000..6f3851a5457534615e85861dcc55becd498d212c --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Velvet.mdl@Velvet_White.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c06d8f5e82ec3a7f29dda3db133c60494f79f6828d824ad46f20572a5ee448e4 +size 83558 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..d0ab068ee44400cc19d75c7e5172a77bb1fa85af --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2e0ffc976e0938e4229a78281870ff9f87398710e479b9caa6561744b6b490fe +size 95709 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton.png new file mode 100644 index 0000000000000000000000000000000000000000..d0ab068ee44400cc19d75c7e5172a77bb1fa85af --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2e0ffc976e0938e4229a78281870ff9f87398710e479b9caa6561744b6b490fe +size 95709 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Aubergine.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Aubergine.png new file mode 100644 index 0000000000000000000000000000000000000000..82da63824fdef01d17fdba6ed900aab87af93e27 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Aubergine.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b7444fec064bb78ab52161483c848eea3b4a4318d9cac9cbcdc97017e72139c9 +size 98329 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Blue_Jay.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Blue_Jay.png new file mode 100644 index 0000000000000000000000000000000000000000..f938c0bbce0d75d390a1adf6a58502cfdd0d551b --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Blue_Jay.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:27b263f513be853855e2100f3bec15586f689db283df1240c03cc028840163a9 +size 108648 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Carbon.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Carbon.png new file mode 100644 index 0000000000000000000000000000000000000000..ee8dd347cd5d350febc4283d0e0701bc474a04cd --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Carbon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c739eb68d8fff67707db5965b022dc4b37daf1cb71b1a34f2e5af85548a8543a +size 86515 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Fuchsia.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Fuchsia.png new file mode 100644 index 0000000000000000000000000000000000000000..16883de296f15eb8f7ee21e30423040755a91b67 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Fuchsia.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:549c0654688d091b42550e99826e76853288c6c65d40c8a2bd2a9a8c3f4c58f4 +size 110135 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Garnet.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Garnet.png new file mode 100644 index 0000000000000000000000000000000000000000..589f7ac167e3af2d6222fc19a22c9bc1627912af --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Garnet.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fa9725b729df4eb2e1982add73960eb3d90049f2ee2ae2522e0295c47f3233ac +size 105612 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Gray.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Gray.png new file mode 100644 index 0000000000000000000000000000000000000000..b778ce703925e8df76b0512180050f5a2c379ab8 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Gray.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3f51028b638b27f97ec70287c0921def2743eb5409c9d00711934bc36aaeed0f +size 96641 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Green_Tea.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Green_Tea.png new file mode 100644 index 0000000000000000000000000000000000000000..cabed5d9a8c9b2ba5b6c65faded3d631b6ba156e --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Green_Tea.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bff6bccf34927fe4c3f2d5907d012d318fa22fdc5af08b7adf727db6ecbc013e +size 107608 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Jungle.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Jungle.png new file mode 100644 index 0000000000000000000000000000000000000000..6ea2e4784dcc67de3e4aabbaf32d949377ff6bc5 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Jungle.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b1e2eb43f31dd13744bca4ede2b908168cd2cf02fda44a9d4639a1eaa54d87d6 +size 98099 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Morning_Glory.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Morning_Glory.png new file mode 100644 index 0000000000000000000000000000000000000000..3621c8269b9891af837fad1de1d3c69a357b2445 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Morning_Glory.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ec0480c6ec6a3dbb0eebe23c687c5aaf2ef859ae98cc9575f440e08dedfd8faa +size 102404 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Paprika.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Paprika.png new file mode 100644 index 0000000000000000000000000000000000000000..dce4806121e83271fb0a4aac65663c117cc82bd3 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Paprika.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:04bce8ab2b681b071564bd9bff6eaa44cf9e5958c81113a5adc2d3951ede4172 +size 107745 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Saffron.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Saffron.png new file mode 100644 index 0000000000000000000000000000000000000000..e74bd6dd502cca43b615efe08ef46c46bd9171a7 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Saffron.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2cef796fed60719fe5c690c67fb245694116f3f39b465f77a5005f0c16119abb +size 112662 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Sand.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Sand.png new file mode 100644 index 0000000000000000000000000000000000000000..af125ff7ce55f5d8949437e162c66f17c5d10aae --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Sand.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dd02629740960baecaa16ae9f93af8e5cf41eec490a69efda4b904fb5453eb06 +size 105523 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Tobacco.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Tobacco.png new file mode 100644 index 0000000000000000000000000000000000000000..44fb2b029d460c7758985c92f50c057bb84970b2 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Melton.mdl@Wool_Melton_Tobacco.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4e6a423ba34961c7151dce48c18bc58bf666912f3040abd2debdb7a92a1d98c3 +size 100942 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..231c2465e14ed6473568228b38e96e00ba4e79fc --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6b0886c2e91d3c79211b758c0047e6248903c4131d28a25ed524b3c553da443b +size 100737 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit.png new file mode 100644 index 0000000000000000000000000000000000000000..231c2465e14ed6473568228b38e96e00ba4e79fc --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6b0886c2e91d3c79211b758c0047e6248903c4131d28a25ed524b3c553da443b +size 100737 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Aubergine.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Aubergine.png new file mode 100644 index 0000000000000000000000000000000000000000..9e418378557dccfa10e619dbdc937ce604fa9200 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Aubergine.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2567e3db1fe4269ceb3f8573ba5276759b66d282e486dca5caa9da394f09fc8c +size 89803 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Black_Pepper.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Black_Pepper.png new file mode 100644 index 0000000000000000000000000000000000000000..5b61615a446157f2427ff86a3110721695c36dfa --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Black_Pepper.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c723dbe69b9aadffa3f495d56fb933c05c457c384d2cf63e8266ad0a9dbecd89 +size 86507 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Blue_Jay.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Blue_Jay.png new file mode 100644 index 0000000000000000000000000000000000000000..afcc053c64c40b1bee8728ee14e8163331d1fbcf --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Blue_Jay.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:68353f8728892b12aa448b7364a496f31f9ecaf9f9db1b309758dc06feb0ca2b +size 102869 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Carbon.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Carbon.png new file mode 100644 index 0000000000000000000000000000000000000000..37e551bf905a84af6a8ebb201422106472ded9aa --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Carbon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b8ad1bbc8850796dfa83f4b6e1544b158a65378f864f2499954561c2aad4296a +size 84076 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Charcoal.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Charcoal.png new file mode 100644 index 0000000000000000000000000000000000000000..bc6fe5f5167cf437b7b6d5f555e135779f22d941 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Charcoal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ff89566bd12927fc56e2d6375e799ee433b9dd85514f54c144d2c945e2fd7ed1 +size 87539 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Emerald.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Emerald.png new file mode 100644 index 0000000000000000000000000000000000000000..2243db75b66e62d126d9a878c7cbf69fcc9378a0 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Emerald.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d8d882515845a85da7611b20d568b5d2f1fde14f8e011bad04a49c5378cb73b0 +size 91066 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Fog.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Fog.png new file mode 100644 index 0000000000000000000000000000000000000000..59199ba76840cd109dfb8c1b41ae2e73c3454817 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Fog.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7435d1a2325f775c34647be3db0cdfc71816695fb159fc12ce22a719c1758413 +size 97669 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Fuchsia.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Fuchsia.png new file mode 100644 index 0000000000000000000000000000000000000000..fc7dcdc39e0d3f9935e2d7116dd9a9d7310060ad --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Fuchsia.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ea94b8f6b2a85cba16900a98ed8c48f12d168c7a3f77ae0e5c165f415ff45611 +size 96703 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Garnet.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Garnet.png new file mode 100644 index 0000000000000000000000000000000000000000..06a5674e5059110c00eecb7cd2001219bdb3913c --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Garnet.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:af74a950bf65b6cab9fe52ccf55dbb972120b4c69d0cb61711bd591b27bf623d +size 95226 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Green_Tea.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Green_Tea.png new file mode 100644 index 0000000000000000000000000000000000000000..cad9ada4f486ebcbd36648b51dd76bdf2ff0e2b5 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Green_Tea.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a1d363d31ff59986408d722b5ea51a07ba0fcc14d836931ee5014cec33a76428 +size 104518 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Oyster.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Oyster.png new file mode 100644 index 0000000000000000000000000000000000000000..59230de6297c916de199910d83c7e98a3390539c --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Oyster.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c5c9b3120e475fa52c6800676312e9131e74f3d5e006d29293ef4fb80f2e8f8a +size 105125 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Paprika.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Paprika.png new file mode 100644 index 0000000000000000000000000000000000000000..9f39a7f83bc6d524dd7f1ba77edf90523ea9d9ae --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Paprika.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5b12e832440410ce2333c5b6cdf105d2c6538e85075bdb28cda0f3dd5ee4d437 +size 103864 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Purple.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Purple.png new file mode 100644 index 0000000000000000000000000000000000000000..4eb17a0e1ce45deb1fb2b7fadee1192cae1bb5ea --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Purple.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:577f4de8b80a5d2f2eba1269087d20944269ae7dd91b16c2e767e682549ec6c1 +size 96701 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Saffron.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Saffron.png new file mode 100644 index 0000000000000000000000000000000000000000..e8ceadd8e9499ac0311e4a8a15a33a8ba61db204 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Saffron.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bb458a12e41d14faab0abea55882aa1ed0b8880f5fa8d17456cf448a9fa9f417 +size 106524 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Sand.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Sand.png new file mode 100644 index 0000000000000000000000000000000000000000..53742ed4bdeb80a716c7a8f72a846959fc0be96e --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Sand.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:82c655cc9d6a054100d4c297651da00bb06c494968c8d1f31638d5637e0d8125 +size 105027 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Tobacco.png b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Tobacco.png new file mode 100644 index 0000000000000000000000000000000000000000..e6fda4d6b56ba66e7c14ed2a75ebc7841c2ef605 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/256x256/Wool_Sweater_Knit.mdl@Wool_Sweater_Knit_Tobacco.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f3c6a0b5b4824937eef43660561892607863c9e96942776c044013d749e91fcf +size 97489 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting.png new file mode 100644 index 0000000000000000000000000000000000000000..c134573a8b6ff1467d1249b5cc3dfd4f003ef18c --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aa8ee124c1d0533a54e9917c0e05862fa47def54b52ae83922bb5569c21b4ed1 +size 96492 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Amazon_Clay.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Amazon_Clay.png new file mode 100644 index 0000000000000000000000000000000000000000..b327de76bc150e8726b00fd6522821ba5398e2e3 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Amazon_Clay.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:baa97276ee66b31a19d4a5953ed5c4cfad9c07bd4e22fad743345676b5c394da +size 86864 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Ash_Brown.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Ash_Brown.png new file mode 100644 index 0000000000000000000000000000000000000000..83d654f63f7a464a0355d3b2fb6db6b514ccdecf --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Ash_Brown.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:12e99c41cccd44db78a43b89dca76b0db46e1c36ac5a68b5febdfbb28a9b8d92 +size 83538 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Autumn.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Autumn.png new file mode 100644 index 0000000000000000000000000000000000000000..0aba6b9ff1a5b582497845788ac910c8058eb662 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Autumn.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:70e7fc51aca904417b1e5ec599276b64d9913f4a0b6eba4ee5976aa4dc619b30 +size 99851 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Black.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Black.png new file mode 100644 index 0000000000000000000000000000000000000000..1321be14cbbaaa4ee4a686dcf34fac576c0d2398 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Black.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:26f398374bf2dd17c4c83809a9464afe19d115233dc73958daca7eede3f5689f +size 80046 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Burgundy.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Burgundy.png new file mode 100644 index 0000000000000000000000000000000000000000..d8383624ff65c0bef4a6094ed8627af40417cbc3 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Burgundy.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:07c4645cb0acf91b154f7f4fd930c26fa6fc476e8b97fbe0faf2e4e9508e400e +size 94863 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Champagne.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Champagne.png new file mode 100644 index 0000000000000000000000000000000000000000..d3b9ef0398d400417ebda3f16c7ec31949614168 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Champagne.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b6d4092de68a80c00f2882a2fcf45b2494f71ff3abb43de8dbe530c4e629bfdd +size 94987 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Chocolate.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Chocolate.png new file mode 100644 index 0000000000000000000000000000000000000000..4e1832cfaf8246430433ed711a7cd6d61f17a4c5 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Chocolate.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5aae59a009c76c59239795236999d05b29eab2f659e93c3ab8fb32c09a627c97 +size 90332 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Crimson.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Crimson.png new file mode 100644 index 0000000000000000000000000000000000000000..8210d9b8de20a7e663d545533f8b15fc26f1b65e --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Crimson.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0f4bfdea39ddf3165f6c65538dd68daf53a54373c83dad90bc673470199a515d +size 99204 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Electric.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Electric.png new file mode 100644 index 0000000000000000000000000000000000000000..a24e40c01d3df9dfa85fa25d2d5923bc1bb0e436 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Electric.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b496cc1eabe179f0367cf79f34fff57711117de009f120386986a4b63e99d6e8 +size 99319 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Lavender.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Lavender.png new file mode 100644 index 0000000000000000000000000000000000000000..df3c46f6b9d0bfd93445001b627f5dabe995a8d0 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Lavender.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:15d68269b8e9f2155acea564932e95a574e8fbefe7c71ee77469039f2effba3f +size 95153 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Mint.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Mint.png new file mode 100644 index 0000000000000000000000000000000000000000..d999e3168acd0c5825b66cce1045a307c9477bf3 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Mint.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0776a0ccaa054d6d3b407c533221cddaf89dac3fa05a59c5a66239029bec54a4 +size 94783 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Olive.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Olive.png new file mode 100644 index 0000000000000000000000000000000000000000..2c8b9941ca11aea7b562edb746879c25f8d35090 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Olive.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:509adf5b7d85373de1bb43ba026f32820f7c9ab0a09a51d125666f68736d388f +size 87010 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Rose.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Rose.png new file mode 100644 index 0000000000000000000000000000000000000000..d33935661018630b5e7837b18f172474425fe780 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Rose.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e59da629ccd2dbd846c4079dbd20940010683367d6e589a179b7995016877cd8 +size 101936 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Silver.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Silver.png new file mode 100644 index 0000000000000000000000000000000000000000..d98841c72be55533f337dc978345495c515bbe7a --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Silver.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:71bfaf3b5b02f4da594bb2d6e100af1154b79ba38fb9299f781b0da6d83b0dc3 +size 92176 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Sky_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Sky_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..00ee157c3dafc06ca272476d89a061d2b87dd9b9 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cashmere_Wool_Suiting.Cashmere_Wool_Suiting_Sky_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:922d6ff985d839b1d8646eea0d15264e1b86f0301ef763c866e09c46a437fdc0 +size 97087 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Denim.Cotton_Denim.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Denim.Cotton_Denim.png new file mode 100644 index 0000000000000000000000000000000000000000..ed61c7fc1a6cc6713cbfbe32fbf209ab30d7cbc5 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Denim.Cotton_Denim.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8d98b438078618735afb143d09e899ef3528bb1a4a8dc141815de9ab3b3e1bea +size 92267 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Denim.Cotton_Denim_Black.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Denim.Cotton_Denim_Black.png new file mode 100644 index 0000000000000000000000000000000000000000..d73ba7b5ca7c93375e169ec6e694cf138a366010 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Denim.Cotton_Denim_Black.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cb31eacffa0a2bbea78a5569681beb6276c7ebba36f9f4eb414f3c254a4b6fa4 +size 90085 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Denim.Cotton_Denim_Bleached_Light_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Denim.Cotton_Denim_Bleached_Light_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..869c632946f11faa16946f350baa5cf863179315 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Denim.Cotton_Denim_Bleached_Light_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1973207e94cf74a777fa41ce84936ff3f6474f3f9e919d4b08e54630eed687a1 +size 101892 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Denim.Cotton_Denim_Carbon.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Denim.Cotton_Denim_Carbon.png new file mode 100644 index 0000000000000000000000000000000000000000..cbb164ee50747549339e141b0d7170bc5e6e1174 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Denim.Cotton_Denim_Carbon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0f7c2247bb9cb8e916e0da8aa5b78087ddd22c80879c6c289ea46d25bb6102d5 +size 88692 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Denim.Cotton_Denim_Light_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Denim.Cotton_Denim_Light_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..f0ca98eaa20516f2f86a3e4016ed77a57536ae45 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Denim.Cotton_Denim_Light_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:33e1ed90ea84b795dd11a836fcdeec69c41189bdf845c8b4ccd2f025ea5c50e6 +size 96035 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Brown.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Brown.png new file mode 100644 index 0000000000000000000000000000000000000000..69e52e79662078ee70583125ffb85efbc22d62f1 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Brown.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:05a3b1ec83ef90c24c53f09e1be94596c269938b7c3a7a009bd85d392d60714d +size 89118 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Burgundy.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Burgundy.png new file mode 100644 index 0000000000000000000000000000000000000000..9ec7643e0219e8a08edaa92d1885cb0a4beffe1f --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Burgundy.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0296dc04813b9cbcb2a7e079afc188da678d6177b589401120ac73aca2ac0b6a +size 88040 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Electric_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Electric_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..f7215643a5678fce8ba1dc29b4fa613de8ca81eb --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Electric_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:94fe078afd171bb90a6533616425467e541594e8a52a60ebe0c906af1efad0ea +size 95396 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Fox_Red.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Fox_Red.png new file mode 100644 index 0000000000000000000000000000000000000000..67a0d2fa8218fa9576aac9ad123266e6197ca714 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Fox_Red.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cb1122a326774d22bb1d4af891b26061c5cd388db362ff0d78047fcdd5d5e5d6 +size 92300 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Fuchsia.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Fuchsia.png new file mode 100644 index 0000000000000000000000000000000000000000..1f98ca891b2e095344439cb9ccc39651caad4d5f --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Fuchsia.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:afe2c2675138212ac5728842389a58baba7ef4466c03c1a70aaae163d9c9cb83 +size 95503 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Gray.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Gray.png new file mode 100644 index 0000000000000000000000000000000000000000..f5de69e6de4a8fb7dfdf56c70f32df71843a8d82 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Gray.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ba7ff11a9be5b7f60f3bd62c7a4c9226b0edee999f2e2f45c5217d076bf28772 +size 91488 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Olive_Green.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Olive_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..123cc63c64e8503d15352644e7a065050ed882d6 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Olive_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cb2bbadbea90945b73192b547be9372cba871fa3e9088bd88b6d4108efbff2d3 +size 85832 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Petrol.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Petrol.png new file mode 100644 index 0000000000000000000000000000000000000000..9fe008bca46997cf182c611b1863b7edc4a4c928 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Petrol.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b02ec3df7842433a5a6bbd7134cafc791e9e5844f8d0a9f38145ba6ed3020c48 +size 91200 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Saffron.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Saffron.png new file mode 100644 index 0000000000000000000000000000000000000000..2ff8a21b9ca30a103b99f9afe626882554164ac2 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Saffron.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0715be658536424cc52f16a34df83019a7270dd3331b0136cb3eb8f5a79069c8 +size 94510 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Sand.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Sand.png new file mode 100644 index 0000000000000000000000000000000000000000..836c82878017dd8bd578e2e03953f0d78d37ded1 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Sand.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d0522279782680d80e16ca41e54af393d108b024898f44dd4932b32e8c85d077 +size 94219 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Shrimp.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Shrimp.png new file mode 100644 index 0000000000000000000000000000000000000000..993d7af3bab8992afe8294fbedbff0e8decf5e25 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Shrimp.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4f8ab0d3e0a5502cea4c1f47a49a9d5f19d953fc19494b30d7d2193a96c72e97 +size 95550 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Terracotta.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Terracotta.png new file mode 100644 index 0000000000000000000000000000000000000000..1e5ea8beb699364baaa6fc9474d96eec82fcc2e6 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_French_Terry.Cotton_French_Terry_Terracotta.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3084a4e7e0602aa1ce07c84c7ac25721c2fd0a5138568b5d05b7dfa3df6f6ced +size 95842 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Blue_Jay.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Blue_Jay.png new file mode 100644 index 0000000000000000000000000000000000000000..f24e937ad2ead326df889ba767f5a3ff0d5fc0c9 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Blue_Jay.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f1bc79c09924b4c7762766b0f028551103e182ebbc478243c62a759b9d4646c3 +size 93796 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Carbon.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Carbon.png new file mode 100644 index 0000000000000000000000000000000000000000..2559350fe68f542d74cffe4e56ad157210c9a80e --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Carbon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dfeda1d729595a6048ab7f0d92db88e9995da8e1279e24e77e80305e5d94f63f +size 81333 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Garnet.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Garnet.png new file mode 100644 index 0000000000000000000000000000000000000000..1c4aca1c99b0e68c80d1bcc7b91823ea7498a743 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Garnet.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3bcf68e675c779818461a34bb325973356401b97526049945be001922001813c +size 95310 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Green_Tea.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Green_Tea.png new file mode 100644 index 0000000000000000000000000000000000000000..739e1ace75e2b59276c7e94e495a9235ebd5548d --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Green_Tea.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:83237d634642000e4f9a1901dcb2bcab1720132630715da4dfd119ff323fc52e +size 96172 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Ink.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Ink.png new file mode 100644 index 0000000000000000000000000000000000000000..5273c9f440d252f902c504f7c5746277a50837f9 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Ink.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a31a5ed01ff8775a3720847bfeb8a14e80a5f6e3e7d8964dd8a1376b5d8e0527 +size 89849 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Jungle.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Jungle.png new file mode 100644 index 0000000000000000000000000000000000000000..5325bf9dc23d36d58e3e98a385a22fca25debd51 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Jungle.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b5ea586d19be23dc11f29443ff5d337b52ef7aa6efec7a6e20c39e8318d3ce40 +size 90680 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Paprika.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Paprika.png new file mode 100644 index 0000000000000000000000000000000000000000..b256ab32268e889535d3c64aede3321dcf96fda5 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Paprika.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5e684a4d72c43fcf8f990fbd4c8b8b7ee0d903b025582b5628ea70731f2a0828 +size 104409 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Pepper.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Pepper.png new file mode 100644 index 0000000000000000000000000000000000000000..59ac1863bf93e83204597ce04f1a3d75a8324570 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Pepper.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c7da8346abe55ee1f314f2f7c162a2456ece24abd9fc08f8aa027cd8078fccf6 +size 101728 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Plum.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Plum.png new file mode 100644 index 0000000000000000000000000000000000000000..8e389232af1ab89aa89f311a0a449d52e17e5dc0 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Plum.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:69c5fdf7d40bb306e36ad2ce826470eb238dcde1925e2106ba07c8d49dc7e6c1 +size 95469 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Saffron.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Saffron.png new file mode 100644 index 0000000000000000000000000000000000000000..0a1b9635c03cdb97c4188458e876cca14c92401c --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Saffron.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0de1c64dd1ae1e5ddda19e92f352faeac8c928b3a9696d5bd6676517ef4ea5c2 +size 106201 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Sand.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Sand.png new file mode 100644 index 0000000000000000000000000000000000000000..f78c6062e88ed1dd33eafd8661285113feb04f73 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Sand.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6de34b778eff421cd2e7d7f27dba6cd1a9d9c870bb7d503854ac9c8ac696a126 +size 96268 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Tobacco.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Tobacco.png new file mode 100644 index 0000000000000000000000000000000000000000..6fc69a783d2e7b9010ecf51842aeee27e5b950fb --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Oxford.Cotton_Oxford_Tobacco.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3bea02622b59ec093006f4ce6ac51352435972abd937d00c84fa078fed360c2c +size 94426 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Roughly_Woven.Cotton_Roughly_Woven.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Roughly_Woven.Cotton_Roughly_Woven.png new file mode 100644 index 0000000000000000000000000000000000000000..b3a5251fdd6cce2b9f50592f0ae3e876ed59aef0 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Roughly_Woven.Cotton_Roughly_Woven.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:459014dd31c63337980da74b646951f01e17b2c7b60021b7f267c93a3d1d7478 +size 114719 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Roughly_Woven.Fabric_Cotton_Roughly_Woven_Cheery_Red.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Roughly_Woven.Fabric_Cotton_Roughly_Woven_Cheery_Red.png new file mode 100644 index 0000000000000000000000000000000000000000..7c825f67b03ae6f29444d2945665494bab83bc0c --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Roughly_Woven.Fabric_Cotton_Roughly_Woven_Cheery_Red.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:241cccf3a451f680b1afc88c85b553628da118430786a25c95262d2680520f8c +size 103189 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Roughly_Woven.Fabric_Cotton_Roughly_Woven_Dark_Ash.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Roughly_Woven.Fabric_Cotton_Roughly_Woven_Dark_Ash.png new file mode 100644 index 0000000000000000000000000000000000000000..f69e1a2a2ae3eb176f61d74ae8f05924aa51941f --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Roughly_Woven.Fabric_Cotton_Roughly_Woven_Dark_Ash.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7f012f48df5ae0cdae9d9bdff9ee0acf08bb659fdbf0174116c4bddae2fd12cf +size 87636 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Almond.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Almond.png new file mode 100644 index 0000000000000000000000000000000000000000..8067523879e3b712f96966361a087b95bdb01c8a --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Almond.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7eec083bb10c1ce7f7046929733325e0b0d77d9b06ae086f2a6e9ff314e83b39 +size 94887 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Black.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Black.png new file mode 100644 index 0000000000000000000000000000000000000000..7501656c7606641be10f8791bae2447e459f90b3 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Black.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:36326348ff5a10bdcaeacec6e6078cebfe01f82b423a8af0463c86aa4038c7cd +size 81022 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Burgundy.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Burgundy.png new file mode 100644 index 0000000000000000000000000000000000000000..3c793f2bf80e7227b3d90251df31836917964428 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Burgundy.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8647e643f696a2c11727e44d8e15651c41a2088717a73d92472c8d1de90e7a01 +size 92098 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Cinnamon.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Cinnamon.png new file mode 100644 index 0000000000000000000000000000000000000000..ef3247bb694232f40d76f82e3d16abf9178708fe --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Cinnamon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:faea82693c64b1569d7d6b1179391383b44fc9a401f34c112edad76be6408549 +size 90934 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Hunter_Green.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Hunter_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..33c447dc4232a2d619fce6d7731ead5480ab9bce --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Hunter_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7a2326db460dad42a0be8ff9cfecc4e619e5e1a8047e17c3bbac1fd7001aa15b +size 92120 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Khaki.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Khaki.png new file mode 100644 index 0000000000000000000000000000000000000000..5e386f8e5bbc436148a72a43970e136a96483aa9 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Khaki.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:857c183d4627839bc371adb60333f518ef364e8ac01764f849f60a42ff65ecce +size 93538 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Lemon.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Lemon.png new file mode 100644 index 0000000000000000000000000000000000000000..01e2392f0042b36544b2067f3f178a51c1cad765 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Lemon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1c28dabafbdaa5338d1eeef407ef5e0cfeaa622a4eb72145a210abb43ed9dd2a +size 101988 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Lime.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Lime.png new file mode 100644 index 0000000000000000000000000000000000000000..d87d4f911ef26d71e49080cd21bda71d5e401ef6 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Lime.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ca4debb85d54e92bcd6d82c80fa340ec19981ebd4ea0b606f3f004aedc25c155 +size 102141 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Mint.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Mint.png new file mode 100644 index 0000000000000000000000000000000000000000..d9217f8513cff69ff4b96a987a570a6fab2ebc9f --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Mint.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:52888cfad2449e315024d217fdcf7626eb475fb59d7158da1b13188743443e1d +size 97987 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Plum.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Plum.png new file mode 100644 index 0000000000000000000000000000000000000000..e0e405b71cfc81325cfcad0fd1d7e11c3aea0a24 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Plum.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:12a4e490c42ac8deccce20aa19547081350450857c086bf7946c794e7873dfbd +size 100429 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Raspberry.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Raspberry.png new file mode 100644 index 0000000000000000000000000000000000000000..bff745af6cbc6dae743838dda3b83bc573a5a77c --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Raspberry.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:25586f018e65d844516cb82acd9421ac5a338ef18ff85f91b431a28b10985e4e +size 96904 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Red.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Red.png new file mode 100644 index 0000000000000000000000000000000000000000..1be82c0e1dec74a971bd36ca65731d70ab461ec5 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Red.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d0bfd3870433ff157f1f7125457abab3afe6eded9fec36e0c74d9427dc93148f +size 101200 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Royal_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Royal_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..d1eb2190407f1ca15912fcff941ff5ffc72e8e3a --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Royal_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4669190f86cbcce5d95a1ac591f96821a0cde12c96455f9d05f803f08e3360de +size 95503 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Shrimp.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Shrimp.png new file mode 100644 index 0000000000000000000000000000000000000000..f117c260bc5043a7fd7ce3c990fe34e9addaa3c9 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Shrimp.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8a6ff270b1ea8806a5506115be3ca0417f4293a1916363acfd2b15411257baf8 +size 98164 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Silver.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Silver.png new file mode 100644 index 0000000000000000000000000000000000000000..be5d9fdb5a8787bb9dd520e2853526d5138ce032 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Silver.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ede8cdf30a0ff78d9fc2c3bff3a714d4940dcc39c6f0b359cac0abe98d1b4abf +size 90785 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Slate.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Slate.png new file mode 100644 index 0000000000000000000000000000000000000000..4c8d83cad5f45cf0a36fbeb2cbc9c82dad1ac60c --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Slate.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2f001df49fff76815a4f2c8f885a74863e0c5ee40006a37059e122663e2d8580 +size 95800 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Terracotta.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Terracotta.png new file mode 100644 index 0000000000000000000000000000000000000000..213187c8ae0d28a584e29af64b455f60e05864a7 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Terracotta.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8f4e8d423804d119264c90f500d8251fa199e6956fb6c6aab4a5234b8e60f22d +size 96781 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Turquoise.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Turquoise.png new file mode 100644 index 0000000000000000000000000000000000000000..bb4595d40adada84d5480e1d673f60c22139d7b2 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Single_Jersey.Cotton_Single_Jersey_Turquoise.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0144074246b7fa4523e96bf61d11f965f726357ebf5242b304495680f524ab48 +size 101271 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine.png new file mode 100644 index 0000000000000000000000000000000000000000..d3cbfadd7bed0db0e3c201f9523e0ac1209a52f8 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e4bcfc16d08f1d7da616957af7991603d471b5670fef8a1154292ee6f194423a +size 93486 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Aubergine.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Aubergine.png new file mode 100644 index 0000000000000000000000000000000000000000..af7d890ab85208a5e22dbbf2194d1e3ade6244fc --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Aubergine.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c3d510f797760e2b4109dd7c6539adcf2c9ab99c5e594ffb2c8d255871e90868 +size 88262 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Blue_Jay.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Blue_Jay.png new file mode 100644 index 0000000000000000000000000000000000000000..73191d5f7487fbf466e76f35f7c6557cb24d4f8c --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Blue_Jay.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:147adc96401dc41da1c095a617e3a54315f8ebdffba37985c2a9d703d72197e2 +size 98170 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Carbon.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Carbon.png new file mode 100644 index 0000000000000000000000000000000000000000..dcf70faab7d8e6f2dfb5b521eebd7b98b390641d --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Carbon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e974f0779764b55ef7e617e4971599b56241dbcdf95ca80b2902cbc8cbe0450c +size 84008 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Charcoal.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Charcoal.png new file mode 100644 index 0000000000000000000000000000000000000000..da97f066ad4dc7e69e06cd77bb0fec7f5620806c --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Charcoal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:420fc3a34a22c80eb5ba1bf4a696b17616efb6e85379d7678d8421b4d98c038e +size 85106 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Fog.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Fog.png new file mode 100644 index 0000000000000000000000000000000000000000..3de8e223f2e4c8e44d972309305335745db48799 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Fog.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:20a18cc92dfbc5c8d2d0c8b23f8f16f305e58b40119638c9f7c13e0946d84136 +size 93477 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Fuchsia.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Fuchsia.png new file mode 100644 index 0000000000000000000000000000000000000000..7a9a5280f9ef511aaf326003bba32f0e7d80374d --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Fuchsia.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e89819690cbf2f304481b93b8a7bf7c55cc4dc80f32de5113e1f3632b0e8dde0 +size 99928 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Garnet.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Garnet.png new file mode 100644 index 0000000000000000000000000000000000000000..429b04961e482eaab8e4269dc7199f474dd00519 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Garnet.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:894182af2126f57a9cfbecf0837ae60f459d612cfd6d3a7f97c94b2b386fde54 +size 95286 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Jungle.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Jungle.png new file mode 100644 index 0000000000000000000000000000000000000000..0063a8c00b91865fdf40f84200653eb148165303 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Jungle.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39534cee958aa41a98c69ec976bd8f779c38b20d254ac19412076cf5e3b73358 +size 86654 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Oyster.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Oyster.png new file mode 100644 index 0000000000000000000000000000000000000000..5b0bd9eff7fc67fa5b5615dd968fb2f51eb1b6ae --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Oyster.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7c8b26916920e506fc5b26f676115b0811b13062a38d428bc33c122563c36a92 +size 95946 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Paprika.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Paprika.png new file mode 100644 index 0000000000000000000000000000000000000000..9800c7bd14c5dac70848f0b0dd6fc88824e600b6 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Paprika.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5099e3684bf9075c258af8b92923010082f4b44e6bfaec578249477aca2a6793 +size 101246 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Saffron.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Saffron.png new file mode 100644 index 0000000000000000000000000000000000000000..e603dba2093e3f9e5ac668d7100c2f2b6688174e --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Saffron.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:55a677fee1f44088dc56f045573417216183d9c5c6dd134b7f6cfbf1391c5c08 +size 105159 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Sand.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Sand.png new file mode 100644 index 0000000000000000000000000000000000000000..4c56374a35131f64d9ad6c6a74f14e6c684ff5fd --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Sand.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:07dabc86f1e76e1dfe2e92d7c97ff2be6daaee40f8982e08990ffe57f1aa3dbf +size 96538 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Tobacco.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Tobacco.png new file mode 100644 index 0000000000000000000000000000000000000000..2ed2f82e90d714e778f94aaf91d12ebc785758f8 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Cotton_Twill_Gabardine.Cotton_Twill_Gabardine_Tobacco.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d0b8292f62ad4949036ba650c4a3195ebe4cf5e4d0def480b2213e4b3068791d +size 93247 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven_Dark_Green.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven_Dark_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..b175b0da03f58e8205ea56b0a5673dc5a977f45a --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven_Dark_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9f8ba9740a715f1b4940f20631928411be71d703126388b744454f703e93f6fc +size 97293 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven_Dark_Red.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven_Dark_Red.png new file mode 100644 index 0000000000000000000000000000000000000000..1a7597e580a3dacb96d92f0fc526880d8e8527d1 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven_Dark_Red.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0e87080657ea3e0496ff0a4ffd7614aa2eb80494c3b0bb62f3443df17ca88412 +size 99906 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven_Light_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven_Light_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..5c818537a95e945ed46631d18f5b027d2430ce7e --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven_Light_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cd59fa6fe8610b110be6b36b6ff35f186d6145114fa0eebe0eb0c6cc041f009a +size 103578 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven_Orange.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven_Orange.png new file mode 100644 index 0000000000000000000000000000000000000000..0c807b8ae1fe03eb570d4728d607ccca5fdf90f4 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Fine_Woven.Fabric_Cotton_Fine_Woven_Orange.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4c82c7fe6836e976942d9800dfd2f74a43ceade905aa48e89f1aad4e9de72bad +size 104979 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave.png new file mode 100644 index 0000000000000000000000000000000000000000..1523ea8f5da0f3a2994f4c0f3fcee8bb2074698b --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1fb9249bc0c394e2b6369c16f6a0d76646c235007428e24f4e37526d34dcf46b +size 110842 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Amethyst.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Amethyst.png new file mode 100644 index 0000000000000000000000000000000000000000..7165f3a3ecd8a30e21839875009ecb12868e8e7a --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Amethyst.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b1aaf9c8a403b4e789ffab11520a1b73c037801b14efb7af8c16ec7399b220f4 +size 105767 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Burnt_Coral.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Burnt_Coral.png new file mode 100644 index 0000000000000000000000000000000000000000..e5d660f94b8185b2919ff5077ef1df45fe0d2079 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Burnt_Coral.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:186c6cdac4a3a58ad4e105a7360903969b7c9d965df89866725d37819e758ace +size 109449 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Buttercream.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Buttercream.png new file mode 100644 index 0000000000000000000000000000000000000000..dce937e4d35b8ae2182c0599d47681b589a22e52 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Buttercream.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cfea5356800754f92ceca41dd548eb1880e905d69a2dd3a358cf1870f773549f +size 107694 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Carulean.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Carulean.png new file mode 100644 index 0000000000000000000000000000000000000000..d3bf2e676a19afab5bcdae556df4d7386e1fe412 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Carulean.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c28999a3da85129834c6ff80451169f989ddae9753456e9ca33202419e55404c +size 103964 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Gray.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Gray.png new file mode 100644 index 0000000000000000000000000000000000000000..7e5fde2c93aaa48ee3e2ac30416eb93c8c75877c --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Gray.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d6d16600cb19c08309269f8e536b94d51eed1305e631d3c1df99075ddacc36fe +size 101766 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Green_Ash.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Green_Ash.png new file mode 100644 index 0000000000000000000000000000000000000000..cea1999e0c08bd1031211832aefe9e8cdaa76f76 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Green_Ash.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:473a5d235affd1d287c6db864847e95da03e3bb35bc6dbe8962b05f10813c6f2 +size 107435 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Inkwell.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Inkwell.png new file mode 100644 index 0000000000000000000000000000000000000000..5c107afa5bf17e9d46a884d7fc00c70e22ee5d28 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Inkwell.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aae53d5ea838e25dfb2d1e54293331390eea4478ef8ad58ea4001a33e84a3d41 +size 97852 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Raspberry.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Raspberry.png new file mode 100644 index 0000000000000000000000000000000000000000..533b31d5d0ad5ad856397ac3f4136c56bf29013d --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Fabric_Cotton_Pique_Weave.Fabric_Cotton_Pique_Weave_Raspberry.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c4f42e9e9140cdcc3b60fddf7ab21b813dcfeeab685cb20681f47279914212b2 +size 110102 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Academyblue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Academyblue.png new file mode 100644 index 0000000000000000000000000000000000000000..ceaf2cc7ac58f85fb9f504951810d7d869b23ee2 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Academyblue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:75ca724a2f431d2bd9867c46e2415654c0a2dbd461062bd5dbdabce2e93d6bf5 +size 78739 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Brick.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Brick.png new file mode 100644 index 0000000000000000000000000000000000000000..96957da8925a6328c291ae6a6ba845f00b4a72dd --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Brick.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:71ea4af7c9a2e62df59909747e5d88148a8ac6d1236397cb1a70fd99ec3db473 +size 78483 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Brown.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Brown.png new file mode 100644 index 0000000000000000000000000000000000000000..bb5dd92e7d4aaa01aea8ad456c864d2d3facd518 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Brown.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6a6a0217c585506db11c117e6608eb2aba585159904fe75fc52e96f7b24477fd +size 74770 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Burgundy.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Burgundy.png new file mode 100644 index 0000000000000000000000000000000000000000..1117349616ec3da33651d4d69fb79259b26b7d02 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Burgundy.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0625b065e41ce1d1bd44752fbc9ba89b60eaf033ce77bed35b7d0f49fbf7e9bd +size 77733 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Darkgreen.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Darkgreen.png new file mode 100644 index 0000000000000000000000000000000000000000..a0a9d44bf80f6d83ad438119eb984f20babd4ca1 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Darkgreen.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e1859589f48bf163a17582d154257a2fc1e743ea3e25d2292d494e2d58288b21 +size 72259 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Electricblue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Electricblue.png new file mode 100644 index 0000000000000000000000000000000000000000..17c3fe428c103573396af7b57c003cc258e80d7f --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Electricblue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0915b9f2a6eea6e324998ec3822b2a4f55dd225cac2be518b70a8b79abaa6883 +size 81919 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Euroblue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Euroblue.png new file mode 100644 index 0000000000000000000000000000000000000000..403c48e7a6898d3feb6589ade164507a77fe111c --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Euroblue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8ef1e5a984826c4fab20557a804edcecf3ac201ff1e92e4f9be00e368a6abc63 +size 78506 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Khaki.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Khaki.png new file mode 100644 index 0000000000000000000000000000000000000000..f5532b7f89b09c20f47b79d38da4bf30f14bbd3d --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Khaki.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dad55b2ec22db623f5488fbd558ae1d29ebb214439e0ec9ec59490b7dfead44a +size 79763 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Steelgray.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Steelgray.png new file mode 100644 index 0000000000000000000000000000000000000000..c3d19dd73367ad9fe95274f84c4b016979f705d3 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Steelgray.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:831037711d9047ee8c90122f463ac7a740660e46f0f1869714035e2ca9f7e5d7 +size 76961 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Taupe.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Taupe.png new file mode 100644 index 0000000000000000000000000000000000000000..927dbd1efbbe0a5f3c7c55e844745fb7ae235227 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Taupe.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:69383abf030bfe72551269c232662531920d781670ff02215ff943443f5979e9 +size 73687 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Tournamentgreen.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Tournamentgreen.png new file mode 100644 index 0000000000000000000000000000000000000000..1766a9f355bf6a382e28b17b3bec25f6591048a0 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Felt_Plain.Felt_Mat_Tournamentgreen.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d766019825d5024b1e6a05d53673aac80d4f42d337d68041abdad196625bdae7 +size 77838 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Charmeuse.Polyester_Charmeuse.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Charmeuse.Polyester_Charmeuse.png new file mode 100644 index 0000000000000000000000000000000000000000..20d4fb9399731b48dbd95bf73f93b6d7c3ecdd77 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Charmeuse.Polyester_Charmeuse.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5c63bd6294211ffe29b1f07b958fb155ae965d03468b434a858107daeb4389dc +size 97147 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Aqua_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Aqua_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..e144329d091e7513563157d9c3ddf7f10a93baa9 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Aqua_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4d0dd2591ef31eab4660407321a9bb20f44966fc22bf52d68df793d43bf0e0ff +size 97476 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Black.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Black.png new file mode 100644 index 0000000000000000000000000000000000000000..26f4dc4fc5b5fde2af44fe622b22ba02701f7847 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Black.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:201c0fc9bc641e99c37d0f7b994b48cdc71bd962507d0e2cb750ecfee2ac1f93 +size 86715 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Gold.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Gold.png new file mode 100644 index 0000000000000000000000000000000000000000..c9031ea97cb7da71a2b736b71b391abb842df8f3 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Gold.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3aa95b4e01973ba4626bd987d3ea6eca8ebfb585e20665cab3792b57683485ee +size 99035 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Lemon.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Lemon.png new file mode 100644 index 0000000000000000000000000000000000000000..bb7bf65c461940032114a62c4f0b3666c9a20f84 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Lemon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:07b4594de8d257e8be6bc03db0edd8e5bf2c28b87bbcec9fb37f5eae1e82b72f +size 100203 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Lime_Green.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Lime_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..07bf941c8e414e87ce1706ed268be31ee4be885d --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Lime_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:00f2d5f86f71dfb5dcb81d2e008fd78a1b68a7392bc0344cb356bf84bf020554 +size 98856 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Orange.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Orange.png new file mode 100644 index 0000000000000000000000000000000000000000..578abd33d695bc418a493cbb257daab7bdcba5a2 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Orange.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:53f79c1bc09c843502eb59d956d96aa9f1f2bc54e47b684512a97e34b0874ba9 +size 99210 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Purple.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Purple.png new file mode 100644 index 0000000000000000000000000000000000000000..36d32262819524bc065e4f1b162e5886d47d56b6 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Purple.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:939de87d94e7715ff7e125f60b07f880d902d73b0544866783efeb3c02f212f7 +size 97728 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Red.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Red.png new file mode 100644 index 0000000000000000000000000000000000000000..831771429ab0fdddb6647a66211c9806077c7141 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Red.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0056586b1c21a6e2a9f9d707d04cd868ff62c7be8ed11afab575a5bff7d15c4d +size 97944 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Teal.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Teal.png new file mode 100644 index 0000000000000000000000000000000000000000..0a8c108ad8a844ec9e15a8ab74ee997b196c8859 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Charmeuse.Polyester_Charmeuse_Teal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6867a7768d721aff8a87095b27aa03887bf65e9c22a4fb652fca5d4040c34cfa +size 95769 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine.png new file mode 100644 index 0000000000000000000000000000000000000000..eb0d3eab01d4a48c4fcb463fcb1fa353ac2c7547 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2758eebd99932a2eccb694445afd5489d6ec2cbbcaecb957cf3d4266aaf11264 +size 95875 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Anthracite.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Anthracite.png new file mode 100644 index 0000000000000000000000000000000000000000..9d93daf864ee6d1ded76d7cc4b0d7152f0cdcc1e --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Anthracite.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:826e279e216e4bbf79328fa50294fc29157a8a053b2dd6d848291538b53b540e +size 90023 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Lime_Green.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Lime_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..fb46853f218170256f41c45408a35be516424e69 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Lime_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e190414afeceab4495cd56251f9801605235b4316400f0e82fbf243a7be84552 +size 99102 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Orange.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Orange.png new file mode 100644 index 0000000000000000000000000000000000000000..a6358186d4c9aae415124735f7315fd433a8cb69 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Orange.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6239eb8df42f91a2aa77359b3ba28c042fd2b2a0be57bbdf98b1498390513cf7 +size 101469 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Petrol.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Petrol.png new file mode 100644 index 0000000000000000000000000000000000000000..67ec3855019b37ecbbdac984966012f0cd919d80 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Petrol.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f83eb1432be66e60ad972cbca306aa4ca5a0e20aabc17c2100e84df424859224 +size 96177 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Pink.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Pink.png new file mode 100644 index 0000000000000000000000000000000000000000..27feea5a507e75fb66d5683f7f33b32dd06922a9 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Pink.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0098f6791fa3e74063888b12c6fc47b4bb777da22f0aee9ee2f509d76ea4dfe6 +size 102195 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Purple.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Purple.png new file mode 100644 index 0000000000000000000000000000000000000000..f526286c05b54b0b581b49ae7c323cb6569bd3ae --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Purple.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ed739a7180549d616f250b3243ceb4d896c80e7cfcdc5b6510c9e62a8d062501 +size 97251 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Rose.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Rose.png new file mode 100644 index 0000000000000000000000000000000000000000..88bb137c10234ecb97adcab4bb41938f37a63556 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Rose.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7a9638c1b9c6d2d20217fef9dcb9a8d70804618a003a249fe3951d053a336dfe +size 99003 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Sky_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Sky_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..69362741d315a879b9fcd70b8c0883c108d9f249 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Crepe_de_Chine.Polyester_Crepe_de_Chine_Sky_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6b85bd176679510a06d1ff287684265e01196c613e34b36af06d2b4ad72b8b93 +size 95485 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Beige.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Beige.png new file mode 100644 index 0000000000000000000000000000000000000000..a7a2d9137321d0a652fab68b839b15db44802793 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Beige.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c04ab3c8020d70a2bca264b1e3ba0f8a1ab2374986395f3b66f1f6eb509a82c5 +size 92341 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Brown.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Brown.png new file mode 100644 index 0000000000000000000000000000000000000000..5c1be528c968f9551a477189f561cd66578c27c1 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Brown.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d383a077e3d744c0f441164731d402f3fc1e7ea3bcd3fc89cffc89e171926de9 +size 87958 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Burgundy.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Burgundy.png new file mode 100644 index 0000000000000000000000000000000000000000..42e57c7ed4797cdb1c78bb8d7067a00ce98ee422 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Burgundy.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:15eb7441d2d501345f8eca9615840e07b868240045f719af4955251ef76329d5 +size 92529 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Green.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..638cef4a498982c7cc31809bbe28c568e1ee44aa --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3ac29bf4857dfc27355ae6f10278ce4128458ea7d466d120722aacac0269b5ae +size 89458 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Light_Brown.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Light_Brown.png new file mode 100644 index 0000000000000000000000000000000000000000..f8817fe1e7f9f0151d8e05bc968205291acf737d --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Light_Brown.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b099d659d19ca20abe81c840db928ee394aa915fba9208eb5daa93d6de90450b +size 92444 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Maroon.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Maroon.png new file mode 100644 index 0000000000000000000000000000000000000000..57e7996204b6246e839a43c3e812ff75892e7786 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Maroon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c1a7e73981689e1f884ebce6e1ff280c42b20723961cf67359e987180e28028f +size 90766 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Orange.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Orange.png new file mode 100644 index 0000000000000000000000000000000000000000..d105fdcf0a830a9bc01bdcb36918ba46b7708ca0 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Orange.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:668f63c67f3e459fc5765446c888180eee486bcb071b090286d1128d7ce94c2d +size 100465 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Pastel_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Pastel_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..45ad6645bf5cbf4361e3d3ee12d0095de25c9cfa --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Pastel_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:854d1a96b4936ab3792c23804431bc1d0fd857a738fdabfc41c8299eb0e8daca +size 91763 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Royal_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Royal_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..d0a793e85d03428aa31938802fc5ce08a575a309 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Royal_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1d599e764544229fdfaff5a38636a3d52db6cf169da2c4be8ffcc2d60bb33a85 +size 91705 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Silver.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Silver.png new file mode 100644 index 0000000000000000000000000000000000000000..a5d9d6d88837423ce623686eddbf3ec327cfca47 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Silver.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ce6de49aca5eacb2720108592c7c4ef75a967dc1d9088c16e682e91b641724dd +size 89769 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Tan.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Tan.png new file mode 100644 index 0000000000000000000000000000000000000000..57387043be4ed969d379903c5964044b2524fd0e --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Tan.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:020371da1c400a2ea40ba0eec77d631b8f056a513dfa00c825da874a4a0e4539 +size 98710 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Yellow.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Yellow.png new file mode 100644 index 0000000000000000000000000000000000000000..7d5b36e5ac021a49e7feb6db80ee08f3e3ad59c9 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Herringbone.Polyester_Herringbone_Yellow.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:33d4f064460ad415f5a896520e2ee1f89e964eec64a4c7d214186555527fb0c8 +size 100766 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Twill.Polyester_Twill.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Twill.Polyester_Twill.png new file mode 100644 index 0000000000000000000000000000000000000000..2c42ccbd958e3bd36a4841eb915f5d51a32afc11 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Twill.Polyester_Twill.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:02d77d8ff2b06f8857b0e3c0240d23a3bf1f619ed746d9499a1073ce85410780 +size 85578 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Twill.Polyester_Twill_Beige.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Twill.Polyester_Twill_Beige.png new file mode 100644 index 0000000000000000000000000000000000000000..071ad1b97eb9fe2efaab85eb307b236e7772978e --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Twill.Polyester_Twill_Beige.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b6f3dfcb73df90d06b7b385d0b8421d454755ec349d384a8971c19e733cad356 +size 95858 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Twill.Polyester_Twill_Light_Brown.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Twill.Polyester_Twill_Light_Brown.png new file mode 100644 index 0000000000000000000000000000000000000000..a0880932eae8e2fa6540b94ffd87898abf175afe --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Twill.Polyester_Twill_Light_Brown.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7d9cc2b4847f3a6f6acc16fbf942b27a7560ab3784193a2d3180531f7fa96c69 +size 95963 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Twill.Polyester_Twill_Light_Grey.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Twill.Polyester_Twill_Light_Grey.png new file mode 100644 index 0000000000000000000000000000000000000000..c0865610e1e7e65a7bf8d10c7eaf150139cc64de --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Twill.Polyester_Twill_Light_Grey.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3ed2b6020c0aa1f46d13df9e7db7a73413132a405df34c71fc1b2ac718be7d84 +size 103676 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Twill.Polyester_Twill_Silver.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Twill.Polyester_Twill_Silver.png new file mode 100644 index 0000000000000000000000000000000000000000..58690c3cad3df28ce8c5b277f10517204ede016a --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Twill.Polyester_Twill_Silver.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c3ea08f00e5e21eab659608a51a67908e88c9ce3f46d2378660113e3d1ade19c +size 92935 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Twill.Polyester_Twill_Tan.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Twill.Polyester_Twill_Tan.png new file mode 100644 index 0000000000000000000000000000000000000000..d436ef69a26b63f209f980b009fe09d56b2831fa --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Polyester_Twill.Polyester_Twill_Tan.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f9db80e48edf310ebc5996a2d5359035c1be3fb740638e2be9262de69dc58637 +size 103370 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Charmeuse.Silk_Charmeuse_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Charmeuse.Silk_Charmeuse_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..9b0f6cc354f9ee25e52778c9cf5a0fe24e631f8a --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Charmeuse.Silk_Charmeuse_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:833e99b28b553fe67802495789f5874a44e8db58d6d8b65b64d9e09cbfcd120e +size 97500 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Charmeuse.Silk_Charmeuse_Lavender.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Charmeuse.Silk_Charmeuse_Lavender.png new file mode 100644 index 0000000000000000000000000000000000000000..c98aa189185bf6bfeb0c19994971db82ec4914c8 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Charmeuse.Silk_Charmeuse_Lavender.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c06bfd6c235b650b285e0e20d61ba479eec2558ea51fe8b900be2a85adfb8b7f +size 95436 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Charmeuse.Silk_Charmeuse_Light_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Charmeuse.Silk_Charmeuse_Light_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..ceecfe535bfc00e9100195120314eebeb2fb1c14 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Charmeuse.Silk_Charmeuse_Light_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4137cd201054dffefc7b9fe76986e8d9a9079a61c32a8b3213de520df50f330b +size 96577 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Charmeuse.Silk_Charmeuse_Natural.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Charmeuse.Silk_Charmeuse_Natural.png new file mode 100644 index 0000000000000000000000000000000000000000..59edcf8aab6365ced55cf5e319cb065dbc8bc221 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Charmeuse.Silk_Charmeuse_Natural.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:36d90f953f47a2da61384ce0b9ead72786081eba386a1dda46c36901bdf66a94 +size 96252 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Charmeuse.Silk_Charmeuse_Orange.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Charmeuse.Silk_Charmeuse_Orange.png new file mode 100644 index 0000000000000000000000000000000000000000..b43eb2a0494335e37b86d752c426ba817a7e2164 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Charmeuse.Silk_Charmeuse_Orange.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:193957761a615722de4e6401a7bae363e3ea64c2cb50f2117fde4494e1956c42 +size 102411 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Charmeuse.Silk_Charmeuse_Purple.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Charmeuse.Silk_Charmeuse_Purple.png new file mode 100644 index 0000000000000000000000000000000000000000..bf127c91274bcfa0f4ebcfc74bf69e48f75bee1b --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Charmeuse.Silk_Charmeuse_Purple.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bfa548af6ed296d4bce9d866c805c6905d42b72972a343a13d5260fe8dd65527 +size 98329 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Charmeuse.Silk_Charmeuse_Rose.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Charmeuse.Silk_Charmeuse_Rose.png new file mode 100644 index 0000000000000000000000000000000000000000..76c2908c756f214eff34536f3841addee7aa1cbb --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Charmeuse.Silk_Charmeuse_Rose.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:410324d02dd0317b8bed23b0bbd59f6234274c60781e0347d883f860df00cb9d +size 96864 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Charmeuse.Silk_Charmeuse_Sand.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Charmeuse.Silk_Charmeuse_Sand.png new file mode 100644 index 0000000000000000000000000000000000000000..25633c6b0dbda2a151afbebb71c8146a59965390 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Charmeuse.Silk_Charmeuse_Sand.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:51c42593039578baa7ebf3e13f8d2d1d69246a640d63092bd29438f54e0e696e +size 94583 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Charmeuse.Silk_Charmeuse_Silver.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Charmeuse.Silk_Charmeuse_Silver.png new file mode 100644 index 0000000000000000000000000000000000000000..1b3be8210e06f2621b966490c9c677246e0bf4c5 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Charmeuse.Silk_Charmeuse_Silver.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:10507e2cbfc5204097c307b8282095564e7e9060b140c4801f1b1da0b0000f1c +size 94090 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin.png new file mode 100644 index 0000000000000000000000000000000000000000..96509a955b3acee44e89439e9d9d5897d2cfa8c1 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2bf57c25bb856adbd6990d164dc2ac58a9fbb9a81d3104255137f8d64e4df45e +size 100046 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Electric_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Electric_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..2a96e204739a059bc77986d65fee9b80f5b5b6c1 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Electric_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3b948f2340f461c7149685b24cd1c43afee0d7ee587c0e4c38b692305acac7bb +size 108066 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Forest_Green.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Forest_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..e32c5bfd08237509f4a7fb4af04fce4bdec671eb --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Forest_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7cc90f5dd91f95762c610b01404e9fe3c3540e995d0fc786d0c6e11e5dd8d13c +size 101972 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Natural.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Natural.png new file mode 100644 index 0000000000000000000000000000000000000000..9799ae70eeba32ff93f50fc1bc3072cca22622a0 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Natural.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8061589249f2221139eedebeb3ec4eb638edf0c1142e470a2f97aa7bb051db13 +size 102273 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Pink.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Pink.png new file mode 100644 index 0000000000000000000000000000000000000000..0474c742375cf7a8d4c3725eec984d9a4268ddfb --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Pink.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2d3df611b052fe1e6ee8cd47d74405b45e7f7168404e647cdd5c0d5332e8c6cf +size 109418 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Purple.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Purple.png new file mode 100644 index 0000000000000000000000000000000000000000..2fcc7f02d3065cde75d256cb95d877e5ba306658 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Purple.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d4177bc95e3bd5852a16e112320ef57a648872333791411e8a58b4730eb12568 +size 107736 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Red.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Red.png new file mode 100644 index 0000000000000000000000000000000000000000..992480379f30ac474d61edd94b045ade01eccd66 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Red.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2aadc302dfb8a23529790eb247cd1a978dadfba671a882b3c39533c807ff7ec6 +size 112932 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Rose.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Rose.png new file mode 100644 index 0000000000000000000000000000000000000000..20081acf1c1052b097830c7b7fbc3578d6f638db --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Rose.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:956fecd376de3ae0ea4fd6cd71d84c688891dd179ec0758ae52c6fbc36658882 +size 106586 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Royal_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Royal_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..25ef66a08022b1fb2e2a0ab4a154a342b5aeac20 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Royal_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:87af4a1eeddb470ce9ab6672d066d453644a4c54d08493d1cd1f9d9240301b80 +size 104205 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Shiny_Moss.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Shiny_Moss.png new file mode 100644 index 0000000000000000000000000000000000000000..947ccf9e102d87fae941c95b2bba482398f1b11d --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Shiny_Moss.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1826bcb1ba340779be168899d0f26fdde0b3fbda4efdbb07656ebbde66656637 +size 104097 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Yellow.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Yellow.png new file mode 100644 index 0000000000000000000000000000000000000000..6ae304330a65c1dcee2afe7174cdae3df48cf064 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_Back_Satin.Silk_Crepe_Back_Satin_Yellow.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:988af75719566ad2236d8ecdf94ac3273437bc480266985b4e1de0f70a23298b +size 109030 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine.png new file mode 100644 index 0000000000000000000000000000000000000000..bc39622763a61c2ca9a4943eb5d516be1fba19e2 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:24aedfa86caa4ca54904d752ff51d253736f7f6a97a7964ddb4fee8d678d4470 +size 97432 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Champagne.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Champagne.png new file mode 100644 index 0000000000000000000000000000000000000000..3337a26e1b6d4af83926a8e9dc64d2f28b6ab913 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Champagne.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ae98977d5dc5dd1bf84b1ef37d9f34cc2ce20442175cff211e11c0ab41aef7e5 +size 98020 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Natural.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Natural.png new file mode 100644 index 0000000000000000000000000000000000000000..24f268371a8bcf931a33815dcecced3600f12cf7 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Natural.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:169615aadc3a45c5b6ecc31c6c5489ac15ec11a38e4ac7fbb9ee0c159573e229 +size 98754 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Pink.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Pink.png new file mode 100644 index 0000000000000000000000000000000000000000..bd16813b58ac24d012892f97193accdd801c06b3 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Pink.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4d59a7cd539540f89baaa077083502dfc5d69252dae2c792f24de8b1897b5d3f +size 101556 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Rose.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Rose.png new file mode 100644 index 0000000000000000000000000000000000000000..af65e6686d768d5b6a8c2f3d5d9944493d73b28d --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Rose.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9e7791fc59f39805baa3299560e0c9f942d470411c94e9dd7fe73a8e364af194 +size 100871 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Royal_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Royal_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..e0f03f46e80683e29bdcd1401ed8f9a1ceaac03a --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Royal_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:34b06f021bd20fbee21d05e20f66c91537a65ba01d9f03d97f510e0403d651b8 +size 93925 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Sky_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Sky_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..60efe1ce2b86e1b84ea792eaf79050f3969b8b40 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Sky_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9e6efd27ca4db28dea4291f800232213379fb8ff058a8c4ac8bf033d5f2cf162 +size 99016 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Yellow.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Yellow.png new file mode 100644 index 0000000000000000000000000000000000000000..a614ca1576e032e84449219e1031b0ebe6bb8314 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Crepe_de_Chine.Silk_Crepe_de_Chine_Yellow.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9c56006e37f7187287e589618c55a5578ef96870de1e587ddcebfc8cd64b2888 +size 100976 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Beige.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Beige.png new file mode 100644 index 0000000000000000000000000000000000000000..253eebe0f819f508edb9397baa57d672711489b7 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Beige.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:86d7ba0da1d0fc9d3fee3432ca84b0e82b660825183e1bcd491c969615a23141 +size 99810 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Electric_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Electric_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..27d2608c6c844272845395816b9302192101d02e --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Electric_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:18ef2c7362d61d9022c0fccc28c2cdcf84710adfd0bc0e30dca01cff7f2993eb +size 104668 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Fuchsia.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Fuchsia.png new file mode 100644 index 0000000000000000000000000000000000000000..f1401e37d311837d585ebbe7bb069cbe41039cb0 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Fuchsia.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0aaff64fb2efdf80dbde2c0e97a0a61fbbfba9a9968fcd75d66643e2429c8110 +size 105848 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Mint_Green.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Mint_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..9243221a0a54aed8c3a42ad4ed8651a17d622318 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Mint_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a9438c8b7a04a509787f08ea142a0fda1d3a9389bbee08a1a24f8101ed0e6f66 +size 110475 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Orange.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Orange.png new file mode 100644 index 0000000000000000000000000000000000000000..ddcf91e5f82fb49c7251ec07d492851a4badd49a --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Orange.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5ae161fffe9da0b0273312fa73558dc46d006534f4fbdbbf52d81b626cd9c831 +size 112882 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Purple.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Purple.png new file mode 100644 index 0000000000000000000000000000000000000000..2b88f54cdf306c08207c74cd20129fce96bd7b43 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Purple.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0636f28d587675f89abfbecdb0152a13cc790f9897c4d7ca3c4040966ddb7b3d +size 97648 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Red.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Red.png new file mode 100644 index 0000000000000000000000000000000000000000..18ed3a93507757226c7a41e031aef703c8f9957d --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Red.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:44363ad196a1271332054fc34294ab1242a2ffbb95b727386e386034877f47e4 +size 105563 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Rose.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Rose.png new file mode 100644 index 0000000000000000000000000000000000000000..eb4711bb343278bad5b99acb7227b0b75b7dd62b --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Rose.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:07dfb4e1c2aaf60b59d9192a5f38f49a0998313beb1a10588b50d132a3fad843 +size 104913 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Silver.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Silver.png new file mode 100644 index 0000000000000000000000000000000000000000..ca3eae0696f2e8ab089926355007c7fbbc1bfad9 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Silver.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:506aa22060e035b3f4bb84e93b033bb342fac326b2094fe18f948ddb07399d15 +size 94377 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Turquoise.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Turquoise.png new file mode 100644 index 0000000000000000000000000000000000000000..a431e783f761e9864df3d81bfcf46756f881eef7 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Turquoise.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1d57f016a88e540c863df92b87265b9b9b2958ddf30506dbb0cf040076f86424 +size 104131 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Yellow.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Yellow.png new file mode 100644 index 0000000000000000000000000000000000000000..f680f42144d78b0445f93c995e40a77cc12bd9fa --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Georgette.Silk_Georgette_Yellow.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6ac8d8c653336538d2c2299b9ec3ccaf3588eda894884ef98407b339e828e215 +size 109132 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Plain_Chiffon.Silk_Plain_Chiffon.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Plain_Chiffon.Silk_Plain_Chiffon.png new file mode 100644 index 0000000000000000000000000000000000000000..d328b176780529f52f419c1a0e7e357468d72ba7 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Plain_Chiffon.Silk_Plain_Chiffon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8c93cb45a97f90b00be4b087425a89e0718a6d91ef85e41f2c9c5e7d5b5f11c6 +size 103606 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Plain_Chiffon.Silk_Plain_Chiffon_Natural.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Plain_Chiffon.Silk_Plain_Chiffon_Natural.png new file mode 100644 index 0000000000000000000000000000000000000000..2f66445fbe0fcea4fc65d9a9ab89ff0075becf10 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Plain_Chiffon.Silk_Plain_Chiffon_Natural.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:89a5f8da73231482b5aa8827941de3db6a3f577d146a3d255f1538c650f63152 +size 102424 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Plain_Chiffon.Silk_Plain_Chiffon_Shiny.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Plain_Chiffon.Silk_Plain_Chiffon_Shiny.png new file mode 100644 index 0000000000000000000000000000000000000000..e068f43f83183e24fef44db3893e6644442d52ce --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Silk_Plain_Chiffon.Silk_Plain_Chiffon_Shiny.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ae92cf3104691ed1460965867c65a33977ee95182e65d11a2235da8ab0379e4e +size 102418 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone.png new file mode 100644 index 0000000000000000000000000000000000000000..116cc03ae87748d2599fba38e5d196acf9f6428d --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:83eb92e14b01f3eb0e11be80b47534bb11027ebb1b63ad956a1adbfb44f2c87e +size 119870 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Blue_Khaki.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Blue_Khaki.png new file mode 100644 index 0000000000000000000000000000000000000000..14492edbb66a14e465b6f8c543bcf86b72c2e4ce --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Blue_Khaki.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b26e111b9935f2828da08f2408ad3df2b8c437b3fa1c0887e928cbbd76019c80 +size 115470 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Brown.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Brown.png new file mode 100644 index 0000000000000000000000000000000000000000..e02ed5e55829bcf8eb92ef7b4b170a4cc1c4292f --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Brown.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b699937e4d78795f90ffc1071f669a6a30155c09ed5a1f84cb32c95739727f6b +size 108524 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Dark_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Dark_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..465bafc51c212ca64daf2503125442386618d4d2 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Dark_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f0aca559b62fa951fff3ebae8c10155184605926a18e523b7278037b81fbaf1d +size 112390 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Dark_Brown.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Dark_Brown.png new file mode 100644 index 0000000000000000000000000000000000000000..2a9bbdc467df9b8d6a7bd99998d541b874cad12e --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Dark_Brown.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4bab14db098ff65d9c6dcc1a82743752bb03d8e6457da5ed1508ce9d373e84c5 +size 113162 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Gray.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Gray.png new file mode 100644 index 0000000000000000000000000000000000000000..b7602fa69da35fd8b1c7512dba43782c477b7403 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Gray.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f0ca7179026c0b7efdd0f5a9abaf655caabd720b8ac2c33daec3a4b7b199bd59 +size 104156 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Purple_Orange.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Purple_Orange.png new file mode 100644 index 0000000000000000000000000000000000000000..f0ba390dc4101197879a3fed046d7b9742ad3061 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Purple_Orange.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:52cf662905b8a314a2bd97ca0951ee51fb24112aace31a9635d45d6d7774f472 +size 120064 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Red_Vanilla.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Red_Vanilla.png new file mode 100644 index 0000000000000000000000000000000000000000..d1597f01e9026d771b3a41de7e19c5d71ac2b349 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Tweed_Herringbone.Tweed_Herringbone_Red_Vanilla.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6e1a78746992d0e04befccb7114b9ec8bb3dc554f936cb4a25c26e632617154e +size 123506 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Black.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Black.png new file mode 100644 index 0000000000000000000000000000000000000000..39b31197a05cf75eba4033bcf5b229c7e25d03c3 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Black.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0cb9d88aeef8af39ab667e6229f8b83f789b4b0a2926c9d0201173f7b3859537 +size 87457 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Bordeaux.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Bordeaux.png new file mode 100644 index 0000000000000000000000000000000000000000..8d1591ee2385b741b5dcb872771e7f9f858c533d --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Bordeaux.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d67abc50e0fff1295e3053d3907a0492b01aad6a1f6096f095b0c6d731b98cce +size 97512 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Dark_Grey.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Dark_Grey.png new file mode 100644 index 0000000000000000000000000000000000000000..847b6a10425a8f83d698d06e36c7754f0eede2b1 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Dark_Grey.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b64ccb5c4bcdb192b0cd65543c6877cac2d6e61cf878d2d475d5fc02d2e2d1fa +size 87946 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Eggplant.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Eggplant.png new file mode 100644 index 0000000000000000000000000000000000000000..57848053e6dc8948df2d31d85a83c251e4d5cf99 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Eggplant.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:636565eddd55970cc81186f83599c77451799911ed1011e3c19400fdefdf7d61 +size 93397 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Ocean_Blue.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Ocean_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..a717b81d3bb7ac0cac7a06fbbd9a5cf78871443a --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Ocean_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0149ad326b03eb703bc68cc2e67aa43af227ff7fb1cdd92199ed1724dbb7379c +size 91466 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Orange.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Orange.png new file mode 100644 index 0000000000000000000000000000000000000000..de5274fa6f25354771a3a30c9f22bfb3e2194580 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Orange.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:98bb120e6669cc9e881694b6a4d676f97fede449c832159dd684df0c4985279c +size 102928 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Shimmering_Dark_Red.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Shimmering_Dark_Red.png new file mode 100644 index 0000000000000000000000000000000000000000..cf8bca8f600360aba1fa91493365fdd59e1b1bc0 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Shimmering_Dark_Red.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8cf3dfa03339fffd212395e863901e9bc7d3317356556e878ae4e15b166b4479 +size 94323 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Shimmering_Purple.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Shimmering_Purple.png new file mode 100644 index 0000000000000000000000000000000000000000..f0c3546fe3f4096e217e45f33df56256726c73a0 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_Shimmering_Purple.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3c240ad108b6d755e250bfda015acf0cd05492550c7c05159b45de5648aa4a8f +size 94781 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_White.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_White.png new file mode 100644 index 0000000000000000000000000000000000000000..2dff679550606b1400f8fc237909e138793f155e --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Velvet.Velvet_White.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f8e2b563453c5e4e8a0ded37b3be80ccc13811fbc2b903f625853ba4c617875e +size 95380 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Aubergine.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Aubergine.png new file mode 100644 index 0000000000000000000000000000000000000000..e9514dd62fd9f5c4b3ac48bbb3ec01dfa77778c8 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Aubergine.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:559fee9caa1de191edaac6253b7ef5326c2743678327df3313de4615f482b604 +size 94228 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Fuchsia.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Fuchsia.png new file mode 100644 index 0000000000000000000000000000000000000000..62e6009228784c8a31ba9ba0811ea63d3bd5bc71 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Fuchsia.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8a11cc6084525dc75cc91889abe439e2704069552a919a543b839c5634db460f +size 106733 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Jungle.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Jungle.png new file mode 100644 index 0000000000000000000000000000000000000000..f8fb51f54c5f138535b2d87fdd60b8266080e547 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Jungle.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ca4aa7025ccfe1d0363f99e92229c37fb81ac2699cadd27264318a78dabb64b2 +size 93762 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Morning_Glory.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Morning_Glory.png new file mode 100644 index 0000000000000000000000000000000000000000..5cbe32cc63fcd97348914562e1a5d82b41fc6cba --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Morning_Glory.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:274814bacf75e74c42784dc8a0b22d19369b58c4dfab97ec6596d2e726dbf9d3 +size 98750 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Saffron.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Saffron.png new file mode 100644 index 0000000000000000000000000000000000000000..8df7a6f392fd36a304900eb4313db969eb5359f1 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Melton.Wool_Melton_Saffron.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9d1df5e600fcbb61e7ea6a0af7667e089b82f8e2276ccc2da81069fa75f2fc23 +size 110719 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Aubergine.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Aubergine.png new file mode 100644 index 0000000000000000000000000000000000000000..43aa57d8596f71b8a8e934d883e2280e47dbc9cc --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Aubergine.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:810c5b850d0d59e5ad919e3e48e4c0fa0860999a65fcfea59cb074883b802ff7 +size 85449 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Black_Pepper.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Black_Pepper.png new file mode 100644 index 0000000000000000000000000000000000000000..976eb6ac153a14b7112ec6dfb720e0e42108efdc --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Black_Pepper.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dd8b1a43df5103e702c5c7c2b6813beb24d79ad057778ccce4a73791fa683163 +size 84506 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Carbon.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Carbon.png new file mode 100644 index 0000000000000000000000000000000000000000..c66544fcf296320e77f84c01ef3f76657f92e2cc --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Carbon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ebdcb366d17ec68a2cd748287f762b185b5cfba0e1dc073a32a59680210da6e1 +size 80879 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Charcoal.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Charcoal.png new file mode 100644 index 0000000000000000000000000000000000000000..a69c1faea5148561b37895b9c045979761326646 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Charcoal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dcd2090a1e150f2e79b8c9593afce468863942f691b23089dd50ea8a1a067989 +size 86341 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Emerald.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Emerald.png new file mode 100644 index 0000000000000000000000000000000000000000..c2610a3b9bd917c3013b34f0fd753062c0d42c56 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Emerald.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:beb7973043d9ede9843120f4bb5e12cfcc3360fc7ea211006879704ce34a58b8 +size 87580 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Fog.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Fog.png new file mode 100644 index 0000000000000000000000000000000000000000..60d66bfaf768e30f2f64fa524de17124520a30fa --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Fog.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:558da0420f9da78f818e504f661790d149e1a6a0163ad08090421a346f2b4e68 +size 94774 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Fuchsia.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Fuchsia.png new file mode 100644 index 0000000000000000000000000000000000000000..3bfaf2fa0425e3529f0234330fec04603a384bfb --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Fuchsia.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:64c2057cd34d6cadf2bdda3e8422b77f93f78d4f7d0e0243794f0e134c8289d0 +size 92547 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Garnet.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Garnet.png new file mode 100644 index 0000000000000000000000000000000000000000..912c0a08134c77e1aa619c15581a1e1c2ad0c2f8 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Garnet.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a4fa27c9acc403e2354c36117860b0fd184bea4b5f15e34ce5b48b7644d0f289 +size 91523 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Green_Tea.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Green_Tea.png new file mode 100644 index 0000000000000000000000000000000000000000..7d161e2aab9b4ca6e6d5648b63de3e632c71e756 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Green_Tea.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:43a87d1cb02a36672ccd70527221de96099cd2218010d44e0aa5c8a40b18bb6e +size 100310 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Oyster.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Oyster.png new file mode 100644 index 0000000000000000000000000000000000000000..35bf8f37902227f4c6b02a35a44069f1c9f7e0b4 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Oyster.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2cf48036b049aeca8926d6855e3fb974e8251de8f22fe61af12bcaa5c3d953fa +size 100169 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Paprika.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Paprika.png new file mode 100644 index 0000000000000000000000000000000000000000..1960c4d80ecc9a6b26f66cc39c44b60c9ced93e3 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Paprika.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:92eb7ba7dace4f847a795fd007dd11afb1e4be94da9a1ed26394e6d55cc68582 +size 102930 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Purple.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Purple.png new file mode 100644 index 0000000000000000000000000000000000000000..c56bcf5ce9809af3e72a45447e2d820a30cd363b --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Purple.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eaf11eb57d672d4c3f6564e455abfb59315e0e0914ab829fd5fed4a567c876dd +size 92547 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Saffron.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Saffron.png new file mode 100644 index 0000000000000000000000000000000000000000..63dcaed8add8629f2d025906fd39ed943d029814 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Saffron.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:210054609b6e569702d770d0b5230f001692066969a94eee6734d1534afc35d9 +size 103078 diff --git a/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Tobacco.png b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Tobacco.png new file mode 100644 index 0000000000000000000000000000000000000000..410bfc79fa9e1d3a0b033005b7dbe39b525bd8ab --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/.thumbs/Wool_Sweater_Knit.Wool_Sweater_Knit_Tobacco.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b23c4fad17b5d607820194b3f51a48299b58763f8a9312ff542851dee3ff4540 +size 93924 diff --git a/code/third_party/vMaterials_2/Fabric/textures/cashmere_wool_suiting_R_diff.jpg b/code/third_party/vMaterials_2/Fabric/textures/cashmere_wool_suiting_R_diff.jpg new file mode 100644 index 0000000000000000000000000000000000000000..8e2cf483b6c0de96ceae343dbf3db1cf08ba59b2 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/textures/cashmere_wool_suiting_R_diff.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:732b2873e3370929bbdc205b798b9689e4e9a29ab9058c0facaf1242f75ee675 +size 1060148 diff --git a/code/third_party/vMaterials_2/Fabric/textures/cashmere_wool_suiting_R_rough_G_ao_B_height.jpg b/code/third_party/vMaterials_2/Fabric/textures/cashmere_wool_suiting_R_rough_G_ao_B_height.jpg new file mode 100644 index 0000000000000000000000000000000000000000..88a6aced32884d3559ceed0fb40fb2259b0ba4ab --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/textures/cashmere_wool_suiting_R_rough_G_ao_B_height.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e46260600b9db509bca273c3f4706e62b81cd86e841d15df234e95daed0131b9 +size 1918218 diff --git a/code/third_party/vMaterials_2/Fabric/textures/cashmere_wool_suiting_norm.jpg b/code/third_party/vMaterials_2/Fabric/textures/cashmere_wool_suiting_norm.jpg new file mode 100644 index 0000000000000000000000000000000000000000..1a53ea2d031ae8c1d7a87bd13ace199ab4369114 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/textures/cashmere_wool_suiting_norm.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b91e50065a847c865102e3e369dcdc859adb20896a070a333d49430d0f65b7fb +size 1484447 diff --git a/code/third_party/vMaterials_2/Fabric/textures/charmeuse_weaving_02_R_id_G_offs.png b/code/third_party/vMaterials_2/Fabric/textures/charmeuse_weaving_02_R_id_G_offs.png new file mode 100644 index 0000000000000000000000000000000000000000..2b0bc5bb50ed28b855d50f29e97ccb60c2eef883 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/textures/charmeuse_weaving_02_R_id_G_offs.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bc5d4339a504a8e94d870b01be1773f182e96452b3cba1a37dad5a4ebd5e2f25 +size 3788 diff --git a/code/third_party/vMaterials_2/Fabric/textures/cot_ox_norm.jpg b/code/third_party/vMaterials_2/Fabric/textures/cot_ox_norm.jpg new file mode 100644 index 0000000000000000000000000000000000000000..49d017e17f53ecdeb21fbc49acd84551c66cd6b3 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/textures/cot_ox_norm.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6ad33ef39775a156a33ad8bee7fe0e37cefd2c075b45b2ede36433f50a5467b3 +size 2778856 diff --git a/code/third_party/vMaterials_2/Fabric/textures/cotton_french_terry_R_diff_G_rough_B_ao_A_height.png b/code/third_party/vMaterials_2/Fabric/textures/cotton_french_terry_R_diff_G_rough_B_ao_A_height.png new file mode 100644 index 0000000000000000000000000000000000000000..1648d51dc3a62be293fb13d210d4df5943bd4bfc --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/textures/cotton_french_terry_R_diff_G_rough_B_ao_A_height.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e32004057b1cde201f9411743e590f35c36c38daedd6ab2972b2fcbe051533fa +size 11295853 diff --git a/code/third_party/vMaterials_2/Fabric/textures/cotton_roughly_woven_rough.jpg b/code/third_party/vMaterials_2/Fabric/textures/cotton_roughly_woven_rough.jpg new file mode 100644 index 0000000000000000000000000000000000000000..6ee9d4a037820b71e105b888b30e1c3405185d05 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/textures/cotton_roughly_woven_rough.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0c179bcd2733135af67d8f473a8b3f49aea758df987ed4745683684b649c9586 +size 3727699 diff --git a/code/third_party/vMaterials_2/Fabric/textures/crepe_de_chine_norm.jpg b/code/third_party/vMaterials_2/Fabric/textures/crepe_de_chine_norm.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a0855d2f9db776c5672d195dd0e18e175b78894e --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/textures/crepe_de_chine_norm.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aa3f402dec75624df44b9c3337ffbc688819e544aaf6176c574c349f111a7733 +size 1774790 diff --git a/code/third_party/vMaterials_2/Fabric/textures/crepe_de_chine_var.jpg b/code/third_party/vMaterials_2/Fabric/textures/crepe_de_chine_var.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2d95d76f361f1fe6a28b049ad83d7d462cb1987c --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/textures/crepe_de_chine_var.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:63c20f8436615b7aad19eca23394bc6caa99f125e52234c9be93935006810802 +size 1882897 diff --git a/code/third_party/vMaterials_2/Fabric/textures/crepe_norm_2.jpg b/code/third_party/vMaterials_2/Fabric/textures/crepe_norm_2.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e9f3571891324a7a34d370d4ad23ab6c881444be --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/textures/crepe_norm_2.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e58a6047b94e11b55e852fc1e2d0696a157d8e9093c7b12004d23966e511b145 +size 1800029 diff --git a/code/third_party/vMaterials_2/Fabric/textures/denim_R_diff_G_mask.jpg b/code/third_party/vMaterials_2/Fabric/textures/denim_R_diff_G_mask.jpg new file mode 100644 index 0000000000000000000000000000000000000000..39d198c17d310dd34205d51e0b56f536a524c24f --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/textures/denim_R_diff_G_mask.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:22c456a7dba14368eedca624ee481eb958b03854582266a084604b24d85e596e +size 3298503 diff --git a/code/third_party/vMaterials_2/Fabric/textures/denim_R_rough_G_ao_B_height.jpg b/code/third_party/vMaterials_2/Fabric/textures/denim_R_rough_G_ao_B_height.jpg new file mode 100644 index 0000000000000000000000000000000000000000..b0e3fff490ba3049676c29c3476b36444b287d15 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/textures/denim_R_rough_G_ao_B_height.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de00bacfe7ce277f470fce28ca160b7f6041b28459c20c4f813fd37fd49584ae +size 3660431 diff --git a/code/third_party/vMaterials_2/Fabric/textures/denim_warp.jpg b/code/third_party/vMaterials_2/Fabric/textures/denim_warp.jpg new file mode 100644 index 0000000000000000000000000000000000000000..1b21f9ca5b70320c91e7e43ca90f4d1cd2512851 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/textures/denim_warp.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0d9eab80f30ad65fa32197d8241c4dfc8241a96482ec5d4dd11dafb7e39c16db +size 259956 diff --git a/code/third_party/vMaterials_2/Fabric/textures/fabric_warp.jpg b/code/third_party/vMaterials_2/Fabric/textures/fabric_warp.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2f1374c07bd66856c64a8f1247cab2d4435a3f29 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/textures/fabric_warp.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2a753baae00cfb35e5aa0b548fc911aa5fda3603d5f25a555c87f7fb3d610a07 +size 141557 diff --git a/code/third_party/vMaterials_2/Fabric/textures/felt_fuzz_mask.jpg b/code/third_party/vMaterials_2/Fabric/textures/felt_fuzz_mask.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e202cd01e951bbb7ea77ca7531867b85864332c7 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/textures/felt_fuzz_mask.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:738fb808574dd21814cfbfde4ce3bf29f40de535e49c83eb6abe5d689d5d94c0 +size 1229106 diff --git a/code/third_party/vMaterials_2/Fabric/textures/fibers.jpg b/code/third_party/vMaterials_2/Fabric/textures/fibers.jpg new file mode 100644 index 0000000000000000000000000000000000000000..d9d4ec414382400ea6b7fef18095b88425154e5a --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/textures/fibers.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8fd0dee8b4183adee7720ea33bdf54d7c249c554619a9d97575fc1cf3aac6d66 +size 519681 diff --git a/code/third_party/vMaterials_2/Fabric/textures/fine_woven_cotton_norm.jpg b/code/third_party/vMaterials_2/Fabric/textures/fine_woven_cotton_norm.jpg new file mode 100644 index 0000000000000000000000000000000000000000..4e390fae764e239c5ee707f5df23736e6c3a9a82 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/textures/fine_woven_cotton_norm.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:27af7247cd5fe3e5cf3508d8f3b4436682263a299abc6c450b3695042db4fb86 +size 5114440 diff --git a/code/third_party/vMaterials_2/Fabric/textures/french_terry_fabric_warp.png b/code/third_party/vMaterials_2/Fabric/textures/french_terry_fabric_warp.png new file mode 100644 index 0000000000000000000000000000000000000000..7ddb95ce9c95c3b5944b1b727ea240f3b77e104a --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/textures/french_terry_fabric_warp.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6dcde159c06cea395ece9a519c1cff04235f5b0295518e1a7bac062413c0e2f7 +size 197484 diff --git a/code/third_party/vMaterials_2/Fabric/textures/pique_weave_multi_R_rough_G_ao_B_height.jpg b/code/third_party/vMaterials_2/Fabric/textures/pique_weave_multi_R_rough_G_ao_B_height.jpg new file mode 100644 index 0000000000000000000000000000000000000000..c423663df268a6f989853f37cddd757142010c29 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/textures/pique_weave_multi_R_rough_G_ao_B_height.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:71accf4506c8fd8eea409dcfe1716e173089b4cf449ec3b875751d2ca1f8da18 +size 4973850 diff --git a/code/third_party/vMaterials_2/Fabric/textures/polyester_herringbone_multi_R_diff_G_rough_B_dirt.jpg b/code/third_party/vMaterials_2/Fabric/textures/polyester_herringbone_multi_R_diff_G_rough_B_dirt.jpg new file mode 100644 index 0000000000000000000000000000000000000000..eeb9006cae699e64c239986677a09f6d6f122934 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/textures/polyester_herringbone_multi_R_diff_G_rough_B_dirt.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7b4483b3810121fd0b999782ab18490e0c48b6bb92818f429f18b83c671fc768 +size 1182383 diff --git a/code/third_party/vMaterials_2/Fabric/textures/polyester_herringbone_norm.jpg b/code/third_party/vMaterials_2/Fabric/textures/polyester_herringbone_norm.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a387637be7521025d156f9374f7d013e84bb5d9c --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/textures/polyester_herringbone_norm.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:793d8803536a72226b631e14b9297937241d5271929ca6016fdaa34ede639c95 +size 2729749 diff --git a/code/third_party/vMaterials_2/Fabric/textures/polyester_twill_multi_R_diff_G_rough_B_dirt.jpg b/code/third_party/vMaterials_2/Fabric/textures/polyester_twill_multi_R_diff_G_rough_B_dirt.jpg new file mode 100644 index 0000000000000000000000000000000000000000..5a1bd18762e1ad7eb48ec80d24c9a928cef53906 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/textures/polyester_twill_multi_R_diff_G_rough_B_dirt.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:143a9a72412f787af85c5d554b37a833e23b77a2f7b31150b05aced341538051 +size 1587505 diff --git a/code/third_party/vMaterials_2/Fabric/textures/polyester_twill_norm.jpg b/code/third_party/vMaterials_2/Fabric/textures/polyester_twill_norm.jpg new file mode 100644 index 0000000000000000000000000000000000000000..4d2ba8c9450d9e01fba0ef535e08df43241e9b97 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/textures/polyester_twill_norm.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2639c3e274c2d59d0713099f13b8f9f6375366b16f8cb3831804269aff392796 +size 1537828 diff --git a/code/third_party/vMaterials_2/Fabric/textures/silk_crepe_satin_R_rough_G_diff_B_height.jpg b/code/third_party/vMaterials_2/Fabric/textures/silk_crepe_satin_R_rough_G_diff_B_height.jpg new file mode 100644 index 0000000000000000000000000000000000000000..84c135332f7ec1a6ec8abcee250a4acb1eedb17c --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/textures/silk_crepe_satin_R_rough_G_diff_B_height.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4267ec7d51f78bb2d1cc07fe06fc4acd7bb70b8345fe19990932f7e688085133 +size 1981810 diff --git a/code/third_party/vMaterials_2/Fabric/textures/silk_georgette_R_rough_G_ao_B_height.jpg b/code/third_party/vMaterials_2/Fabric/textures/silk_georgette_R_rough_G_ao_B_height.jpg new file mode 100644 index 0000000000000000000000000000000000000000..064567046ea71c32d6622df291f03f503c1025a0 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/textures/silk_georgette_R_rough_G_ao_B_height.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1d7153958fcee8a85f864eec5ed0d71a89be9ad63a6d18320ca3aeae881e8c58 +size 1563462 diff --git a/code/third_party/vMaterials_2/Fabric/textures/silk_georgette_norm.jpg b/code/third_party/vMaterials_2/Fabric/textures/silk_georgette_norm.jpg new file mode 100644 index 0000000000000000000000000000000000000000..7895412fb96f9d113cb953b5c592661401ee877e --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/textures/silk_georgette_norm.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:472f674a6a2adb6f4e290568244f899fa44b5e5c6e363e4412b300d18b6b852d +size 1473365 diff --git a/code/third_party/vMaterials_2/Fabric/textures/silk_georgette_roughvar.jpg b/code/third_party/vMaterials_2/Fabric/textures/silk_georgette_roughvar.jpg new file mode 100644 index 0000000000000000000000000000000000000000..4ed2630d1fc92b13230ea10c7d662fdec4991f35 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/textures/silk_georgette_roughvar.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0cbd5a525ebed6074416e4be572d16543b460bca7944975bdf2bcc890c19ba03 +size 677344 diff --git a/code/third_party/vMaterials_2/Fabric/textures/silk_plain_chiffon_R_diff.jpg b/code/third_party/vMaterials_2/Fabric/textures/silk_plain_chiffon_R_diff.jpg new file mode 100644 index 0000000000000000000000000000000000000000..52936f0e5819a86e4eda7a983b2ce728d47e3314 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/textures/silk_plain_chiffon_R_diff.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bcbd109bc66bb47e416127856f7e549f2fe198aee1cec4ea0cea791a5497b117 +size 1030433 diff --git a/code/third_party/vMaterials_2/Fabric/textures/single_jersey_norm.jpg b/code/third_party/vMaterials_2/Fabric/textures/single_jersey_norm.jpg new file mode 100644 index 0000000000000000000000000000000000000000..9f103dd903c270aed95e032e7c2a2dd4d429482e --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/textures/single_jersey_norm.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3e21dafa2c1e7376a5700d0b4b8d252bf096e2c4fb49f782e474cdb39632ad41 +size 2419779 diff --git a/code/third_party/vMaterials_2/Fabric/textures/tweed_fibers_diff.jpg b/code/third_party/vMaterials_2/Fabric/textures/tweed_fibers_diff.jpg new file mode 100644 index 0000000000000000000000000000000000000000..8f2f74045f46802c310532e5bbb24789faadf4d8 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/textures/tweed_fibers_diff.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:12df0c22f625add61b1941fccb6c4d55243a8b74395f8d6741383e6764a17665 +size 3247529 diff --git a/code/third_party/vMaterials_2/Fabric/textures/tweed_fuzz_diff.png b/code/third_party/vMaterials_2/Fabric/textures/tweed_fuzz_diff.png new file mode 100644 index 0000000000000000000000000000000000000000..25eddf8cf870b1ada77da5558eb51f25d01979bb --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/textures/tweed_fuzz_diff.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ab52cbc820806214650946604cab1c5575629cf59c772b11291616c417fc6dbc +size 16675007 diff --git a/code/third_party/vMaterials_2/Fabric/textures/tweed_norm.jpg b/code/third_party/vMaterials_2/Fabric/textures/tweed_norm.jpg new file mode 100644 index 0000000000000000000000000000000000000000..aab2a299441698bdb1d0e68f347f8fbe448a0147 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/textures/tweed_norm.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:69897c73ac081fb7aafb96e4fca04f95fbf0416a50760592938d192d8411c3b3 +size 6395862 diff --git a/code/third_party/vMaterials_2/Fabric/textures/twill_gabardine_R_rough_G_ao_B_height.jpg b/code/third_party/vMaterials_2/Fabric/textures/twill_gabardine_R_rough_G_ao_B_height.jpg new file mode 100644 index 0000000000000000000000000000000000000000..3da023b8953a1ccf875bc44d6b812f95df707369 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/textures/twill_gabardine_R_rough_G_ao_B_height.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0d63a39a9e1932c9cfdacc527fd5a5aa3651dcae848563e5fbc3a71b3b9687f5 +size 5117759 diff --git a/code/third_party/vMaterials_2/Fabric/textures/velvet_diff.jpg b/code/third_party/vMaterials_2/Fabric/textures/velvet_diff.jpg new file mode 100644 index 0000000000000000000000000000000000000000..4bd9a7c388cb3854c35d9a352ab8b863827d5552 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/textures/velvet_diff.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5fe6a544cd302f0f3fd7bb9fb6ccd6c8bac98a3472158eb5813fcdfa5b68f095 +size 2749962 diff --git a/code/third_party/vMaterials_2/Fabric/textures/velvet_imperfections.jpg b/code/third_party/vMaterials_2/Fabric/textures/velvet_imperfections.jpg new file mode 100644 index 0000000000000000000000000000000000000000..90d94ba81fd415dae0a32261713b41ac01f06dbd --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/textures/velvet_imperfections.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0862089ef822953fff76e05a450eb66365b805c98ad1551ad4a543d8d9ed6448 +size 1532720 diff --git a/code/third_party/vMaterials_2/Fabric/textures/wool_knit_R_diff.jpg b/code/third_party/vMaterials_2/Fabric/textures/wool_knit_R_diff.jpg new file mode 100644 index 0000000000000000000000000000000000000000..692adc31d72c2f487bfb5cb8fa052438290caa5e --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/textures/wool_knit_R_diff.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d1917cfbbf69161ff6bdfe5e693ce3279094c70620fdfedaba986913d29f3e73 +size 916220 diff --git a/code/third_party/vMaterials_2/Fabric/textures/wool_knit_R_rough_G_ao_B_height.jpg b/code/third_party/vMaterials_2/Fabric/textures/wool_knit_R_rough_G_ao_B_height.jpg new file mode 100644 index 0000000000000000000000000000000000000000..9f97afcc3254c9b586fd50c26a885d5687f19a7c --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/textures/wool_knit_R_rough_G_ao_B_height.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:291843cba368bb290f643b45ce4abb950c6769d310c9a07963108d0c8978fadb +size 1631277 diff --git a/code/third_party/vMaterials_2/Fabric/textures/wool_knit_norm.jpg b/code/third_party/vMaterials_2/Fabric/textures/wool_knit_norm.jpg new file mode 100644 index 0000000000000000000000000000000000000000..3c867c7bc2cfb2dc30b460199b13f42ff61087c2 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/textures/wool_knit_norm.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0d59e306d248206604b04e8a9f5f4acebcd62747011eeaf317e8fa46044d0ce6 +size 1311807 diff --git a/code/third_party/vMaterials_2/Fabric/textures/wool_melton_R_diff_G_fuzz.jpg b/code/third_party/vMaterials_2/Fabric/textures/wool_melton_R_diff_G_fuzz.jpg new file mode 100644 index 0000000000000000000000000000000000000000..803ab17a30f59d28359a2b2f909f1e30bae6a7c2 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/textures/wool_melton_R_diff_G_fuzz.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7eaa6b578297f4d038d827c9db7cd571f22dd976f1c60e805f4b22093014a643 +size 957100 diff --git a/code/third_party/vMaterials_2/Fabric/textures/wool_melton_R_rough_G_ao_B_height.jpg b/code/third_party/vMaterials_2/Fabric/textures/wool_melton_R_rough_G_ao_B_height.jpg new file mode 100644 index 0000000000000000000000000000000000000000..aa3f3031a692798d854a8edc62f356e233a68572 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/textures/wool_melton_R_rough_G_ao_B_height.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:62bf61f1301f5fb0df1af8d4f2a3b98597bd1c12fa155e44e0454b568d235466 +size 1880330 diff --git a/code/third_party/vMaterials_2/Fabric/textures/wuckerl_R_ao_G_mask.jpg b/code/third_party/vMaterials_2/Fabric/textures/wuckerl_R_ao_G_mask.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f9c85ec18e34143f7911ef18258237dbdd15e3b3 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/textures/wuckerl_R_ao_G_mask.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:770ce7de12ff48eb4323f9251260eea17bb86f2f954c5bf480fd996ff0764e90 +size 1371864 diff --git a/code/third_party/vMaterials_2/Fabric/textures/wuckerl_norm.jpg b/code/third_party/vMaterials_2/Fabric/textures/wuckerl_norm.jpg new file mode 100644 index 0000000000000000000000000000000000000000..7677ef59dd10ed0703d3e6c1c8f82ee39cde1995 --- /dev/null +++ b/code/third_party/vMaterials_2/Fabric/textures/wuckerl_norm.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c0853f2d770b691ad78b54805edbe4dbabdf6d66c26eeb05259813ef2cace31d +size 1099801 diff --git a/code/third_party/vMaterials_2/Metal/Aging_Copper.mdl b/code/third_party/vMaterials_2/Metal/Aging_Copper.mdl new file mode 100644 index 0000000000000000000000000000000000000000..25622daf83179bd1f18bd7025fc26bbd5073cdb0 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/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 = float2(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 = float2(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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/aging_copper_haze_weight.png", ::tex::gamma_linear), age, 0).x, ::df::microfacet_ggx_smith_bsdf(0.16f, 0.16f, gradient_lookup(texture_2d("./textures/aging_copper_gradient.png", ::tex::gamma_srgb), ::math::clamp((flow_stains_balance - 0.5f) * 2.f * float3(infinite_tiling ? endless_texture(texture_2d("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/aging_copper_gradient.png", ::tex::gamma_srgb), ::math::clamp((flow_stains_balance - 0.5f) * 2.f * float3(infinite_tiling ? endless_texture(texture_2d("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/aging_copper_norm.jpg", ::tex::gamma_linear), ::math::clamp((flow_stains_balance - 0.5f) * 2.f * float3(infinite_tiling ? endless_texture(texture_2d("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/aging_copper_norm.jpg", ::tex::gamma_linear), ::math::clamp((flow_stains_balance - 0.5f) * 2.f * float3(infinite_tiling ? endless_texture(texture_2d("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/aging_copper_haze_weight.png", ::tex::gamma_linear), age, 0).x, ::df::microfacet_ggx_smith_bsdf(0.16f, 0.16f, gradient_lookup(texture_2d("./textures/aging_copper_gradient.png", ::tex::gamma_srgb), ::math::clamp((flow_stains_balance - 0.5f) * 2.f * float3(infinite_tiling ? endless_texture(texture_2d("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/aging_copper_gradient.png", ::tex::gamma_srgb), ::math::clamp((flow_stains_balance - 0.5f) * 2.f * float3(infinite_tiling ? endless_texture(texture_2d("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/aging_copper_norm.jpg", ::tex::gamma_linear), ::math::clamp((flow_stains_balance - 0.5f) * 2.f * float3(infinite_tiling ? endless_texture(texture_2d("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/aging_copper_norm.jpg", ::tex::gamma_linear), ::math::clamp((flow_stains_balance - 0.5f) * 2.f * float3(infinite_tiling ? endless_texture(texture_2d("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/aging_copper_gradient.png", ::tex::gamma_srgb), ::math::clamp((flow_stains_balance - 0.5f) * 2.f * float3(infinite_tiling ? endless_texture(texture_2d("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/aging_copper_norm.jpg", ::tex::gamma_linear), ::math::clamp((flow_stains_balance - 0.5f) * 2.f * float3(infinite_tiling ? endless_texture(texture_2d("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/aging_copper_norm.jpg", ::tex::gamma_linear), ::math::clamp((flow_stains_balance - 0.5f) * 2.f * float3(infinite_tiling ? endless_texture(texture_2d("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/aging_copper_norm.jpg", ::tex::gamma_linear), ::math::clamp((flow_stains_balance - 0.5f) * 2.f * float3(infinite_tiling ? endless_texture(texture_2d("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/aging_copper_norm.jpg", ::tex::gamma_linear), ::math::clamp((flow_stains_balance - 0.5f) * 2.f * float3(infinite_tiling ? endless_texture(texture_2d("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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/code/third_party/vMaterials_2/Metal/Aluminum.mdl b/code/third_party/vMaterials_2/Metal/Aluminum.mdl new file mode 100644 index 0000000000000000000000000000000000000000..dd7a5b36eb049790ae0a593aab7d83a7f8f52ecc --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/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 = float2(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 = float2(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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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/code/third_party/vMaterials_2/Metal/Aluminum_Anodized.mdl b/code/third_party/vMaterials_2/Metal/Aluminum_Anodized.mdl new file mode 100644 index 0000000000000000000000000000000000000000..ed53adbdb058cb14fef9a7960d8c71cdd36c96fb --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/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 = float2(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 = float2(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 = float2(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("./textures/analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./textures/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("./textures/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("./textures/analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./textures/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("./textures/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("./textures/analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./textures/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("./textures/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("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(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("./textures/analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./textures/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("./textures/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("./textures/analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./textures/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("./textures/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("./textures/analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./textures/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("./textures/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("./textures/analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./textures/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("./textures/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("./textures/analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./textures/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("./textures/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("./textures/analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./textures/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("./textures/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("./textures/analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./textures/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("./textures/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("./textures/analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./textures/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("./textures/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("./textures/analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./textures/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("./textures/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("./textures/analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./textures/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("./textures/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("./textures/analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./textures/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("./textures/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("./textures/analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./textures/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("./textures/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("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(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("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(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("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(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("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(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("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(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("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(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("./textures/analum_worn_norm.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.289999992f)), scratches_bump_strength * histogram_scan_big(infinite_tiling ? vm_tex_infinite(texture_2d("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(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("./textures/analum_scratches_norm.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), float3(0.497999996f, 0.497999996f, 0.987999976f), 0.349999994f, histogram_scan_big(infinite_tiling ? vm_tex_infinite(texture_2d("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(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("./textures/analum_scratches_norm.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), histogram_scan_big(infinite_tiling ? vm_tex_infinite(texture_2d("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(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("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(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("./textures/analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./textures/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("./textures/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("./textures/analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./textures/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("./textures/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("./textures/analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./textures/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("./textures/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("./textures/analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./textures/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("./textures/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("./textures/analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./textures/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("./textures/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("./textures/analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./textures/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("./textures/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("./textures/analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./textures/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("./textures/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("./textures/analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./textures/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("./textures/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("./textures/analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./textures/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("./textures/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("./textures/analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./textures/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("./textures/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("./textures/analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./textures/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("./textures/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("./textures/analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./textures/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("./textures/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("./textures/analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./textures/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("./textures/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("./textures/analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./textures/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("./textures/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("./textures/analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./textures/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("./textures/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("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(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("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(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("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(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("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(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("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(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("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(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("./textures/analum_worn_norm.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.289999992f)), scratches_bump_strength * histogram_scan_big(infinite_tiling ? vm_tex_infinite(texture_2d("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(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("./textures/analum_scratches_norm.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), float3(0.497999996f, 0.497999996f, 0.987999976f), 0.349999994f, histogram_scan_big(infinite_tiling ? vm_tex_infinite(texture_2d("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(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("./textures/analum_scratches_norm.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), histogram_scan_big(infinite_tiling ? vm_tex_infinite(texture_2d("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(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("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(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("./textures/analum_worn_norm.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.289999992f)), scratches_bump_strength * histogram_scan_big(infinite_tiling ? vm_tex_infinite(texture_2d("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(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("./textures/analum_scratches_norm.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), float3(0.497999996f, 0.497999996f, 0.987999976f), 0.349999994f, histogram_scan_big(infinite_tiling ? vm_tex_infinite(texture_2d("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(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("./textures/analum_scratches_norm.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), histogram_scan_big(infinite_tiling ? vm_tex_infinite(texture_2d("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(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("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), float3(0.0149999997f), 0.349999994f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./textures/analum_scratches_dist.png", ::tex::gamma_default), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(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("./textures/analum_multi_smudges.jpg", ::tex::gamma_linear), texture_2d("./textures/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("./textures/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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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/code/third_party/vMaterials_2/Metal/Aluminum_Brushed.mdl b/code/third_party/vMaterials_2/Metal/Aluminum_Brushed.mdl new file mode 100644 index 0000000000000000000000000000000000000000..bf071e0ac400f68b59bd8f8d0537d7841447ef03 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/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 = float2(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 = float2(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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + + diff --git a/code/third_party/vMaterials_2/Metal/Aluminum_Foil.mdl b/code/third_party/vMaterials_2/Metal/Aluminum_Foil.mdl new file mode 100644 index 0000000000000000000000000000000000000000..3b613d28837ac08833852989b821ea7ccff8bcbf --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Aluminum_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.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 = "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 Aluminum_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 = float2(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 = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(.25f, .25f)) + ]], + 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("Aluminum Foil - Slightly Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Aluminum_Foil.Aluminum_Foil.png"), + ::anno::key_words(string[]("design", "metal", "aluminum", "aluminium", "foil", "smooth", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral")) +]] + = + let { + color normal_reflectivity = color(0.911810895428f,0.914089043421f,0.920152876196f); + color grazing_reflectivity = color(0.99942f, 1.f, 1.f); + + texture_2d rough_ao_tex = texture_2d("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear); + texture_2d smudge_splotch_tex = texture_2d("./textures/foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear); + texture_2d norm_tex = texture_2d("./textures/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 Aluminum_Foil_Smudged_Foil(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Aluminum Foil - Smudgy Foil"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Aluminum_Foil.Aluminum_Foil_Smudged_Foil.png"), + ::anno::key_words(string[]("design", "metal", "aluminum", "aluminium", "foil", "smooth", "unfinished", "decorative", "creative", "neutral")) +]] += Aluminum_Foil( + infinite_tiling: true, + roughness: 0.15f, + roughness_variation: 0.84f, + smudges: 0.35f, + bump_strength: 0.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + +export material Aluminum_Foil_Shiny_Wrinkled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Aluminum Foil - Shiny Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Aluminum_Foil.Aluminum_Foil_Shiny_Wrinkled.png"), + ::anno::key_words(string[]("design", "metal", "aluminum", "aluminium", "foil", "shiny", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral")) +]] += Aluminum_Foil( + infinite_tiling: true, + roughness: 0.25f, + roughness_variation: 0.25f, + smudges: 0.75f, + bump_strength: 0.25f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + + +export material Aluminum_Foil_Matte_Wrinkled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Aluminum Foil - Matte Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Aluminum_Foil.Aluminum_Foil_Matte_Wrinkled.png"), + ::anno::key_words(string[]("design", "metal", "aluminum", "aluminium", "foil", "matte", "smooth", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral", "gray")) +]] += Aluminum_Foil( + infinite_tiling: true, + roughness: 0.65f, + roughness_variation: 1.0f, + smudges: 0.4f, + bump_strength: 0.15f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + +export material Aluminum_Foil_Heavy_Glossy_Wrinkles(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Aluminum Foil - Heavy Glossy Wrinkles"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Aluminum_Foil.Aluminum_Foil_Heavy_Glossy_Wrinkles.png"), + ::anno::key_words(string[]("design", "metal", "aluminum", "aluminium", "foil", "smooth", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral")) +]] += Aluminum_Foil( + infinite_tiling: true, + roughness: 0.164f, + roughness_variation: 0.021f, + smudges: 0.143f, + bump_strength: 0.99f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + +export material Aluminum_Foil_Heavy_Matte_Wrinkled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Aluminum Foil - Heavy Matte Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Aluminum_Foil.Aluminum_Foil_Heavy_Matte_Wrinkled.png"), + ::anno::key_words(string[]("design", "metal", "aluminum", "aluminium", "foil", "matte", "bumped", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral", "gray")) +]] += Aluminum_Foil( + infinite_tiling: true, + roughness: 0.889f, + roughness_variation: 0.018f, + smudges: 0.246f, + bump_strength: 0.732f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + + + + + + + + + + + + diff --git a/code/third_party/vMaterials_2/Metal/Aluminum_Hammered.mdl b/code/third_party/vMaterials_2/Metal/Aluminum_Hammered.mdl new file mode 100644 index 0000000000000000000000000000000000000000..09299e93bad8745f687c194484bbf6db6da0a428 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Aluminum_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 Aluminum_Hammered( + color metal_color = color(0.399f, 0.399f, 0.405f) [[ + ::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 = float2(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 = float2(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 Aluminum - Dark Pits"), + ::anno::author("NVIDIA vMaterials"), + ::anno::in_group("Metal"), + ::anno::key_words(string[]("metal", "aluminum", "blackened", "hammered", "design", "classic", "architecture", "pattern", "reflective", "rough", "bumped", "conductor")), + ::anno::thumbnail("./.thumbs/Aluminum_Hammered.Aluminum_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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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 Aluminum_Hammered_Shiny(*) +[[ + ::anno::display_name("Hammered Aluminum - Shiny"), + ::anno::author("NVIDIA vMaterials"), + ::anno::in_group("Metal"), + ::anno::key_words(string[]("metal", "aluminum", "hammered", "design", "classic", "architecture", "pattern", "reflective", "rough", "bumped", "conductor", "shiny")), + ::anno::thumbnail("./.thumbs/Aluminum_Hammered.Aluminum_Hammered_Shiny.png"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT) +]] + = Aluminum_Hammered( + metal_color: color(0.399f, 0.399f, 0.405f), + 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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + +export material Aluminum_Hammered_Dull(*) +[[ + ::anno::display_name("Hammered Aluminum - Dull"), + ::anno::author("NVIDIA vMaterials"), + ::anno::in_group("Metal"), + ::anno::key_words(string[]("metal", "aluminum", "hammered", "design", "classic", "architecture", "pattern", "reflective", "rough", "bumped", "conductor", "matte", "dull")), + ::anno::thumbnail("./.thumbs/Aluminum_Hammered.Aluminum_Hammered_Dull.png"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT) +]] + = Aluminum_Hammered( + metal_color: color(0.399f, 0.399f, 0.405f), + 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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Metal/Aluminum_Knurling.mdl b/code/third_party/vMaterials_2/Metal/Aluminum_Knurling.mdl new file mode 100644 index 0000000000000000000000000000000000000000..cc6b44d833c3080ad5c3fd38afd7a7f941b5326f --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Aluminum_Knurling.mdl @@ -0,0 +1,359 @@ +/****************************************************************************** + * 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 ::df::*; +import ::tex::*; +import ::math::*; +import ::base::*; +import ::state::*; +import ::anno::*; +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 = "Metal with a diamond knurling finish"; + +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; + //TODO: at least also handle sign of z? + //TODO: handle tangent becoming 0 + + + 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)); +} + +export material Aluminum_Knurling( + //Appearance + float brightness = float(0.7f) [[ + ::anno::description("Adjusts the brightness of the material."), + ::anno::display_name("Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.0f, 1.0f) + ]], + float roughness = float(0.5f) [[ + ::anno::description("Higher values lead to a rougher appearance of the material."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.0f, 1.0f) + ]], + float grooves_dirt = float(0.4f) [[ + ::anno::description("Adds dirt in the grooves of the knurling pattern."), + ::anno::display_name("Grooves Dirt"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.0f, 1.0f) + ]], + uniform float bump_strength = float(0.8f) [[ + ::anno::description("Adds dirt in the grooves of the knurling pattern."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.0f, 1.0f) + ]], + + // Round Corners + 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("Sets the radius of the round corners in millimeters."), + ::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") + ]], + //Transform + float2 texture_translate = float2(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"), + ::anno::soft_range(0.f, 360.f) + ]], + float2 texture_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::anno::soft_range(float2(0.f), float2(2.f)), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::anno::in_group("Transform") + ]], + + // Advanced + uniform int uv_space_index = 0 [[ + ::anno::description("uses the selected UV space index."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced"), + ::anno::soft_range(0, 4) + ]] +) +[[ + ::anno::display_name("Aluminum Knurling"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Aluminum_Knurling.Aluminum_Knurling.png"), + ::anno::key_words(string[]("metal", "aluminum", "aluminium", "knurled", "knurling", "pattern", "design", "bumped")), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials") +]] += let +{ + color metal_tint = color(0.911810895428,0.914089043421,0.920152876196); // Aluminum + + // Texture setup + texture_2d normal_tex = texture_2d("./textures/metal_knurling_norm.jpg", ::tex::gamma_linear); + texture_2d multi_heights_tex = texture_2d("./textures/metal_knurling_multi_heights.jpg", ::tex::gamma_linear); + texture_2d diff_rough_grunge_tex = texture_2d("./textures/metal_knurling_multi_R_diff_G_rough_B_grunge.jpg", ::tex::gamma_linear); + + // Coordinate setup + ::base::texture_coordinate_info uvw = vmat_transform( + translation: texture_translate, + rotation: texture_rotate, + scaling: texture_scale, + system: ::base::texture_coordinate_uvw, + uv_space: uv_space_index + ); + + // ---------- Diff Rough Grunge Lookup ---------- + + float3 diff_rough_grunge_lookup = float3( + ::base::file_texture( + texture: diff_rough_grunge_tex, + uvw: uvw, + mono_source: ::base::mono_average + ).tint ); + + float3 multi_height_lookup = float3( + ::base::file_texture( + texture: multi_heights_tex, + uvw: uvw, + mono_source: ::base::mono_average + ).tint ); + + float3 norm = ::base::tangent_space_normal_texture( + texture: normal_tex, + factor: bump_strength, + uvw: uvw + ); + + + float remap_rough = histogram_range( + input: diff_rough_grunge_lookup.y, + range: 1.0f, + position: 0.234f + ); + + + float roughness_mapped = remap_rough + (roughness * multi_height_lookup.y); + + float remapped_diff = histogram_range( + input: diff_rough_grunge_lookup.x, + range: 1.0f, + position: (brightness * 0.4f) + 0.4f + ); + + float diff_contribution = ::math::pow(remapped_diff - ((grooves_dirt * 0.5) * multi_height_lookup.x * diff_rough_grunge_lookup.z), 2.67f); + + bsdf ggx_smith_bumped = ::df::weighted_layer( + layer: ::df::microfacet_ggx_smith_bsdf( + roughness_u: roughness_mapped * roughness_mapped, + roughness_v: roughness_mapped * roughness_mapped, + tint: color(diff_contribution), + mode: ::df::scatter_reflect + ), + base: bsdf(), + weight: 1.0f, + normal: norm + ); + + bsdf diff_bsdf = ::df::diffuse_reflection_bsdf( + tint: color(diff_contribution) + ); + + + bsdf final_bsdf = ::df::weighted_layer( + weight: 1.0f - (diff_rough_grunge_lookup.z * multi_height_lookup.x * grooves_dirt), + layer: ::df::directional_factor( + normal_tint: metal_tint, + grazing_tint: color(1.0f), + base: ggx_smith_bumped + ), + base: diff_bsdf + ); + + + // Round Corners + float3 round_normal = enable_round_corners ? + ::state::rounded_corner_normal( + radius: roundcorner_radius * 0.001, + across_materials: across_materials + ) : ::state::normal(); +} +in material ( + + surface: material_surface( + scattering: final_bsdf + ), + geometry: material_geometry( + normal: round_normal + ) +); + + +export material Aluminum_Knurling_Worn(*) +[[ + ::anno::display_name("Aluminum Knurling - Worn"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Aluminum_Knurling.Aluminum_Knurling_Worn.png"), + ::anno::key_words(string[]("metal", "aluminum", "aluminium", "knurled", "pattern", "knurling", "design", "bumped", "worn")), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials") +]] = Aluminum_Knurling( + brightness: 0.4f, + roughness: 1.0f, + grooves_dirt: 1.0f, + bump_strength: 0.8f, + + enable_round_corners: false, + roundcorner_radius: 1.2f, + across_materials: false, + + texture_translate: float2(0.0f), + texture_rotate: 0.f, + texture_scale: float2(1.0f), + + uv_space_index: 0 +); + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/code/third_party/vMaterials_2/Metal/Aluminum_Scratched.mdl b/code/third_party/vMaterials_2/Metal/Aluminum_Scratched.mdl new file mode 100644 index 0000000000000000000000000000000000000000..d5127a478d837e2922880742fabe2520d02d7ed3 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Aluminum_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 Aluminum_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 = float2(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 = float2(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("Aluminum Scratched"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "aluminum", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped")), + ::anno::thumbnail("./.thumbs/Aluminum_Scratched.Aluminum_Scratched.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = + let { + float brush_scratches_weight = 0.5f; + // Aluminum Reflection Color + color reflection_color = color(0.911810895428,0.914089043421,0.920152876196); + 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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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 Aluminum_Scratched_Light_Bumpy(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Aluminum Scratched - Bright and Bumped"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "aluminum", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "gray", "shiny")), + ::anno::thumbnail("./.thumbs/Aluminum_Scratched.Aluminum_Scratched_Light_Bumpy.png"), + ::anno::copyright_notice(COPYRIGHT) +]]= Aluminum_Scratched( + infinite_tiling: true, + roughness_metal_surface: 1.0f, + roughness_variation: 0.208f, + brightness: 0.75f, + brightness_variation: 0.3f, + bump_factor: 1.0f, + roughness_scratches: 0.145f, + scratches_variation: 0.3f, + scratches_bump_factor: 0.249f, + dirt_transition_softness: 0.85f, + dirt_amount: 0.05f, + texture_translate: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); + + + +export material Aluminum_Scratched_Dark_Shiny(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Aluminum Scratched - Dark Shiny"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "aluminum", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "gray", "shiny", "dark")), + ::anno::thumbnail("./.thumbs/Aluminum_Scratched.Aluminum_Scratched_Dark_Shiny.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Aluminum_Scratched( + infinite_tiling: true, + roughness_metal_surface: 0.278f, + roughness_variation: 0.517f, + brightness: 0.15f, + brightness_variation: 0.431f, + bump_factor: 0.262f, + roughness_scratches: 0.205f, + scratches_variation: 0.761f, + scratches_bump_factor: 0.231f, + dirt_transition_softness: 0.981f, + dirt_amount: 0.057f, + texture_translate: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); + + +export material Aluminum_Scratched_Dark_Matte(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Aluminum Scratched - Dark Matte"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "aluminum", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "gray", "matte", "dark")), + ::anno::thumbnail("./.thumbs/Aluminum_Scratched.Aluminum_Scratched_Dark_Matte.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Aluminum_Scratched( + infinite_tiling: true, + roughness_metal_surface: 1.0f, + roughness_variation: 0.208f, + brightness: 0.023f, + brightness_variation: 0.119f, + bump_factor: 0.521f, + roughness_scratches: 0.279f, + scratches_variation: 0.858f, + scratches_bump_factor: 1.0f, + dirt_transition_softness: 0.85f, + dirt_amount: 0.057f, + texture_translate: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); + + + + +export material Aluminum_Scratched_Scuffs_and_Grime(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Aluminum Scratched - Scuffs and Grime"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "aluminum", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "gray", "matte", "dark")), + ::anno::thumbnail("./.thumbs/Aluminum_Scratched.Aluminum_Scratched_Scuffs_and_Grime.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Aluminum_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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); + + + + +export material Aluminum_Scratched_Dirty_Rough(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Aluminum Scratched - Dirty Rough"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "aluminum", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "gray", "matte", "dark")), + ::anno::thumbnail("./.thumbs/Aluminum_Scratched.Aluminum_Scratched_Dirty_Rough.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Aluminum_Scratched( + infinite_tiling: true, + roughness_metal_surface: 1.0f, + roughness_variation: 0.208f, + brightness: 0.254f, + brightness_variation: 0.838f, + bump_factor: 1.914f, + roughness_scratches: 0.611f, + scratches_variation: 0.0f, + scratches_bump_factor: 0.903f, + dirt_transition_softness: 0.901f, + dirt_amount: 0.581f, + texture_translate: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); diff --git a/code/third_party/vMaterials_2/Metal/Aluminum_Sheet.mdl b/code/third_party/vMaterials_2/Metal/Aluminum_Sheet.mdl new file mode 100644 index 0000000000000000000000000000000000000000..7da957531933648a0d4d84da33b969b88503fd7e --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Aluminum_Sheet.mdl @@ -0,0 +1,1330 @@ +/****************************************************************************** + * 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 aluminum 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) + float2(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 Aluminum_Sheet( + 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::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::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 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 = float2(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 = float2(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("Aluminum Sheet - New Clean"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Aluminum_Sheet.Aluminum_Sheet.png"), + ::anno::key_words(string[]("metal", "sheet", "aluminum", "aluminium", "imperfections", "interior", "exterior", "automotive", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "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(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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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 Aluminum_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 = float2(.5f, .5f) + [[ + ::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) + ]], + + + +// Aluminum 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::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::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 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 = float2(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 = float2(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::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Aluminum Sheet - Circular Punch"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Aluminum_Sheet.Aluminum_Sheet_Punched.png"), + ::anno::key_words(string[]("metal", "sheet", "aluminum", "aluminium", "imperfections", "interior", "exterior", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "circular", "gray")) +]] = let +{ + material base_mat = Aluminum_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, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + enable_round_corners: enable_round_corners, + roundcorner_radius: roundcorner_radius, + across_materials: across_materials + ); + texture_2d punching_cutout = texture_2d("./textures/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 + ) +); + +// ------------------------ Aluminum Sheet Presets ------------------------ +export material Aluminum_Sheet_Soft_Splotches(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Aluminum Sheet - Soft Splotches"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Aluminum_Sheet.Aluminum_Sheet_Soft_Splotches.png"), + ::anno::key_words(string[]("metal", "sheet", "aluminum", "aluminium", "imperfections", "interior", "exterior", "automotive", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "neutral", "gray")) +]] += Aluminum_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + + +export material Aluminum_Sheet_Matte_Imperfections(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Aluminum Sheet - Matte Imperfections"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Aluminum_Sheet.Aluminum_Sheet_Matte_Imperfections.png"), + ::anno::key_words(string[]("metal", "sheet", "aluminum", "aluminium", "imperfections", "interior", "exterior", "automotive", "new", "matte", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "neutral")) +]]= Aluminum_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + + +export material Aluminum_Sheet_Glossy_Imperfections(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Aluminum Sheet - Glossy Imperfections"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Aluminum_Sheet.Aluminum_Sheet_Glossy_Imperfections.png"), + ::anno::key_words(string[]("metal", "sheet", "aluminum", "aluminium", "imperfections", "interior", "exterior", "automotive", "new", "glossy", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "neutral")) +]] += Aluminum_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + + +export material Aluminum_Sheet_Splotchy_Streaks(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Aluminum Sheet - Splotchy Streaks"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Aluminum_Sheet.Aluminum_Sheet_Splotchy_Streaks.png"), + ::anno::key_words(string[]("metal", "sheet", "aluminum", "aluminium", "imperfections", "interior", "exterior", "automotive", "new", "glossy", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "neutral")) +]]= Aluminum_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + +export material Aluminum_Sheet_Glossy_Streaks(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Aluminum Sheet - Glossy Streaks"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Aluminum_Sheet.Aluminum_Sheet_Glossy_Streaks.png"), + ::anno::key_words(string[]("metal", "sheet", "aluminum", "aluminium", "imperfections", "interior", "exterior", "automotive", "new", "glossy", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "neutral")) +]] += Aluminum_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// ------------------------ Punched Aluminum Sheet Presets ------------------------ + +export material Aluminum_Sheet_Punched_Small_Circular(*)[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Aluminum Sheet - Small Circular Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Aluminum_Sheet.Aluminum_Sheet_Punched_Small_Circular.png"), + ::anno::key_words(string[]("metal", "sheet", "aluminum", "aluminium", "imperfections", "interior", "exterior", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "circular", "gray")) +]] = Aluminum_Sheet_Punched( + // Punching parameters + shape_select: pattern_circle, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.55f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.33f, + impurities_weight_1: 0.75f, + impurities_weight_2: 0.43f, + impurities_weight_3: 1.0f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Aluminum_Sheet_Punched_Hexagonal(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Aluminum Sheet - Hexagonal Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Aluminum_Sheet.Aluminum_Sheet_Punched_Hexagonal.png"), + ::anno::key_words(string[]("metal", "sheet", "aluminum", "aluminium", "imperfections", "interior", "exterior", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "hexagonal", "gray")) +]] = Aluminum_Sheet_Punched( + // Punching parameters + shape_select: pattern_hexagon, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.55f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.33f, + impurities_weight_1: 0.75f, + impurities_weight_2: 0.43f, + impurities_weight_3: 1.0f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Aluminum_Sheet_Punched_Hexagonal_Small(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Aluminum Sheet - Small Hexagonal Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Aluminum_Sheet.Aluminum_Sheet_Punched_Hexagonal_Small.png"), + ::anno::key_words(string[]("metal", "sheet", "aluminum", "aluminium", "imperfections", "interior", "exterior", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "hexagonal", "gray")) +]] = Aluminum_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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.55f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.33f, + impurities_weight_1: 0.75f, + impurities_weight_2: 0.43f, + impurities_weight_3: 1.0f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Aluminum_Sheet_Punched_Square(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Aluminum Sheet - Square Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Aluminum_Sheet.Aluminum_Sheet_Punched_Square.png"), + ::anno::key_words(string[]("metal", "sheet", "aluminum", "aluminium", "imperfections", "interior", "exterior", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "square", "gray")) +]] = Aluminum_Sheet_Punched( + // Punching parameters + shape_select: pattern_square, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.55f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.33f, + impurities_weight_1: 0.75f, + impurities_weight_2: 0.43f, + impurities_weight_3: 1.0f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Aluminum_Sheet_Punched_Line(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Aluminum Sheet - Line Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Aluminum_Sheet.Aluminum_Sheet_Punched_Line.png"), + ::anno::key_words(string[]("metal", "sheet", "aluminum", "aluminium", "imperfections", "interior", "exterior", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "line", "gray")) +]] = Aluminum_Sheet_Punched( + // Punching parameters + shape_select: pattern_line, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.55f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.33f, + impurities_weight_1: 0.75f, + impurities_weight_2: 0.43f, + impurities_weight_3: 1.0f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + +export material Aluminum_Sheet_Punched_Cross(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Aluminum Sheet - Cross Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Aluminum_Sheet.Aluminum_Sheet_Punched_Cross.png"), + ::anno::key_words(string[]("metal", "sheet", "aluminum", "aluminium", "imperfections", "interior", "exterior", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "cross", "gray")) +]] = Aluminum_Sheet_Punched( + // Punching parameters + shape_select: pattern_cross, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.55f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.33f, + impurities_weight_1: 0.75f, + impurities_weight_2: 0.43f, + impurities_weight_3: 1.0f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + +export material Aluminum_Sheet_Punched_Rhombus(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Aluminum Sheet - Rhombus Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Aluminum_Sheet.Aluminum_Sheet_Punched_Rhombus.png"), + ::anno::key_words(string[]("metal", "sheet", "aluminum", "aluminium", "imperfections", "interior", "exterior", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "rhombus", "gray")) +]] = Aluminum_Sheet_Punched( + // Punching parameters + shape_select: pattern_rhombus, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.55f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.33f, + impurities_weight_1: 0.75f, + impurities_weight_2: 0.43f, + impurities_weight_3: 1.0f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Aluminum_Sheet_Punched_Triangle(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Aluminum Sheet - Triangle Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Aluminum_Sheet.Aluminum_Sheet_Punched_Triangle.png"), + ::anno::key_words(string[]("metal", "sheet", "aluminum", "aluminium", "imperfections", "interior", "exterior", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "triangle", "gray")) +]] = Aluminum_Sheet_Punched( + // Punching parameters + shape_select: pattern_triangle, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.55f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.33f, + impurities_weight_1: 0.75f, + impurities_weight_2: 0.43f, + impurities_weight_3: 1.0f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Aluminum_Sheet_Punched_Star(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Aluminum Sheet - Star Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Aluminum_Sheet.Aluminum_Sheet_Punched_Star.png"), + ::anno::key_words(string[]("metal", "sheet", "aluminum", "aluminium", "imperfections", "interior", "exterior", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "star", "gray")) +]] = Aluminum_Sheet_Punched( + // Punching parameters + shape_select: pattern_star, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.55f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.33f, + impurities_weight_1: 0.75f, + impurities_weight_2: 0.43f, + impurities_weight_3: 1.0f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Metal/Blued_Steel_Cold.mdl b/code/third_party/vMaterials_2/Metal/Blued_Steel_Cold.mdl new file mode 100644 index 0000000000000000000000000000000000000000..993c9d8aa0150a1c7806bbc166cbbea19b695b60 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Blued_Steel_Cold.mdl @@ -0,0 +1,494 @@ +/****************************************************************************** + * 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 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); +} + + +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) ); +} + + +// endless texture, function as described in https://www.shadertoy.com/view/MdyfDV +// https://hal.inria.fr/hal-01824773/document +// Note that the average color must be +// Additional parameters have been exposed like the size samples from each hexagonal patch +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); +} + +// NOTE: "texture" must be in linear space (ensure that ::tex::gamma_linear is used) +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); +} + +// NOTE: tex_resource must be in linear space (ensure that ::tex::gamma_linear is used) +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 + )); +} + +float overlay(float base, float layer, float weight) +{ + return base + (1.0f - base) * layer * weight; +} + + +float remap(float input, float low, float high) +{ + //return low + input * (high - low); + 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); + 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)); +} + +::base::texture_coordinate_info vmat_transform_post_scale( + ::base::texture_coordinate_info uvw, + float2 scale = float2(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 Blued_Steel_Cold( + float brightness = 0.5f [[ + ::anno::description("Adjusts the brightness of the material. Recommended default is 0.5."), + ::anno::display_name("Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(0) + ]], + float roughness = 0.05f [[ + ::anno::description("Amount of variation applied to the roughness, higher numbers lead to non uniform reflections of the material."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float roughness_variation = 0.12f [[ + ::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(2) + ]], + float smudges = 0.f [[ + ::anno::description("Add surface variation to the material to make the material appear being used before."), + ::anno::display_name("Smudges"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float smudges_roughness = 0.02f [[ + ::anno::description("The overall roughness of the smudges on the surface."), + ::anno::display_name("Smudges Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::enable_if("smudges > 0.0"), + ::anno::ui_order(4) + ]], + float damage = 0.f [[ + ::anno::description("Adds surface wear and damages to the material."), + ::anno::display_name("Damage"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(5) + ]], + float2 texture_translate = float2(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 = float2(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) + ]], + 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 = .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::enable_if("roundcorners_enable == true"), + ::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::enable_if("roundcorners_enable == true"), + ::anno::ui_order(12) + ]]) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::display_name("Blued Steel - Cold Blued Shiny"), + ::anno::description("Steel that has been treated with a blueing solution which gives it a black-blueish appearance. Optional smudges and scratches add further variation to the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Blued_Steel_Cold.Blued_Steel_Cold.png"), + ::anno::key_words(string[]("metal", "steel", "iron", "blued", "coated", "treated", "blueing", "tool", "automotive", "shiny", "new", "black", "dark")) +]] + = + let { + bool tmp0 = false; + material_surface tmp1(::df::custom_curve_layer(remap(float3(endless_texture(texture_2d("./textures/blued_steel_multi_R_rough_G_smudge_B_scratch.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.5f)), 10.f, float3(0.75999999f, 0.175999999f, 0.00300000003f), 8.f, false)).z, 0.0399999991f, remap(::math::pow(damage, 2.20000005f), 0.0399999991f, 1.f)), 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(overlay(::math::lerp(histogram_range(float3(endless_texture(texture_2d("./textures/blued_steel_multi_R_rough_G_smudge_B_scratch.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.5f)), 10.f, float3(0.75999999f, 0.175999999f, 0.00300000003f), 8.f, false)).x, roughness_variation, roughness * 0.600000024f + 0.0500000007f), smudges_roughness, float3(endless_texture(texture_2d("./textures/blued_steel_multi_R_rough_G_smudge_B_scratch.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.5f)), 10.f, float3(0.75999999f, 0.175999999f, 0.00300000003f), 8.f, false)).y * smudges), float3(endless_texture(texture_2d("./textures/blued_steel_multi_R_rough_G_smudge_B_scratch.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.5f)), 10.f, float3(0.75999999f, 0.175999999f, 0.00300000003f), 8.f, false)).z, 0.f) * overlay(::math::lerp(histogram_range(float3(endless_texture(texture_2d("./textures/blued_steel_multi_R_rough_G_smudge_B_scratch.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.5f)), 10.f, float3(0.75999999f, 0.175999999f, 0.00300000003f), 8.f, false)).x, roughness_variation, roughness * 0.600000024f + 0.0500000007f), smudges_roughness, float3(endless_texture(texture_2d("./textures/blued_steel_multi_R_rough_G_smudge_B_scratch.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.5f)), 10.f, float3(0.75999999f, 0.175999999f, 0.00300000003f), 8.f, false)).y * smudges), float3(endless_texture(texture_2d("./textures/blued_steel_multi_R_rough_G_smudge_B_scratch.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.5f)), 10.f, float3(0.75999999f, 0.175999999f, 0.00300000003f), 8.f, false)).z, 0.f), overlay(::math::lerp(histogram_range(float3(endless_texture(texture_2d("./textures/blued_steel_multi_R_rough_G_smudge_B_scratch.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.5f)), 10.f, float3(0.75999999f, 0.175999999f, 0.00300000003f), 8.f, false)).x, roughness_variation, roughness * 0.600000024f + 0.0500000007f), smudges_roughness, float3(endless_texture(texture_2d("./textures/blued_steel_multi_R_rough_G_smudge_B_scratch.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.5f)), 10.f, float3(0.75999999f, 0.175999999f, 0.00300000003f), 8.f, false)).y * smudges), float3(endless_texture(texture_2d("./textures/blued_steel_multi_R_rough_G_smudge_B_scratch.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.5f)), 10.f, float3(0.75999999f, 0.175999999f, 0.00300000003f), 8.f, false)).z, 0.f) * overlay(::math::lerp(histogram_range(float3(endless_texture(texture_2d("./textures/blued_steel_multi_R_rough_G_smudge_B_scratch.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.5f)), 10.f, float3(0.75999999f, 0.175999999f, 0.00300000003f), 8.f, false)).x, roughness_variation, roughness * 0.600000024f + 0.0500000007f), smudges_roughness, float3(endless_texture(texture_2d("./textures/blued_steel_multi_R_rough_G_smudge_B_scratch.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.5f)), 10.f, float3(0.75999999f, 0.175999999f, 0.00300000003f), 8.f, false)).y * smudges), float3(endless_texture(texture_2d("./textures/blued_steel_multi_R_rough_G_smudge_B_scratch.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.5f)), 10.f, float3(0.75999999f, 0.175999999f, 0.00300000003f), 8.f, false)).z, 0.f), color(0.846872985f, 0.91753602f, 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(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(color(0.00699499995f, 0.00699499995f, 0.00699499995f), color(0.0121590002f, 0.0118270004f, 0.0273209997f), ::base::color_layer_blend, float3(endless_texture(texture_2d("./textures/blued_steel_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.75999999f, 0.175999999f, 0.00300000003f), 8.f, true)).x, true).tint, color(::math::pow(brightness * 0.699999988f + 0.300000012f, 2.f)), ::base::color_layer_multiply, 1.f, true).tint, 0.f), bsdf(), endless_normal(texture_2d("./textures/blued_steel_norm.jpg", ::tex::gamma_linear), damage, false, false, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.5f)), 10.f, float3(0.5f, 0.5f, 1.f), 8.f)), endless_normal(texture_2d("./textures/blued_steel_norm.jpg", ::tex::gamma_linear), damage, false, false, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.5f)), 10.f, float3(0.5f, 0.5f, 1.f), 8.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()); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + +export material Blued_Steel_Cold_Matte(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::display_name("Blued Steel - Cold Blued Matte"), + ::anno::description("Steel that has been treated with a blueing solution which gives it a black-blueish appearance. Optional smudges and scratches add further variation to the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Blued_Steel_Cold.Blued_Steel_Cold_Matte.png"), + ::anno::key_words(string[]("metal", "steel", "iron", "blued", "coated", "treated", "blueing", "tool", "automotive", "shiny", "new", "black", "dark")) +]] + = Blued_Steel_Cold( + brightness: 0.5f, + roughness: 0.55f, + roughness_variation: 0.13f, + smudges: 0.0f, + smudges_roughness: 0.02f, + damage: 0.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + + + +export material Blued_Steel_Cold_Matte_Smudged(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::display_name("Blued Steel - Cold Blued Matte Smudged"), + ::anno::description("Steel that has been treated with a blueing solution which gives it a black-blueish appearance. Optional smudges and scratches add further variation to the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Blued_Steel_Cold.Blued_Steel_Cold_Matte_Smudged.png"), + ::anno::key_words(string[]("metal", "steel", "iron", "blued", "coated", "treated", "blueing", "tool", "automotive", "shiny", "smudges", "black", "dark")) +]] + = Blued_Steel_Cold( + brightness: 0.5f, + roughness: 0.55f, + roughness_variation: 0.13f, + smudges: 0.79f, + smudges_roughness: 0.02f, + damage: 0.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + + +export material Blued_Steel_Cold_Worn(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::display_name("Blued Steel - Cold Blued Worn"), + ::anno::description("Steel that has been treated with a blueing solution which gives it a black-blueish appearance. Optional smudges and scratches add further variation to the material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Blued_Steel_Cold.Blued_Steel_Cold_Worn.png"), + ::anno::key_words(string[]("metal", "steel", "iron", "blued", "coated", "treated", "blueing", "tool", "automotive", "shiny", "smudges", "black", "dark")) +]] + = Blued_Steel_Cold( + brightness: 0.5f, + roughness: 0.55f, + roughness_variation: 0.84f, + smudges: 0.79f, + smudges_roughness: 0.2f, + damage: 0.76f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + diff --git a/code/third_party/vMaterials_2/Metal/Brass.mdl b/code/third_party/vMaterials_2/Metal/Brass.mdl new file mode 100644 index 0000000000000000000000000000000000000000..c739527e7640f95fac1fa0b644fc0e2157eba1e0 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Brass.mdl @@ -0,0 +1,759 @@ +/****************************************************************************** + * 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 plain brass material with controls to add wear and dirt. Set the parameter " + "'Brass Type Blend' to 0.0 or 1.0 for yellow brass, 0.33 for gold brass and 0.66 for " + "red brass. Values inbetween will interpolate between the brass colors"; + +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); +} + +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 Brass( + float brass_type_select = 0.0f [[ + ::anno::description("Bends between the Brass types. 0 is yellow brass, 0.33 gold brass and 0.66 red brass. Going from 0.66 to 1.0 wraps back to yellow brass."), + ::anno::display_name("Brass Type Blend"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(0) + ]], + 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(1) + ]], + float roughness_variation = 0.95f [[ + ::anno::description("Adds variation to the roughness across the material so that its shininess changes."), + ::anno::display_name("Roughness Variation"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float surface_dirt = 0.f [[ + ::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(3) + ]], + float dirt_dents = 0.f [[ + ::anno::description("Adds dirt in the areas where dents appear on the surface."), + ::anno::display_name("Dents Dirt"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + float bump_strength = 0.09f [[ + ::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) + ]], + uniform float2 texture_translate = float2(0.f) [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture 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("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f), + ::anno::ui_order(7) + ]], + uniform float2 texture_scale = float2(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 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(9) + ]], + 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(10) + ]], + uniform bool roundcorners_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::ui_order(11) + ]], + 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(12) + ]]) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Yellow - New"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass.Brass.png"), + // new, worn, aged, dirty, bumped, shiny, rough, matte + ::anno::key_words(string[]("metal", "brass", "new", "shiny", "smooth", "reflective","plain", "design", "sanitary", "yellow", "warm")) +]] + = + let { + bool tmp0 = false; + material_surface tmp1(::df::weighted_layer(::math::max(float3(endless_texture(texture_2d("./textures/brass_multi_R_grad_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.805000007f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z * surface_dirt, ::math::min(dirt_dents, float3(endless_texture(texture_2d("./textures/brass_multi_R_grad_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.805000007f, 0.112999998f, 0.591000021f), 6.12999964f, false)).y)), ::df::diffuse_reflection_bsdf(color(0.0173889995f, 0.0125169996f, 0.00369399996f), 0.f), ::df::weighted_layer(::math::lerp(0.209999993f, 0.395000011f, roughness), ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(color(0.139981002f, 0.0928419977f, 0.0170479994f), color(0.00604900019f, 0.00469399989f, 0.00184399995f), ::base::color_layer_blend, histogram_scan_big(float3(endless_texture(texture_2d("./textures/brass_multi_R_grad_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.805000007f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, 0.359999985f, 0.560000002f)).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("./textures/brass_multi_R_grad_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.805000007f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, 0.170000002f, ::math::lerp(0.399999976f, 0.736000001f, roughness)) * histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_grad_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.805000007f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, 0.170000002f, ::math::lerp(0.399999976f, 0.736000001f, roughness)), histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_grad_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.805000007f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, 0.170000002f, ::math::lerp(0.399999976f, 0.736000001f, roughness)) * histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_grad_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.805000007f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, 0.170000002f, ::math::lerp(0.399999976f, 0.736000001f, roughness)), 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(histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_grad_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.805000007f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, ::math::lerp(0.0700000003f, 0.870000005f, roughness_variation), ::math::lerp(0.0399999991f, 0.435000002f, roughness)) * histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_grad_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.805000007f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, ::math::lerp(0.0700000003f, 0.870000005f, roughness_variation), ::math::lerp(0.0399999991f, 0.435000002f, roughness)), histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_grad_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.805000007f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, ::math::lerp(0.0700000003f, 0.870000005f, roughness_variation), ::math::lerp(0.0399999991f, 0.435000002f, roughness)) * histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_grad_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.805000007f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, ::math::lerp(0.0700000003f, 0.870000005f, roughness_variation), ::math::lerp(0.0399999991f, 0.435000002f, roughness)), color(1.f, 1.f, 1.f), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), bsdf(), endless_normal(texture_2d("./textures/brass_normal.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.5f, 0.5f, 0.999000013f), 6.12999964f)), endless_normal(texture_2d("./textures/brass_normal.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.5f, 0.5f, 0.999000013f), 6.12999964f)), ::df::tint(gradient_lookup_smooth(texture_2d("./textures/brass_gradients_yellow_gold_red.png", ::tex::gamma_srgb), float3(endless_texture(texture_2d("./textures/brass_multi_R_grad_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.805000007f, 0.112999998f, 0.591000021f), 6.12999964f, false)).x, brass_type_select), ::df::weighted_layer(0.349999994f, ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_grad_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.805000007f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, 0.170000002f, ::math::lerp(0.399999976f, 0.736000001f, roughness)) * histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_grad_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.805000007f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, 0.170000002f, ::math::lerp(0.399999976f, 0.736000001f, roughness)), histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_grad_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.805000007f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, 0.170000002f, ::math::lerp(0.399999976f, 0.736000001f, roughness)) * histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_grad_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.805000007f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, 0.170000002f, ::math::lerp(0.399999976f, 0.736000001f, roughness)), 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(histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_grad_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.805000007f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, ::math::lerp(0.0700000003f, 0.870000005f, roughness_variation), ::math::lerp(0.0399999991f, 0.435000002f, roughness)) * histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_grad_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.805000007f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, ::math::lerp(0.0700000003f, 0.870000005f, roughness_variation), ::math::lerp(0.0399999991f, 0.435000002f, roughness)), histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_grad_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.805000007f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, ::math::lerp(0.0700000003f, 0.870000005f, roughness_variation), ::math::lerp(0.0399999991f, 0.435000002f, roughness)) * histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_grad_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.805000007f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, ::math::lerp(0.0700000003f, 0.870000005f, roughness_variation), ::math::lerp(0.0399999991f, 0.435000002f, roughness)), color(1.f, 1.f, 1.f), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), bsdf(), endless_normal(texture_2d("./textures/brass_normal.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.5f, 0.5f, 0.999000013f), 6.12999964f)), endless_normal(texture_2d("./textures/brass_normal.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.5f, 0.5f, 0.999000013f), 6.12999964f))), ::state::normal()), endless_normal(texture_2d("./textures/brass_normal.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.5f, 0.5f, 0.999000013f), 6.12999964f)), endless_normal(texture_2d("./textures/brass_normal.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.5f, 0.5f, 0.999000013f), 6.12999964f)), 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 Brass_Yellow_New_Stained(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Yellow - New Stained"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass.Brass_Yellow_New_Stained.png"), + ::anno::key_words(string[]("metal", "brass", "new", "shiny", "smooth", "stained", "reflective","plain", "design", "sanitary", "yellow", "warm")) +]] = Brass( + brass_type_select: 0.0f, + roughness: 0.0f, + roughness_variation: 0.95f, + surface_dirt: 0.72f, + dirt_dents: 0.45f, + bump_strength: 0.25f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +// 3 +export material Brass_Yellow_Shiny_Handled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Yellow - Shiny Handled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass.Brass_Yellow_Shiny_Handled.png"), + ::anno::key_words(string[]("metal", "brass", "pure", "reflective","plain", "design", "sanitary", "bumped", "yellow", "warm")) +]] = Brass( + brass_type_select: 0.0f, + roughness: 0.14f, + roughness_variation: 0.95f, + surface_dirt: 0.63f, + dirt_dents: 0.6f, + bump_strength: 0.9f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +// 4 +export material Brass_Yellow_Worn(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Yellow - Worn"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass.Brass_Yellow_Worn.png"), + ::anno::key_words(string[]("metal", "brass", "pure", "dirty", "worn", "reflective","plain", "stained", "design", "sanitary", "bumped", "yellow", "warm")) +]] = Brass( + brass_type_select: 0.0f, + roughness: 0.43f, + roughness_variation: 0.95f, + surface_dirt: 1.0f, + dirt_dents: 0.54f, + bump_strength: 0.92f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +// 5 +export material Brass_Yellow_Rough_Worn(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Yellow - Rough Worn"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass.Brass_Yellow_Rough_Worn.png"), + ::anno::key_words(string[]("metal", "brass", "matte", "dirty", "aged", "old", "worn", "reflective","plain", "stained", "design", "sanitary", "bumped", "yellow", "warm")) +]] = Brass( + brass_type_select: 0.0f, + roughness: 1.0f, + roughness_variation: 1.0f, + surface_dirt: 0.92f, + dirt_dents: 0.35f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +// 6 +export material Brass_Gold_New(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Gold - New"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass.Brass_Gold_New.png"), + ::anno::key_words(string[]("metal", "brass", "pure", "reflective","plain", "design", "sanitary", "gold", "warm")) +]] = Brass( + brass_type_select: 0.33f, + roughness: 0.0f, + roughness_variation: 0.95f, + surface_dirt: 0.0f, + dirt_dents: 0.0f, + bump_strength: 0.09f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 7 +export material Brass_Gold_New_Stained(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Gold - New Stained"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass.Brass_Gold_New_Stained.png"), + ::anno::key_words(string[]("metal", "brass", "new", "shiny", "smooth", "stained", "reflective","plain", "design", "sanitary", "gold", "warm")) +]] = Brass( + brass_type_select: 0.33f, + roughness: 0.0f, + roughness_variation: 0.95f, + surface_dirt: 0.72f, + dirt_dents: 0.45f, + bump_strength: 0.25f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +// 8 +export material Brass_Gold_Shiny_Handled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Gold - Shiny Handled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass.Brass_Gold_Shiny_Handled.png"), + ::anno::key_words(string[]("metal", "brass", "pure", "reflective","plain", "design", "sanitary", "bumped", "gold", "warm")) +]] = Brass( + brass_type_select: 0.33f, + roughness: 0.14f, + roughness_variation: 0.95f, + surface_dirt: 0.63f, + dirt_dents: 0.6f, + bump_strength: 0.9f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +// 9 +export material Brass_Gold_Worn(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Gold - Worn"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass.Brass_Gold_Worn.png"), + ::anno::key_words(string[]("metal", "brass", "pure", "dirty", "worn", "reflective","plain", "stained", "design", "sanitary", "bumped", "gold", "warm")) +]] = Brass( + brass_type_select: 0.33f, + roughness: 0.43f, + roughness_variation: 0.95f, + surface_dirt: 1.0f, + dirt_dents: 0.54f, + bump_strength: 0.92f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +// 10 +export material Brass_Gold_Rough_Worn(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Gold - Rough Worn"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass.Brass_Gold_Rough_Worn.png"), + ::anno::key_words(string[]("metal", "brass", "matte", "dirty", "aged", "old", "worn", "reflective","plain", "stained", "design", "sanitary", "bumped", "gold", "warm")) +]] = Brass( + brass_type_select: 0.33f, + roughness: 1.0f, + roughness_variation: 1.0f, + surface_dirt: 0.92f, + dirt_dents: 0.35f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 11 +export material Brass_Red_New(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Red - New"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass.Brass_Red_New.png"), + ::anno::key_words(string[]("metal", "brass", "pure", "reflective","plain", "design", "sanitary", "red", "warm")) +]] = Brass( + brass_type_select: 0.66f, + roughness: 0.0f, + roughness_variation: 0.95f, + surface_dirt: 0.0f, + dirt_dents: 0.0f, + bump_strength: 0.09f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 12 +export material Brass_Red_New_Stained(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Red - New Stained"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass.Brass_Red_New_Stained.png"), + ::anno::key_words(string[]("metal", "brass", "new", "shiny", "smooth", "stained", "reflective","plain", "design", "sanitary", "red", "warm")) +]] = Brass( + brass_type_select: 0.66f, + roughness: 0.0f, + roughness_variation: 0.95f, + surface_dirt: 0.72f, + dirt_dents: 0.45f, + bump_strength: 0.25f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +// 13 +export material Brass_Red_Shiny_Handled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Red - Shiny Handled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass.Brass_Red_Shiny_Handled.png"), + ::anno::key_words(string[]("metal", "brass", "pure", "reflective","plain", "design", "sanitary", "bumped", "red", "warm")) +]] = Brass( + brass_type_select: 0.66f, + roughness: 0.14f, + roughness_variation: 0.95f, + surface_dirt: 0.63f, + dirt_dents: 0.6f, + bump_strength: 0.9f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +// 14 +export material Brass_Red_Worn(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Red - Worn"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass.Brass_Red_Worn.png"), + ::anno::key_words(string[]("metal", "brass", "pure", "dirty", "worn", "reflective","plain", "stained", "design", "sanitary", "bumped", "red", "warm")) +]] = Brass( + brass_type_select: 0.66f, + roughness: 0.43f, + roughness_variation: 0.95f, + surface_dirt: 1.0f, + dirt_dents: 0.54f, + bump_strength: 0.92f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +// 15 +export material Brass_Red_Rough_Worn(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Red - Rough Worn"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass.Brass_Red_Rough_Worn.png"), + ::anno::key_words(string[]("metal", "brass", "matte", "dirty", "aged", "old", "worn", "reflective","plain", "stained", "design", "sanitary", "bumped", "red", "warm")) +]] = Brass( + brass_type_select: 0.66f, + roughness: 1.0f, + roughness_variation: 1.0f, + surface_dirt: 0.92f, + dirt_dents: 0.35f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + diff --git a/code/third_party/vMaterials_2/Metal/Brass_Antique.mdl b/code/third_party/vMaterials_2/Metal/Brass_Antique.mdl new file mode 100644 index 0000000000000000000000000000000000000000..40a6bde3b06a618a006831c228663e115a0c4081 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Brass_Antique.mdl @@ -0,0 +1,427 @@ +/****************************************************************************** + * 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"; + + +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); +} + +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_xy_to_0_1(input, + low, + high), + 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 Brass_Antique( + float roughness = 0.0f [[ + ::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(0) + ]], + float surface_dirt_amount = 0.f [[ + ::anno::description("Adds a diffuse dirt layer which darkens the material."), + ::anno::display_name("Surface Dirt Amount"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float dirt_dents = 0.6f [[ + ::anno::description("Adds dirt in the areas where dents show up in the bump map."), + ::anno::display_name("Dents Dirt"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + 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(3) + ]], + uniform float2 texture_translate = float2(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 = float2(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.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(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("Brass Antique - Shiny Smooth"), + ::anno::description("An antique, worn brass material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Antique.Brass_Antique.png"), + // scratched, + ::anno::key_words(string[]("metal", "brass", "reflective", "antique", "old", "worn", "stained", "sanitary", "scratched", "design", "brown")) +]] + = + let { + bool tmp0 = false; + material_surface tmp1(::df::weighted_layer(::math::max(::math::max(histogram_scan(float3(endless_texture(texture_2d("./textures/brass_antique_multi_R_splats_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.00100000005f, 0.131999999f, 0.442999989f), 6.12999964f, false)).z, 0.f, ::math::lerp(0.f, 0.409999996f, surface_dirt_amount)), float3(endless_texture(texture_2d("./textures/brass_antique_multi_R_splats_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.00100000005f, 0.131999999f, 0.442999989f), 6.12999964f, false)).x), ::math::min(dirt_dents, float3(endless_texture(texture_2d("./textures/brass_antique_multi_R_splats_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.00100000005f, 0.131999999f, 0.442999989f), 6.12999964f, false)).y)), ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(color(0.0173889995f, 0.0125169996f, 0.00369399996f), color(0.0889820009f, 0.0442779996f, 0.00795899983f), ::base::color_layer_blend, float3(endless_texture(texture_2d("./textures/brass_antique_multi_R_splats_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.00100000005f, 0.131999999f, 0.442999989f), 6.12999964f, false)).x).tint, 0.f, ""), ::df::weighted_layer(::math::lerp(0.299999982f, 0.599999964f, roughness), ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(color(0.139981002f, 0.0928419977f, 0.0170479994f), color(0.00604900019f, 0.00469399989f, 0.00184399995f), ::base::color_layer_blend, histogram_scan_big(float3(endless_texture(texture_2d("./textures/brass_antique_multi_R_splats_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.00100000005f, 0.131999999f, 0.442999989f), 6.12999964f, false)).z, 0.359999985f, 0.560000002f)).tint, 0.f, ""), ::df::weighted_layer(0.349999994f, ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(endless_texture(texture_2d("./textures/brass_antique_multi_R_splats_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.00100000005f, 0.131999999f, 0.442999989f), 6.12999964f, false)).z, 0.170000002f, ::math::lerp(0.399999976f, 0.799999952f, roughness)) * histogram_range(float3(endless_texture(texture_2d("./textures/brass_antique_multi_R_splats_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.00100000005f, 0.131999999f, 0.442999989f), 6.12999964f, false)).z, 0.170000002f, ::math::lerp(0.399999976f, 0.799999952f, roughness)), histogram_range(float3(endless_texture(texture_2d("./textures/brass_antique_multi_R_splats_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.00100000005f, 0.131999999f, 0.442999989f), 6.12999964f, false)).z, 0.170000002f, ::math::lerp(0.399999976f, 0.799999952f, roughness)) * histogram_range(float3(endless_texture(texture_2d("./textures/brass_antique_multi_R_splats_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.00100000005f, 0.131999999f, 0.442999989f), 6.12999964f, false)).z, 0.170000002f, ::math::lerp(0.399999976f, 0.799999952f, roughness)), endless_texture(texture_2d("./textures/brass_antique_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.621999979f, 0.504999995f, 0.248999998f), 6.12999964f, true), color(0.0908420011f, 0.0231829993f, 0.f), ::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("./textures/brass_antique_multi_R_splats_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.00100000005f, 0.131999999f, 0.442999989f), 6.12999964f, false)).z, ::math::lerp(0.639999986f, 0.25f, roughness), ::math::lerp(0.25f, 0.50999999f, roughness)) * histogram_range(float3(endless_texture(texture_2d("./textures/brass_antique_multi_R_splats_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.00100000005f, 0.131999999f, 0.442999989f), 6.12999964f, false)).z, ::math::lerp(0.639999986f, 0.25f, roughness), ::math::lerp(0.25f, 0.50999999f, roughness)), histogram_range(float3(endless_texture(texture_2d("./textures/brass_antique_multi_R_splats_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.00100000005f, 0.131999999f, 0.442999989f), 6.12999964f, false)).z, ::math::lerp(0.639999986f, 0.25f, roughness), ::math::lerp(0.25f, 0.50999999f, roughness)) * histogram_range(float3(endless_texture(texture_2d("./textures/brass_antique_multi_R_splats_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.00100000005f, 0.131999999f, 0.442999989f), 6.12999964f, false)).z, ::math::lerp(0.639999986f, 0.25f, roughness), ::math::lerp(0.25f, 0.50999999f, roughness)), endless_texture(texture_2d("./textures/brass_antique_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.621999979f, 0.504999995f, 0.248999998f), 6.12999964f, true), color(0.f, 0.f, 0.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), bsdf(), endless_normal(texture_2d("./textures/brass_antique_normal.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.5f, 0.5f, 0.999000013f), 6.12999964f)), endless_normal(texture_2d("./textures/brass_antique_normal.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.5f, 0.5f, 0.999000013f), 6.12999964f)), endless_normal(texture_2d("./textures/brass_antique_normal.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.5f, 0.5f, 0.999000013f), 6.12999964f)), endless_normal(texture_2d("./textures/brass_antique_normal.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.5f, 0.5f, 0.999000013f), 6.12999964f)), 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 Brass_Antique_Shiny_Stained(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Antique - Shiny Stained"), + ::anno::description("An antique, worn brass material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Antique.Brass_Antique_Shiny_Stained.png"), + // scratched, + ::anno::key_words(string[]("metal", "brass", "reflective", "antique", "old", "worn", "shiny", "stained", "sanitary", "scratched", "design", "brown")) +]] = Brass_Antique +( + roughness: 0.0f, + surface_dirt_amount: 1.0f, + dirt_dents: 0.94f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + + +export material Brass_Antique_Matte_Dirty(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Antique - Matte Dirty"), + ::anno::description("An antique, worn brass material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Antique.Brass_Antique_Matte_Dirty.png"), + // scratched, + ::anno::key_words(string[]("metal", "brass", "reflective", "antique", "old", "worn", "matte", "stained", "sanitary", "scratched", "design", "brown")) +]] = Brass_Antique +( + roughness: 0.65f, + surface_dirt_amount: 0.59f, + dirt_dents: 0.73f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); diff --git a/code/third_party/vMaterials_2/Metal/Brass_Brushed.mdl b/code/third_party/vMaterials_2/Metal/Brass_Brushed.mdl new file mode 100644 index 0000000000000000000000000000000000000000..3e90f6a80eeb4b5e7c7f14f72b685361cc904a72 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Brass_Brushed.mdl @@ -0,0 +1,828 @@ +/****************************************************************************** + * 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 brushed brass material with controls to add wear and dirt. Set the parameter " + "'Brass Type Blend' to 0.0 or 1.0 for yellow brass, 0.33 for gold brass and 0.66 for " + "red brass. Values inbetween will interpolate between the brass colors"; + +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 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); +} + + +::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 Brass_Brushed( + float brass_type_select = 0.f [[ + ::anno::description("Bends between the Brass types. 0 is yellow brass, 0.33 gold brass and 0.66 red brass. Going from 0.66 to 1.0 fades to yellow brass."), + ::anno::display_name("Brass Type Blend"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(0) + ]], + float brushing_roughness = 0.09f [[ + ::anno::description("Adjusts the overall roughness of the brushed metal."), + ::anno::display_name("Brushing Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float brushing_anisotropy = 0.42f [[ + ::anno::description("A higher value stretches out the reflection."), + ::anno::display_name("Brushing Anisotropy"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float brush_darkening = 0.69f [[ + ::anno::description("Adds brightness variation to the brushing pattern which gives a more pronounced look to the brushing effect. Also darkend the appearance."), + ::anno::display_name("Brush Darkening"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float surface_dirt = 0.01f [[ + ::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(4) + ]], + float dirt_dents = 0.01f [[ + ::anno::description("Adds dirt in the areas where dents appear on the surface."), + ::anno::display_name("Dents Dirt"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(5) + ]], + float bump_strength = 0.01f [[ + ::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(6) + ]], + uniform float2 texture_translate = float2(0.f) [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform"), + ::anno::ui_order(7) + ]], + 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(8) + ]], + uniform float2 texture_scale = float2(1.0f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(0.6f, 0.6f)), + ::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.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(11) + ]], + uniform bool roundcorners_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::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("Advanced"), + ::anno::hard_range(0, 10), + ::anno::ui_order(13) + ]]) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Yellow Brushed - Smooth Subtle"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Brushed.Brass_Brushed.png"), + // new, worn, aged, dirty, bumped, shiny, rough, matte + ::anno::key_words(string[]("metal", "brass", "brushed", "anisotropic", "new", "shiny", "smooth", "reflective", "design", "sanitary", "yellow", "warm")) +]] + = + let { + bool tmp0 = false; + float2 texture_rescale = texture_scale * 0.5f; + material_surface tmp1(::df::weighted_layer(::math::max(float3(endless_texture(texture_2d("./textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z * surface_dirt, ::math::min(dirt_dents, float3(endless_texture(texture_2d("./textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).y)), ::df::diffuse_reflection_bsdf(color(0.0173889995f, 0.0125169996f, 0.00369399996f), 0.f), ::df::custom_curve_layer(0.f, 1.f, 5.35999966f, 1.f, ::df::weighted_layer(0.349999994f, ::df::microfacet_ggx_smith_bsdf(0.0625f, 0.0625f, nvidia::core_definitions::blend_colors(color(1.f, 1.f, 1.f), color(float3(endless_texture(texture_2d("./textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).x), ::base::color_layer_multiply, brush_darkening).tint, nvidia::core_definitions::blend_colors(color(1.f, 1.f, 1.f), color(float3(endless_texture(texture_2d("./textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).x), ::base::color_layer_multiply, brush_darkening).tint, ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::microfacet_ggx_smith_bsdf(anisotropy_conversion(histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).x, 0.539999962f, brushing_roughness * 0.300000012f + 0.0500000007f), histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).x, 1.f, brushing_anisotropy * 0.610000014f + 0.170000002f), texture_rotate / 360.f, ::state::texture_tangent_u(0)).roughness_u, anisotropy_conversion(histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).x, 0.539999962f, brushing_roughness * 0.300000012f + 0.0500000007f), histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).x, 1.f, brushing_anisotropy * 0.610000014f + 0.170000002f), texture_rotate / 360.f, ::state::texture_tangent_u(0)).roughness_v, nvidia::core_definitions::blend_colors(color(1.f, 1.f, 1.f), color(float3(endless_texture(texture_2d("./textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).x), ::base::color_layer_multiply, brush_darkening).tint, nvidia::core_definitions::blend_colors(color(1.f, 1.f, 1.f), color(float3(endless_texture(texture_2d("./textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).x), ::base::color_layer_multiply, brush_darkening).tint, anisotropy_conversion(histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).x, 0.539999962f, brushing_roughness * 0.300000012f + 0.0500000007f), histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).x, 1.f, brushing_anisotropy * 0.610000014f + 0.170000002f), texture_rotate / 360.f, ::state::texture_tangent_u(0)).tangent_u, ::df::scatter_reflect), bsdf(), endless_normal(texture_2d("./textures/brushed_metal_linear_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.5f, 0.5f, 0.999000013f), 6.12999964f)), endless_normal(texture_2d("./textures/brushed_metal_linear_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.5f, 0.5f, 0.999000013f), 6.12999964f)), ::df::tint(gradient_lookup_smooth(texture_2d("./textures/brass_gradients_yellow_gold_red.png", ::tex::gamma_srgb), ::math::pow(float3(endless_texture(texture_2d("./textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, 0.399999976f), brass_type_select), ::df::weighted_layer(0.349999994f, ::df::microfacet_ggx_smith_bsdf(0.0625f, 0.0625f, nvidia::core_definitions::blend_colors(color(1.f, 1.f, 1.f), color(float3(endless_texture(texture_2d("./textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).x), ::base::color_layer_multiply, brush_darkening).tint, nvidia::core_definitions::blend_colors(color(1.f, 1.f, 1.f), color(float3(endless_texture(texture_2d("./textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).x), ::base::color_layer_multiply, brush_darkening).tint, ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::microfacet_ggx_smith_bsdf(anisotropy_conversion(histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).x, 0.539999962f, brushing_roughness * 0.300000012f + 0.0500000007f), histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).x, 1.f, brushing_anisotropy * 0.610000014f + 0.170000002f), texture_rotate / 360.f, ::state::texture_tangent_u(0)).roughness_u, anisotropy_conversion(histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).x, 0.539999962f, brushing_roughness * 0.300000012f + 0.0500000007f), histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).x, 1.f, brushing_anisotropy * 0.610000014f + 0.170000002f), texture_rotate / 360.f, ::state::texture_tangent_u(0)).roughness_v, nvidia::core_definitions::blend_colors(color(1.f, 1.f, 1.f), color(float3(endless_texture(texture_2d("./textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).x), ::base::color_layer_multiply, brush_darkening).tint, nvidia::core_definitions::blend_colors(color(1.f, 1.f, 1.f), color(float3(endless_texture(texture_2d("./textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).x), ::base::color_layer_multiply, brush_darkening).tint, anisotropy_conversion(histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).x, 0.539999962f, brushing_roughness * 0.300000012f + 0.0500000007f), histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).x, 1.f, brushing_anisotropy * 0.610000014f + 0.170000002f), texture_rotate / 360.f, ::state::texture_tangent_u(0)).tangent_u, ::df::scatter_reflect), bsdf(), endless_normal(texture_2d("./textures/brushed_metal_linear_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.5f, 0.5f, 0.999000013f), 6.12999964f)), endless_normal(texture_2d("./textures/brushed_metal_linear_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.5f, 0.5f, 0.999000013f), 6.12999964f))), ::state::normal()), endless_normal(texture_2d("./textures/brushed_metal_linear_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.5f, 0.5f, 0.999000013f), 6.12999964f)), 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 Brass_Brushed_Yellow_Fine(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Yellow Brushed - Fine"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Brushed.Brass_Brushed_Yellow_Fine.png"), + // new, worn, aged, dirty, bumped, shiny, rough, matte + ::anno::key_words(string[]("metal", "brass", "brushed", "anisotropic", "new", "shiny", "smooth", "fine", "reflective", "design", "sanitary", "yellow", "warm")) +]] = Brass_Brushed +( + brass_type_select: 0.0f, // Yellow + brushing_roughness: 0.05f, + brushing_anisotropy: 0.76f, + brush_darkening: 0.0f, + surface_dirt: 0.0f, + dirt_dents: 0.0f, + bump_strength: 0.19f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +// 3 +export material Brass_Brushed_Yellow_Medium(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Yellow Brushed - Medium"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Brushed.Brass_Brushed_Yellow_Medium.png"), + // new, worn, aged, dirty, bumped, shiny, rough, matte + ::anno::key_words(string[]("metal", "brass", "brushed", "anisotropic", "new", "shiny", "smooth", "reflective", "design", "sanitary", "yellow", "warm")) +]] = Brass_Brushed +( + brass_type_select: 0.0f, // Yellow + brushing_roughness: 0.32f, + brushing_anisotropy: 0.77f, + brush_darkening: 0.0f, + surface_dirt: 0.03f, + dirt_dents: 0.3f, + bump_strength: 0.48f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +// 4 +export material Brass_Brushed_Yellow_Dirty_Medium(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Yellow Brushed - Dirty Medium"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Brushed.Brass_Brushed_Yellow_Dirty_Medium.png"), + // new, worn, aged, dirty, bumped, shiny, rough, matte + ::anno::key_words(string[]("metal", "brass", "brushed", "anisotropic", "dirty", "worn", "shiny", "rough", "reflective", "design", "sanitary", "yellow", "warm")) +]] = Brass_Brushed +( + brass_type_select: 0.0f, // Yellow + brushing_roughness: 0.32f, + brushing_anisotropy: 0.77f, + brush_darkening: 0.0f, + surface_dirt: 0.03f, + dirt_dents: 0.3f, + bump_strength: 0.48f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +// 5 +export material Brass_Brushed_Yellow_Strong(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Yellow Brushed - Strong"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Brushed.Brass_Brushed_Yellow_Strong.png"), + // new, worn, aged, dirty, bumped, shiny, rough, matte + ::anno::key_words(string[]("metal", "brass", "brushed", "anisotropic", "new", "shiny", "rough", "reflective", "design", "sanitary", "yellow", "warm")) +]] = Brass_Brushed +( + brass_type_select: 0.0f, // Yellow + brushing_roughness: 0.75f, + brushing_anisotropy: 0.96f, + brush_darkening: 0.55f, + surface_dirt: 0.05f, + dirt_dents: 0.05f, + bump_strength: 0.73f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +// 6 +export material Brass_Brushed_Gold_Smooth_Subtle(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Gold Brushed - Smooth Subtle"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Brushed.Brass_Brushed_Gold_Smooth_Subtle.png"), + // new, worn, aged, dirty, bumped, shiny, rough, matte + ::anno::key_words(string[]("metal", "brass", "brushed", "anisotropic", "new", "shiny", "smooth", "reflective", "design", "sanitary", "gold", "warm")) +]] = Brass_Brushed +( + brass_type_select: 0.33f, // Gold + brushing_roughness: 0.09f, + brushing_anisotropy: 0.42f, + brush_darkening: 0.69f, + surface_dirt: 0.01f, + dirt_dents: 0.01f, + bump_strength: 0.01f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +// 7 +export material Brass_Brushed_Gold_Fine(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Gold Brushed - Fine"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Brushed.Brass_Brushed_Gold_Fine.png"), + // new, worn, aged, dirty, bumped, shiny, rough, matte + ::anno::key_words(string[]("metal", "brass", "brushed", "anisotropic", "new", "shiny", "smooth", "fine", "reflective", "design", "sanitary", "gold", "warm")) +]] = Brass_Brushed +( + brass_type_select: 0.33f, // Gold + brushing_roughness: 0.05f, + brushing_anisotropy: 0.76f, + brush_darkening: 0.0f, + surface_dirt: 0.0f, + dirt_dents: 0.0f, + bump_strength: 0.19f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +// 8 +export material Brass_Brushed_Gold_Medium(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Gold Brushed - Medium"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Brushed.Brass_Brushed_Gold_Medium.png"), + // new, worn, aged, dirty, bumped, shiny, rough, matte + ::anno::key_words(string[]("metal", "brass", "brushed", "anisotropic", "new", "shiny", "smooth", "reflective", "design", "sanitary", "gold", "warm")) +]] = Brass_Brushed +( + brass_type_select: 0.33f, // Gold + brushing_roughness: 0.32f, + brushing_anisotropy: 0.77f, + brush_darkening: 0.0f, + surface_dirt: 0.03f, + dirt_dents: 0.3f, + bump_strength: 0.48f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +// 9 +export material Brass_Brushed_Gold_Dirty_Medium(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Gold Brushed - Dirty Medium"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Brushed.Brass_Brushed_Gold_Dirty_Medium.png"), + // new, worn, aged, dirty, bumped, shiny, rough, matte + ::anno::key_words(string[]("metal", "brass", "brushed", "anisotropic", "dirty", "worn", "shiny", "rough", "reflective", "design", "sanitary", "gold", "warm")) +]] = Brass_Brushed +( + brass_type_select: 0.33f, // Gold + brushing_roughness: 0.32f, + brushing_anisotropy: 0.77f, + brush_darkening: 0.0f, + surface_dirt: 0.03f, + dirt_dents: 0.3f, + bump_strength: 0.48f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +// 10 +export material Brass_Brushed_Gold_Strong(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Gold Brushed - Strong"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Brushed.Brass_Brushed_Gold_Strong.png"), + // new, worn, aged, dirty, bumped, shiny, rough, matte + ::anno::key_words(string[]("metal", "brass", "brushed", "anisotropic", "new", "shiny", "rough", "reflective", "design", "sanitary", "gold", "warm")) +]] = Brass_Brushed +( + brass_type_select: 0.33f, // Gold + brushing_roughness: 0.75f, + brushing_anisotropy: 0.96f, + brush_darkening: 0.55f, + surface_dirt: 0.05f, + dirt_dents: 0.05f, + bump_strength: 0.73f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + + +// 11 +export material Brass_Brushed_Red_Smooth_Subtle(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Red Brushed - Smooth Subtle"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Brushed.Brass_Brushed_Red_Smooth_Subtle.png"), + // new, worn, aged, dirty, bumped, shiny, rough, matte + ::anno::key_words(string[]("metal", "brass", "brushed", "anisotropic", "new", "shiny", "smooth", "reflective", "design", "sanitary", "red", "warm")) +]] = Brass_Brushed +( + brass_type_select: 0.66f, // Red + brushing_roughness: 0.09f, + brushing_anisotropy: 0.42f, + brush_darkening: 0.69f, + surface_dirt: 0.01f, + dirt_dents: 0.05f, + bump_strength: 0.01f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +// 12 +export material Brass_Brushed_Red_Fine(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Red Brushed - Fine"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Brushed.Brass_Brushed_Red_Fine.png"), + // new, worn, aged, dirty, bumped, shiny, rough, matte + ::anno::key_words(string[]("metal", "brass", "brushed", "anisotropic", "new", "shiny", "smooth", "fine", "reflective", "design", "sanitary", "red", "warm")) +]] = Brass_Brushed +( + brass_type_select: 0.66f, // Red + brushing_roughness: 0.05f, + brushing_anisotropy: 0.76f, + brush_darkening: 0.0f, + surface_dirt: 0.0f, + dirt_dents: 0.0f, + bump_strength: 0.19f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +// 13 +export material Brass_Brushed_Red_Medium(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Red Brushed - Medium"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Brushed.Brass_Brushed_Red_Medium.png"), + // new, worn, aged, dirty, bumped, shiny, rough, matte + ::anno::key_words(string[]("metal", "brass", "brushed", "anisotropic", "new", "shiny", "smooth", "reflective", "design", "sanitary", "red", "warm")) +]] = Brass_Brushed +( + brass_type_select: 0.66f, // Red + brushing_roughness: 0.32f, + brushing_anisotropy: 0.77f, + brush_darkening: 0.0f, + surface_dirt: 0.03f, + dirt_dents: 0.3f, + bump_strength: 0.48f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +// 14 +export material Brass_Brushed_Red_Dirty_Medium(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Red Brushed - Dirty Medium"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Brushed.Brass_Brushed_Red_Dirty_Medium.png"), + // new, worn, aged, dirty, bumped, shiny, rough, matte + ::anno::key_words(string[]("metal", "brass", "brushed", "anisotropic", "dirty", "worn", "shiny", "rough", "reflective", "design", "sanitary", "red", "warm")) +]] = Brass_Brushed +( + brass_type_select: 0.66f, // Red + brushing_roughness: 0.32f, + brushing_anisotropy: 0.77f, + brush_darkening: 0.0f, + surface_dirt: 0.03f, + dirt_dents: 0.3f, + bump_strength: 0.48f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +// 15 +export material Brass_Brushed_Red_Strong(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Red Brushed - Strong"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Brushed.Brass_Brushed_Red_Strong.png"), + // new, worn, aged, dirty, bumped, shiny, rough, matte + ::anno::key_words(string[]("metal", "brass", "brushed", "anisotropic", "new", "shiny", "rough", "reflective", "design", "sanitary", "red", "warm")) +]] = Brass_Brushed +( + brass_type_select: 0.66f, // Red + brushing_roughness: 0.75f, + brushing_anisotropy: 0.96f, + brush_darkening: 0.55f, + surface_dirt: 0.05f, + dirt_dents: 0.05f, + bump_strength: 0.73f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + + + + diff --git a/code/third_party/vMaterials_2/Metal/Brass_Foil.mdl b/code/third_party/vMaterials_2/Metal/Brass_Foil.mdl new file mode 100644 index 0000000000000000000000000000000000000000..488066aca77a188664cc4f62174a6d7125f6946d --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Brass_Foil.mdl @@ -0,0 +1,800 @@ +/****************************************************************************** + * 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 brass metal foil material with optional smudges and crumples"; + +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 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); +} + +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)); +} + + +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 Brass_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"), + ::anno::ui_order(0) + ]], + float brass_type_select = 0.00f [[ + ::anno::description("Bends between the Brass types. 0 is yellow brass, 0.33 gold brass and 0.66 red brass. Going from 0.66 to 1.0 wraps back to gold brass."), + ::anno::display_name("Brass Type Blend"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float roughness = 0.125f [[ + ::anno::description("Higher values make blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::ui_order(2) + ]], + float roughness_variation = 0.14f [[ + ::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::in_group("Appearance"), + ::anno::ui_order(3) + ]], + float smudges = 0.88f [[ + ::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), + ::anno::ui_order(4) + ]], + uniform float bump_strength = 0.f [[ + ::anno::description("Specifies the strength of the bump."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::ui_order(5) + ]], + uniform float2 texture_translate = float2(0.f) [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform"), + ::anno::ui_order(6) + ]], + uniform float texture_rotate = 0.0f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::ui_order(7) + ]], + uniform float2 texture_scale = float2(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("Chosses which textures space to use."), + ::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.0f [[ + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::display_name("Round Corner 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::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Foil Yellow - Flat Smudged"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Foil.Brass_Foil.png"), + // scratched, old, stained, crumpled, handled, worn, creative, smudged, bumped, matte, shiny + ::anno::key_words(string[]("metal", "brass", "reflective", "shiny", "foil", "smooth", "old", "new", "smudged", "design", "yellow", "warm")) +]] + = + let { + bool tmp0 = false; + + texture_2d rough_ao_tex = texture_2d("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear); + texture_2d gradient_tex = texture_2d("./textures/brass_gradients_yellow_gold_red.png", ::tex::gamma_srgb); + texture_2d smudge_splotch_tex = texture_2d("./textures/foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear); + texture_2d norm_tex = texture_2d("./textures/foil_crumpled_norm.jpg", ::tex::gamma_linear); + + material_surface tmp1(df::weighted_layer(0.0599999987f, df::microfacet_ggx_smith_bsdf(0.300000012f, 0.300000012f, gradient_lookup_smooth(gradient_tex, 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).x, brass_type_select), color(0.f, 0.f, 0.f), state::texture_tangent_u(0), df::scatter_reflect), df::color_custom_curve_layer(gradient_lookup_smooth(gradient_tex, 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).x, brass_type_select), color(0.998699009f, 1.f, 1.f), 5.f, color(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).z, 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).x, 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).y - 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).x + 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).y) * (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).x, 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).y - 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).x + 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).y), (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).x, 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).y - 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).x + 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).y) * (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).x, 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).y - 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).x + 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).y), color(1.f, 1.f, 1.f), color(0.f, 0.f, 0.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()); + 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 Brass_Foil_Yellow_Slightly_Wrinkled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Foil Yellow - Slightly Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Foil.Brass_Foil_Yellow_Slightly_Wrinkled.png"), + // scratched, old, stained, crumpled, handled, worn, creative, smudged, bumped, matte, shiny + ::anno::key_words(string[]("metal", "brass", "reflective", "shiny", "foil", "smooth", "worn", "wrinkled", "design", "yellow", "warm")) +]] = Brass_Foil( + infinite_tiling: true, + brass_type_select: 0.0f, + roughness: 0.15f, + roughness_variation:0.56f, + smudges: 0.35f, + bump_strength: 0.05f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.0f, + across_materials: false +); + +// 3 +export material Brass_Foil_Yellow_Shiny_Wrinkled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Foil Yellow - Shiny Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Foil.Brass_Foil_Yellow_Shiny_Wrinkled.png"), + // scratched, old, stained, crumpled, handled, worn, creative, smudged, bumped, matte, shiny + ::anno::key_words(string[]("metal", "brass", "reflective", "foil", "smooth", "shiny", "worn", "stained", "wrinkled", "design", "yellow", "warm")) +]] = Brass_Foil( + infinite_tiling: true, + brass_type_select: 0.0f, + roughness: 0.25f, + roughness_variation:0.25f, + smudges: 0.75f, + bump_strength: 0.25f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.0f, + across_materials: false +); + + +// 4 +export material Brass_Foil_Yellow_Matte_Wrinkled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Foil Yellow - Matte Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Foil.Brass_Foil_Yellow_Matte_Wrinkled.png"), + // scratched, old, stained, crumpled, handled, worn, creative, smudged, bumped, matte, shiny + ::anno::key_words(string[]("metal", "brass", "reflective", "foil", "smooth", "matte", "worn", "stained", "wrinkled", "design", "yellow", "warm")) +]] = Brass_Foil( + infinite_tiling: true, + brass_type_select: 0.0f, + roughness: 0.65f, + roughness_variation:1.0f, + smudges: 0.4f, + bump_strength: 0.5f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.0f, + across_materials: false +); + + +// 5 +export material Brass_Foil_Yellow_Heavy_Wrinkles(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Foil Yellow - Heavy Matte Wrinkles"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Foil.Brass_Foil_Yellow_Heavy_Wrinkles.png"), + // scratched, old, stained, crumpled, handled, worn, creative, smudged, bumped, matte, shiny + ::anno::key_words(string[]("metal", "brass", "reflective", "foil", "smooth", "shiny", "worn", "stained", "wrinkled", "design", "yellow", "warm")) +]] = Brass_Foil( + infinite_tiling: true, + brass_type_select: 0.0f, + roughness: 0.164f, + roughness_variation:0.0f, + smudges: 0.75f, + bump_strength: 0.99f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.0f, + across_materials: false +); + + +// 6 +export material Brass_Foil_Gold_Heavy_Wrinkles(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Foil Gold - Heavy Matte Wrinkles"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Foil.Brass_Foil_Gold_Heavy_Wrinkles.png"), + // scratched, old, stained, crumpled, handled, worn, creative, smudged, bumped, matte, shiny + ::anno::key_words(string[]("metal", "brass", "reflective", "foil", "smooth", "shiny", "worn", "stained", "wrinkled", "design", "gold", "warm")) +]] = Brass_Foil( + infinite_tiling: true, + brass_type_select: 0.33f, + roughness: 0.125f, + roughness_variation:0.14f, + smudges: 0.88f, + bump_strength: 0.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.0f, + across_materials: false +); + + +// 7 +export material Brass_Foil_Gold_Slightly_Wrinkled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Foil Gold - Slightly Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Foil.Brass_Foil_Gold_Slightly_Wrinkled.png"), + // scratched, old, stained, crumpled, handled, worn, creative, smudged, bumped, matte, shiny + ::anno::key_words(string[]("metal", "brass", "reflective", "shiny", "foil", "smooth", "worn", "wrinkled", "design", "gold", "warm")) +]] = Brass_Foil( + infinite_tiling: true, + brass_type_select: 0.33f, + roughness: 0.15f, + roughness_variation:0.56f, + smudges: 0.35f, + bump_strength: 0.05f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.0f, + across_materials: false +); + +// 8 +export material Brass_Foil_Gold_Shiny_Wrinkled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Foil Gold - Shiny Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Foil.Brass_Foil_Gold_Shiny_Wrinkled.png"), + // scratched, old, stained, crumpled, handled, worn, creative, smudged, bumped, matte, shiny + ::anno::key_words(string[]("metal", "brass", "reflective", "foil", "smooth", "shiny", "worn", "stained", "wrinkled", "design", "gold", "warm")) +]] = Brass_Foil( + infinite_tiling: true, + brass_type_select: 0.33f, + roughness: 0.25f, + roughness_variation:0.25f, + smudges: 0.75f, + bump_strength: 0.25f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.0f, + across_materials: false +); + + +// 9 +export material Brass_Foil_Gold_Matte_Wrinkled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Foil Gold - Matte Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Foil.Brass_Foil_Gold_Matte_Wrinkled.png"), + // scratched, old, stained, crumpled, handled, worn, creative, smudged, bumped, matte, shiny + ::anno::key_words(string[]("metal", "brass", "reflective", "foil", "smooth", "matte", "worn", "stained", "wrinkled", "design", "gold", "warm")) +]] = Brass_Foil( + infinite_tiling: true, + brass_type_select: 0.33f, + roughness: 0.65f, + roughness_variation:1.0f, + smudges: 0.4f, + bump_strength: 0.5f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.0f, + across_materials: false +); + + +// 10 +export material Brass_Foil_Gold_Flat_Smudged(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Foil Gold - Flat Smudged"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Foil.Brass_Foil_Gold_Flat_Smudged.png"), + // scratched, old, stained, crumpled, handled, worn, creative, smudged, bumped, matte, shiny + ::anno::key_words(string[]("metal", "brass", "reflective", "foil", "smooth", "shiny", "worn", "stained", "design", "smudged", "gold", "warm")) +]] = Brass_Foil( + infinite_tiling: true, + brass_type_select: 0.33f, + roughness: 0.164f, + roughness_variation:0.0f, + smudges: 0.75f, + bump_strength: 0.99f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.0f, + across_materials: false +); + + + + +// 11 +export material Brass_Foil_Red_Heavy_Wrinkles(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Foil Red - Heavy Matte Wrinkles"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Foil.Brass_Foil_Red_Heavy_Wrinkles.png"), + // scratched, old, stained, crumpled, handled, worn, creative, smudged, bumped, matte, shiny + ::anno::key_words(string[]("metal", "brass", "reflective", "foil", "smooth", "shiny", "worn", "stained", "wrinkled", "design", "red", "warm")) +]] = Brass_Foil( + infinite_tiling: true, + brass_type_select: 0.33f, + roughness: 0.125f, + roughness_variation:0.14f, + smudges: 0.88f, + bump_strength: 0.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.0f, + across_materials: false +); + + +// 12 +export material Brass_Foil_Red_Slightly_Wrinkled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Foil Red - Slightly Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Foil.Brass_Foil_Red_Slightly_Wrinkled.png"), + // scratched, old, stained, crumpled, handled, worn, creative, smudged, bumped, matte, shiny + ::anno::key_words(string[]("metal", "brass", "reflective", "shiny", "foil", "smooth", "worn", "wrinkled", "design", "red", "warm")) +]] = Brass_Foil( + infinite_tiling: true, + brass_type_select: 0.33f, + roughness: 0.15f, + roughness_variation:0.56f, + smudges: 0.35f, + bump_strength: 0.05f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.0f, + across_materials: false +); + +// 13 +export material Brass_Foil_Red_Shiny_Wrinkled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Foil Red - Shiny Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Foil.Brass_Foil_Red_Shiny_Wrinkled.png"), + // scratched, old, stained, crumpled, handled, worn, creative, smudged, bumped, matte, shiny + ::anno::key_words(string[]("metal", "brass", "reflective", "foil", "smooth", "shiny", "worn", "stained", "wrinkled", "design", "red", "warm")) +]] = Brass_Foil( + infinite_tiling: true, + brass_type_select: 0.33f, + roughness: 0.25f, + roughness_variation:0.25f, + smudges: 0.75f, + bump_strength: 0.25f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.0f, + across_materials: false +); + + +// 14 +export material Brass_Foil_Red_Matte_Wrinkled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Foil Red - Matte Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Foil.Brass_Foil_Red_Matte_Wrinkled.png"), + // scratched, old, stained, crumpled, handled, worn, creative, smudged, bumped, matte, shiny + ::anno::key_words(string[]("metal", "brass", "reflective", "foil", "smooth", "matte", "worn", "stained", "wrinkled", "design", "red", "warm")) +]] = Brass_Foil( + infinite_tiling: true, + brass_type_select: 0.33f, + roughness: 0.65f, + roughness_variation:1.0f, + smudges: 0.4f, + bump_strength: 0.5f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.0f, + across_materials: false +); + + +// 15 +export material Brass_Foil_Red_Flat_Smudged(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Foil Red - Flat Smudged"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Foil.Brass_Foil_Red_Flat_Smudged.png"), + // scratched, old, stained, crumpled, handled, worn, creative, smudged, bumped, matte, shiny + ::anno::key_words(string[]("metal", "brass", "reflective", "foil", "smooth", "shiny", "worn", "stained", "smudged", "design", "red", "warm")) +]] = Brass_Foil( + infinite_tiling: true, + brass_type_select: 0.33f, + roughness: 0.164f, + roughness_variation:0.0f, + smudges: 0.75f, + bump_strength: 0.99f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.0f, + across_materials: false +); + + + + + + + + + + + + + + + + diff --git a/code/third_party/vMaterials_2/Metal/Brass_Hammered.mdl b/code/third_party/vMaterials_2/Metal/Brass_Hammered.mdl new file mode 100644 index 0000000000000000000000000000000000000000..732e52d0575e1917e7de7d07cd21e0b7d7c98227 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Brass_Hammered.mdl @@ -0,0 +1,441 @@ +/****************************************************************************** + * 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 brass 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 Brass_Hammered( + float brass_type_select = 0.f [[ + ::anno::description("Bends between the Brass types. 0 is yellow brass, 0.33 gold brass and 0.66 red brass. Going from 0.66 to 1.0 wraps back to yellow brass."), + ::anno::display_name("Brass Type Blend"), + ::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 = float2(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 = float2(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("Brass Hammered Yellow - Hammered Darkened"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Hammered.Brass_Hammered.png"), + // scratched, old, stained, crumpled, handled, worn, creative, smudged, bumped, matte, shiny + ::anno::key_words(string[]("metal", "brass", "reflective", "shiny", "hammered", "stained", "bumped", "design", "yellow", "warm")) +]] + = + let { + 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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/brass_gradients_yellow_gold_red.png", ::tex::gamma_srgb), float3(base::file_texture(texture_2d("./textures/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, brass_type_select), color(math::pow(float3(base::file_texture(texture_2d("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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 Brass_Hammered_Yellow_Shiny_Soft_Hammering(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Hammered Yellow - Shiny Soft Hammering"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Hammered.Brass_Hammered_Yellow_Shiny_Soft_Hammering.png"), + // scratched, old, stained, crumpled, handled, worn, creative, smudged, bumped, matte, shiny + ::anno::key_words(string[]("metal", "brass", "reflective", "shiny", "hammered", "bumped", "design", "yellow", "warm")) +]] = Brass_Hammered( + brass_type_select: 0.0f, + cavities_darkening: 0.0f, + roughness: 0.0f, + bump_strength: 0.51f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 3 +export material Brass_Hammered_Yellow_Matte_Hammering(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Hammered Yellow - Matte Hammering"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Hammered.Brass_Hammered_Yellow_Matte_Hammering.png"), + // scratched, old, stained, crumpled, handled, worn, creative, smudged, bumped, matte, shiny + ::anno::key_words(string[]("metal", "brass", "reflective", "matte", "hammered", "bumped", "design", "yellow", "warm")) +]] = Brass_Hammered( + brass_type_select: 0.0f, + cavities_darkening: 1.0f, + roughness: 0.8f, + bump_strength: 0.99f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 4 +export material Brass_Hammered_Gold_Hammered_Darkened(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Hammered Gold - Hammered Darkened"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Hammered.Brass_Hammered_Gold_Hammered_Darkened.png"), + // scratched, old, stained, crumpled, handled, worn, creative, smudged, bumped, matte, shiny + ::anno::key_words(string[]("metal", "brass", "reflective", "matte", "hammered", "bumped", "design", "gold", "warm")) +]] = Brass_Hammered( + brass_type_select: 0.33f, + cavities_darkening: 1.0f, + roughness: 0.0f, + bump_strength: 0.99f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 5 +export material Brass_Hammered_Gold_Shiny_Soft_Hammering(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Hammered Gold - Shiny Soft Hammering"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Hammered.Brass_Hammered_Gold_Shiny_Soft_Hammering.png"), + // scratched, old, stained, crumpled, handled, worn, creative, smudged, bumped, matte, shiny + ::anno::key_words(string[]("metal", "brass", "reflective", "shiny", "hammered", "bumped", "design", "gold", "warm")) +]] = Brass_Hammered( + brass_type_select: 0.33f, + cavities_darkening: 0.0f, + roughness: 0.0f, + bump_strength: 0.51f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 6 +export material Brass_Hammered_Gold_Matte_Hammering(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Hammered Gold - Matte Hammering"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Hammered.Brass_Hammered_Gold_Matte_Hammering.png"), + // scratched, old, stained, crumpled, handled, worn, creative, smudged, bumped, matte, shiny + ::anno::key_words(string[]("metal", "brass", "reflective", "matte", "hammered", "bumped", "design", "gold", "warm")) +]] = Brass_Hammered( + brass_type_select: 0.33f, + cavities_darkening: 1.0f, + roughness: 0.8f, + bump_strength: 0.99f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + + +// 7 +export material Brass_Hammered_Red_Hammered_Darkened(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Hammered Red - Hammered Darkened"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Hammered.Brass_Hammered_Red_Hammered_Darkened.png"), + // scratched, old, stained, crumpled, handled, worn, creative, smudged, bumped, matte, shiny + ::anno::key_words(string[]("metal", "brass", "reflective", "matte", "hammered", "bumped", "design", "red", "warm")) +]] = Brass_Hammered( + brass_type_select: 0.33f, + cavities_darkening: 1.0f, + roughness: 0.0f, + bump_strength: 0.99f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 8 +export material Brass_Hammered_Red_Shiny_Soft_Hammering(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Hammered Red - Shiny Soft Hammering"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Hammered.Brass_Hammered_Red_Shiny_Soft_Hammering.png"), + // scratched, old, stained, crumpled, handled, worn, creative, smudged, bumped, matte, shiny + ::anno::key_words(string[]("metal", "brass", "reflective", "shiny", "hammered", "bumped", "design", "red", "warm")) +]] = Brass_Hammered( + brass_type_select: 0.33f, + cavities_darkening: 0.0f, + roughness: 0.0f, + bump_strength: 0.51f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 9 +export material Brass_Hammered_Red_Matte_Hammering(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Hammered Red - Matte Hammering"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Hammered.Brass_Hammered_Red_Matte_Hammering.png"), + // scratched, old, stained, crumpled, handled, worn, creative, smudged, bumped, matte, shiny + ::anno::key_words(string[]("metal", "brass", "reflective", "matte", "hammered", "bumped", "design", "red", "warm")) +]] = Brass_Hammered( + brass_type_select: 0.33f, + cavities_darkening: 1.0f, + roughness: 0.8f, + bump_strength: 0.99f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + + + diff --git a/code/third_party/vMaterials_2/Metal/Brass_Knurling.mdl b/code/third_party/vMaterials_2/Metal/Brass_Knurling.mdl new file mode 100644 index 0000000000000000000000000000000000000000..9b2542966561a845ba1e235dd3944306c2aa3359 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Brass_Knurling.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.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 brass material with a knurling pattern that has controls to add wear and dirt. Set " + "the parameter 'Brass Type Blend' to 0.0 or 1.0 for yellow brass, 0.33 for gold brass " + "and 0.66 for red brass. Values inbetween will interpolate between the brass colors."; + +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 Brass_Knurling( + float brass_type_select = 0.f [[ + ::anno::description("Bends between the Brass types. 0 is yellow brass, 0.33 gold brass and 0.66 red brass. Going from 0.66 to 1.0 wraps back to yellow brass."), + ::anno::display_name("Brass Type Blend"), + ::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 = float2(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 = float2(1.0f) [[ + ::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("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("Brass Knurling Yellow"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Knurling.Brass_Knurling.png"), + ::anno::key_words(string[]("metal", "brass", "knurl", "knurling", "bumped", "diamond", "pattern", "reflective", "design", "sanitary", "yellow", "warm")) +]] + = + let { + bool tmp0 = false; + float2 texture_rescale = texture_scale * 0.08f; + + material_surface tmp1(::df::weighted_layer(::math::max(float3(endless_texture(texture_2d("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::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("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::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("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::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("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::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("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::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("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::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("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::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("./textures/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_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).z, cavities_dirt * 1.42999995f + 0.300000012f)), color(::math::pow(float3(::base::file_texture(texture_2d("./textures/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_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).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("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::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("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::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("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::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("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::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("./textures/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_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).z, cavities_dirt * 1.42999995f + 0.300000012f)), color(::math::pow(float3(::base::file_texture(texture_2d("./textures/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_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).z, cavities_dirt * 1.42999995f + 0.300000012f)), ::state::texture_tangent_u(0), ::df::scatter_reflect), bsdf(), normalmap_normal(texture_2d("./textures/metal_knurling_norm.jpg", ::tex::gamma_linear), bump_strength, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index))), normalmap_normal(texture_2d("./textures/metal_knurling_norm.jpg", ::tex::gamma_linear), bump_strength, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index))), ::df::tint(gradient_lookup_smooth(texture_2d("./textures/brass_gradients_yellow_gold_red.png", ::tex::gamma_srgb), ::math::pow(float3(endless_texture(texture_2d("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, 0.399999976f), brass_type_select), ::df::weighted_layer(0.349999994f, ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::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("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::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("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::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("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::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("./textures/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_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).z, cavities_dirt * 1.42999995f + 0.300000012f)), color(::math::pow(float3(::base::file_texture(texture_2d("./textures/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_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).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("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::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("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::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("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::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("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::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("./textures/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_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).z, cavities_dirt * 1.42999995f + 0.300000012f)), color(::math::pow(float3(::base::file_texture(texture_2d("./textures/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_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).z, cavities_dirt * 1.42999995f + 0.300000012f)), ::state::texture_tangent_u(0), ::df::scatter_reflect), bsdf(), normalmap_normal(texture_2d("./textures/metal_knurling_norm.jpg", ::tex::gamma_linear), bump_strength, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index))), normalmap_normal(texture_2d("./textures/metal_knurling_norm.jpg", ::tex::gamma_linear), bump_strength, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index)))), ::state::normal()), normalmap_normal(texture_2d("./textures/metal_knurling_norm.jpg", ::tex::gamma_linear), bump_strength, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::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 Brass_Knurling_Yellow_Rough_Dirty(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Knurling Yellow - Rough Dirty"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Knurling.Brass_Knurling_Yellow_Rough_Dirty.png"), + ::anno::key_words(string[]("metal", "brass", "knurl", "knurling", "bumped", "diamond", "dirty", "worn", "pattern", "reflective", "design", "sanitary", "yellow", "warm")) +]] = Brass_Knurling( + brass_type_select: 0.0f, + knurling_roughness: 0.87f, + surface_dirt: 0.95f, + cavities_dirt: 1.0f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 3 +export material Brass_Knurling_Gold(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Knurling Gold"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Knurling.Brass_Knurling_Gold.png"), + ::anno::key_words(string[]("metal", "brass", "knurl", "knurling", "bumped", "diamond", "worn", "pattern", "reflective", "design", "sanitary", "gold", "warm")) +]] = Brass_Knurling( + brass_type_select: 0.33f, + knurling_roughness: 0.3f, + surface_dirt: 0.12f, + cavities_dirt: .73f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 4 +export material Brass_Knurling_Gold_Rough_Dirty(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Knurling Gold - Rough Dirty"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Knurling.Brass_Knurling_Gold_Rough_Dirty.png"), + ::anno::key_words(string[]("metal", "brass", "knurl", "knurling", "bumped", "diamond", "dirty", "worn", "pattern", "reflective", "design", "sanitary", "gold", "warm")) +]] = Brass_Knurling( + brass_type_select: 0.33f, + knurling_roughness: 0.87f, + surface_dirt: 0.95f, + cavities_dirt: 1.0f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 5 +export material Brass_Knurling_Red(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Knurling Red"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Knurling.Brass_Knurling_Red.png"), + ::anno::key_words(string[]("metal", "brass", "knurl", "knurling", "bumped", "diamond", "worn", "pattern", "reflective", "design", "sanitary", "red", "warm")) +]] = Brass_Knurling( + brass_type_select: 0.66f, + knurling_roughness: 0.3f, + surface_dirt: 0.12f, + cavities_dirt: 0.73f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 6 +export material Brass_Knurling_Red_Rough_Dirty(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Knurling Red - Rough Dirty"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Knurling.Brass_Knurling_Red_Rough_Dirty.png"), + ::anno::key_words(string[]("metal", "brass", "knurl", "knurling", "bumped", "diamond", "dirty", "worn", "pattern", "reflective", "design", "sanitary", "red", "warm")) +]] = Brass_Knurling( + brass_type_select: 0.66f, + knurling_roughness: 0.87f, + surface_dirt: 0.95f, + cavities_dirt: 1.0f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + diff --git a/code/third_party/vMaterials_2/Metal/Brass_Polished.mdl b/code/third_party/vMaterials_2/Metal/Brass_Polished.mdl new file mode 100644 index 0000000000000000000000000000000000000000..282201bbf1d3d1385a13815b92e4223376387225 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Brass_Polished.mdl @@ -0,0 +1,740 @@ +/****************************************************************************** + * 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 polished brass material with tweakable surface imperfections"; + +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 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 ; +} + +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)); +} + + + +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 Brass_Polished( + float polish_film_roughness = 0.06f [[ + ::anno::description("Low values make the polish layer appear shinier while higher values give it more cloudy."), + ::anno::display_name("Polish Film Roughness"), + ::anno::in_group("Appearance", "Polish"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(0) + ]], + float polish_film_strength = 1.f [[ + ::anno::description("The amount of of polish film visible on the metal surface."), + ::anno::display_name("Polish Film Weight"), + ::anno::in_group("Appearance", "Polish"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float brass_type_select = 0.f [[ + ::anno::description("Bends between the Brass types. 0 is yellow brass, 0.33 gold brass and 0.66 red brass. Going from 0.66 to 1.0 wraps back to yellow brass."), + ::anno::display_name("Brass Type Blend"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float roughness = 0.04f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Metal Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float roughness_variation = 0.62f [[ + ::anno::description("Adds variation to the shininess of the metal."), + ::anno::display_name("Roughness Variation"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + float surface_dirt = 0.f [[ + ::anno::description("Adds a thin 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(5) + ]], + float bump_strength = 0.05f [[ + ::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(6) + ]], + uniform float2 texture_translate = float2(0.f) [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform"), + ::anno::ui_order(7) + ]], + 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(8) + ]], + uniform float2 texture_scale = float2(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 = true [[ + ::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("Advanced"), + ::anno::hard_range(0, 10), + ::anno::ui_order(13) + ]]) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Polished Yellow - Shiny Polish"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Polished.Brass_Polished.png"), + ::anno::key_words(string[]("metal", "brass", "reflective", "polished", "new", "smudged", "design", "yellow", "warm")) +]] + = + let { + bool tmp0 = false; + material_surface tmp1(df::weighted_layer(math::max(float3(endless_texture(texture_2d("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).x * surface_dirt, math::min(surface_dirt, float3(endless_texture(texture_2d("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, 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("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, 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.219999999f, 1.f, 1.09000003f, math::pow(float3(endless_texture(texture_2d("./textures/polish_wipe.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.284000009f), 6.12999964f, false)).x, 0.25f) * (polish_film_strength * 0.25f + 0.0500000007f), df::microfacet_ggx_smith_bsdf(histogram_range(float3(endless_texture(texture_2d("./textures/polish_wipe.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.284000009f), 6.12999964f, false)).x, 0.919999957f, polish_film_roughness * 0.349999994f), histogram_range(float3(endless_texture(texture_2d("./textures/polish_wipe.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.284000009f), 6.12999964f, false)).x, 0.919999957f, polish_film_roughness * 0.349999994f), color(0.638283014f, 0.638283014f, 0.638283014f), color(0.f, 0.f, 0.f), state::texture_tangent_u(0), df::scatter_reflect), df::custom_curve_layer(0.f, 1.f, 5.35999966f, 1.f, df::weighted_layer(0.119999997f, df::microfacet_ggx_smith_bsdf(histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, 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.799999952f, roughness)) * histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, 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.799999952f, roughness)), histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, 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.799999952f, roughness)) * histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, 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.799999952f, roughness)), 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(histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, math::lerp(0.0700000003f, 0.870000005f, roughness_variation), math::lerp(0.0399999991f, 0.50999999f, roughness)) * histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, math::lerp(0.0700000003f, 0.870000005f, roughness_variation), math::lerp(0.0399999991f, 0.50999999f, roughness)), histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, math::lerp(0.0700000003f, 0.870000005f, roughness_variation), math::lerp(0.0399999991f, 0.50999999f, roughness)) * histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, math::lerp(0.0700000003f, 0.870000005f, roughness_variation), math::lerp(0.0399999991f, 0.50999999f, roughness)), color(1.f, 1.f, 1.f), color(0.f, 0.f, 0.f), state::texture_tangent_u(0), df::scatter_reflect), bsdf(), endless_normal(texture_2d("./textures/brass_normal.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.5f, 0.5f, 0.999000013f), 6.12999964f)), state::normal()), df::tint(gradient_lookup_smooth(texture_2d("./textures/brass_gradients_yellow_gold_red.png", ::tex::gamma_srgb), math::pow(float3(endless_texture(texture_2d("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, 0.399999976f), brass_type_select), df::weighted_layer(0.119999997f, df::microfacet_ggx_smith_bsdf(histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, 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.799999952f, roughness)) * histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, 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.799999952f, roughness)), histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, 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.799999952f, roughness)) * histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, 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.799999952f, roughness)), 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(histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, math::lerp(0.0700000003f, 0.870000005f, roughness_variation), math::lerp(0.0399999991f, 0.50999999f, roughness)) * histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, math::lerp(0.0700000003f, 0.870000005f, roughness_variation), math::lerp(0.0399999991f, 0.50999999f, roughness)), histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, math::lerp(0.0700000003f, 0.870000005f, roughness_variation), math::lerp(0.0399999991f, 0.50999999f, roughness)) * histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, math::lerp(0.0700000003f, 0.870000005f, roughness_variation), math::lerp(0.0399999991f, 0.50999999f, roughness)), color(1.f, 1.f, 1.f), color(0.f, 0.f, 0.f), state::texture_tangent_u(0), df::scatter_reflect), bsdf(), endless_normal(texture_2d("./textures/brass_normal.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.5f, 0.5f, 0.999000013f), 6.12999964f)), state::normal())), state::normal()), add_detail_normal(endless_normal(texture_2d("./textures/polish_norm.jpg", ::tex::gamma_linear), 0.600000024f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.5f, 0.5f, 0.999000013f), 6.12999964f), endless_normal(texture_2d("./textures/brass_normal.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.5f, 0.5f, 0.999000013f), 6.12999964f))), endless_normal(texture_2d("./textures/brass_normal.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.5f, 0.5f, 0.999000013f), 6.12999964f)), 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 Brass_Polished_Yellow_Matte_Polish(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Polished Yellow - Matte Polish"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Polished.Brass_Polished_Yellow_Matte_Polish.png"), + ::anno::key_words(string[]("metal", "brass", "reflective", "polished", "new", "smudged", "design", "yellow", "warm")) +]] = Brass_Polished +( + polish_film_roughness: 0.15f, + polish_film_strength: 1.0f, + brass_type_select: 0.0f, + roughness: 0.04f, + roughness_variation: 0.47f, + surface_dirt: 0.0f, + bump_strength: 0.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 3 +export material Brass_Polished_Yellow_Cloudy_Polish(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Polished Yellow - Cloudy Polish"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Polished.Brass_Polished_Yellow_Cloudy_Polish.png"), + ::anno::key_words(string[]("metal", "brass", "reflective", "polished", "cloudy", "new", "smudged", "design", "yellow", "warm")) +]] = Brass_Polished +( + polish_film_roughness: 0.85f, + polish_film_strength: 1.0f, + brass_type_select: 0.0f, + roughness: 0.04f, + roughness_variation: 0.48f, + surface_dirt: 0.31f, + bump_strength: 0.05f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +//4 +export material Brass_Polished_Yellow_Shiny_Worn(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Polished Yellow - Shiny Worn"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Polished.Brass_Polished_Yellow_Shiny_Worn.png"), + ::anno::key_words(string[]("metal", "brass", "reflective", "polished", "old", "worn", "handled", "stained", "dirty", "bumped", "smudged", "design", "yellow", "warm")) +]] = Brass_Polished +( + polish_film_roughness: 0.5f, + polish_film_strength: 1.0f, + brass_type_select: 0.0f, + roughness: 0.04f, + roughness_variation: 0.69f, + surface_dirt: 0.95f, + bump_strength: 0.44f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +//5 +export material Brass_Polished_Gold_Shiny_Polish(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Polished Gold - Shiny Polish"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Polished.Brass_Polished_Gold_Shiny_Polish.png"), + ::anno::key_words(string[]("metal", "brass", "reflective", "polished", "old", "worn", "handled", "stained", "dirty", "bumped", "smudged", "design", "gold", "warm")) +]] = Brass_Polished +( + polish_film_roughness: 0.5f, + polish_film_strength: 1.0f, + brass_type_select: 0.0f, + roughness: 0.04f, + roughness_variation: 0.69f, + surface_dirt: 0.95f, + bump_strength: 0.44f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 6 +export material Brass_Polished_Gold_Matte_Polish(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Polished Gold - Matte Polish"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Polished.Brass_Polished_Gold_Matte_Polish.png"), + ::anno::key_words(string[]("metal", "brass", "reflective", "polished", "new", "smudged", "design", "gold", "warm")) +]] = Brass_Polished +( + polish_film_roughness: 0.15f, + polish_film_strength: 1.0f, + brass_type_select: 0.0f, + roughness: 0.04f, + roughness_variation: 0.47f, + surface_dirt: 0.0f, + bump_strength: 0.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 7 +export material Brass_Polished_Gold_Cloudy_Polish(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Polished Gold - Cloudy Polish"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Polished.Brass_Polished_Gold_Cloudy_Polish.png"), + ::anno::key_words(string[]("metal", "brass", "reflective", "polished", "cloudy", "new", "smudged", "design", "gold", "warm")) +]] = Brass_Polished +( + polish_film_roughness: 0.85f, + polish_film_strength: 1.0f, + brass_type_select: 0.0f, + roughness: 0.04f, + roughness_variation: 0.48f, + surface_dirt: 0.31f, + bump_strength: 0.05f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 8 +export material Brass_Polished_Gold_Shiny_Worn(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Polished Gold - Shiny Worn"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Polished.Brass_Polished_Gold_Shiny_Worn.png"), + ::anno::key_words(string[]("metal", "brass", "reflective", "polished", "old", "worn", "handled", "stained", "dirty", "bumped", "smudged", "design", "gold", "warm")) +]] = Brass_Polished +( + polish_film_roughness: 0.5f, + polish_film_strength: 1.0f, + brass_type_select: 0.0f, + roughness: 0.04f, + roughness_variation: 0.69f, + surface_dirt: 0.95f, + bump_strength: 0.44f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 9 +export material Brass_Polished_Red_Shiny_Polish(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Polished Red - Shiny Polish"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Polished.Brass_Polished_Red_Shiny_Polish.png"), + ::anno::key_words(string[]("metal", "brass", "reflective", "polished", "old", "worn", "handled", "stained", "dirty", "bumped", "smudged", "design", "red", "warm")) +]] = Brass_Polished +( + polish_film_roughness: 0.5f, + polish_film_strength: 1.0f, + brass_type_select: 0.0f, + roughness: 0.04f, + roughness_variation: 0.69f, + surface_dirt: 0.95f, + bump_strength: 0.44f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 10 +export material Brass_Polished_Red_Matte_Polish(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Polished Red - Matte Polish"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Polished.Brass_Polished_Red_Matte_Polish.png"), + ::anno::key_words(string[]("metal", "brass", "reflective", "polished", "new", "smudged", "design", "red", "warm")) +]] = Brass_Polished +( + polish_film_roughness: 0.15f, + polish_film_strength: 1.0f, + brass_type_select: 0.0f, + roughness: 0.04f, + roughness_variation: 0.47f, + surface_dirt: 0.0f, + bump_strength: 0.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 11 +export material Brass_Polished_Red_Cloudy_Polish(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Polished Red - Cloudy Polish"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Polished.Brass_Polished_Red_Cloudy_Polish.png"), + ::anno::key_words(string[]("metal", "brass", "reflective", "polished", "cloudy", "new", "smudged", "design", "red", "warm")) +]] = Brass_Polished +( + polish_film_roughness: 0.85f, + polish_film_strength: 1.0f, + brass_type_select: 0.0f, + roughness: 0.04f, + roughness_variation: 0.48f, + surface_dirt: 0.31f, + bump_strength: 0.05f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 12 +export material Brass_Polished_Red_Shiny_Worn(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Polished Red - Shiny Worn"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Polished.Brass_Polished_Red_Shiny_Worn.png"), + ::anno::key_words(string[]("metal", "brass", "reflective", "polished", "old", "worn", "handled", "stained", "dirty", "bumped", "smudged", "design", "red", "warm")) +]] = Brass_Polished +( + polish_film_roughness: 0.5f, + polish_film_strength: 1.0f, + brass_type_select: 0.0f, + roughness: 0.04f, + roughness_variation: 0.69f, + surface_dirt: 0.95f, + bump_strength: 0.44f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + diff --git a/code/third_party/vMaterials_2/Metal/Brass_Scratched.mdl b/code/third_party/vMaterials_2/Metal/Brass_Scratched.mdl new file mode 100644 index 0000000000000000000000000000000000000000..4f645c2c50dc05a6f9cac9193fc811c40a591182 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Brass_Scratched.mdl @@ -0,0 +1,828 @@ +/****************************************************************************** + * 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 plain brass material with controls to add wear and dirt. Set the parameter " + "'Brass Type Blend' to 0.0 or 1.0 for yellow brass, 0.33 for gold brass and 0.66 for " + "red brass. Values inbetween will interpolate between the brass colors."; + +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); +} + +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 Brass_Scratched( + float brass_type_select = 0.f [[ + ::anno::description("Bends between the Brass types. 0 is yellow brass, 0.33 gold brass and 0.66 red brass. Going from 0.66 to 1.0 wraps back to yellow brass."), + ::anno::display_name("Brass Type Blend"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(0) + ]], + float roughness = 0.15f [[ + ::anno::description("Adjusts the roughness of the material."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float surface_dirt_amount = 0.0f [[ + ::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 bump_strength = 0.f [[ + ::anno::description("Specifies the strength of the bump."), + ::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(3) + ]], + float rough_scratches_roughness = 0.3f [[ + ::anno::description("Increasing this value will increase the roughness of the scratches. The roughness will be calculated relative to the the overall roughness of the metal."), + ::anno::display_name("Rough Scratches Roughness"), + ::anno::in_group("Appearance", "Scratches Rough"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + float rough_scratches_attenuation = 0.97f [[ + ::anno::description("Increase this value to darken the appearance of rough scratches to give them a dirty, old look."), + ::anno::display_name("Rough Scratches Attenuation"), + ::anno::in_group("Appearance", "Scratches Rough"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(5) + ]], + float shiny_scratches_roughness = 0.f [[ + ::anno::description("Increasing this value will increase the shininess of scratches. The shininess will be calculated relative to the the overall roughness of the metal."), + ::anno::display_name("Shiny Scratches Shininess"), + ::anno::in_group("Appearance", "Scratches Shiny"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(6) + ]], + float shiny_scratches_brightness = 0.f [[ + ::anno::description("Increase this value to brighten the appearance of shiny scratches to make them appear more fresh."), + ::anno::display_name("Shiny Scratches Brightness"), + ::anno::in_group("Appearance", "Scratches Shiny"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(7) + ]], + uniform float2 texture_translate = float2(0.f) [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform"), + ::anno::ui_order(8) + ]], + 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(9) + ]], + uniform float2 texture_scale = float2(0.5f) [[ + ::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(10) + ]], + 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(11) + ]], + 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(12) + ]], + 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(13) + ]], + 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(14) + ]]) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Yellow Scratched - Polished Subtle Dark Scratches"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Scratched.Brass_Scratched.png"), + // new, worn, aged, dirty, bumped, shiny, rough, matte + ::anno::key_words(string[]("metal", "brass", "scratched", "reflective", "design", "sanitary", "old", "worn", "polished", "shiny", "smooth", "yellow", "warm")) +]] + = + let { + bool tmp0 = false; + material_surface tmp1(::df::weighted_layer(float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).x * histogram_scan_big((1.f - float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).y) * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).z + float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 1.f, surface_dirt_amount * 0.579999983f), ::df::custom_curve_layer(0.f, 1.f, 5.35999966f, 1.f, ::df::weighted_layer(0.219999999f, ::df::microfacet_ggx_smith_bsdf((histogram_range(float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 0.170000002f, ::math::lerp(0.399999976f, 0.799999952f, roughness)) + surface_dirt_amount * 0.579999983f * (1.f - histogram_scan_big(histogram_scan_big((1.f - float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).y) * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).z + float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 1.f, surface_dirt_amount * 0.579999983f), 0.289999992f, 0.479999989f))) * (histogram_range(float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 0.170000002f, ::math::lerp(0.399999976f, 0.799999952f, roughness)) + surface_dirt_amount * 0.579999983f * (1.f - histogram_scan_big(histogram_scan_big((1.f - float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).y) * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).z + float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 1.f, surface_dirt_amount * 0.579999983f), 0.289999992f, 0.479999989f))), (histogram_range(float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 0.170000002f, ::math::lerp(0.399999976f, 0.799999952f, roughness)) + surface_dirt_amount * 0.579999983f * (1.f - histogram_scan_big(histogram_scan_big((1.f - float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).y) * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).z + float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 1.f, surface_dirt_amount * 0.579999983f), 0.289999992f, 0.479999989f))) * (histogram_range(float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 0.170000002f, ::math::lerp(0.399999976f, 0.799999952f, roughness)) + surface_dirt_amount * 0.579999983f * (1.f - histogram_scan_big(histogram_scan_big((1.f - float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).y) * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).z + float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 1.f, surface_dirt_amount * 0.579999983f), 0.289999992f, 0.479999989f))), 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(::math::clamp(histogram_range(float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, ::math::lerp(0.0700000003f, 0.75999999f, roughness), ::math::lerp(0.0399999991f, 0.349999994f, roughness)) + rough_scratches_roughness * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).y - float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).x * shiny_scratches_roughness + surface_dirt_amount * 0.579999983f * (1.f - histogram_scan_big(histogram_scan_big((1.f - float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).y) * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).z + float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 1.f, surface_dirt_amount * 0.579999983f), 0.289999992f, 0.479999989f)), 0.f, 1.f) * ::math::clamp(histogram_range(float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, ::math::lerp(0.0700000003f, 0.75999999f, roughness), ::math::lerp(0.0399999991f, 0.349999994f, roughness)) + rough_scratches_roughness * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).y - float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).x * shiny_scratches_roughness + surface_dirt_amount * 0.579999983f * (1.f - histogram_scan_big(histogram_scan_big((1.f - float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).y) * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).z + float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 1.f, surface_dirt_amount * 0.579999983f), 0.289999992f, 0.479999989f)), 0.f, 1.f), ::math::clamp(histogram_range(float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, ::math::lerp(0.0700000003f, 0.75999999f, roughness), ::math::lerp(0.0399999991f, 0.349999994f, roughness)) + rough_scratches_roughness * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).y - float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).x * shiny_scratches_roughness + surface_dirt_amount * 0.579999983f * (1.f - histogram_scan_big(histogram_scan_big((1.f - float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).y) * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).z + float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 1.f, surface_dirt_amount * 0.579999983f), 0.289999992f, 0.479999989f)), 0.f, 1.f) * ::math::clamp(histogram_range(float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, ::math::lerp(0.0700000003f, 0.75999999f, roughness), ::math::lerp(0.0399999991f, 0.349999994f, roughness)) + rough_scratches_roughness * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).y - float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).x * shiny_scratches_roughness + surface_dirt_amount * 0.579999983f * (1.f - histogram_scan_big(histogram_scan_big((1.f - float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).y) * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).z + float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 1.f, surface_dirt_amount * 0.579999983f), 0.289999992f, 0.479999989f)), 0.f, 1.f), color(1.f, 1.f, 1.f), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), bsdf(), endless_normal(texture_2d("./textures/scratched_normal.jpg", ::tex::gamma_linear), bump_strength, false, false, ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.5f, 0.5f, 1.f), 3.18999982f)), endless_normal(texture_2d("./textures/scratched_normal.jpg", ::tex::gamma_linear), bump_strength, false, false, ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.5f, 0.5f, 1.f), 3.18999982f)), ::df::tint(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(gradient_lookup_smooth(texture_2d("./textures/brass_gradients_yellow_gold_red.png", ::tex::gamma_srgb), ::math::pow(float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 0.179999992f), brass_type_select), color(1.f - float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).y), ::base::color_layer_multiply, rough_scratches_attenuation).tint, nvidia::core_definitions::blend_colors(gradient_lookup_smooth(texture_2d("./textures/brass_gradients_yellow_gold_red.png", ::tex::gamma_srgb), ::math::pow(float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 0.179999992f), brass_type_select), color(0.655930996f, 0.655930996f, 0.655930996f), ::base::color_layer_screen, shiny_scratches_brightness).tint, ::base::color_layer_blend, float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).x).tint, ::df::weighted_layer(0.219999999f, ::df::microfacet_ggx_smith_bsdf((histogram_range(float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 0.170000002f, ::math::lerp(0.399999976f, 0.799999952f, roughness)) + surface_dirt_amount * 0.579999983f * (1.f - histogram_scan_big(histogram_scan_big((1.f - float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).y) * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).z + float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 1.f, surface_dirt_amount * 0.579999983f), 0.289999992f, 0.479999989f))) * (histogram_range(float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 0.170000002f, ::math::lerp(0.399999976f, 0.799999952f, roughness)) + surface_dirt_amount * 0.579999983f * (1.f - histogram_scan_big(histogram_scan_big((1.f - float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).y) * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).z + float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 1.f, surface_dirt_amount * 0.579999983f), 0.289999992f, 0.479999989f))), (histogram_range(float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 0.170000002f, ::math::lerp(0.399999976f, 0.799999952f, roughness)) + surface_dirt_amount * 0.579999983f * (1.f - histogram_scan_big(histogram_scan_big((1.f - float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).y) * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).z + float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 1.f, surface_dirt_amount * 0.579999983f), 0.289999992f, 0.479999989f))) * (histogram_range(float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 0.170000002f, ::math::lerp(0.399999976f, 0.799999952f, roughness)) + surface_dirt_amount * 0.579999983f * (1.f - histogram_scan_big(histogram_scan_big((1.f - float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).y) * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).z + float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 1.f, surface_dirt_amount * 0.579999983f), 0.289999992f, 0.479999989f))), 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(::math::clamp(histogram_range(float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, ::math::lerp(0.0700000003f, 0.75999999f, roughness), ::math::lerp(0.0399999991f, 0.349999994f, roughness)) + rough_scratches_roughness * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).y - float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).x * shiny_scratches_roughness + surface_dirt_amount * 0.579999983f * (1.f - histogram_scan_big(histogram_scan_big((1.f - float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).y) * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).z + float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 1.f, surface_dirt_amount * 0.579999983f), 0.289999992f, 0.479999989f)), 0.f, 1.f) * ::math::clamp(histogram_range(float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, ::math::lerp(0.0700000003f, 0.75999999f, roughness), ::math::lerp(0.0399999991f, 0.349999994f, roughness)) + rough_scratches_roughness * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).y - float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).x * shiny_scratches_roughness + surface_dirt_amount * 0.579999983f * (1.f - histogram_scan_big(histogram_scan_big((1.f - float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).y) * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).z + float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 1.f, surface_dirt_amount * 0.579999983f), 0.289999992f, 0.479999989f)), 0.f, 1.f), ::math::clamp(histogram_range(float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, ::math::lerp(0.0700000003f, 0.75999999f, roughness), ::math::lerp(0.0399999991f, 0.349999994f, roughness)) + rough_scratches_roughness * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).y - float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).x * shiny_scratches_roughness + surface_dirt_amount * 0.579999983f * (1.f - histogram_scan_big(histogram_scan_big((1.f - float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).y) * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).z + float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 1.f, surface_dirt_amount * 0.579999983f), 0.289999992f, 0.479999989f)), 0.f, 1.f) * ::math::clamp(histogram_range(float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, ::math::lerp(0.0700000003f, 0.75999999f, roughness), ::math::lerp(0.0399999991f, 0.349999994f, roughness)) + rough_scratches_roughness * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).y - float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).x * shiny_scratches_roughness + surface_dirt_amount * 0.579999983f * (1.f - histogram_scan_big(histogram_scan_big((1.f - float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).y) * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).z + float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 1.f, surface_dirt_amount * 0.579999983f), 0.289999992f, 0.479999989f)), 0.f, 1.f), color(1.f, 1.f, 1.f), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), bsdf(), endless_normal(texture_2d("./textures/scratched_normal.jpg", ::tex::gamma_linear), bump_strength, false, false, ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.5f, 0.5f, 1.f), 3.18999982f)), endless_normal(texture_2d("./textures/scratched_normal.jpg", ::tex::gamma_linear), bump_strength, false, false, ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.5f, 0.5f, 1.f), 3.18999982f))), ::state::normal()), ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(color(0.00489600003f, 0.00409199996f, 0.00365399988f), color(0.0196070001f, 0.015904f, 0.012565f), ::base::color_layer_blend, float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z).tint, 0.f), endless_normal(texture_2d("./textures/scratched_normal.jpg", ::tex::gamma_linear), bump_strength, false, false, ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.5f, 0.5f, 1.f), 3.18999982f)), 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 +); + +// 2 +export material Brass_Scratched_Yellow_Subtle_Worn_Scratches(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Yellow Scratched - Subtle Worn Scratches"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Scratched.Brass_Scratched_Yellow_Subtle_Worn_Scratches.png"), + // new, worn, aged, dirty, bumped, shiny, rough, matte + ::anno::key_words(string[]("metal", "brass", "scratched", "reflective", "design", "sanitary", "old", "worn", "shiny", "yellow", "warm")) +]] = Brass_Scratched( + brass_type_select: 0.0f, + roughness: 0.22f, + surface_dirt_amount: 0.78f, + bump_strength: 0.29f, + rough_scratches_roughness: 0.3f, + rough_scratches_attenuation: 1.0f, + shiny_scratches_roughness: 0.0f, + shiny_scratches_brightness: 0.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 3 +export material Brass_Scratched_Yellow_Medium_Glossy_Scratches(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Yellow Scratched - Medium Glossy Scratches"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Scratched.Brass_Scratched_Yellow_Medium_Glossy_Scratches.png"), + // new, worn, aged, dirty, bumped, shiny, rough, matte + ::anno::key_words(string[]("metal", "brass", "scratched", "reflective", "design", "sanitary", "old", "worn", "shiny", "rough", "yellow", "warm")) +]] = Brass_Scratched( + brass_type_select: 0.0f, + roughness: 0.44f, + surface_dirt_amount: 0.6f, + bump_strength: 0.63f, + rough_scratches_roughness: 0.2f, + rough_scratches_attenuation: 0.96f, + shiny_scratches_roughness: 1.0f, + shiny_scratches_brightness: 0.94f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 4 +export material Brass_Scratched_Yellow_Medium_Glossy_Deep_Scratches(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Yellow Scratched - Medium Glossy Deep Scratches"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Scratched.Brass_Scratched_Yellow_Medium_Glossy_Deep_Scratches.png"), + // new, worn, aged, dirty, bumped, shiny, rough, matte + ::anno::key_words(string[]("metal", "brass", "scratched", "reflective", "design", "sanitary", "old", "worn", "shiny", "rough", "yellow", "warm")) +]] = Brass_Scratched( + brass_type_select: 0.0f, + roughness: 0.44f, + surface_dirt_amount: 0.6f, + bump_strength: 1.5f, + rough_scratches_roughness: 0.2f, + rough_scratches_attenuation: 0.96f, + shiny_scratches_roughness: 1.0f, + shiny_scratches_brightness: 0.94f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 5 +export material Brass_Scratched_Yellow_Heavy_Worn_Scratches(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Yellow Scratched - Heavy Worn Scratches"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Scratched.Brass_Scratched_Yellow_Heavy_Worn_Scratches.png"), + // new, worn, aged, dirty, bumped, shiny, rough, matte + ::anno::key_words(string[]("metal", "brass", "scratched", "reflective", "design", "sanitary", "old", "worn", "shiny", "rough", "yellow", "warm")) +]] = Brass_Scratched( + brass_type_select: 0.0f, + roughness: 0.64f, + surface_dirt_amount: 0.91f, + bump_strength: 1.5f, + rough_scratches_roughness: 0.89f, + rough_scratches_attenuation: 0.96f, + shiny_scratches_roughness: 1.0f, + shiny_scratches_brightness: 0.94f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 6 +export material Brass_Scratched_Gold_Polished_Subtle_Dark_Scratches(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Gold Scratched - Polished Subtle Dark Scratches"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Scratched.Brass_Scratched_Gold_Polished_Subtle_Dark_Scratches.png"), + // new, worn, aged, dirty, bumped, shiny, rough, matte + ::anno::key_words(string[]("metal", "brass", "scratched", "reflective", "design", "sanitary", "polished", "worn", "shiny", "smooth", "gold", "warm")) +]] = Brass_Scratched( + brass_type_select: 0.33f, // gold + roughness: 0.64f, + surface_dirt_amount: 0.91f, + bump_strength: 1.5f, + rough_scratches_roughness: 0.89f, + rough_scratches_attenuation: 0.96f, + shiny_scratches_roughness: 1.0f, + shiny_scratches_brightness: 0.94f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + + +// 7 +export material Brass_Scratched_Gold_Subtle_Worn_Scratches(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Gold Scratched - Subtle Worn Scratches"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Scratched.Brass_Scratched_Gold_Subtle_Worn_Scratches.png"), + // new, worn, aged, dirty, bumped, shiny, rough, matte + ::anno::key_words(string[]("metal", "brass", "scratched", "reflective", "design", "sanitary", "old", "worn", "shiny", "gold", "warm")) +]] = Brass_Scratched( + brass_type_select: 0.33f, // gold + roughness: 0.22f, + surface_dirt_amount: 0.78f, + bump_strength: 0.29f, + rough_scratches_roughness: 0.3f, + rough_scratches_attenuation: 1.0f, + shiny_scratches_roughness: 0.0f, + shiny_scratches_brightness: 0.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 8 +export material Brass_Scratched_Gold_Medium_Glossy_Scratches(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Gold Scratched - Medium Glossy Scratches"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Scratched.Brass_Scratched_Gold_Medium_Glossy_Scratches.png"), + // new, worn, aged, dirty, bumped, shiny, rough, matte + ::anno::key_words(string[]("metal", "brass", "scratched", "reflective", "design", "sanitary", "old", "worn", "shiny", "rough", "gold", "warm")) +]] = Brass_Scratched( + brass_type_select: 0.33f, // gold + roughness: 0.44f, + surface_dirt_amount: 0.6f, + bump_strength: 0.63f, + rough_scratches_roughness: 0.2f, + rough_scratches_attenuation: 0.96f, + shiny_scratches_roughness: 1.0f, + shiny_scratches_brightness: 0.94f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 9 +export material Brass_Scratched_Gold_Medium_Glossy_Deep_Scratches(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Gold Scratched - Medium Glossy Deep Scratches"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Scratched.Brass_Scratched_Gold_Medium_Glossy_Deep_Scratches.png"), + // new, worn, aged, dirty, bumped, shiny, rough, matte + ::anno::key_words(string[]("metal", "brass", "scratched", "reflective", "design", "sanitary", "old", "worn", "shiny", "rough", "gold", "warm")) +]] = Brass_Scratched( + brass_type_select: 0.33f, // gold + roughness: 0.44f, + surface_dirt_amount: 0.6f, + bump_strength: 1.5f, + rough_scratches_roughness: 0.2f, + rough_scratches_attenuation: 0.96f, + shiny_scratches_roughness: 1.0f, + shiny_scratches_brightness: 0.94f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 10 +export material Brass_Scratched_Gold_Heavy_Worn_Scratches(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Gold Scratched - Heavy Worn Scratches"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Scratched.Brass_Scratched_Gold_Heavy_Worn_Scratches.png"), + // new, worn, aged, dirty, bumped, shiny, rough, matte + ::anno::key_words(string[]("metal", "brass", "scratched", "reflective", "design", "sanitary", "old", "worn", "shiny", "rough", "gold", "warm")) +]] = Brass_Scratched( + brass_type_select: 0.33f, // gold + roughness: 0.64f, + surface_dirt_amount: 0.91f, + bump_strength: 1.5f, + rough_scratches_roughness: 0.89f, + rough_scratches_attenuation: 0.96f, + shiny_scratches_roughness: 1.0f, + shiny_scratches_brightness: 0.94f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 11 +export material Brass_Scratched_Red_Polished_Subtle_Dark_Scratches(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Red Scratched - Polished Subtle Dark Scratches"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Scratched.Brass_Scratched_Red_Polished_Subtle_Dark_Scratches.png"), + // new, worn, aged, dirty, bumped, shiny, rough, matte + ::anno::key_words(string[]("metal", "brass", "scratched", "reflective", "design", "sanitary", "polished", "worn", "shiny", "smooth", "red", "warm")) +]] = Brass_Scratched( + brass_type_select: 0.66f, // red + roughness: 0.64f, + surface_dirt_amount: 0.91f, + bump_strength: 1.5f, + rough_scratches_roughness: 0.89f, + rough_scratches_attenuation: 0.96f, + shiny_scratches_roughness: 1.0f, + shiny_scratches_brightness: 0.94f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + + +// 12 +export material Brass_Scratched_Red_Subtle_Worn_Scratches(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Red Scratched - Subtle Worn Scratches"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Scratched.Brass_Scratched_Red_Subtle_Worn_Scratches.png"), + // new, worn, aged, dirty, bumped, shiny, rough, matte + ::anno::key_words(string[]("metal", "brass", "scratched", "reflective", "design", "sanitary", "old", "worn", "shiny", "red", "warm")) +]] = Brass_Scratched( + brass_type_select: 0.66f, // red + roughness: 0.22f, + surface_dirt_amount: 0.78f, + bump_strength: 0.29f, + rough_scratches_roughness: 0.3f, + rough_scratches_attenuation: 1.0f, + shiny_scratches_roughness: 0.0f, + shiny_scratches_brightness: 0.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 13 +export material Brass_Scratched_Red_Medium_Glossy_Scratches(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Red Scratched - Medium Glossy Scratches"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Scratched.Brass_Scratched_Red_Medium_Glossy_Scratches.png"), + // new, worn, aged, dirty, bumped, shiny, rough, matte + ::anno::key_words(string[]("metal", "brass", "scratched", "reflective", "design", "sanitary", "old", "worn", "shiny", "rough", "red", "warm")) +]] = Brass_Scratched( + brass_type_select: 0.66f, // red + roughness: 0.44f, + surface_dirt_amount: 0.6f, + bump_strength: 0.63f, + rough_scratches_roughness: 0.2f, + rough_scratches_attenuation: 0.96f, + shiny_scratches_roughness: 1.0f, + shiny_scratches_brightness: 0.94f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 14 +export material Brass_Scratched_Red_Medium_Glossy_Deep_Scratches(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Red Scratched - Medium Glossy Deep Scratches"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Scratched.Brass_Scratched_Red_Medium_Glossy_Deep_Scratches.png"), + // new, worn, aged, dirty, bumped, shiny, rough, matte + ::anno::key_words(string[]("metal", "brass", "scratched", "reflective", "design", "sanitary", "old", "worn", "shiny", "rough", "red", "warm")) +]] = Brass_Scratched( + brass_type_select: 0.66f, // red + roughness: 0.44f, + surface_dirt_amount: 0.6f, + bump_strength: 1.5f, + rough_scratches_roughness: 0.2f, + rough_scratches_attenuation: 0.96f, + shiny_scratches_roughness: 1.0f, + shiny_scratches_brightness: 0.94f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 15 +export material Brass_Scratched_Red_Heavy_Worn_Scratches(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Red Scratched - Heavy Worn Scratches"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Scratched.Brass_Scratched_Red_Heavy_Worn_Scratches.png"), + // new, worn, aged, dirty, bumped, shiny, rough, matte + ::anno::key_words(string[]("metal", "brass", "scratched", "reflective", "design", "sanitary", "old", "worn", "shiny", "rough", "red", "warm")) +]] = Brass_Scratched( + brass_type_select: 0.66f, // red + roughness: 0.64f, + surface_dirt_amount: 0.91f, + bump_strength: 1.5f, + rough_scratches_roughness: 0.89f, + rough_scratches_attenuation: 0.96f, + shiny_scratches_roughness: 1.0f, + shiny_scratches_brightness: 0.94f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + diff --git a/code/third_party/vMaterials_2/Metal/Brass_Sheet.mdl b/code/third_party/vMaterials_2/Metal/Brass_Sheet.mdl new file mode 100644 index 0000000000000000000000000000000000000000..a87e3c25435d481ba8822326046a7c2139443b39 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Brass_Sheet.mdl @@ -0,0 +1,844 @@ +/****************************************************************************** + * 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 brass sheet metal material with tweaks to add surface imperfections"; + + + + +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); +} + + +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 + )); +} + + +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)); +} + +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); +} + +export material Brass_Sheet( + 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", "Infinite Tiing"), + ::anno::ui_order(0) + ]], + float brass_type_select = 0.f [[ + ::anno::description("Bends between the Brass types. 0 is yellow brass, 0.33 gold brass and 0.66 red brass. Going from 0.66 to 1.0 wraps back to yellow brass."), + ::anno::display_name("Brass Type Blend"), + ::anno::in_group("Appearance", "Main"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float sheet_brightness = .9f [[ + ::anno::description("Adjusts the brightness of the reflection."), + ::anno::display_name("Brightness"), + ::anno::in_group("Appearance", "Main"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float roughness = 0.3f [[ + ::anno::description("Higher values lead to blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance", "Main"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float streaks = 0.2f [[ + ::anno::description("Reveals streaks from the manufacturing process."), + ::anno::display_name("Streaks Weight"), + ::anno::in_group("Appearance", "Main"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + uniform float scratch_bump_factor = 0.1f [[ + ::anno::description("Determines the degree of bumpiness."), + ::anno::display_name("Bump Factor Streaks"), + ::anno::in_group("Appearance", "Main"), + ::anno::ui_order(5) + ]], + float imperfections_amount = 0.1f [[ + ::anno::description("Balances between a perfectly smooth metal and."), + ::anno::display_name("Imperfections Amount"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(6) + ]], + uniform float impurities_weight_1 = 0.75f [[ + ::anno::description("Adds impurities which have an influence on the reflection."), + ::anno::display_name("Directional Washed Ratio"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(7) + ]], + uniform float impurities_weight_2 = 0.43f [[ + ::anno::description("Adds impurities which have an influence on the reflection."), + ::anno::display_name("Noisy Ratio"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(8) + ]], + uniform float impurities_weight_3 = 0.1f [[ + ::anno::description("Adds impurities which have an influence on the reflection."), + ::anno::display_name("Soft Splotches Ratio"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(9) + ]], + uniform float2 texture_translate = float2(0.f) [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform"), + ::anno::ui_order(10) + ]], + 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::ui_order(11) + ]], + uniform float2 texture_scale = float2(1.0f) [[ + ::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(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) + ]], + 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(14) + ]], + 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(15) + ]], + 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(16) + ]]) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Sheet Yellow - New Clean"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Sheet.Brass_Sheet.png"), + ::anno::key_words(string[]("metal", "brass", "reflective", "new", "smooth", "shiny", "sheet", "sanitary", "construction", "design", "yellow", "warm")) +]] + = + let { + bool tmp0 = false; + material_surface tmp1(df::color_custom_curve_layer(gradient_lookup_smooth(texture_2d("./textures/brass_gradients_yellow_gold_red.png", ::tex::gamma_srgb), 0.5f, brass_type_select), color(0.998699009f, 1.f, 1.f), 5.f, color(math::lerp(0.400000006f, 1.f, sheet_brightness) * math::lerp(1.f, math::pow(float3(base::file_texture(texture_2d("./textures/sheet_metal_R_rough_G_ao_B_streaks.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false).tint)[1], 2.20000005f), math::lerp(0.f, 0.300000012f, streaks))), df::weighted_layer(0.0700000003f, df::microfacet_ggx_smith_bsdf(0.150000006f, 0.150000006f, gradient_lookup_smooth(texture_2d("./textures/brass_gradients_yellow_gold_red.png", ::tex::gamma_srgb), 0.5f, brass_type_select), gradient_lookup_smooth(texture_2d("./textures/brass_gradients_yellow_gold_red.png", ::tex::gamma_srgb), 0.5f, brass_type_select), 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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/sheet_metal_R_rough_G_ao_B_streaks.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false).tint)[0] - 0.5f) * (streaks * 0.5f * 0.5f)), color(1.f, 1.f, 1.f), color(0.577580988f, 0.577580988f, 0.577580988f), state::texture_tangent_u(0), df::scatter_reflect), math::normalize(math::lerp(state::normal(), base::tangent_space_normal_texture(texture_2d("./textures/sheet_metal_norm.jpg", ::tex::gamma_linear), scratch_bump_factor, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 1.f, 0.f), histogram_scan_big(float3(base::file_texture(texture_2d("./textures/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("./textures/sheet_metal_norm.jpg", ::tex::gamma_linear), scratch_bump_factor, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), tex::wrap_repeat, tex::wrap_repeat, false, 1.f, 0.f), histogram_scan_big(float3(base::file_texture(texture_2d("./textures/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(roundcorners_radius_mm * 0.00100000005f, 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 Brass_Sheet_Yellow_Soft_Splotches(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Sheet Yellow - Soft Splotches"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Sheet.Brass_Sheet_Yellow_Soft_Splotches.png"), + // scratched, + ::anno::key_words(string[]("metal", "brass", "reflective", "polished", "new", "sheet", "sanitary", "construction", "scratched", "design", "yellow", "warm")) +]] = Brass_Sheet( + infinite_tiling: true, + brass_type_select: 0.0f, + sheet_brightness: 0.5f, + roughness: 0.3f, + streaks: 0.0f, + scratch_bump_factor: 0.25f, + imperfections_amount: 0.75f, + impurities_weight_1: 0.75f, + impurities_weight_2: 0.01f, + impurities_weight_3: 0.98f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + roundcorners_radius_mm: 1.0f, + across_materials: false, + uv_space_index: 0 +); + +// 3 +export material Brass_Sheet_Yellow_Glossy_Imperfections(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Sheet Yellow - Glossy Imperfections"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Sheet.Brass_Sheet_Yellow_Glossy_Imperfections.png"), + // scratched, + ::anno::key_words(string[]("metal", "brass", "reflective", "polished", "new", "sheet", "sanitary", "construction", "design", "yellow", "warm")) +]] = Brass_Sheet( + infinite_tiling: true, + brass_type_select: 0.0f, + sheet_brightness: 0.85f, + roughness: 0.4f, + 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, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + roundcorners_radius_mm: 1.0f, + across_materials: false, + uv_space_index: 0 +); + + +//4 +export material Brass_Sheet_Yellow_Splotchy_Streaks(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Sheet Yellow - Splotchy Streaks"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Sheet.Brass_Sheet_Yellow_Splotchy_Streaks.png"), + // scratched, + ::anno::key_words(string[]("metal", "brass", "reflective", "new", "sheet", "matte", "sanitary", "construction", "design", "yellow", "warm")) +]] = Brass_Sheet( + infinite_tiling: true, + brass_type_select: 0.0f, + sheet_brightness: 0.85f, + roughness: 0.55f, + 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, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + roundcorners_radius_mm: 1.0f, + across_materials: false, + uv_space_index: 0 +); + + +// 5 +export material Brass_Sheet_Yellow_Matte_Imperfections(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Sheet Yellow - Matte Imperfections"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Sheet.Brass_Sheet_Yellow_Matte_Imperfections.png"), + // scratched, + ::anno::key_words(string[]("metal", "brass", "reflective", "matte", "new", "sheet", "sanitary", "construction", "design", "yellow", "warm")) +]] = Brass_Sheet( + infinite_tiling: true, + brass_type_select: 0.0f, + 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, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + roundcorners_radius_mm: 1.0f, + across_materials: false, + uv_space_index: 0 +); + +// 6 +export material Brass_Sheet_Gold_New_Clean(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Sheet Gold - New Clean"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Sheet.Brass_Sheet_Gold_Matte_Imperfections.png"), + ::anno::key_words(string[]("metal", "brass", "reflective", "new", "smooth", "shiny", "sheet", "sanitary", "construction", "design", "gold", "warm")) +]] = Brass_Sheet( + infinite_tiling: true, + brass_type_select: 0.33f, + sheet_brightness: 0.85f, + roughness: 0.3f, + streaks: 0.2f, + scratch_bump_factor: 0.1f, + imperfections_amount: 0.1f, + impurities_weight_1: 0.75f, + impurities_weight_2: 0.43f, + impurities_weight_3: 0.1f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + roundcorners_radius_mm: 1.0f, + across_materials: false, + uv_space_index: 0 +); + + +// 7 +export material Brass_Sheet_Gold_Soft_Splotches(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Sheet Gold - Soft Splotches"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Sheet.Brass_Sheet_Gold_Soft_Splotches.png"), + // scratched, + ::anno::key_words(string[]("metal", "brass", "reflective", "polished", "new", "sheet", "sanitary", "construction", "scratched", "design", "gold", "warm")) +]] = Brass_Sheet( + infinite_tiling: true, + brass_type_select: 0.33f, + sheet_brightness: 0.5f, + roughness: 0.3f, + streaks: 0.0f, + scratch_bump_factor: 0.25f, + imperfections_amount: 0.75f, + impurities_weight_1: 0.75f, + impurities_weight_2: 0.01f, + impurities_weight_3: 0.98f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + roundcorners_radius_mm: 1.0f, + across_materials: false, + uv_space_index: 0 +); + +// 8 +export material Brass_Sheet_Gold_Glossy_Imperfections(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Sheet Gold - Glossy Imperfections"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Sheet.Brass_Sheet_Gold_Glossy_Imperfections.png"), + // scratched, + ::anno::key_words(string[]("metal", "brass", "reflective", "polished", "new", "sheet", "sanitary", "construction", "design", "gold", "warm")) +]] = Brass_Sheet( + infinite_tiling: true, + brass_type_select: 0.33f, + sheet_brightness: 0.85f, + roughness: 0.4f, + 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, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + roundcorners_radius_mm: 1.0f, + across_materials: false, + uv_space_index: 0 +); + + +// 9 +export material Brass_Sheet_Gold_Splotchy_Streaks(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Sheet Gold - Splotchy Streaks"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Sheet.Brass_Sheet_Gold_Splotchy_Streaks.png"), + // scratched, + ::anno::key_words(string[]("metal", "brass", "reflective", "new", "sheet", "matte", "sanitary", "construction", "design", "gold", "warm")) +]] = Brass_Sheet( + infinite_tiling: true, + brass_type_select: 0.33f, + sheet_brightness: 0.85f, + roughness: 0.55f, + 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, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + roundcorners_radius_mm: 1.0f, + across_materials: false, + uv_space_index: 0 +); + + +// 10 +export material Brass_Sheet_Gold_Matte_Imperfections(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Sheet Gold - Matte Imperfections"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Sheet.Brass_Sheet_Gold_Matte_Imperfections.png"), + // scratched, + ::anno::key_words(string[]("metal", "brass", "reflective", "matte", "new", "sheet", "sanitary", "construction", "design", "gold", "warm")) +]] = Brass_Sheet( + infinite_tiling: true, + brass_type_select: 0.33f, + 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, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + roundcorners_radius_mm: 1.0f, + across_materials: false, + uv_space_index: 0 +); + + +// 11 +export material Brass_Sheet_Red_New_Clean(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Sheet Red - New Clean"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Sheet.Brass_Sheet_Red_Matte_Imperfections.png"), + ::anno::key_words(string[]("metal", "brass", "reflective", "new", "smooth", "shiny", "sheet", "sanitary", "construction", "design", "red", "warm")) +]] = Brass_Sheet( + infinite_tiling: true, + brass_type_select: 0.66f, + sheet_brightness: 0.85f, + roughness: 0.3f, + streaks: 0.2f, + scratch_bump_factor: 0.1f, + imperfections_amount: 0.1f, + impurities_weight_1: 0.75f, + impurities_weight_2: 0.43f, + impurities_weight_3: 0.1f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + roundcorners_radius_mm: 1.0f, + across_materials: false, + uv_space_index: 0 +); + + +// 12 +export material Brass_Sheet_Red_Soft_Splotches(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Sheet Red - Soft Splotches"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Sheet.Brass_Sheet_Red_Soft_Splotches.png"), + // scratched, + ::anno::key_words(string[]("metal", "brass", "reflective", "polished", "new", "sheet", "sanitary", "construction", "scratched", "design", "red", "warm")) +]] = Brass_Sheet( + infinite_tiling: true, + brass_type_select: 0.66f, + sheet_brightness: 0.5f, + roughness: 0.3f, + streaks: 0.0f, + scratch_bump_factor: 0.25f, + imperfections_amount: 0.75f, + impurities_weight_1: 0.75f, + impurities_weight_2: 0.01f, + impurities_weight_3: 0.98f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + roundcorners_radius_mm: 1.0f, + across_materials: false, + uv_space_index: 0 +); + +// 13 +export material Brass_Sheet_Red_Glossy_Imperfections(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Sheet Red - Glossy Imperfections"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Sheet.Brass_Sheet_Red_Glossy_Imperfections.png"), + // scratched, + ::anno::key_words(string[]("metal", "brass", "reflective", "polished", "new", "sheet", "sanitary", "construction", "design", "red", "warm")) +]] = Brass_Sheet( + infinite_tiling: true, + brass_type_select: 0.66f, + sheet_brightness: 0.85f, + roughness: 0.4f, + 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, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + roundcorners_radius_mm: 1.0f, + across_materials: false, + uv_space_index: 0 +); + + +// 14 +export material Brass_Sheet_Red_Splotchy_Streaks(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Sheet Red - Splotchy Streaks"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Sheet.Brass_Sheet_Red_Splotchy_Streaks.png"), + // scratched, + ::anno::key_words(string[]("metal", "brass", "reflective", "new", "sheet", "matte", "sanitary", "construction", "design", "red", "warm")) +]] = Brass_Sheet( + infinite_tiling: true, + brass_type_select: 0.66f, + sheet_brightness: 0.85f, + roughness: 0.55f, + 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, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + roundcorners_radius_mm: 1.0f, + across_materials: false, + uv_space_index: 0 +); + + +// 15 +export material Brass_Sheet_Red_Matte_Imperfections(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Brass Sheet Red - Matte Imperfections"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Brass_Sheet.Brass_Sheet_Red_Matte_Imperfections.png"), + // scratched, + ::anno::key_words(string[]("metal", "brass", "reflective", "matte", "new", "sheet", "sanitary", "construction", "design", "red", "warm")) +]] = Brass_Sheet( + infinite_tiling: true, + brass_type_select: 0.66f, + 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, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + roundcorners_radius_mm: 1.0f, + across_materials: false, + uv_space_index: 0 +); + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/code/third_party/vMaterials_2/Metal/Bronze.mdl b/code/third_party/vMaterials_2/Metal/Bronze.mdl new file mode 100644 index 0000000000000000000000000000000000000000..7a68279e0f9989b84e0a7d2487d54ab876599f69 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Bronze.mdl @@ -0,0 +1,759 @@ +/****************************************************************************** + * 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 plain bronze material with controls to add wear and dirt. Use the " + "'Copper Tint' parameter to fade from a yellowish (0.0) to a reddish (1.0) 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); +} + +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 Bronze( + float copper_tint = 0.0f [[ + ::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 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(1) + ]], + float roughness_variation = 0.95f [[ + ::anno::description("Adds variation to the roughness across the material so that its shininess changes."), + ::anno::display_name("Roughness Variation"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float surface_dirt = 0.f [[ + ::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(3) + ]], + float dirt_dents = 0.f [[ + ::anno::description("Adds dirt in the areas where dents appear on the surface."), + ::anno::display_name("Dents Dirt"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + float bump_strength = 0.09f [[ + ::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) + ]], + uniform float2 texture_translate = float2(0.f) [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture 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("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::soft_range(0.f, 360.f), + ::anno::ui_order(7) + ]], + uniform float2 texture_scale = float2(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 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(9) + ]], + 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(10) + ]], + uniform bool roundcorners_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::ui_order(11) + ]], + 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(12) + ]]) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Yellow - New"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze.Bronze.png"), + ::anno::key_words(string[]("metal", "bronze", "new", "shiny", "smooth", "reflective","plain", "design", "sanitary", "yellow", "warm")) +]] + = + let { + float copper_amount_remap = copper_tint / 1.5f; + bool tmp0 = false; + material_surface tmp1(::df::weighted_layer(::math::max(float3(endless_texture(texture_2d("./textures/brass_multi_R_grad_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.805000007f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z * surface_dirt, ::math::min(dirt_dents, float3(endless_texture(texture_2d("./textures/brass_multi_R_grad_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.805000007f, 0.112999998f, 0.591000021f), 6.12999964f, false)).y)), ::df::diffuse_reflection_bsdf(color(0.0173889995f, 0.0125169996f, 0.00369399996f), 0.f), ::df::weighted_layer(::math::lerp(0.209999993f, 0.395000011f, roughness), ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(color(0.139981002f, 0.0928419977f, 0.0170479994f), color(0.00604900019f, 0.00469399989f, 0.00184399995f), ::base::color_layer_blend, histogram_scan_big(float3(endless_texture(texture_2d("./textures/brass_multi_R_grad_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.805000007f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, 0.359999985f, 0.560000002f)).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("./textures/brass_multi_R_grad_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.805000007f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, 0.170000002f, ::math::lerp(0.399999976f, 0.736000001f, roughness)) * histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_grad_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.805000007f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, 0.170000002f, ::math::lerp(0.399999976f, 0.736000001f, roughness)), histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_grad_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.805000007f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, 0.170000002f, ::math::lerp(0.399999976f, 0.736000001f, roughness)) * histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_grad_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.805000007f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, 0.170000002f, ::math::lerp(0.399999976f, 0.736000001f, roughness)), 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(histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_grad_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.805000007f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, ::math::lerp(0.0700000003f, 0.870000005f, roughness_variation), ::math::lerp(0.0399999991f, 0.435000002f, roughness)) * histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_grad_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.805000007f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, ::math::lerp(0.0700000003f, 0.870000005f, roughness_variation), ::math::lerp(0.0399999991f, 0.435000002f, roughness)), histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_grad_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.805000007f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, ::math::lerp(0.0700000003f, 0.870000005f, roughness_variation), ::math::lerp(0.0399999991f, 0.435000002f, roughness)) * histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_grad_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.805000007f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, ::math::lerp(0.0700000003f, 0.870000005f, roughness_variation), ::math::lerp(0.0399999991f, 0.435000002f, roughness)), color(1.f, 1.f, 1.f), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), bsdf(), endless_normal(texture_2d("./textures/brass_normal.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.5f, 0.5f, 0.999000013f), 6.12999964f)), endless_normal(texture_2d("./textures/brass_normal.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.5f, 0.5f, 0.999000013f), 6.12999964f)), ::df::tint(gradient_lookup_smooth(texture_2d("./textures/bronze_gradients.png", ::tex::gamma_srgb), float3(endless_texture(texture_2d("./textures/brass_multi_R_grad_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.805000007f, 0.112999998f, 0.591000021f), 6.12999964f, false)).x, copper_amount_remap), ::df::weighted_layer(0.349999994f, ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_grad_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.805000007f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, 0.170000002f, ::math::lerp(0.399999976f, 0.736000001f, roughness)) * histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_grad_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.805000007f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, 0.170000002f, ::math::lerp(0.399999976f, 0.736000001f, roughness)), histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_grad_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.805000007f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, 0.170000002f, ::math::lerp(0.399999976f, 0.736000001f, roughness)) * histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_grad_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.805000007f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, 0.170000002f, ::math::lerp(0.399999976f, 0.736000001f, roughness)), 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(histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_grad_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.805000007f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, ::math::lerp(0.0700000003f, 0.870000005f, roughness_variation), ::math::lerp(0.0399999991f, 0.435000002f, roughness)) * histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_grad_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.805000007f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, ::math::lerp(0.0700000003f, 0.870000005f, roughness_variation), ::math::lerp(0.0399999991f, 0.435000002f, roughness)), histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_grad_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.805000007f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, ::math::lerp(0.0700000003f, 0.870000005f, roughness_variation), ::math::lerp(0.0399999991f, 0.435000002f, roughness)) * histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_grad_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.805000007f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, ::math::lerp(0.0700000003f, 0.870000005f, roughness_variation), ::math::lerp(0.0399999991f, 0.435000002f, roughness)), color(1.f, 1.f, 1.f), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), bsdf(), endless_normal(texture_2d("./textures/brass_normal.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.5f, 0.5f, 0.999000013f), 6.12999964f)), endless_normal(texture_2d("./textures/brass_normal.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.5f, 0.5f, 0.999000013f), 6.12999964f))), ::state::normal()), endless_normal(texture_2d("./textures/brass_normal.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.5f, 0.5f, 0.999000013f), 6.12999964f)), endless_normal(texture_2d("./textures/brass_normal.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.5f, 0.5f, 0.999000013f), 6.12999964f)), 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_Yellow_New_Stained(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Yellow - New Stained"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze.Bronze_Yellow_New_Stained.png"), + ::anno::key_words(string[]("metal", "bronze", "new", "shiny", "smooth", "stained", "reflective","plain", "design", "sanitary", "yellow", "warm")) +]] = Bronze( + copper_tint: 0.0f, + roughness: 0.0f, + roughness_variation: 0.95f, + surface_dirt: 0.72f, + dirt_dents: 0.45f, + bump_strength: 0.25f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +// 3 +export material Bronze_Yellow_Shiny_Handled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Yellow - Shiny Handled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze.Bronze_Yellow_Shiny_Handled.png"), + ::anno::key_words(string[]("metal", "bronze", "pure", "reflective","plain", "design", "sanitary", "bumped", "yellow", "warm")) +]] = Bronze( + copper_tint: 0.0f, + roughness: 0.14f, + roughness_variation: 0.95f, + surface_dirt: 0.63f, + dirt_dents: 0.6f, + bump_strength: 0.9f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +// 4 +export material Bronze_Yellow_Worn(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Yellow - Worn"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze.Bronze_Yellow_Worn.png"), + ::anno::key_words(string[]("metal", "bronze", "pure", "dirty", "worn", "reflective","plain", "stained", "design", "sanitary", "bumped", "yellow", "warm")) +]] = Bronze( + copper_tint: 0.0f, + roughness: 0.43f, + roughness_variation: 0.95f, + surface_dirt: 1.0f, + dirt_dents: 0.54f, + bump_strength: 0.92f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +// 5 +export material Bronze_Yellow_Rough_Worn(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Yellow - Rough Worn"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze.Bronze_Yellow_Rough_Worn.png"), + ::anno::key_words(string[]("metal", "bronze", "matte", "dirty", "aged", "old", "worn", "reflective","plain", "stained", "design", "sanitary", "bumped", "yellow", "warm")) +]] = Bronze( + copper_tint: 0.0f, + roughness: 1.0f, + roughness_variation: 1.0f, + surface_dirt: 0.92f, + dirt_dents: 0.35f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +// 6 +export material Bronze_New(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze - New"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze.Bronze_New.png"), + ::anno::key_words(string[]("metal", "bronze", "pure", "reflective","plain", "design", "sanitary", "gold", "warm")) +]] = Bronze( + copper_tint: 0.5f, + roughness: 0.0f, + roughness_variation: 0.95f, + surface_dirt: 0.0f, + dirt_dents: 0.0f, + bump_strength: 0.09f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 7 +export material Bronze_New_Stained(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze - New Stained"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze.Bronze_New_Stained.png"), + ::anno::key_words(string[]("metal", "bronze", "new", "shiny", "smooth", "stained", "reflective","plain", "design", "sanitary", "gold", "warm")) +]] = Bronze( + copper_tint: 0.5f, + roughness: 0.0f, + roughness_variation: 0.95f, + surface_dirt: 0.72f, + dirt_dents: 0.45f, + bump_strength: 0.25f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +// 8 +export material Bronze_Shiny_Handled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze - Shiny Handled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze.Bronze_Shiny_Handled.png"), + ::anno::key_words(string[]("metal", "bronze", "pure", "reflective","plain", "design", "sanitary", "bumped", "gold", "warm")) +]] = Bronze( + copper_tint: 0.5f, + roughness: 0.14f, + roughness_variation: 0.95f, + surface_dirt: 0.63f, + dirt_dents: 0.6f, + bump_strength: 0.9f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +// 9 +export material Bronze_Worn(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze - Worn"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze.Bronze_Worn.png"), + ::anno::key_words(string[]("metal", "bronze", "pure", "dirty", "worn", "reflective","plain", "stained", "design", "sanitary", "bumped", "gold", "warm")) +]] = Bronze( + copper_tint: 0.5f, + roughness: 0.43f, + roughness_variation: 0.95f, + surface_dirt: 1.0f, + dirt_dents: 0.54f, + bump_strength: 0.92f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +// 10 +export material Bronze_Rough_Worn(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze - Rough Worn"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze.Bronze_Rough_Worn.png"), + ::anno::key_words(string[]("metal", "bronze", "matte", "dirty", "aged", "old", "worn", "reflective","plain", "stained", "design", "sanitary", "bumped", "gold", "warm")) +]] = Bronze( + copper_tint: 0.5f, + roughness: 1.0f, + roughness_variation: 1.0f, + surface_dirt: 0.92f, + dirt_dents: 0.35f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 11 +export material Bronze_Red_New(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Red - New"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze.Bronze_Red_New.png"), + ::anno::key_words(string[]("metal", "bronze", "pure", "reflective","plain", "design", "sanitary", "red", "warm")) +]] = Bronze( + copper_tint: 1.00f, + roughness: 0.0f, + roughness_variation: 0.95f, + surface_dirt: 0.0f, + dirt_dents: 0.0f, + bump_strength: 0.09f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 12 +export material Bronze_Red_New_Stained(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Red - New Stained"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze.Bronze_Red_New_Stained.png"), + ::anno::key_words(string[]("metal", "bronze", "new", "shiny", "smooth", "stained", "reflective","plain", "design", "sanitary", "red", "warm")) +]] = Bronze( + copper_tint: 1.00f, + roughness: 0.0f, + roughness_variation: 0.95f, + surface_dirt: 0.72f, + dirt_dents: 0.45f, + bump_strength: 0.25f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +// 13 +export material Bronze_Red_Shiny_Handled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Red - Shiny Handled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze.Bronze_Red_Shiny_Handled.png"), + ::anno::key_words(string[]("metal", "bronze", "pure", "reflective","plain", "design", "sanitary", "bumped", "red", "warm")) +]] = Bronze( + copper_tint: 1.00f, + roughness: 0.14f, + roughness_variation: 0.95f, + surface_dirt: 0.63f, + dirt_dents: 0.6f, + bump_strength: 0.9f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +// 14 +export material Bronze_Red_Worn(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Red - Worn"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze.Bronze_Red_Worn.png"), + ::anno::key_words(string[]("metal", "bronze", "pure", "dirty", "worn", "reflective","plain", "stained", "design", "sanitary", "bumped", "red", "warm")) +]] = Bronze( + copper_tint: 1.00f, + roughness: 0.43f, + roughness_variation: 0.95f, + surface_dirt: 1.0f, + dirt_dents: 0.54f, + bump_strength: 0.92f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +// 15 +export material Bronze_Red_Rough_Worn(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Red - Rough Worn"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze.Bronze_Red_Rough_Worn.png"), + ::anno::key_words(string[]("metal", "bronze", "matte", "dirty", "aged", "old", "worn", "reflective","plain", "stained", "design", "sanitary", "bumped", "red", "warm")) +]] = Bronze( + copper_tint: 1.00f, + roughness: 1.0f, + roughness_variation: 1.0f, + surface_dirt: 0.92f, + dirt_dents: 0.35f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + diff --git a/code/third_party/vMaterials_2/Metal/Bronze_Antique.mdl b/code/third_party/vMaterials_2/Metal/Bronze_Antique.mdl new file mode 100644 index 0000000000000000000000000000000000000000..a56710f8f1003643c101709e1653c62708067326 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Bronze_Antique.mdl @@ -0,0 +1,429 @@ +/****************************************************************************** + * 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"; + + +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); +} + +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_Antique( + 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"), + ::anno::ui_order(0) + ]], + float roughness = 0.0f [[ + ::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(1) + ]], + float surface_dirt_amount = 0.f [[ + ::anno::description("Adds a diffuse dirt layer which darkens the material."), + ::anno::display_name("Surface Dirt Amount"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float dirt_dents = 0.6f [[ + ::anno::description("Adds dirt in the areas where dents show up in the bump map."), + ::anno::display_name("Dents Dirt"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + 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(4) + ]], + uniform float2 texture_translate = float2(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 = float2(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("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 Antique - Shiny Smooth"), + ::anno::description("An antique, worn bronze material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze_Antique.Bronze_Antique.png"), + // scratched, + ::anno::key_words(string[]("metal", "bronze", "reflective", "antique", "old", "worn", "stained", "sanitary", "scratched", "design", "brown")) +]] + = + let { + bool tmp0 = false; + material_surface tmp1(::df::weighted_layer(::math::max(surface_dirt_amount * float3(infinite_tiling ? endless_texture(texture_2d("./textures/bronze_antique_bronze_antique_multi_R_dirt_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.172999993f, 0.131999999f, 0.442999989f), 6.12999964f, false) : ::base::file_texture(texture_2d("./textures/bronze_antique_bronze_antique_multi_R_dirt_G_scratches_B_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, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, ::math::min(dirt_dents, float3(infinite_tiling ? endless_texture(texture_2d("./textures/bronze_antique_bronze_antique_multi_R_dirt_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.172999993f, 0.131999999f, 0.442999989f), 6.12999964f, false) : ::base::file_texture(texture_2d("./textures/bronze_antique_bronze_antique_multi_R_dirt_G_scratches_B_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, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).y)), ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(color(0.00439100014f, 0.00351099996f, 0.00143499998f), color(0.0159959998f, 0.0091289999f, 0.00268299994f), ::base::color_layer_blend, float3(infinite_tiling ? endless_texture(texture_2d("./textures/bronze_antique_bronze_antique_multi_R_dirt_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.172999993f, 0.131999999f, 0.442999989f), 6.12999964f, false) : ::base::file_texture(texture_2d("./textures/bronze_antique_bronze_antique_multi_R_dirt_G_scratches_B_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, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, true).tint, 0.f, ""), ::df::weighted_layer(::math::lerp(0.299999982f, 0.599999964f, roughness), ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(color(0.0295570008f, 0.0207199994f, 0.0132680004f), color(0.0212190002f, 0.0147630004f, 0.00987899955f), ::base::color_layer_blend, histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/bronze_antique_bronze_antique_multi_R_dirt_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.172999993f, 0.131999999f, 0.442999989f), 6.12999964f, false) : ::base::file_texture(texture_2d("./textures/bronze_antique_bronze_antique_multi_R_dirt_G_scratches_B_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, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).z, 0.359999985f, 0.560000002f), true).tint, 0.f, ""), ::df::weighted_layer(0.349999994f, ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/bronze_antique_bronze_antique_multi_R_dirt_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.172999993f, 0.131999999f, 0.442999989f), 6.12999964f, false) : ::base::file_texture(texture_2d("./textures/bronze_antique_bronze_antique_multi_R_dirt_G_scratches_B_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, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).z, 0.170000002f, ::math::lerp(0.399999976f, 0.799999952f, roughness)) * histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/bronze_antique_bronze_antique_multi_R_dirt_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.172999993f, 0.131999999f, 0.442999989f), 6.12999964f, false) : ::base::file_texture(texture_2d("./textures/bronze_antique_bronze_antique_multi_R_dirt_G_scratches_B_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, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).z, 0.170000002f, ::math::lerp(0.399999976f, 0.799999952f, roughness)), histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/bronze_antique_bronze_antique_multi_R_dirt_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.172999993f, 0.131999999f, 0.442999989f), 6.12999964f, false) : ::base::file_texture(texture_2d("./textures/bronze_antique_bronze_antique_multi_R_dirt_G_scratches_B_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, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).z, 0.170000002f, ::math::lerp(0.399999976f, 0.799999952f, roughness)) * histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/bronze_antique_bronze_antique_multi_R_dirt_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.172999993f, 0.131999999f, 0.442999989f), 6.12999964f, false) : ::base::file_texture(texture_2d("./textures/bronze_antique_bronze_antique_multi_R_dirt_G_scratches_B_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, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).z, 0.170000002f, ::math::lerp(0.399999976f, 0.799999952f, roughness)), infinite_tiling ? endless_texture(texture_2d("./textures/bronze_antique_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.64200002f, 0.485000014f, 0.319999993f), 6.12999964f, true) : ::base::file_texture(texture_2d("./textures/bronze_antique_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, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint, color(0.0908420011f, 0.0231829993f, 0.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::weighted_layer(1.f, ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/bronze_antique_bronze_antique_multi_R_dirt_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.172999993f, 0.131999999f, 0.442999989f), 6.12999964f, false) : ::base::file_texture(texture_2d("./textures/bronze_antique_bronze_antique_multi_R_dirt_G_scratches_B_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, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).z, ::math::lerp(0.639999986f, 0.589999974f, roughness), ::math::lerp(0.25f, 0.50999999f, roughness)) * histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/bronze_antique_bronze_antique_multi_R_dirt_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.172999993f, 0.131999999f, 0.442999989f), 6.12999964f, false) : ::base::file_texture(texture_2d("./textures/bronze_antique_bronze_antique_multi_R_dirt_G_scratches_B_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, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).z, ::math::lerp(0.639999986f, 0.589999974f, roughness), ::math::lerp(0.25f, 0.50999999f, roughness)), histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/bronze_antique_bronze_antique_multi_R_dirt_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.172999993f, 0.131999999f, 0.442999989f), 6.12999964f, false) : ::base::file_texture(texture_2d("./textures/bronze_antique_bronze_antique_multi_R_dirt_G_scratches_B_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, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).z, ::math::lerp(0.639999986f, 0.589999974f, roughness), ::math::lerp(0.25f, 0.50999999f, roughness)) * histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/bronze_antique_bronze_antique_multi_R_dirt_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.172999993f, 0.131999999f, 0.442999989f), 6.12999964f, false) : ::base::file_texture(texture_2d("./textures/bronze_antique_bronze_antique_multi_R_dirt_G_scratches_B_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, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).z, ::math::lerp(0.639999986f, 0.589999974f, roughness), ::math::lerp(0.25f, 0.50999999f, roughness)), infinite_tiling ? endless_texture(texture_2d("./textures/bronze_antique_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.64200002f, 0.485000014f, 0.319999993f), 6.12999964f, true) : ::base::file_texture(texture_2d("./textures/bronze_antique_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, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint, color(0.f, 0.f, 0.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), bsdf(), infinite_tiling ? endless_normal(texture_2d("./textures/metal_antique_normal.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.5f, 0.5f, 0.999000013f), 6.12999964f) : normalmap_normal(texture_2d("./textures/metal_antique_normal.jpg", ::tex::gamma_linear), 1.f, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index))), infinite_tiling ? endless_normal(texture_2d("./textures/metal_antique_normal.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.5f, 0.5f, 0.999000013f), 6.12999964f) : normalmap_normal(texture_2d("./textures/metal_antique_normal.jpg", ::tex::gamma_linear), 1.f, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index))), infinite_tiling ? endless_normal(texture_2d("./textures/metal_antique_normal.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.5f, 0.5f, 0.999000013f), 6.12999964f) : normalmap_normal(texture_2d("./textures/metal_antique_normal.jpg", ::tex::gamma_linear), 1.f, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index))), infinite_tiling ? endless_normal(texture_2d("./textures/metal_antique_normal.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.5f, 0.5f, 0.999000013f), 6.12999964f) : normalmap_normal(texture_2d("./textures/metal_antique_normal.jpg", ::tex::gamma_linear), 1.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_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 Bronze_Antique_Shiny_Stained(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Antique - Shiny Stained"), + ::anno::description("An antique, worn bronze material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze_Antique.Bronze_Antique_Shiny_Stained.png"), + // scratched, + ::anno::key_words(string[]("metal", "bronze", "reflective", "antique", "old", "worn", "shiny", "stained", "sanitary", "scratched", "design", "brown")) +]] = Bronze_Antique +( + infinite_tiling: true, + roughness: 0.0f, + surface_dirt_amount: 1.0f, + dirt_dents: 0.94f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + + +export material Bronze_Antique_Matte_Dirty(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Antique - Matte Dirty"), + ::anno::description("An antique, worn bronze material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze_Antique.Bronze_Antique_Matte_Dirty.png"), + // scratched, + ::anno::key_words(string[]("metal", "bronze", "reflective", "antique", "old", "worn", "matte", "stained", "sanitary", "scratched", "design", "brown")) +]] = Bronze_Antique +( + infinite_tiling: true, + roughness: 0.65f, + surface_dirt_amount: 0.59f, + dirt_dents: 0.73f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Metal/Bronze_Brushed.mdl b/code/third_party/vMaterials_2/Metal/Bronze_Brushed.mdl new file mode 100644 index 0000000000000000000000000000000000000000..793cf348f6eedb836409ec3f61edd8f42234bd57 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Bronze_Brushed.mdl @@ -0,0 +1,518 @@ +/****************************************************************************** + * 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 brushed bronze material with controls to add wear and dirt. Use the " + "'Copper Tint' parameter to fade from a yellowish (0.0) to a reddish (1.0) 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 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); +} + + +::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 Bronze_Brushed( + 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 brushing_roughness = 0.09f [[ + ::anno::description("Adjusts the overall roughness of the brushed metal."), + ::anno::display_name("Brushing Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float brushing_anisotropy = 0.42f [[ + ::anno::description("A higher value stretches out the reflection."), + ::anno::display_name("Brushing Anisotropy"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float brush_darkening = 0.69f [[ + ::anno::description("Adds brightness variation to the brushing pattern which gives a more pronounced look to the brushing effect. Also darkend the appearance."), + ::anno::display_name("Brush Darkening"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float surface_dirt = 0.01f [[ + ::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(4) + ]], + float dirt_dents = 0.01f [[ + ::anno::description("Adds dirt in the areas where dents appear on the surface."), + ::anno::display_name("Dents Dirt"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(5) + ]], + float bump_strength = 0.01f [[ + ::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(6) + ]], + uniform float2 texture_translate = float2(0.f) [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform"), + ::anno::ui_order(7) + ]], + 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(8) + ]], + uniform float2 texture_scale = float2(1.0f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(0.6f, 0.6f)), + ::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.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(11) + ]], + uniform bool roundcorners_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::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("Advanced"), + ::anno::hard_range(0, 10), + ::anno::ui_order(13) + ]]) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Brushed - Smooth Subtle"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze_Brushed.Bronze_Brushed.png"), + ::anno::key_words(string[]("metal", "bronze", "brushed", "anisotropic", "new", "shiny", "smooth", "reflective", "design", "sanitary", "yellow", "warm")) +]] + = + let { + float copper_amount_remap = copper_tint / 1.5f; + bool tmp0 = false; + float2 texture_rescale = texture_scale * 0.5f; + material_surface tmp1(::df::weighted_layer(::math::max(float3(endless_texture(texture_2d("./textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z * surface_dirt, ::math::min(dirt_dents, float3(endless_texture(texture_2d("./textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).y)), ::df::diffuse_reflection_bsdf(color(0.0173889995f, 0.0125169996f, 0.00369399996f), 0.f), ::df::custom_curve_layer(0.f, 1.f, 5.35999966f, 1.f, ::df::weighted_layer(0.349999994f, ::df::microfacet_ggx_smith_bsdf(0.0625f, 0.0625f, nvidia::core_definitions::blend_colors(color(1.f, 1.f, 1.f), color(float3(endless_texture(texture_2d("./textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).x), ::base::color_layer_multiply, brush_darkening).tint, nvidia::core_definitions::blend_colors(color(1.f, 1.f, 1.f), color(float3(endless_texture(texture_2d("./textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).x), ::base::color_layer_multiply, brush_darkening).tint, ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::microfacet_ggx_smith_bsdf(anisotropy_conversion(histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).x, 0.539999962f, brushing_roughness * 0.300000012f + 0.0500000007f), histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).x, 1.f, brushing_anisotropy * 0.610000014f + 0.170000002f), texture_rotate / 360.f, ::state::texture_tangent_u(0)).roughness_u, anisotropy_conversion(histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).x, 0.539999962f, brushing_roughness * 0.300000012f + 0.0500000007f), histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).x, 1.f, brushing_anisotropy * 0.610000014f + 0.170000002f), texture_rotate / 360.f, ::state::texture_tangent_u(0)).roughness_v, nvidia::core_definitions::blend_colors(color(1.f, 1.f, 1.f), color(float3(endless_texture(texture_2d("./textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).x), ::base::color_layer_multiply, brush_darkening).tint, nvidia::core_definitions::blend_colors(color(1.f, 1.f, 1.f), color(float3(endless_texture(texture_2d("./textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).x), ::base::color_layer_multiply, brush_darkening).tint, anisotropy_conversion(histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).x, 0.539999962f, brushing_roughness * 0.300000012f + 0.0500000007f), histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).x, 1.f, brushing_anisotropy * 0.610000014f + 0.170000002f), texture_rotate / 360.f, ::state::texture_tangent_u(0)).tangent_u, ::df::scatter_reflect), bsdf(), endless_normal(texture_2d("./textures/brushed_metal_linear_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.5f, 0.5f, 0.999000013f), 6.12999964f)), endless_normal(texture_2d("./textures/brushed_metal_linear_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.5f, 0.5f, 0.999000013f), 6.12999964f)), ::df::tint(gradient_lookup_smooth(texture_2d("./textures/bronze_gradients.png", ::tex::gamma_srgb), ::math::pow(float3(endless_texture(texture_2d("./textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::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(0.0625f, 0.0625f, nvidia::core_definitions::blend_colors(color(1.f, 1.f, 1.f), color(float3(endless_texture(texture_2d("./textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).x), ::base::color_layer_multiply, brush_darkening).tint, nvidia::core_definitions::blend_colors(color(1.f, 1.f, 1.f), color(float3(endless_texture(texture_2d("./textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).x), ::base::color_layer_multiply, brush_darkening).tint, ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::microfacet_ggx_smith_bsdf(anisotropy_conversion(histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).x, 0.539999962f, brushing_roughness * 0.300000012f + 0.0500000007f), histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).x, 1.f, brushing_anisotropy * 0.610000014f + 0.170000002f), texture_rotate / 360.f, ::state::texture_tangent_u(0)).roughness_u, anisotropy_conversion(histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).x, 0.539999962f, brushing_roughness * 0.300000012f + 0.0500000007f), histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).x, 1.f, brushing_anisotropy * 0.610000014f + 0.170000002f), texture_rotate / 360.f, ::state::texture_tangent_u(0)).roughness_v, nvidia::core_definitions::blend_colors(color(1.f, 1.f, 1.f), color(float3(endless_texture(texture_2d("./textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).x), ::base::color_layer_multiply, brush_darkening).tint, nvidia::core_definitions::blend_colors(color(1.f, 1.f, 1.f), color(float3(endless_texture(texture_2d("./textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).x), ::base::color_layer_multiply, brush_darkening).tint, anisotropy_conversion(histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).x, 0.539999962f, brushing_roughness * 0.300000012f + 0.0500000007f), histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_brushing_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).x, 1.f, brushing_anisotropy * 0.610000014f + 0.170000002f), texture_rotate / 360.f, ::state::texture_tangent_u(0)).tangent_u, ::df::scatter_reflect), bsdf(), endless_normal(texture_2d("./textures/brushed_metal_linear_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.5f, 0.5f, 0.999000013f), 6.12999964f)), endless_normal(texture_2d("./textures/brushed_metal_linear_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.5f, 0.5f, 0.999000013f), 6.12999964f))), ::state::normal()), endless_normal(texture_2d("./textures/brushed_metal_linear_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.5f, 0.5f, 0.999000013f), 6.12999964f)), 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_Brushed_Yellow_Fine(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Brushed - Fine"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze_Brushed.Bronze_Brushed_Yellow_Fine.png"), + ::anno::key_words(string[]("metal", "bronze", "brushed", "anisotropic", "new", "shiny", "smooth", "fine", "reflective", "design", "sanitary", "yellow", "warm")) +]] = Bronze_Brushed +( + copper_tint: 0.50f, + brushing_roughness: 0.05f, + brushing_anisotropy: 0.76f, + brush_darkening: 0.0f, + surface_dirt: 0.0f, + dirt_dents: 0.0f, + bump_strength: 0.19f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +// 3 +export material Bronze_Brushed_Yellow_Medium(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Brushed - Medium"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze_Brushed.Bronze_Brushed_Yellow_Medium.png"), + ::anno::key_words(string[]("metal", "bronze", "brushed", "anisotropic", "new", "shiny", "smooth", "reflective", "design", "sanitary", "yellow", "warm")) +]] = Bronze_Brushed +( + copper_tint: 0.50f, + brushing_roughness: 0.32f, + brushing_anisotropy: 0.77f, + brush_darkening: 0.0f, + surface_dirt: 0.03f, + dirt_dents: 0.3f, + bump_strength: 0.48f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +// 4 +export material Bronze_Brushed_Yellow_Dirty_Medium(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Brushed - Dirty Medium"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze_Brushed.Bronze_Brushed_Yellow_Dirty_Medium.png"), + ::anno::key_words(string[]("metal", "bronze", "brushed", "anisotropic", "dirty", "worn", "shiny", "rough", "reflective", "design", "sanitary", "yellow", "warm")) +]] = Bronze_Brushed +( + copper_tint: 0.50f, + brushing_roughness: 0.32f, + brushing_anisotropy: 0.77f, + brush_darkening: 0.0f, + surface_dirt: 0.03f, + dirt_dents: 0.3f, + bump_strength: 0.48f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +// 5 +export material Bronze_Brushed_Yellow_Strong(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Brushed - Strong"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze_Brushed.Bronze_Brushed_Yellow_Strong.png"), + ::anno::key_words(string[]("metal", "bronze", "brushed", "anisotropic", "new", "shiny", "rough", "reflective", "design", "sanitary", "yellow", "warm")) +]] = Bronze_Brushed +( + copper_tint: 0.50f, + brushing_roughness: 0.75f, + brushing_anisotropy: 0.96f, + brush_darkening: 0.55f, + surface_dirt: 0.05f, + dirt_dents: 0.05f, + bump_strength: 0.73f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + diff --git a/code/third_party/vMaterials_2/Metal/Bronze_Foil.mdl b/code/third_party/vMaterials_2/Metal/Bronze_Foil.mdl new file mode 100644 index 0000000000000000000000000000000000000000..be5c41c63d4357cf206a0b647ba6f00d2c0ebdff --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Bronze_Foil.mdl @@ -0,0 +1,509 @@ +/****************************************************************************** + * 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 metal foil material with optional smudges and crumples"; + +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 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); +} + +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)); +} + + +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 Bronze_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"), + ::anno::ui_order(0) + ]], + float copper_tint = 0.50f [[ + ::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(1) + ]], + float roughness = 0.125f [[ + ::anno::description("Higher values make blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::ui_order(2) + ]], + float roughness_variation = 0.14f [[ + ::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::in_group("Appearance"), + ::anno::ui_order(3) + ]], + float smudges = 0.88f [[ + ::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), + ::anno::ui_order(4) + ]], + uniform float bump_strength = 0.f [[ + ::anno::description("Specifies the strength of the bump."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::ui_order(5) + ]], + uniform float2 texture_translate = float2(0.f) [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform"), + ::anno::ui_order(6) + ]], + uniform float texture_rotate = 0.0f [[ + ::anno::description("Rotates angle of the texture in degrees."), + ::anno::display_name("Texture Rotate"), + ::anno::in_group("Transform"), + ::anno::ui_order(7) + ]], + uniform float2 texture_scale = float2(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("Chosses which textures space to use."), + ::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.0f [[ + ::anno::description("Radius of the rounded corners in millimeters."), + ::anno::display_name("Round Corner Radius (mm)"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(11) + ]], + uniform bool across_materials = false [[ + ::anno::description("."), + ::anno::display_name("Across Materials"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(12) + ]]) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Foil - Flat Smudged"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze_Foil.Bronze_Foil.png"), + // scratched, old, stained, crumpled, handled, worn, creative, smudged, bumped, matte, shiny + ::anno::key_words(string[]("metal", "bronze", "reflective", "shiny", "foil", "smooth", "old", "new", "smudged", "design", "warm")) +]] + = + let { + float copper_amount_remap = copper_tint / 1.5f; + bool tmp0 = false; + + texture_2d rough_ao_tex = texture_2d("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear); + texture_2d gradient_tex = texture_2d("./textures/bronze_gradients.png", ::tex::gamma_srgb); + texture_2d smudge_splotch_tex = texture_2d("./textures/foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear); + texture_2d norm_tex = texture_2d("./textures/foil_crumpled_norm.jpg", ::tex::gamma_linear); + + material_surface tmp1(::df::weighted_layer(0.0599999987f, ::df::microfacet_ggx_smith_bsdf(0.300000012f, 0.300000012f, gradient_lookup_smooth(gradient_tex, 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).x, copper_amount_remap), color(0.f, 0.f, 0.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::color_custom_curve_layer(gradient_lookup_smooth(gradient_tex, 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).x, copper_amount_remap), color(0.998699009f, 1.f, 1.f), 5.f, color(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).z, 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).x, 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).y - 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).x + 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).y) * (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).x, 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).y - 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).x + 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).y), (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).x, 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).y - 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).x + 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).y) * (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).x, 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).y - 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).x + 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).y), color(1.f, 1.f, 1.f), color(0.f, 0.f, 0.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()); + 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_Foil_Slightly_Wrinkled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Foil - Slightly Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze_Foil.Bronze_Foil_Slightly_Wrinkled.png"), + // scratched, old, stained, crumpled, handled, worn, creative, smudged, bumped, matte, shiny + ::anno::key_words(string[]("metal", "bronze", "reflective", "shiny", "foil", "smooth", "worn", "wrinkled", "design", "warm")) +]] = Bronze_Foil( + infinite_tiling: true, + copper_tint: 0.5f, + roughness: 0.15f, + roughness_variation:0.56f, + smudges: 0.35f, + bump_strength: 0.05f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.0f, + across_materials: false +); + +// 3 +export material Bronze_Foil_Shiny_Wrinkled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Foil - Shiny Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze_Foil.Bronze_Foil_Shiny_Wrinkled.png"), + // scratched, old, stained, crumpled, handled, worn, creative, smudged, bumped, matte, shiny + ::anno::key_words(string[]("metal", "bronze", "reflective", "foil", "smooth", "shiny", "worn", "stained", "wrinkled", "design", "warm")) +]] = Bronze_Foil( + infinite_tiling: true, + copper_tint: 0.5f, + roughness: 0.25f, + roughness_variation:0.25f, + smudges: 0.75f, + bump_strength: 0.25f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.0f, + across_materials: false +); + + +// 4 +export material Bronze_Foil_Matte_Wrinkled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Foil - Matte Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze_Foil.Bronze_Foil_Matte_Wrinkled.png"), + // scratched, old, stained, crumpled, handled, worn, creative, smudged, bumped, matte, shiny + ::anno::key_words(string[]("metal", "bronze", "reflective", "foil", "smooth", "matte", "worn", "stained", "wrinkled", "design", "warm")) +]] = Bronze_Foil( + infinite_tiling: true, + copper_tint: 0.5f, + roughness: 0.65f, + roughness_variation:1.0f, + smudges: 0.4f, + bump_strength: 0.5f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.0f, + across_materials: false +); + + +// 5 +export material Bronze_Foil_Heavy_Wrinkles(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Foil - Heavy Matte Wrinkles"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze_Foil.Bronze_Foil_Heavy_Wrinkles.png"), + // scratched, old, stained, crumpled, handled, worn, creative, smudged, bumped, matte, shiny + ::anno::key_words(string[]("metal", "bronze", "reflective", "foil", "smooth", "shiny", "worn", "stained", "wrinkled", "design", "warm")) +]] = Bronze_Foil( + infinite_tiling: true, + copper_tint: 0.5f, + roughness: 0.8f, + roughness_variation:0.0f, + smudges: 0.75f, + bump_strength: 0.99f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 1.0f, + across_materials: false +); + + + + + + + + + + + + + + + diff --git a/code/third_party/vMaterials_2/Metal/Bronze_Hammered.mdl b/code/third_party/vMaterials_2/Metal/Bronze_Hammered.mdl new file mode 100644 index 0000000000000000000000000000000000000000..2736a2d1dcb05ef2794e5f4370ce0b6f1e7ea08f --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/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 = float2(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 = float2(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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/bronze_gradients.png", ::tex::gamma_srgb), float3(::base::file_texture(texture_2d("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + + + + + + + + diff --git a/code/third_party/vMaterials_2/Metal/Bronze_Knurling.mdl b/code/third_party/vMaterials_2/Metal/Bronze_Knurling.mdl new file mode 100644 index 0000000000000000000000000000000000000000..4040674a01864128fb10d86fe6edcd245567a8f2 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/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 = float2(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 = float2(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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/bronze_gradients.png", ::tex::gamma_srgb), ::math::pow(float3(endless_texture(texture_2d("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + diff --git a/code/third_party/vMaterials_2/Metal/Bronze_Polished.mdl b/code/third_party/vMaterials_2/Metal/Bronze_Polished.mdl new file mode 100644 index 0000000000000000000000000000000000000000..be2dc8fb91b219a09af9977ebb6314d237e8afa6 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Bronze_Polished.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.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 polished bronze material with tweakable surface imperfections"; + +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 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 ; +} + +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)); +} + + + +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_Polished( + float polish_film_roughness = 0.06f [[ + ::anno::description("Low values make the polish layer appear shinier while higher values give it more cloudy."), + ::anno::display_name("Polish Film Roughness"), + ::anno::in_group("Appearance", "Polish"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(0) + ]], + float polish_film_strength = 1.f [[ + ::anno::description("The amount of of polish film visible on the metal surface."), + ::anno::display_name("Polish Film Weight"), + ::anno::in_group("Appearance", "Polish"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + 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(2) + ]], + float roughness = 0.04f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Metal Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float roughness_variation = 0.62f [[ + ::anno::description("Adds variation to the shininess of the metal."), + ::anno::display_name("Roughness Variation"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + float surface_dirt = 0.f [[ + ::anno::description("Adds a thin 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(5) + ]], + float bump_strength = 0.05f [[ + ::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(6) + ]], + uniform float2 texture_translate = float2(0.f) [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform"), + ::anno::ui_order(7) + ]], + 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(8) + ]], + uniform float2 texture_scale = float2(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 = true [[ + ::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("Advanced"), + ::anno::hard_range(0, 10), + ::anno::ui_order(13) + ]]) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Polished - Shiny Polish"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze_Polished.Bronze_Polished.png"), + ::anno::key_words(string[]("metal", "bronze", "reflective", "polished", "new", "smudged", "design", "yellow", "warm")) +]] + = + let { + float copper_amount_remap = copper_tint / 1.5f; + bool tmp0 = false; + material_surface tmp1(::df::weighted_layer(::math::max(float3(endless_texture(texture_2d("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).x * surface_dirt, ::math::min(surface_dirt, float3(endless_texture(texture_2d("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::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("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::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.219999999f, 1.f, 1.09000003f, ::math::pow(float3(endless_texture(texture_2d("./textures/polish_wipe.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.284000009f), 6.12999964f, false)).x, 0.25f) * (polish_film_strength * 0.25f + 0.0500000007f), ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(endless_texture(texture_2d("./textures/polish_wipe.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.284000009f), 6.12999964f, false)).x, 0.919999957f, polish_film_roughness * 0.349999994f), histogram_range(float3(endless_texture(texture_2d("./textures/polish_wipe.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.284000009f), 6.12999964f, false)).x, 0.919999957f, polish_film_roughness * 0.349999994f), color(0.638283014f, 0.638283014f, 0.638283014f), color(0.f, 0.f, 0.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::custom_curve_layer(0.f, 1.f, 5.35999966f, 1.f, ::df::weighted_layer(0.119999997f, ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::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.799999952f, roughness)) * histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::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.799999952f, roughness)), histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::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.799999952f, roughness)) * histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::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.799999952f, roughness)), 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(histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, ::math::lerp(0.0700000003f, 0.870000005f, roughness_variation), ::math::lerp(0.0399999991f, 0.50999999f, roughness)) * histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, ::math::lerp(0.0700000003f, 0.870000005f, roughness_variation), ::math::lerp(0.0399999991f, 0.50999999f, roughness)), histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, ::math::lerp(0.0700000003f, 0.870000005f, roughness_variation), ::math::lerp(0.0399999991f, 0.50999999f, roughness)) * histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, ::math::lerp(0.0700000003f, 0.870000005f, roughness_variation), ::math::lerp(0.0399999991f, 0.50999999f, roughness)), color(1.f, 1.f, 1.f), color(0.f, 0.f, 0.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), bsdf(), endless_normal(texture_2d("./textures/brass_normal.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.5f, 0.5f, 0.999000013f), 6.12999964f)), ::state::normal()), ::df::tint(gradient_lookup_smooth(texture_2d("./textures/bronze_gradients.png", ::tex::gamma_srgb), ::math::pow(float3(endless_texture(texture_2d("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::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.119999997f, ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::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.799999952f, roughness)) * histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::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.799999952f, roughness)), histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::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.799999952f, roughness)) * histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::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.799999952f, roughness)), 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(histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, ::math::lerp(0.0700000003f, 0.870000005f, roughness_variation), ::math::lerp(0.0399999991f, 0.50999999f, roughness)) * histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, ::math::lerp(0.0700000003f, 0.870000005f, roughness_variation), ::math::lerp(0.0399999991f, 0.50999999f, roughness)), histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, ::math::lerp(0.0700000003f, 0.870000005f, roughness_variation), ::math::lerp(0.0399999991f, 0.50999999f, roughness)) * histogram_range(float3(endless_texture(texture_2d("./textures/brass_multi_R_noise_G_scratches_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.523999989f, 0.112999998f, 0.591000021f), 6.12999964f, false)).z, ::math::lerp(0.0700000003f, 0.870000005f, roughness_variation), ::math::lerp(0.0399999991f, 0.50999999f, roughness)), color(1.f, 1.f, 1.f), color(0.f, 0.f, 0.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), bsdf(), endless_normal(texture_2d("./textures/brass_normal.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.5f, 0.5f, 0.999000013f), 6.12999964f)), ::state::normal())), ::state::normal()), add_detail_normal(endless_normal(texture_2d("./textures/polish_norm.jpg", ::tex::gamma_linear), 0.600000024f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.5f, 0.5f, 0.999000013f), 6.12999964f), endless_normal(texture_2d("./textures/brass_normal.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.5f, 0.5f, 0.999000013f), 6.12999964f))), endless_normal(texture_2d("./textures/brass_normal.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.5f, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.5f, 0.5f, 0.999000013f), 6.12999964f)), 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_Polished_Matte_Polish(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Polished - Matte Polish"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze_Polished.Bronze_Polished_Matte_Polish.png"), + ::anno::key_words(string[]("metal", "bronze", "reflective", "polished", "new", "smudged", "design", "yellow", "warm")) +]] = Bronze_Polished +( + polish_film_roughness: 0.15f, + polish_film_strength: 1.0f, + copper_tint: 0.5f, + roughness: 0.04f, + roughness_variation: 0.47f, + surface_dirt: 0.0f, + bump_strength: 0.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 3 +export material Bronze_Polished_Cloudy_Polish(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Polished - Cloudy Polish"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze_Polished.Bronze_Polished_Cloudy_Polish.png"), + ::anno::key_words(string[]("metal", "bronze", "reflective", "polished", "cloudy", "new", "smudged", "design", "yellow", "warm")) +]] = Bronze_Polished +( + polish_film_roughness: 0.85f, + polish_film_strength: 1.0f, + copper_tint: 0.5f, + roughness: 0.04f, + roughness_variation: 0.48f, + surface_dirt: 0.31f, + bump_strength: 0.05f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +//4 +export material Bronze_Polished_Shiny_Worn(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Polished - Shiny Worn"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze_Polished.Bronze_Polished_Shiny_Worn.png"), + ::anno::key_words(string[]("metal", "bronze", "reflective", "polished", "old", "worn", "handled", "stained", "dirty", "bumped", "smudged", "design", "yellow", "warm")) +]] = Bronze_Polished +( + polish_film_roughness: 0.5f, + polish_film_strength: 1.0f, + copper_tint: 0.5f, + roughness: 0.04f, + roughness_variation: 0.69f, + surface_dirt: 0.95f, + bump_strength: 0.44f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + diff --git a/code/third_party/vMaterials_2/Metal/Bronze_Scratched.mdl b/code/third_party/vMaterials_2/Metal/Bronze_Scratched.mdl new file mode 100644 index 0000000000000000000000000000000000000000..2321f7f75e7952f9cadd1dec5474e6a0f22d3487 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Bronze_Scratched.mdl @@ -0,0 +1,511 @@ +/****************************************************************************** + * 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 scratched bronze material with controls to add wear and dirt. Use the " + "'Copper Tint' parameter to fade from a yellowish (0.0) to a reddish (1.0) 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); +} + +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 Bronze_Scratched( + 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 roughness = 0.15f [[ + ::anno::description("Adjusts the roughness of the material."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float surface_dirt_amount = 0.0f [[ + ::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 bump_strength = 0.f [[ + ::anno::description("Specifies the strength of the bump."), + ::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(3) + ]], + float rough_scratches_roughness = 0.3f [[ + ::anno::description("Increasing this value will increase the roughness of the scratches. The roughness will be calculated relative to the the overall roughness of the metal."), + ::anno::display_name("Rough Scratches Roughness"), + ::anno::in_group("Appearance", "Scratches Rough"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + float rough_scratches_attenuation = 0.97f [[ + ::anno::description("Increase this value to darken the appearance of rough scratches to give them a dirty, old look."), + ::anno::display_name("Rough Scratches Attenuation"), + ::anno::in_group("Appearance", "Scratches Rough"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(5) + ]], + float shiny_scratches_roughness = 0.f [[ + ::anno::description("Increasing this value will increase the shininess of scratches. The shininess will be calculated relative to the the overall roughness of the metal."), + ::anno::display_name("Shiny Scratches Shininess"), + ::anno::in_group("Appearance", "Scratches Shiny"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(6) + ]], + float shiny_scratches_brightness = 0.f [[ + ::anno::description("Increase this value to brighten the appearance of shiny scratches to make them appear more fresh."), + ::anno::display_name("Shiny Scratches Brightness"), + ::anno::in_group("Appearance", "Scratches Shiny"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(7) + ]], + uniform float2 texture_translate = float2(0.f) [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform"), + ::anno::ui_order(8) + ]], + 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(9) + ]], + uniform float2 texture_scale = float2(0.5f) [[ + ::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(10) + ]], + 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(11) + ]], + 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(12) + ]], + 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(13) + ]], + 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(14) + ]]) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Scratched - Polished Subtle Dark Scratches"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze_Scratched.Bronze_Scratched.png"), + ::anno::key_words(string[]("metal", "bronze", "scratched", "reflective", "design", "sanitary", "old", "worn", "polished", "shiny", "smooth", "yellow", "warm")) +]] + = + let { + float copper_amount_remap = copper_tint / 1.5f; + bool tmp0 = false; + material_surface tmp1(::df::weighted_layer(float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).x * histogram_scan_big((1.f - float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).y) * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).z + float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 1.f, surface_dirt_amount * 0.579999983f), ::df::custom_curve_layer(0.f, 1.f, 5.35999966f, 1.f, ::df::weighted_layer(0.219999999f, ::df::microfacet_ggx_smith_bsdf((histogram_range(float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 0.170000002f, ::math::lerp(0.399999976f, 0.799999952f, roughness)) + surface_dirt_amount * 0.579999983f * (1.f - histogram_scan_big(histogram_scan_big((1.f - float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).y) * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).z + float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 1.f, surface_dirt_amount * 0.579999983f), 0.289999992f, 0.479999989f))) * (histogram_range(float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 0.170000002f, ::math::lerp(0.399999976f, 0.799999952f, roughness)) + surface_dirt_amount * 0.579999983f * (1.f - histogram_scan_big(histogram_scan_big((1.f - float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).y) * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).z + float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 1.f, surface_dirt_amount * 0.579999983f), 0.289999992f, 0.479999989f))), (histogram_range(float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 0.170000002f, ::math::lerp(0.399999976f, 0.799999952f, roughness)) + surface_dirt_amount * 0.579999983f * (1.f - histogram_scan_big(histogram_scan_big((1.f - float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).y) * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).z + float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 1.f, surface_dirt_amount * 0.579999983f), 0.289999992f, 0.479999989f))) * (histogram_range(float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 0.170000002f, ::math::lerp(0.399999976f, 0.799999952f, roughness)) + surface_dirt_amount * 0.579999983f * (1.f - histogram_scan_big(histogram_scan_big((1.f - float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).y) * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).z + float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 1.f, surface_dirt_amount * 0.579999983f), 0.289999992f, 0.479999989f))), 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(::math::clamp(histogram_range(float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, ::math::lerp(0.0700000003f, 0.75999999f, roughness), ::math::lerp(0.0399999991f, 0.349999994f, roughness)) + rough_scratches_roughness * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).y - float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).x * shiny_scratches_roughness + surface_dirt_amount * 0.579999983f * (1.f - histogram_scan_big(histogram_scan_big((1.f - float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).y) * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).z + float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 1.f, surface_dirt_amount * 0.579999983f), 0.289999992f, 0.479999989f)), 0.f, 1.f) * ::math::clamp(histogram_range(float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, ::math::lerp(0.0700000003f, 0.75999999f, roughness), ::math::lerp(0.0399999991f, 0.349999994f, roughness)) + rough_scratches_roughness * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).y - float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).x * shiny_scratches_roughness + surface_dirt_amount * 0.579999983f * (1.f - histogram_scan_big(histogram_scan_big((1.f - float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).y) * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).z + float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 1.f, surface_dirt_amount * 0.579999983f), 0.289999992f, 0.479999989f)), 0.f, 1.f), ::math::clamp(histogram_range(float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, ::math::lerp(0.0700000003f, 0.75999999f, roughness), ::math::lerp(0.0399999991f, 0.349999994f, roughness)) + rough_scratches_roughness * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).y - float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).x * shiny_scratches_roughness + surface_dirt_amount * 0.579999983f * (1.f - histogram_scan_big(histogram_scan_big((1.f - float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).y) * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).z + float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 1.f, surface_dirt_amount * 0.579999983f), 0.289999992f, 0.479999989f)), 0.f, 1.f) * ::math::clamp(histogram_range(float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, ::math::lerp(0.0700000003f, 0.75999999f, roughness), ::math::lerp(0.0399999991f, 0.349999994f, roughness)) + rough_scratches_roughness * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).y - float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).x * shiny_scratches_roughness + surface_dirt_amount * 0.579999983f * (1.f - histogram_scan_big(histogram_scan_big((1.f - float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).y) * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).z + float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 1.f, surface_dirt_amount * 0.579999983f), 0.289999992f, 0.479999989f)), 0.f, 1.f), color(1.f, 1.f, 1.f), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), bsdf(), endless_normal(texture_2d("./textures/scratched_normal.jpg", ::tex::gamma_linear), bump_strength, false, false, ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.5f, 0.5f, 1.f), 3.18999982f)), endless_normal(texture_2d("./textures/scratched_normal.jpg", ::tex::gamma_linear), bump_strength, false, false, ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.5f, 0.5f, 1.f), 3.18999982f)), ::df::tint(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(gradient_lookup_smooth(texture_2d("./textures/bronze_gradients.png", ::tex::gamma_srgb), ::math::pow(float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 0.179999992f), copper_amount_remap), color(1.f - float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).y), ::base::color_layer_multiply, rough_scratches_attenuation).tint, nvidia::core_definitions::blend_colors(gradient_lookup_smooth(texture_2d("./textures/bronze_gradients.png", ::tex::gamma_srgb), ::math::pow(float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 0.179999992f), copper_amount_remap), color(0.655930996f, 0.655930996f, 0.655930996f), ::base::color_layer_screen, shiny_scratches_brightness).tint, ::base::color_layer_blend, float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).x).tint, ::df::weighted_layer(0.219999999f, ::df::microfacet_ggx_smith_bsdf((histogram_range(float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 0.170000002f, ::math::lerp(0.399999976f, 0.799999952f, roughness)) + surface_dirt_amount * 0.579999983f * (1.f - histogram_scan_big(histogram_scan_big((1.f - float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).y) * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).z + float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 1.f, surface_dirt_amount * 0.579999983f), 0.289999992f, 0.479999989f))) * (histogram_range(float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 0.170000002f, ::math::lerp(0.399999976f, 0.799999952f, roughness)) + surface_dirt_amount * 0.579999983f * (1.f - histogram_scan_big(histogram_scan_big((1.f - float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).y) * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).z + float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 1.f, surface_dirt_amount * 0.579999983f), 0.289999992f, 0.479999989f))), (histogram_range(float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 0.170000002f, ::math::lerp(0.399999976f, 0.799999952f, roughness)) + surface_dirt_amount * 0.579999983f * (1.f - histogram_scan_big(histogram_scan_big((1.f - float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).y) * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).z + float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 1.f, surface_dirt_amount * 0.579999983f), 0.289999992f, 0.479999989f))) * (histogram_range(float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 0.170000002f, ::math::lerp(0.399999976f, 0.799999952f, roughness)) + surface_dirt_amount * 0.579999983f * (1.f - histogram_scan_big(histogram_scan_big((1.f - float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).y) * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).z + float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 1.f, surface_dirt_amount * 0.579999983f), 0.289999992f, 0.479999989f))), 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(::math::clamp(histogram_range(float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, ::math::lerp(0.0700000003f, 0.75999999f, roughness), ::math::lerp(0.0399999991f, 0.349999994f, roughness)) + rough_scratches_roughness * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).y - float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).x * shiny_scratches_roughness + surface_dirt_amount * 0.579999983f * (1.f - histogram_scan_big(histogram_scan_big((1.f - float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).y) * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).z + float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 1.f, surface_dirt_amount * 0.579999983f), 0.289999992f, 0.479999989f)), 0.f, 1.f) * ::math::clamp(histogram_range(float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, ::math::lerp(0.0700000003f, 0.75999999f, roughness), ::math::lerp(0.0399999991f, 0.349999994f, roughness)) + rough_scratches_roughness * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).y - float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).x * shiny_scratches_roughness + surface_dirt_amount * 0.579999983f * (1.f - histogram_scan_big(histogram_scan_big((1.f - float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).y) * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).z + float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 1.f, surface_dirt_amount * 0.579999983f), 0.289999992f, 0.479999989f)), 0.f, 1.f), ::math::clamp(histogram_range(float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, ::math::lerp(0.0700000003f, 0.75999999f, roughness), ::math::lerp(0.0399999991f, 0.349999994f, roughness)) + rough_scratches_roughness * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).y - float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).x * shiny_scratches_roughness + surface_dirt_amount * 0.579999983f * (1.f - histogram_scan_big(histogram_scan_big((1.f - float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).y) * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).z + float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 1.f, surface_dirt_amount * 0.579999983f), 0.289999992f, 0.479999989f)), 0.f, 1.f) * ::math::clamp(histogram_range(float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, ::math::lerp(0.0700000003f, 0.75999999f, roughness), ::math::lerp(0.0399999991f, 0.349999994f, roughness)) + rough_scratches_roughness * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).y - float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).x * shiny_scratches_roughness + surface_dirt_amount * 0.579999983f * (1.f - histogram_scan_big(histogram_scan_big((1.f - float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).y) * float3(endless_texture(texture_2d("./textures/scratched_multi_R_scratchA_G_scratchB_B_ABblur.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.0869999975f, 0.0979999974f, 0.247999996f), 3.18999982f, false)).z + float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z, 1.f, surface_dirt_amount * 0.579999983f), 0.289999992f, 0.479999989f)), 0.f, 1.f), color(1.f, 1.f, 1.f), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), bsdf(), endless_normal(texture_2d("./textures/scratched_normal.jpg", ::tex::gamma_linear), bump_strength, false, false, ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.5f, 0.5f, 1.f), 3.18999982f)), endless_normal(texture_2d("./textures/scratched_normal.jpg", ::tex::gamma_linear), bump_strength, false, false, ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.5f, 0.5f, 1.f), 3.18999982f))), ::state::normal()), ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(color(0.00489600003f, 0.00409199996f, 0.00365399988f), color(0.0196070001f, 0.015904f, 0.012565f), ::base::color_layer_blend, float3(endless_texture(texture_2d("./textures/scratched_multi_R_dents_G_crust_B_rough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 6.08999968f, float3(0.930999994f, 0.505999982f, 0.442999989f), 3.18999982f, false)).z).tint, 0.f), endless_normal(texture_2d("./textures/scratched_normal.jpg", ::tex::gamma_linear), bump_strength, false, false, ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 6.08999968f, float3(0.5f, 0.5f, 1.f), 3.18999982f)), 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 +); + +// 2 +export material Bronze_Scratched_Yellow_Subtle_Worn_Scratches(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Scratched - Subtle Worn Scratches"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze_Scratched.Bronze_Scratched_Yellow_Subtle_Worn_Scratches.png"), + ::anno::key_words(string[]("metal", "bronze", "scratched", "reflective", "design", "sanitary", "old", "worn", "shiny", "yellow", "warm")) +]] = Bronze_Scratched( + copper_tint: 0.5f, + roughness: 0.22f, + surface_dirt_amount: 0.78f, + bump_strength: 0.29f, + rough_scratches_roughness: 0.3f, + rough_scratches_attenuation: 1.0f, + shiny_scratches_roughness: 0.0f, + shiny_scratches_brightness: 0.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 3 +export material Bronze_Scratched_Yellow_Medium_Glossy_Scratches(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Scratched - Medium Glossy Scratches"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze_Scratched.Bronze_Scratched_Yellow_Medium_Glossy_Scratches.png"), + ::anno::key_words(string[]("metal", "bronze", "scratched", "reflective", "design", "sanitary", "old", "worn", "shiny", "rough", "yellow", "warm")) +]] = Bronze_Scratched( + copper_tint: 0.5f, + roughness: 0.44f, + surface_dirt_amount: 0.6f, + bump_strength: 0.63f, + rough_scratches_roughness: 0.2f, + rough_scratches_attenuation: 0.96f, + shiny_scratches_roughness: 1.0f, + shiny_scratches_brightness: 0.94f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 4 +export material Bronze_Scratched_Yellow_Medium_Glossy_Deep_Scratches(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Scratched - Medium Glossy Deep Scratches"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze_Scratched.Bronze_Scratched_Yellow_Medium_Glossy_Deep_Scratches.png"), + ::anno::key_words(string[]("metal", "bronze", "scratched", "reflective", "design", "sanitary", "old", "worn", "shiny", "rough", "yellow", "warm")) +]] = Bronze_Scratched( + copper_tint: 0.5f, + roughness: 0.44f, + surface_dirt_amount: 0.6f, + bump_strength: 1.5f, + rough_scratches_roughness: 0.2f, + rough_scratches_attenuation: 0.96f, + shiny_scratches_roughness: 1.0f, + shiny_scratches_brightness: 0.94f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 5 +export material Bronze_Scratched_Yellow_Heavy_Worn_Scratches(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Scratched - Heavy Worn Scratches"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze_Scratched.Bronze_Scratched_Yellow_Heavy_Worn_Scratches.png"), + ::anno::key_words(string[]("metal", "bronze", "scratched", "reflective", "design", "sanitary", "old", "worn", "shiny", "rough", "yellow", "warm")) +]] = Bronze_Scratched( + copper_tint: 0.5f, + roughness: 0.64f, + surface_dirt_amount: 0.91f, + bump_strength: 1.5f, + rough_scratches_roughness: 0.89f, + rough_scratches_attenuation: 0.96f, + shiny_scratches_roughness: 1.0f, + shiny_scratches_brightness: 0.94f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 1.0, + roundcorners_across_materials: false, + uv_space_index: 0 +); + diff --git a/code/third_party/vMaterials_2/Metal/Bronze_Sheet.mdl b/code/third_party/vMaterials_2/Metal/Bronze_Sheet.mdl new file mode 100644 index 0000000000000000000000000000000000000000..d3a9705d11e2640b584d8cfe8de05d1879e6068e --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Bronze_Sheet.mdl @@ -0,0 +1,503 @@ +/****************************************************************************** + * 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 sheet metal material with tweaks to add surface imperfections"; + + + +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); +} + + +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 + )); +} + + +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)); +} + +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); +} + +export material Bronze_Sheet( + 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", "Infinite Tiing"), + ::anno::ui_order(0) + ]], + 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", "Main"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float sheet_brightness = 1.f [[ + ::anno::description("Adjusts the brightness of the reflection."), + ::anno::display_name("Brightness"), + ::anno::in_group("Appearance", "Main"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float roughness = 0.479999989f [[ + ::anno::description("Higher values lead to blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance", "Main"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float streaks = 0.979999959f [[ + ::anno::description("Reveals streaks from the manufacturing process."), + ::anno::display_name("Streaks Weight"), + ::anno::in_group("Appearance", "Main"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + uniform float scratch_bump_factor = 0.995000064f [[ + ::anno::description("Determines the degree of bumpiness."), + ::anno::display_name("Bump Factor Streaks"), + ::anno::in_group("Appearance", "Main"), + ::anno::ui_order(5) + ]], + float imperfections_amount = 1.f [[ + ::anno::description("Balances between a perfectly smooth metal and."), + ::anno::display_name("Imperfections Amount"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(6) + ]], + uniform float impurities_weight_1 = 0.709999979f [[ + ::anno::description("Adds impurities which have an influence on the reflection."), + ::anno::display_name("Directional Washed Ratio"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(7) + ]], + uniform float impurities_weight_2 = 0.969999969f [[ + ::anno::description("Adds impurities which have an influence on the reflection."), + ::anno::display_name("Noisy Ratio"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(8) + ]], + uniform float impurities_weight_3 = 0.529999971f [[ + ::anno::description("Adds impurities which have an influence on the reflection."), + ::anno::display_name("Soft Splotches Ratio"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(9) + ]], + uniform float2 texture_translate = float2(0.f) [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform"), + ::anno::ui_order(10) + ]], + 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::ui_order(11) + ]], + uniform float2 texture_scale = float2(0.5f) [[ + ::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(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) + ]], + 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(14) + ]], + 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(15) + ]], + 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(16) + ]]) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Sheet Yellow - New Clean"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze_Sheet.Bronze_Sheet.png"), + ::anno::key_words(string[]("metal", "bronze", "reflective", "new", "smooth", "shiny", "sheet", "sanitary", "construction", "design", "yellow", "warm")) +]] + = + let { + float copper_amount_remap = copper_tint / 1.5f; + bool tmp0 = false; + material_surface tmp1(::df::color_custom_curve_layer(gradient_lookup_smooth(texture_2d("./textures/bronze_gradients.png", ::tex::gamma_srgb), 0.5f, copper_amount_remap), color(0.998699009f, 1.f, 1.f), 5.f, color(::math::lerp(0.400000006f, 1.f, sheet_brightness) * ::math::lerp(1.f, ::math::pow(float3(::base::file_texture(texture_2d("./textures/sheet_metal_R_rough_G_ao_B_streaks.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 2.20000005f), ::math::lerp(0.f, 0.300000012f, streaks))), ::df::weighted_layer(0.0700000003f, ::df::microfacet_ggx_smith_bsdf(0.150000006f, 0.150000006f, gradient_lookup_smooth(texture_2d("./textures/bronze_gradients.png", ::tex::gamma_srgb), 0.5f, copper_amount_remap), gradient_lookup_smooth(texture_2d("./textures/bronze_gradients.png", ::tex::gamma_srgb), 0.5f, copper_amount_remap), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::microfacet_ggx_smith_bsdf((::math::lerp(roughness * 0.5f, (impurities_weight_1 + impurities_weight_2 + impurities_weight_3 > 0.f ? impurities_weight_1 / (impurities_weight_1 + impurities_weight_2 + impurities_weight_3) : 0.333299994f) * roughness * float3(infinite_tiling ? endless_texture(texture_2d("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/sheet_metal_R_rough_G_ao_B_streaks.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] - 0.5f) * (streaks * 0.5f * 0.5f)), color(1.f, 1.f, 1.f), color(0.577580988f, 0.577580988f, 0.577580988f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::math::normalize(::math::lerp(::state::normal(), ::base::tangent_space_normal_texture(texture_2d("./textures/sheet_metal_norm.jpg", ::tex::gamma_linear), scratch_bump_factor, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f), histogram_scan_big(float3(::base::file_texture(texture_2d("./textures/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("./textures/sheet_metal_norm.jpg", ::tex::gamma_linear), scratch_bump_factor, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f), histogram_scan_big(float3(::base::file_texture(texture_2d("./textures/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(roundcorners_radius_mm * 0.00100000005f, 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_Sheet_Soft_Splotches(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Sheet Yellow - Soft Splotches"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze_Sheet.Bronze_Sheet_Soft_Splotches.png"), + // scratched, + ::anno::key_words(string[]("metal", "bronze", "reflective", "polished", "new", "sheet", "sanitary", "construction", "scratched", "design", "yellow", "warm")) +]] = Bronze_Sheet( + infinite_tiling: true, + copper_tint: 0.5f, + sheet_brightness: 0.5f, + roughness: 0.3f, + streaks: 0.0f, + scratch_bump_factor: 0.25f, + imperfections_amount: 0.75f, + impurities_weight_1: 0.75f, + impurities_weight_2: 0.01f, + impurities_weight_3: 0.98f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + roundcorners_radius_mm: 1.0f, + across_materials: false, + uv_space_index: 0 +); + +// 3 +export material Bronze_Sheet_Glossy_Imperfections(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Sheet Yellow - Glossy Imperfections"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze_Sheet.Bronze_Sheet_Glossy_Imperfections.png"), + // scratched, + ::anno::key_words(string[]("metal", "bronze", "reflective", "polished", "new", "sheet", "sanitary", "construction", "design", "yellow", "warm")) +]] = Bronze_Sheet( + infinite_tiling: true, + copper_tint: 0.5f, + sheet_brightness: 0.85f, + roughness: 0.4f, + 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, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + roundcorners_radius_mm: 1.0f, + across_materials: false, + uv_space_index: 0 +); + + +//4 +export material Bronze_Sheet_Splotchy_Streaks(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Sheet Yellow - Splotchy Streaks"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze_Sheet.Bronze_Sheet_Splotchy_Streaks.png"), + // scratched, + ::anno::key_words(string[]("metal", "bronze", "reflective", "new", "sheet", "matte", "sanitary", "construction", "design", "yellow", "warm")) +]] = Bronze_Sheet( + infinite_tiling: true, + copper_tint: 0.5f, + sheet_brightness: 0.85f, + roughness: 0.55f, + 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, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + roundcorners_radius_mm: 1.0f, + across_materials: false, + uv_space_index: 0 +); + + +// 5 +export material Bronze_Sheet_Matte_Imperfections(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Sheet Yellow - Matte Imperfections"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze_Sheet.Bronze_Sheet_Matte_Imperfections.png"), + // scratched, + ::anno::key_words(string[]("metal", "bronze", "reflective", "matte", "new", "sheet", "sanitary", "construction", "design", "yellow", "warm")) +]] = Bronze_Sheet( + infinite_tiling: true, + copper_tint: 0.5f, + 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, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + roundcorners_radius_mm: 1.0f, + across_materials: false, + uv_space_index: 0 +); + + + + + + + + + diff --git a/code/third_party/vMaterials_2/Metal/Bronze_Sheet_Punched.mdl b/code/third_party/vMaterials_2/Metal/Bronze_Sheet_Punched.mdl new file mode 100644 index 0000000000000000000000000000000000000000..ca6f93c4aed14d1942880580bedf403a6e983562 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Bronze_Sheet_Punched.mdl @@ -0,0 +1,1267 @@ +/****************************************************************************** + * 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 sheet metal material with tweaks to add surface imperfections"; + + +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) + float2(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 +) +{ + // if (horizontal_offset) + // { + // uv.uv = float2( uv.uv.x + ::math::floor(uv.uv.y) * offset, uv.uv.y); + // } + // else + // { + // uv.uv = float2(uv.uv.x, uv.uv.y + ::math::floor(uv.uv.x) * offset); + // } + + // Workaround + 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")]] +}; + + + +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); +} + + +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 + )); +} + + +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)); +} + +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); +} + +export material Bronze_Sheet_Punched( + 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", "Infinite Tiing"), + ::anno::ui_order(0) + ]], + 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", "Main"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float sheet_brightness = .85f [[ + ::anno::description("Adjusts the brightness of the reflection."), + ::anno::display_name("Brightness"), + ::anno::in_group("Appearance", "Main"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float roughness = 0.5f [[ + ::anno::description("Higher values lead to blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance", "Main"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float streaks = 0.05f [[ + ::anno::description("Reveals streaks from the manufacturing process."), + ::anno::display_name("Streaks Weight"), + ::anno::in_group("Appearance", "Main"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + uniform float scratch_bump_factor = 0.05f [[ + ::anno::description("Determines the degree of bumpiness."), + ::anno::display_name("Bump Factor Streaks"), + ::anno::in_group("Appearance", "Main"), + ::anno::ui_order(5) + ]], + float imperfections_amount = .265f [[ + ::anno::description("Balances between a perfectly smooth metal and one that shows imperfections."), + ::anno::display_name("Imperfections Amount"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(6) + ]], + uniform float impurities_weight_1 = 0.75f [[ + ::anno::description("Adds impurities which have an influence on the reflection."), + ::anno::display_name("Directional Washed Ratio"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(7) + ]], + uniform float impurities_weight_2 = 0.43f [[ + ::anno::description("Adds impurities which have an influence on the reflection."), + ::anno::display_name("Noisy Ratio"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(8) + ]], + uniform float impurities_weight_3 = 0.1f [[ + ::anno::description("Adds impurities which have an influence on the reflection."), + ::anno::display_name("Soft Splotches Ratio"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(9) + ]], + uniform float2 texture_translate = float2(0.f) [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform"), + ::anno::ui_order(10) + ]], + 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::ui_order(11) + ]], + uniform float2 texture_scale = float2(1.0f) [[ + ::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(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) + ]], + 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(14) + ]], + 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(15) + ]], + 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(16) + ]]) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Sheet - Template"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::hidden(), + ::anno::thumbnail("./.thumbs/Bronze_Sheet_Punched.Bronze_Sheet_Punched.png"), + ::anno::key_words(string[]("metal", "bronze", "decorative", "reflective", "new", "smooth", "shiny", "sheet", "sanitary", "construction", "design", "yellow", "warm")) +]] + = + let { + float copper_amount_remap = copper_tint / 1.5f; + bool tmp0 = false; + material_surface tmp1(::df::color_custom_curve_layer(gradient_lookup_smooth(texture_2d("./textures/bronze_gradients.png", ::tex::gamma_srgb), 0.5f, copper_amount_remap), color(0.998699009f, 1.f, 1.f), 5.f, color(::math::lerp(0.400000006f, 1.f, sheet_brightness) * ::math::lerp(1.f, ::math::pow(float3(::base::file_texture(texture_2d("./textures/sheet_metal_R_rough_G_ao_B_streaks.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 2.20000005f), ::math::lerp(0.f, 0.300000012f, streaks))), ::df::weighted_layer(0.0700000003f, ::df::microfacet_ggx_smith_bsdf(0.150000006f, 0.150000006f, gradient_lookup_smooth(texture_2d("./textures/bronze_gradients.png", ::tex::gamma_srgb), 0.5f, copper_amount_remap), gradient_lookup_smooth(texture_2d("./textures/bronze_gradients.png", ::tex::gamma_srgb), 0.5f, copper_amount_remap), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::microfacet_ggx_smith_bsdf((::math::lerp(roughness * 0.5f, (impurities_weight_1 + impurities_weight_2 + impurities_weight_3 > 0.f ? impurities_weight_1 / (impurities_weight_1 + impurities_weight_2 + impurities_weight_3) : 0.333299994f) * roughness * float3(infinite_tiling ? endless_texture(texture_2d("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/sheet_metal_R_rough_G_ao_B_streaks.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] - 0.5f) * (streaks * 0.5f * 0.5f)), color(1.f, 1.f, 1.f), color(0.577580988f, 0.577580988f, 0.577580988f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::math::normalize(::math::lerp(::state::normal(), ::base::tangent_space_normal_texture(texture_2d("./textures/sheet_metal_norm.jpg", ::tex::gamma_linear), scratch_bump_factor, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f), histogram_scan_big(float3(::base::file_texture(texture_2d("./textures/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("./textures/sheet_metal_norm.jpg", ::tex::gamma_linear), scratch_bump_factor, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f), histogram_scan_big(float3(::base::file_texture(texture_2d("./textures/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(roundcorners_radius_mm * 0.00100000005f, 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 Bronze_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 = float2(.5f, .5f) + [[ + ::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) + ]], + + + +// Bronze 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", "Infinite Tiing"), + ::anno::ui_order(9) + ]], + 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", "Main"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(10) + ]], + float sheet_brightness = .85f [[ + ::anno::description("Adjusts the brightness of the reflection."), + ::anno::display_name("Brightness"), + ::anno::in_group("Appearance", "Main"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(11) + ]], + float roughness = 0.5f [[ + ::anno::description("Higher values lead to blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance", "Main"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(12) + ]], + float streaks = 0.05f [[ + ::anno::description("Reveals streaks from the manufacturing process."), + ::anno::display_name("Streaks Weight"), + ::anno::in_group("Appearance", "Main"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(13) + ]], + uniform float scratch_bump_factor = 0.05f [[ + ::anno::description("Determines the degree of bumpiness."), + ::anno::display_name("Bump Factor Streaks"), + ::anno::in_group("Appearance", "Main"), + ::anno::ui_order(14) + ]], + float imperfections_amount = 0.265f [[ + ::anno::description("Balances between a perfectly smooth metal and one that shows imperfections."), + ::anno::display_name("Imperfections Amount"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(15) + ]], + uniform float impurities_weight_1 = 0.75f [[ + ::anno::description("Adds impurities which have an influence on the reflection."), + ::anno::display_name("Directional Washed Ratio"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(16) + ]], + uniform float impurities_weight_2 = 0.43f [[ + ::anno::description("Adds impurities which have an influence on the reflection."), + ::anno::display_name("Noisy Ratio"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(17) + ]], + uniform float impurities_weight_3 = 0.0f [[ + ::anno::description("Adds impurities which have an influence on the reflection."), + ::anno::display_name("Soft Splotches Ratio"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(18) + ]], + uniform float2 texture_translate = float2(0.f) [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform"), + ::anno::ui_order(19) + ]], + 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::ui_order(20) + ]], + uniform float2 texture_scale = float2(1.0f) [[ + ::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(21) + ]], + 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(22) + ]], + 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(23) + ]], + 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(24) + ]], + 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(25) + ]] + +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Sheet - Circular Punch"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze_Sheet_Punched.Bronze_Sheet_Punched_.png"), + ::anno::key_words(string[]("metal", "bronze", "decorative", "reflective", "new", "smooth", "shiny", "sheet", "sanitary", "construction", "design", "architecture", "yellow", "punched", "punching", "circular", "warm")) +]] = let +{ + material base_mat = Bronze_Sheet_Punched( + infinite_tiling: infinite_tiling, + copper_tint: copper_tint, + 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, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + enable_round_corners: enable_round_corners, + roundcorners_radius_mm: roundcorners_radius_mm, + across_materials: across_materials + ); + texture_2d punching_cutout = texture_2d("./textures/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 + ) +); + +export material Bronze_Sheet_Punched_Small_Circular(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Sheet - Small Circular Punch"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze_Sheet_Punched.Bronze_Sheet_Punched_Small_Circular.png"), + ::anno::key_words(string[]("metal", "bronze", "decorative", "reflective", "new", "smooth", "shiny", "sheet", "sanitary", "construction", "design", "architecture", "yellow", "punched", "punching", "circular", "warm")) +]] = Bronze_Sheet_Punched_ +( + // Punching parameters + shape_select: pattern_circle, + punching_grid_size: float2(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, + + // Bronze Sheet Parameters + infinite_tiling: true, + copper_tint: 0.5f, + sheet_brightness: 0.85f, + roughness: 0.5f, + streaks: 0.05f, + scratch_bump_factor: 0.05f, + imperfections_amount: 0.265f, + impurities_weight_1: 0.75f, + impurities_weight_2: 0.43f, + impurities_weight_3: 0.00f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + roundcorners_radius_mm: 1.0f, + across_materials: false, + uv_space_index: 0 +); + + +export material Bronze_Sheet_Punched_Hexagonal(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Sheet - Hexagonal Punch"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze_Sheet_Punched.Bronze_Sheet_Punched_Hexagonal.png"), + ::anno::key_words(string[]("metal", "bronze", "decorative", "reflective", "new", "smooth", "shiny", "sheet", "sanitary", "construction", "design", "architecture", "yellow", "punched", "punching", "hexagonal", "warm")) +]] = Bronze_Sheet_Punched_ +( + // Punching parameters + shape_select: pattern_hexagon, + punching_grid_size: float2(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, + + // Bronze Sheet Parameters + infinite_tiling: true, + copper_tint: 0.5f, + sheet_brightness: 0.85f, + roughness: 0.5f, + streaks: 0.05f, + scratch_bump_factor: 0.05f, + imperfections_amount: 0.265f, + impurities_weight_1: 0.75f, + impurities_weight_2: 0.43f, + impurities_weight_3: 0.00f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + roundcorners_radius_mm: 1.0f, + across_materials: false, + uv_space_index: 0 +); + + +export material Bronze_Sheet_Punched_Hexagonal_Small(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Sheet - Small Hexagonal Punch"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze_Sheet_Punched.Bronze_Sheet_Punched_Hexagonal_Small.png"), + ::anno::key_words(string[]("metal", "bronze", "decorative", "reflective", "new", "smooth", "shiny", "sheet", "sanitary", "construction", "design", "architecture", "yellow", "punched", "punching", "hexagonal", "warm")) +]] = Bronze_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, + + // Bronze Sheet Parameters + infinite_tiling: true, + copper_tint: 0.5f, + sheet_brightness: 0.85f, + roughness: 0.5f, + streaks: 0.05f, + scratch_bump_factor: 0.05f, + imperfections_amount: 0.265f, + impurities_weight_1: 0.75f, + impurities_weight_2: 0.43f, + impurities_weight_3: 0.00f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + roundcorners_radius_mm: 1.0f, + across_materials: false, + uv_space_index: 0 +); + +export material Bronze_Sheet_Punched_Square(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Sheet - Square Punch"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze_Sheet_Punched.Bronze_Sheet_Punched_Square.png"), + ::anno::key_words(string[]("metal", "bronze", "decorative", "reflective", "new", "smooth", "shiny", "sheet", "sanitary", "construction", "design", "architecture", "yellow", "punched", "punching", "square", "warm")) +]] = Bronze_Sheet_Punched_ +( + // Punching parameters + shape_select: pattern_square, + punching_grid_size: float2(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, + // Bronze Sheet Parameters + infinite_tiling: true, + copper_tint: 0.5f, + sheet_brightness: 0.85f, + roughness: 0.5f, + streaks: 0.05f, + scratch_bump_factor: 0.05f, + imperfections_amount: 0.265f, + impurities_weight_1: 0.75f, + impurities_weight_2: 0.43f, + impurities_weight_3: 0.00f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + roundcorners_radius_mm: 1.0f, + across_materials: false, + uv_space_index: 0 +); + + +export material Bronze_Sheet_Punched_Line(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Sheet - Line Punch"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze_Sheet_Punched.Bronze_Sheet_Punched_Line.png"), + ::anno::key_words(string[]("metal", "bronze", "decorative", "reflective", "new", "smooth", "shiny", "sheet", "sanitary", "construction", "design", "architecture", "yellow", "punched", "punching", "line", "warm")) +]] = Bronze_Sheet_Punched_ +( + // Punching parameters + shape_select: pattern_line, + punching_grid_size: float2(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, + + // Bronze Sheet Parameters + infinite_tiling: true, + copper_tint: 0.5f, + sheet_brightness: 0.85f, + roughness: 0.5f, + streaks: 0.05f, + scratch_bump_factor: 0.05f, + imperfections_amount: 0.265f, + impurities_weight_1: 0.75f, + impurities_weight_2: 0.43f, + impurities_weight_3: 0.00f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + roundcorners_radius_mm: 1.0f, + across_materials: false, + uv_space_index: 0 +); + + +export material Bronze_Sheet_Punched_Cross(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Sheet - Cross Punch"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze_Sheet_Punched.Bronze_Sheet_Punched_Cross.png"), + ::anno::key_words(string[]("metal", "bronze", "decorative", "reflective", "new", "smooth", "shiny", "sheet", "sanitary", "construction", "design", "architecture", "yellow", "punched", "punching", "cross", "warm")) +]] = Bronze_Sheet_Punched_ +( + // Punching parameters + shape_select: pattern_cross, + punching_grid_size: float2(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, + + // Bronze Sheet Parameters + infinite_tiling: true, + copper_tint: 0.5f, + sheet_brightness: 0.85f, + roughness: 0.5f, + streaks: 0.05f, + scratch_bump_factor: 0.05f, + imperfections_amount: 0.265f, + impurities_weight_1: 0.75f, + impurities_weight_2: 0.43f, + impurities_weight_3: 0.00f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + roundcorners_radius_mm: 1.0f, + across_materials: false, + uv_space_index: 0 +); + + +export material Bronze_Sheet_Punched_Rhombus(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Sheet - Rhombus Punch"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze_Sheet_Punched.Bronze_Sheet_Punched_Rhombus.png"), + ::anno::key_words(string[]("metal", "bronze", "decorative", "reflective", "new", "smooth", "shiny", "sheet", "sanitary", "construction", "design", "architecture", "yellow", "punched", "punching", "rhombus", "warm")) +]] = Bronze_Sheet_Punched_ +( + // Punching parameters + shape_select: pattern_rhombus, + punching_grid_size: float2(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, + + // Bronze Sheet Parameters + infinite_tiling: true, + copper_tint: 0.5f, + sheet_brightness: 0.85f, + roughness: 0.5f, + streaks: 0.05f, + scratch_bump_factor: 0.05f, + imperfections_amount: 0.265f, + impurities_weight_1: 0.75f, + impurities_weight_2: 0.43f, + impurities_weight_3: 0.00f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + roundcorners_radius_mm: 1.0f, + across_materials: false, + uv_space_index: 0 +); + + +export material Bronze_Sheet_Punched_Triangle(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Sheet - Triangle Punch"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze_Sheet_Punched.Bronze_Sheet_Punched_Triangle.png"), + ::anno::key_words(string[]("metal", "bronze", "decorative", "reflective", "new", "smooth", "shiny", "sheet", "sanitary", "construction", "design", "architecture", "yellow", "punched", "punching", "triangle", "triangular", "warm")) +]] = Bronze_Sheet_Punched_ +( + // Punching parameters + shape_select: pattern_triangle, + punching_grid_size: float2(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, + + // Bronze Sheet Parameters + infinite_tiling: true, + copper_tint: 0.5f, + sheet_brightness: 0.85f, + roughness: 0.5f, + streaks: 0.05f, + scratch_bump_factor: 0.05f, + imperfections_amount: 0.265f, + impurities_weight_1: 0.75f, + impurities_weight_2: 0.43f, + impurities_weight_3: 0.00f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + roundcorners_radius_mm: 1.0f, + across_materials: false, + uv_space_index: 0 +); + + +export material Bronze_Sheet_Punched_Star(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Bronze Sheet - Star Punch"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Bronze_Sheet_Punched.Bronze_Sheet_Punched_Star.png"), + ::anno::key_words(string[]("metal", "bronze", "decorative", "reflective", "new", "smooth", "shiny", "sheet", "sanitary", "construction", "design", "architecture", "yellow", "punched", "punching", "star", "warm")) +]] = Bronze_Sheet_Punched_ +( + // Punching parameters + shape_select: pattern_star, + punching_grid_size: float2(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, + + // Bronze Sheet Parameters + infinite_tiling: true, + copper_tint: 0.5f, + sheet_brightness: 0.85f, + roughness: 0.5f, + streaks: 0.05f, + scratch_bump_factor: 0.05f, + imperfections_amount: 0.265f, + impurities_weight_1: 0.75f, + impurities_weight_2: 0.43f, + impurities_weight_3: 0.00f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + roundcorners_radius_mm: 1.0f, + across_materials: false, + uv_space_index: 0 +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Metal/Chrome_Hammered.mdl b/code/third_party/vMaterials_2/Metal/Chrome_Hammered.mdl new file mode 100644 index 0000000000000000000000000000000000000000..a1a018e50ac1b66a0da3455823ce470383854910 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Chrome_Hammered.mdl @@ -0,0 +1,214 @@ +/****************************************************************************** + * 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 Chrome_Hammered( + color metal_color = color(0.399f, 0.399f, 0.405f) [[ + ::anno::description("Adjusts the reflection color of the metal material."), + ::anno::display_name("Metal Color"), + ::anno::in_group("Appearance") + ]], + float roughness = 0.0f [[ + ::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.0f [[ + ::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.5f [[ + ::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 = float2(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 = float2(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 Chrome - Shiny"), + ::anno::author("NVIDIA vMaterials"), + ::anno::in_group("Metal"), + ::anno::key_words(string[]("metal", "chrome", "hammered", "blackened", "design", "classic", "architecture", "pattern", "reflective", "rough", "bumped", "conductor")), + ::anno::thumbnail("./.thumbs/Chrome_Hammered.Chrome_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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Metal/Chromium.mdl b/code/third_party/vMaterials_2/Metal/Chromium.mdl new file mode 100644 index 0000000000000000000000000000000000000000..e13f71f41d7f588981bc36cdf7fbdca61c6c53b7 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Chromium.mdl @@ -0,0 +1,378 @@ +/****************************************************************************** + * 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 Chromium( + 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 = 0.03f [[ + ::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::description("When enabled the round corner effect is applied across different materials."), + ::anno::in_group("Round Corners") + ]], + uniform float2 texture_translate = float2(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 = float2(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("Chromium"), + ::anno::description("Pure metal material with optional smudges."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Chromium.Chromium.png"), + ::anno::key_words(string[]("metal", "pure", "smudged", "design", "reflective", "infinite tiling", "smooth", "conductor", "new", "polished", "chromium")) +]] + = + let { + + color normal_reflectivity = color(0.549302f, 0.5560554f, 0.5542377f); + 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(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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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, across_materials, 1.f) : ::state::normal()); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + + +export material Chromium_Polished(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Chromium Polished"), + ::anno::description("Pure metal material with optional smudges."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Chromium.Chromium_Polished.png"), + ::anno::key_words(string[]("metal", "pure", "design", "reflective", "infinite tiling", "smooth", "conductor", "new", "polished", "chromium")) +]] += Chromium( + 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 Chromium_Glossy_Fingerprints(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Chromium Glossy Fingerprints"), + ::anno::description("Pure metal material with optional smudges."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Chromium.Chromium_Glossy_Fingerprints.png"), + ::anno::key_words(string[]("metal", "pure", "design", "smudged", "reflective", "infinite tiling", "smooth", "conductor", "new", "polished", "chromium")) +]] += Chromium( + 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/code/third_party/vMaterials_2/Metal/Chromium_Brushed.mdl b/code/third_party/vMaterials_2/Metal/Chromium_Brushed.mdl new file mode 100644 index 0000000000000000000000000000000000000000..7e0de3a642a928302578b671760ea1fd8527801c --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Chromium_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 Chromium_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 = float2(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 = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Scale"), + ::nvidia::core_definitions::dimension(float2(0.75f, 0.75f)), + ::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("Brushed Chromium - Strong Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Chromium_Brushed.Chromium_Brushed.png"), + ::anno::key_words(string[]("aec", "metal", "chromium", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] + = + let { + color normal_reflectivity = color(0.549302f, 0.5560554f, 0.5542377f); + 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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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 Chromium_Brushed_Light_Brushing(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Brushed Chromium - Light Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Chromium_Brushed.Chromium_Brushed_Light_Brushing.png"), + ::anno::key_words(string[]("aec", "metal", "chromium", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] + = Chromium_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + +export material Chromium_Brushed_Medium_Light_Brushing(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Brushed Chromium - Medium Light Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Chromium_Brushed.Chromium_Brushed_Medium_Light_Brushing.png"), + ::anno::key_words(string[]("aec", "metal", "chromium", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] += Chromium_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + +export material Chromium_Brushed_Medium_Brushing(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Brushed Chromium - Medium Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Chromium_Brushed.Chromium_Brushed_Medium_Brushing.png"), + ::anno::key_words(string[]("aec", "metal", "chromium", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] += Chromium_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Chromium_Brushed_Very_Strong_Brushing(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Brushed Chromium - Very Strong Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Chromium_Brushed.Chromium_Brushed_Very_Strong_Brushing.png"), + ::anno::key_words(string[]("aec", "metal", "chromium", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] += Chromium_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + + diff --git a/code/third_party/vMaterials_2/Metal/Chromium_Foil.mdl b/code/third_party/vMaterials_2/Metal/Chromium_Foil.mdl new file mode 100644 index 0000000000000000000000000000000000000000..7b8aed414e318983fe1a8f777afc6dd6841ac8f2 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Chromium_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.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 = "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 Chromium_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 = float2(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 = float2(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("Chromium Foil - Slightly Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Chromium_Foil.Chromium_Foil.png"), + ::anno::key_words(string[]("design", "metal", "chromium", "foil", "smooth", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral")) +]] + = + let { + color normal_reflectivity = color(0.549302f, 0.5560554f, 0.5542377f); + color grazing_reflectivity = color(0.99942f, 1.f, 1.f); + + texture_2d rough_ao_tex = texture_2d("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear); + texture_2d smudge_splotch_tex = texture_2d("./textures/foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear); + texture_2d norm_tex = texture_2d("./textures/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 Chromium_Foil_Smudged_Foil(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Chromium Foil - Smudgy Foil"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Chromium_Foil.Chromium_Foil_Smudged_Foil.png"), + ::anno::key_words(string[]("design", "metal", "chromium", "foil", "smooth", "unfinished", "decorative", "creative", "neutral")) +]] += Chromium_Foil( + infinite_tiling: true, + roughness: 0.15f, + roughness_variation: 0.84f, + smudges: 0.35f, + bump_strength: 0.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + +export material Chromium_Foil_Shiny_Wrinkled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Chromium Foil - Shiny Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Chromium_Foil.Chromium_Foil_Shiny_Wrinkled.png"), + ::anno::key_words(string[]("design", "metal", "chromium", "foil", "shiny", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral")) +]] += Chromium_Foil( + infinite_tiling: true, + roughness: 0.25f, + roughness_variation: 0.25f, + smudges: 0.75f, + bump_strength: 0.25f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + + +export material Chromium_Foil_Matte_Wrinkled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Chromium Foil - Matte Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Chromium_Foil.Chromium_Foil_Matte_Wrinkled.png"), + ::anno::key_words(string[]("design", "metal", "chromium", "foil", "matte", "smooth", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral", "gray")) +]] += Chromium_Foil( + infinite_tiling: true, + roughness: 0.65f, + roughness_variation: 1.0f, + smudges: 0.4f, + bump_strength: 0.15f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + +export material Chromium_Foil_Heavy_Glossy_Wrinkles(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Chromium Foil - Heavy Glossy Wrinkles"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Chromium_Foil.Chromium_Foil_Heavy_Glossy_Wrinkles.png"), + ::anno::key_words(string[]("design", "metal", "chromium", "foil", "smooth", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral")) +]] += Chromium_Foil( + infinite_tiling: true, + roughness: 0.164f, + roughness_variation: 0.021f, + smudges: 0.143f, + bump_strength: 0.99f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + +export material Chromium_Foil_Heavy_Matte_Wrinkled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Chromium Foil - Heavy Matte Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Chromium_Foil.Chromium_Foil_Heavy_Matte_Wrinkled.png"), + ::anno::key_words(string[]("design", "metal", "chromium", "foil", "matte", "bumped", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral", "gray")) +]] += Chromium_Foil( + infinite_tiling: true, + roughness: 0.889f, + roughness_variation: 0.018f, + smudges: 0.246f, + bump_strength: 0.732f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + + + + + + + + + + + + diff --git a/code/third_party/vMaterials_2/Metal/Chromium_Knurling.mdl b/code/third_party/vMaterials_2/Metal/Chromium_Knurling.mdl new file mode 100644 index 0000000000000000000000000000000000000000..df0c0eaac05099a05fc9ff552b0c2cd11c2bdcbe --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Chromium_Knurling.mdl @@ -0,0 +1,359 @@ +/****************************************************************************** + * 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 ::df::*; +import ::tex::*; +import ::math::*; +import ::base::*; +import ::state::*; +import ::anno::*; +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 = "Metal with a diamond knurling finish"; + +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; + //TODO: at least also handle sign of z? + //TODO: handle tangent becoming 0 + + + 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)); +} + +export material Chromium_Knurling( + //Appearance + float brightness = float(0.7f) [[ + ::anno::description("Adjusts the brightness of the material."), + ::anno::display_name("Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.0f, 1.0f) + ]], + float roughness = float(0.5f) [[ + ::anno::description("Higher values lead to a rougher appearance of the material."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.0f, 1.0f) + ]], + float grooves_dirt = float(0.4f) [[ + ::anno::description("Adds dirt in the grooves of the knurling pattern."), + ::anno::display_name("Grooves Dirt"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.0f, 1.0f) + ]], + uniform float bump_strength = float(0.8f) [[ + ::anno::description("Adds dirt in the grooves of the knurling pattern."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.0f, 1.0f) + ]], + + // Round Corners + 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("Sets the radius of the round corners in millimeters."), + ::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") + ]], + //Transform + float2 texture_translate = float2(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"), + ::anno::soft_range(0.f, 360.f) + ]], + float2 texture_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::nvidia::core_definitions::dimension(float2(0.35f, .35f)), + ::anno::in_group("Transform"), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + + // Advanced + uniform int uv_space_index = 0 [[ + ::anno::description("Uses the selected UV space index."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced"), + ::anno::soft_range(0, 4) + ]] +) +[[ + ::anno::display_name("Metal Knurling Chromium"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Chromium_Knurling.Chromium_Knurling.png"), + ::anno::key_words(string[]("metal", "chromium", "knurled", "knurling", "pattern", "design", "bumped")), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials") +]] += let +{ + color metal_tint = color(0.549302f, 0.5560554f, 0.5542377f); + + // Texture setup + texture_2d normal_tex = texture_2d("./textures/metal_knurling_norm.jpg", ::tex::gamma_linear); + texture_2d multi_heights_tex = texture_2d("./textures/metal_knurling_multi_heights.jpg", ::tex::gamma_linear); + texture_2d diff_rough_grunge_tex = texture_2d("./textures/metal_knurling_multi_R_diff_G_rough_B_grunge.jpg", ::tex::gamma_linear); + + // Coordinate setup + ::base::texture_coordinate_info uvw = vmat_transform( + translation: texture_translate, + rotation: texture_rotate, + scaling: texture_scale, + system: ::base::texture_coordinate_uvw, + uv_space: uv_space_index + ); + + // ---------- Diff Rough Grunge Lookup ---------- + + float3 diff_rough_grunge_lookup = float3( + ::base::file_texture( + texture: diff_rough_grunge_tex, + uvw: uvw, + mono_source: ::base::mono_average + ).tint ); + + float3 multi_height_lookup = float3( + ::base::file_texture( + texture: multi_heights_tex, + uvw: uvw, + mono_source: ::base::mono_average + ).tint ); + + float3 norm = ::base::tangent_space_normal_texture( + texture: normal_tex, + factor: bump_strength, + uvw: uvw + ); + + + float remap_rough = histogram_range( + input: diff_rough_grunge_lookup.y, + range: 1.0f, + position: 0.234f + ); + + + float roughness_mapped = remap_rough + (roughness * multi_height_lookup.y); + + float remapped_diff = histogram_range( + input: diff_rough_grunge_lookup.x, + range: 1.0f, + position: (brightness * 0.4f) + 0.4f + ); + + float diff_contribution = ::math::pow(remapped_diff - ((grooves_dirt * 0.5) * multi_height_lookup.x * diff_rough_grunge_lookup.z), 2.67f); + + bsdf ggx_smith_bumped = ::df::weighted_layer( + layer: ::df::microfacet_ggx_smith_bsdf( + roughness_u: roughness_mapped * roughness_mapped, + roughness_v: roughness_mapped * roughness_mapped, + tint: color(diff_contribution), + mode: ::df::scatter_reflect + ), + base: bsdf(), + weight: 1.0f, + normal: norm + ); + + bsdf diff_bsdf = ::df::diffuse_reflection_bsdf( + tint: color(diff_contribution) + ); + + + bsdf final_bsdf = ::df::weighted_layer( + weight: 1.0f - (diff_rough_grunge_lookup.z * multi_height_lookup.x * grooves_dirt), + layer: ::df::directional_factor( + normal_tint: metal_tint, + grazing_tint: color(1.0f), + base: ggx_smith_bumped + ), + base: diff_bsdf + ); + + + // Round Corners + float3 round_normal = enable_round_corners ? + ::state::rounded_corner_normal( + radius: roundcorner_radius * 0.001, + across_materials: across_materials + ) : ::state::normal(); +} +in material ( + + surface: material_surface( + scattering: final_bsdf + ), + geometry: material_geometry( + normal: round_normal + ) +); + + +export material Chromium_Knurling_Worn(*) +[[ + ::anno::display_name("Metal Knurling - Chromium Worn"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Chromium_Knurling.Chromium_Knurling_Worn.png"), + ::anno::key_words(string[]("metal", "chromium", "knurled", "pattern", "knurling", "design", "bumped", "worn")), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials") +]] = Chromium_Knurling( + brightness: 0.4f, + roughness: 1.0f, + grooves_dirt: 1.0f, + bump_strength: 0.8f, + + enable_round_corners: false, + roundcorner_radius: 1.2f, + across_materials: false, + + texture_translate: float2(0.0f), + texture_rotate: 0.f, + texture_scale: float2(1.0f), + + uv_space_index: 0 +); + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/code/third_party/vMaterials_2/Metal/Chromium_Scratched.mdl b/code/third_party/vMaterials_2/Metal/Chromium_Scratched.mdl new file mode 100644 index 0000000000000000000000000000000000000000..9bca1b601bf0a42d8b909928f9af66013c18e321 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Chromium_Scratched.mdl @@ -0,0 +1,595 @@ +/****************************************************************************** + * 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 Chromium_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 = float2(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 = float2(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("Chromium Scratched"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "chromium", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped")), + ::anno::thumbnail("./.thumbs/Chromium_Scratched.Chromium_Scratched.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = + let { + float brush_scratches_weight = 0.5f; + // Chromium Reflection Color + color reflection_color = color(0.549302f, 0.5560554f, 0.5542377f); + 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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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 Chromium_Scratched_Light_Bumpy(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Chromium Scratched - Bright and Bumped"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "chromium", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "shiny")), + ::anno::thumbnail("./.thumbs/Chromium_Scratched.Chromium_Scratched_Light_Bumpy.png"), + ::anno::copyright_notice(COPYRIGHT) +]]= Chromium_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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); + + + +export material Chromium_Scratched_Dark_Shiny(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Chromium Scratched - Dark Shiny"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "chromium", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "shiny", "dark")), + ::anno::thumbnail("./.thumbs/Chromium_Scratched.Chromium_Scratched_Dark_Shiny.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Chromium_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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); + + +export material Chromium_Scratched_Dark_Matte(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Chromium Scratched - Dark Matte"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "chromium", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "matte", "dark")), + ::anno::thumbnail("./.thumbs/Chromium_Scratched.Chromium_Scratched_Dark_Matte.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Chromium_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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); + + + + +export material Chromium_Scratched_Scuffs_and_Grime(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Chromium Scratched - Scuffs and Grime"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "chromium", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "matte", "dark")), + ::anno::thumbnail("./.thumbs/Chromium_Scratched.Chromium_Scratched_Scuffs_and_Grime.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Chromium_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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); + + + + +export material Chromium_Scratched_Dirty_Rough(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Chromium Scratched - Dirty Rough"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "chromium", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "matte", "dark")), + ::anno::thumbnail("./.thumbs/Chromium_Scratched.Chromium_Scratched_Dirty_Rough.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Chromium_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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); diff --git a/code/third_party/vMaterials_2/Metal/Chromium_Sheet.mdl b/code/third_party/vMaterials_2/Metal/Chromium_Sheet.mdl new file mode 100644 index 0000000000000000000000000000000000000000..f8dc8709ffeb931b02c1ce5218b8c7410f94b732 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Chromium_Sheet.mdl @@ -0,0 +1,1336 @@ +/****************************************************************************** + * 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 chromium 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) + float2(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 Chromium_Sheet( + 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::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::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 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 = float2(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 = float2(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 Chromium - New Clean"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Chromium_Sheet.Chromium_Sheet.png"), + ::anno::key_words(string[]("metal", "sheet", "chromium", "interior", "exterior", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "neutral")) +]] + = + let { + color normal_reflectivity = color(0.549302f, 0.5560554f, 0.5542377f); + 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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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 Chromium_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 = float2(.5f, .5f) + [[ + ::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) + ]], + + + +// Chromium 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.9f [[ + ::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.1f [[ + ::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.3f [[ + ::anno::display_name("Washed Imperfections Ratio"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float impurities_weight_2 = 1.0f [[ + ::anno::display_name("Noisy Imperfections Ratio"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float impurities_weight_3 = 0.5f [[ + ::anno::display_name("Splotchy Imperfection Ratio"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::hard_range(0.f, 1.f) + ]], + uniform float2 texture_translate = float2(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 = float2(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("Chromium Sheet - Circular Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Chromium_Sheet.Chromium_Sheet_Punched.png"), + ::anno::key_words(string[]("metal", "sheet", "chromium", "interior", "exterior", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "decorative", "punched", "punching", "neutral")) +]] = let +{ + material base_mat = Chromium_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, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + enable_round_corners: enable_round_corners, + roundcorner_radius: roundcorner_radius, + across_materials: across_materials + ); + texture_2d punching_cutout = texture_2d("./textures/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 + ) +); + + + + +// ------------------------ Chromium Sheet Presets ------------------------ +export material Chromium_Sheet_Soft_Splotches(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Chromium - Soft Splotches"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Chromium_Sheet.Chromium_Sheet_Soft_Splotches.png"), + ::anno::key_words(string[]("metal", "sheet", "chromium", "interior", "exterior", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "neutral", "gray")) +]] += Chromium_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + + +export material Chromium_Sheet_Matte_Imperfections(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Chromium - Matte Imperfections"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Chromium_Sheet.Chromium_Sheet_Matte_Imperfections.png"), + ::anno::key_words(string[]("metal", "sheet", "chromium", "interior", "exterior", "imperfections", "new", "matte", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "neutral")) +]]= Chromium_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + + +export material Chromium_Sheet_Glossy_Imperfections(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Chromium - Glossy Imperfections"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Chromium_Sheet.Chromium_Sheet_Glossy_Imperfections.png"), + ::anno::key_words(string[]("metal", "sheet", "chromium", "interior", "exterior", "imperfections", "new", "glossy", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "neutral")) +]] += Chromium_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + + +export material Chromium_Sheet_Splotchy_Streaks(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Chromium - Splotchy Streaks"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Chromium_Sheet.Chromium_Sheet_Splotchy_Streaks.png"), + ::anno::key_words(string[]("metal", "sheet", "chromium", "interior", "exterior", "imperfections", "new", "glossy", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "neutral")) +]]= Chromium_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + +export material Chromium_Sheet_Glossy_Streaks(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Chromium - Glossy Streaks"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Chromium_Sheet.Chromium_Sheet_Glossy_Streaks.png"), + ::anno::key_words(string[]("metal", "sheet", "chromium", "interior", "exterior", "imperfections", "new", "glossy", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "neutral")) +]] += Chromium_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + +// ------------------------ Punched Chromium Sheet Presets ------------------------ + +export material Chromium_Sheet_Punched_Circular_Small(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Chromium Sheet - Small Circular Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Chromium_Sheet.Chromium_Sheet_Punched_Circular_Small.png"), + ::anno::key_words(string[]("metal", "sheet", "chromium", "interior", "exterior", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "decorative", "punched", "punching", "circular", "neutral")) +]] = Chromium_Sheet_Punched ( + // Punching parameters + shape_select: pattern_circle, + punching_grid_size: float2(.6f), + 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, + + // Material Parameters + 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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Chromium_Sheet_Punched_Hexagonal(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Chromium Sheet - Hexagonal Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Chromium_Sheet.Chromium_Sheet_Punched_Hexagonal.png"), + ::anno::key_words(string[]("metal", "sheet", "chromium", "interior", "exterior", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "decorative", "punched", "punching", "hexagonal", "neutral")) +]] = Chromium_Sheet_Punched ( + // Punching parameters + shape_select: pattern_hexagon, + punching_grid_size: float2(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, + + // Material Parameters + 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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Chromium_Sheet_Punched_Hexagonal_Small(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Chromium Sheet - Small Hexagonal Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Chromium_Sheet.Chromium_Sheet_Punched_Hexagonal_Small.png"), + ::anno::key_words(string[]("metal", "sheet", "chromium", "interior", "exterior", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "decorative", "punched", "punching", "hexagonal", "neutral")) +]] = Chromium_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, + + // Material Parameters + 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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Chromium_Sheet_Punched_Square(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Chromium Sheet - Square Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Chromium_Sheet.Chromium_Sheet_Punched_Square.png"), + ::anno::key_words(string[]("metal", "sheet", "chromium", "interior", "exterior", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "decorative", "punched", "punching", "square", "neutral")) +]] = Chromium_Sheet_Punched ( + // Punching parameters + shape_select: pattern_square, + punching_grid_size: float2(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, + + // Material Parameters + 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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Chromium_Sheet_Punched_Line(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Chromium Sheet - Line Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Chromium_Sheet.Chromium_Sheet_Punched_Line.png"), + ::anno::key_words(string[]("metal", "sheet", "chromium", "interior", "exterior", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "decorative", "punched", "punching", "line", "neutral")) +]] = Chromium_Sheet_Punched ( + // Punching parameters + shape_select: pattern_line, + punching_grid_size: float2(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, + + // Material Parameters + 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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + +export material Chromium_Sheet_Punched_Cross(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Chromium Sheet - Cross Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Chromium_Sheet.Chromium_Sheet_Punched_Cross.png"), + ::anno::key_words(string[]("metal", "sheet", "chromium", "interior", "exterior", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "decorative", "punched", "punching", "cross", "neutral")) +]] = Chromium_Sheet_Punched ( + // Punching parameters + shape_select: pattern_cross, + punching_grid_size: float2(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, + + // Material Parameters + 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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Chromium_Sheet_Punched_Rhombus(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Chromium Sheet - Rhombus Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Chromium_Sheet.Chromium_Sheet_Punched_Rhombus.png"), + ::anno::key_words(string[]("metal", "sheet", "chromium", "interior", "exterior", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "decorative", "punched", "punching", "rhombus", "neutral")) +]] = Chromium_Sheet_Punched ( + // Punching parameters + shape_select: pattern_rhombus, + punching_grid_size: float2(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, + + // Material Parameters + 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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Chromium_Sheet_Punched_Triangle(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Chromium Sheet - Triangle Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Chromium_Sheet.Chromium_Sheet_Punched_Triangle.png"), + ::anno::key_words(string[]("metal", "sheet", "chromium", "interior", "exterior", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "decorative", "punched", "punching", "triangle", "neutral")) +]] = Chromium_Sheet_Punched ( + // Punching parameters + shape_select: pattern_triangle, + punching_grid_size: float2(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, + + // Material Parameters + 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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Chromium_Sheet_Punched_Star(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Chromium Sheet - Star Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Chromium_Sheet.Chromium_Sheet_Punched_Star.png"), + ::anno::key_words(string[]("metal", "sheet", "chromium", "interior", "exterior", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "decorative", "punched", "punching", "star", "neutral")) +]] = Chromium_Sheet_Punched ( + // Punching parameters + shape_select: pattern_star, + punching_grid_size: float2(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, + + // Material Parameters + 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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Metal/Copper.mdl b/code/third_party/vMaterials_2/Metal/Copper.mdl new file mode 100644 index 0000000000000000000000000000000000000000..a80ef643b98cfc41bcaf3bfbdebd6453c22a44f9 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Copper.mdl @@ -0,0 +1,378 @@ +/****************************************************************************** + * 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 Copper( + 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 = 0.03f [[ + ::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::description("When enabled the round corner effect is applied across different materials."), + ::anno::in_group("Round Corners") + ]], + uniform float2 texture_translate = float2(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 = float2(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("Copper"), + ::anno::description("Pure metal material with optional smudges."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Copper.Copper.png"), + ::anno::key_words(string[]("metal", "pure", "smudged", "design", "reflective", "infinite tiling", "smooth", "conductor", "new", "polished", "copper", "warm")) +]] + = + let { + + // color normal_reflectivity = color(0.9654565f, 0.6899602f, 0.4830392f); + color normal_reflectivity = color(0.93120f, 0.62276f, 0.52235f); // Johnson Christy + 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(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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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, across_materials, 1.f) : ::state::normal()); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + +export material Copper_Polished(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Copper Polished"), + ::anno::description("Pure metal material with optional smudges."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Copper.Copper_Polished.png"), + ::anno::key_words(string[]("metal", "pure", "design", "reflective", "infinite tiling", "smooth", "conductor", "new", "polished", "copper", "warm")) +]] += Copper( + 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 Copper_Glossy_Fingerprints(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Copper Glossy Fingerprints"), + ::anno::description("Pure metal material with optional smudges."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Copper.Copper_Glossy_Fingerprints.png"), + ::anno::key_words(string[]("metal", "pure", "design", "smudged", "reflective", "infinite tiling", "smooth", "conductor", "new", "polished", "copper", "warm")) +]] += Copper( + 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/code/third_party/vMaterials_2/Metal/Copper_Antique_Brushed.mdl b/code/third_party/vMaterials_2/Metal/Copper_Antique_Brushed.mdl new file mode 100644 index 0000000000000000000000000000000000000000..57d3a01eb1fe3453c0587d35805e099ccddf9c36 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/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 = float2(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 = float2(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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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/code/third_party/vMaterials_2/Metal/Copper_Antique_Brushed_Patinated.mdl b/code/third_party/vMaterials_2/Metal/Copper_Antique_Brushed_Patinated.mdl new file mode 100644 index 0000000000000000000000000000000000000000..30cd3c6d6895a16f813cd8c2594e3c597fa34aa5 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Copper_Antique_Brushed_Patinated.mdl @@ -0,0 +1,565 @@ +/****************************************************************************** + * 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"; + + +float3 contrast_brightness( + float3 input, + float contrast, + float brightness +) +[[ + ::anno::unused() +]] +{ + float3 return_value = contrast > 0.5 ? + float3( ::math::clamp((input.x - 0.5) * 1/(1.000001 - (contrast - 0.5)*2.0) + 0.5, 0.0, 1.0) + (brightness - 0.5) * 2.0, + ::math::clamp((input.y - 0.5) * 1/(1.000001 - (contrast - 0.5)*2.0) + 0.5, 0.0, 1.0) + (brightness - 0.5) * 2.0, + ::math::clamp((input.z - 0.5) * 1/(1.000001 - (contrast - 0.5)*2.0) + 0.5, 0.0, 1.0) + (brightness - 0.5) * 2.0) + : + float3( ::math::clamp((input.x - 0.5) * contrast * 2.0 + 0.5 + (brightness - 0.5)*2.0, 0.0, 1.0), + ::math::clamp((input.y - 0.5) * contrast * 2.0 + 0.5 + (brightness - 0.5)*2.0, 0.0, 1.0), + ::math::clamp((input.z - 0.5) * contrast * 2.0 + 0.5 + (brightness - 0.5)*2.0, 0.0, 1.0)); + + return return_value; +} + +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; +} + +// remaps a value that lies between low_1 and high_1 to range between low_2 and high_2 +// This is the general case for range remapping +float remap(float x, float low_1, float high_1, float low_2, float high_2) +{ + return low_2 + ((x - low_1) * (high_2 - low_2))/(high_1 - low_1); +} + + +export material Copper_Antique_Brushed_Patinated ( + float metal_roughness = 0.4f + [[ + ::anno::display_name("Metal Roughness"), + ::anno::soft_range(float(0.0f), float(1.0f)), + ::anno::description("The general roughness of the metal. the roughness of the metal will be affected as the ." + "parameter 'Patina Amount' is increased"), + ::anno::in_group("Appearance") + ]], + uniform float patina_metal_blend = .5f + [[ + ::anno::display_name("Patina Amount"), + ::anno::hard_range(float(0.0), float(1.0)), + ::anno::description("Adjusts how much patina has settled on the copper material ."), + ::anno::in_group("Appearance") + ]], + uniform float patina_metal_blend_softness = .25f + [[ + ::anno::display_name("Patina Transition Softness"), + ::anno::soft_range(float(0.0), float(1.0)), + ::anno::hard_range(float(0.0), float(5.0)), + ::anno::description("Adjusts how soft the fallof between patina and metal is."), + ::anno::in_group("Appearance") + ]], + uniform float corrosion_offset = .25f + [[ + ::anno::display_name("Corrosion Offset"), + ::anno::soft_range(float(0.0), float(1.0)), + ::anno::description("Offsets the roughness of the metal, so that it gets earlier glossy as the patina progresses to settle on the material."), + ::anno::in_group("Appearance") + ]], + float patina_brightness = 0.5f + [[ + ::anno::display_name("Patina Brightness"), + ::anno::soft_range(float(0.0f), float(1.0f)), + ::anno::description("A control to attenuate the brightness of the patina."), + ::anno::in_group("Appearance") + ]], + float smudge_amount = 0.0f + [[ + ::anno::display_name("Metal Smudge"), + ::anno::soft_range(float(0.0f), float(1.0f)), + ::anno::description("Adds glossy smudges on top of the material."), + ::anno::in_group("Appearance") + ]], + uniform float patina_bump_amount = 0.35f + [[ + ::anno::display_name("Patina Bump Amount"), + ::anno::soft_range(float(0.0f), float(1.0f)), + ::anno::description("Specifies the intensity of the patina normal texture."), + ::anno::in_group("Normal") + ]], + uniform float copper_bump_amount = 1.0 + [[ + ::anno::display_name("Copper Bump Amount"), + ::anno::description("Specifies the intensity of the normal texture for the underlying copper."), + ::anno::in_group("Normal") + ]], + + // Adjustments Group + uniform float2 texture_translate = float2(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 = float2(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("Patinated copper"), + ::anno::description("A copper material that starts building a patina on top of its surface."), + ::anno::key_words(string[]("design", "metal", "copper", "antique", "corrosion", "oxidized", "aged", "bumped", "brushed", "scratched", "patina", "green", "rust")), + ::anno::thumbnail("./.thumbs/Copper_Antique_Brushed_Patinated.Copper_Antique_Brushed_Patinated.png"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::hidden() +]] = let { + float reflection_contrast = 0.25; + float patina_brightness_x = patina_brightness * 0.5 + 0.5; + + float patina_metal_blend_x = patina_metal_blend * 0.4; + float patina_metal_blend_softness_x = (patina_metal_blend_softness + 0.001) * 0.12; + float corrosion_offset_x = corrosion_offset * 0.15; + + ::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.0f), 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("./textures/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; + + // Patina diffuse color + ::base::texture_return patina_diffuse_color = ::base::file_texture( + texture: texture_2d("./textures/copper_patina_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: patina_uvw, + clip: false + ); + + // Patina normal + float3 patina_bump = ::base::tangent_space_normal_texture( + texture: texture_2d("./textures/copper_patina_norm.jpg" , ::tex::gamma_linear), + factor: patina_bump_amount, + uvw: transformed_uvw, + flip_tangent_u: false, + flip_tangent_v: false + ); + + color final_diffuse_color = diffuse_color; + + float roughness_lookup = ::math::clamp(contrast_brightness( + ::tex::lookup_float( + tex: texture_2d("./textures/brushed_antique_copper_rough.jpg" , ::tex::gamma_linear), + coord: float2(uvw.position.x, uvw.position.y)), + reflection_contrast, // contrast + metal_roughness // brightness + ) + ::base::file_texture( + texture: texture_2d("./textures/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, 0.0f, 1.0f) + + ::math::clamp(remap(patina_diffuse_color.mono, + patina_metal_blend_x - patina_metal_blend_softness_x - corrosion_offset_x, + patina_metal_blend_x + patina_metal_blend_softness_x + corrosion_offset_x, + 1.0, + 0.0), 0.0, 1.0); + + + // Specular Level lookup + float specular_level = ::base::file_texture( + texture: texture_2d("./textures/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 = 1.0f; + + + // Patina + bsdf patina_bsdf = ::df::diffuse_reflection_bsdf( + roughness: 0.0f, //assign the user controllable + tint: patina_diffuse_color.tint * patina_brightness_x //values to the bsdf + ); + + + 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 pre_final_bsdf = ::df::weighted_layer( + base: custom_curve_layer_bsdf, + weight: metallic, + layer: directional_factor_bsdf + ); + + bsdf final_bsdf = ::df::weighted_layer( + base: pre_final_bsdf, + weight: remap(patina_diffuse_color.mono, + patina_metal_blend_x - patina_metal_blend_softness_x, + patina_metal_blend_x + patina_metal_blend_softness_x, + 1.0, + 0.0), + layer: patina_bsdf, + normal: patina_bump + ); + + // Normal lookup + float3 bump = ::base::tangent_space_normal_texture( + texture: texture_2d("./textures/brushed_antique_copper_norm.jpg" , ::tex::gamma_linear), + factor: copper_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 + ) +); + + + +export material Copper_Antique_Brushed_Minimal_Patina(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Copper - Minimal Patina"), + ::anno::description("A copper material that starts building a patina on top of its surface."), + ::anno::key_words(string[]("design", "metal", "copper", "antique", "corrosion", "oxidized", "aged", "bumped", "brushed", "scratched", "patina", "green", "rust")), + ::anno::thumbnail("./.thumbs/Copper_Antique_Brushed_Patinated.Copper_Antique_Brushed_Minimal_Patina.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Copper_Antique_Brushed_Patinated( + metal_roughness: 0.4f, + patina_metal_blend: 0.2f, + patina_metal_blend_softness:0.5f, + corrosion_offset: 0.2f, + patina_brightness: 0.75f, + smudge_amount: 0.0f, + patina_bump_amount: 0.35f, + copper_bump_amount: 1.0f + ); + + +export material Copper_Antique_Brushed_Slight_Patina(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Copper - Slight Patina"), + ::anno::description("A copper material that starts building a patina on top of its surface."), + ::anno::key_words(string[]("design", "metal", "copper", "antique", "corrosion", "oxidized", "aged", "bumped", "brushed", "scratched", "patina", "green", "rust")), + ::anno::thumbnail("./.thumbs/Copper_Antique_Brushed_Patinated.Copper_Antique_Brushed_Slight_Patina.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Copper_Antique_Brushed_Patinated( + metal_roughness: 0.4f, + patina_metal_blend: 0.3f, + patina_metal_blend_softness:0.5f, + corrosion_offset: 0.2f, + patina_brightness: 0.75f, + smudge_amount: 0.0f, + patina_bump_amount: 0.35f, + copper_bump_amount: 1.0f + ); + +export material Copper_Antique_Brushed_Slight_Patina_Spots(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Copper - Slight Patina Spots"), + ::anno::description("A copper material that starts building a patina on top of its surface."), + ::anno::key_words(string[]("design", "metal", "copper", "antique", "corrosion", "oxidized", "aged", "bumped", "brushed", "scratched", "patina", "green", "rust")), + ::anno::thumbnail("./.thumbs/Copper_Antique_Brushed_Patinated.Copper_Antique_Brushed_Slight_Patina_Spots.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Copper_Antique_Brushed_Patinated( + metal_roughness: 0.5f, + patina_metal_blend: 0.38f, + patina_metal_blend_softness:0.1f, + corrosion_offset: 0.1f, + patina_brightness: 0.8f, + smudge_amount: 0.0f, + patina_bump_amount: 0.7f, + copper_bump_amount: 1.0f + ); + + +export material Copper_Antique_Brushed_Medium_Patina(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Copper - Medium Patina"), + ::anno::description("A copper material that starts building a patina on top of its surface."), + ::anno::key_words(string[]("design", "metal", "copper", "antique", "corrosion", "oxidized", "aged", "bumped", "brushed", "scratched", "patina", "green", "rust")), + ::anno::thumbnail("./.thumbs/Copper_Antique_Brushed_Patinated.Copper_Antique_Brushed_Medium_Patina.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Copper_Antique_Brushed_Patinated( + metal_roughness: 0.4f, + patina_metal_blend: 0.4f, + patina_metal_blend_softness:0.5f, + corrosion_offset: 0.2f, + patina_brightness: 0.75f, + smudge_amount: 0.0f, + patina_bump_amount: 0.35f, + copper_bump_amount: 1.0f + ); + + +export material Copper_Antique_Brushed_Strong_Patina(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Copper - Strong Patina"), + ::anno::description("A copper material that starts building a patina on top of its surface."), + ::anno::key_words(string[]("design", "metal", "copper", "antique", "corrosion", "oxidized", "aged", "bumped", "brushed", "scratched", "patina", "green", "rust")), + ::anno::thumbnail("./.thumbs/Copper_Antique_Brushed_Patinated.Copper_Antique_Brushed_Strong_Patina.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Copper_Antique_Brushed_Patinated( + metal_roughness: 0.4f, + patina_metal_blend: 0.5f, + patina_metal_blend_softness:0.6f, + corrosion_offset: 0.2f, + patina_brightness: 0.75f, + smudge_amount: 0.0f, + patina_bump_amount: 0.35f, + copper_bump_amount: 1.0f + ); + + +export material Copper_Antique_Brushed_Very_Strong_Patina(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Copper - Very Strong Patina"), + ::anno::description("A copper material that starts building a patina on top of its surface."), + ::anno::key_words(string[]("design", "metal", "copper", "antique", "corrosion", "oxidized", "aged", "bumped", "brushed", "scratched", "patina", "green", "rust")), + ::anno::thumbnail("./.thumbs/Copper_Antique_Brushed_Patinated.Copper_Antique_Brushed_Very_Strong_Patina.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Copper_Antique_Brushed_Patinated( + metal_roughness: 0.5f, + patina_metal_blend: 0.55f, + patina_metal_blend_softness:0.4f, + corrosion_offset: 0.2f, + patina_brightness: 0.75f, + smudge_amount: 0.0f, + patina_bump_amount: 0.35f, + copper_bump_amount: 1.0f + ); + +export material Copper_Antique_Brushed_Pure_Patina(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Copper - Pure Patina"), + ::anno::description("A copper material that starts building a patina on top of its surface."), + ::anno::key_words(string[]("design", "metal", "copper", "antique", "corrosion", "oxidized", "aged", "bumped", "brushed", "scratched", "patina", "green", "rust")), + ::anno::thumbnail("./.thumbs/Copper_Antique_Brushed_Patinated.Copper_Antique_Brushed_Pure_Patina.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Copper_Antique_Brushed_Patinated( + metal_roughness: 0.5f, + patina_metal_blend: 1.0f, + patina_metal_blend_softness:0.4f, + corrosion_offset: 0.2f, + patina_brightness: 0.75f, + smudge_amount: 0.0f, + patina_bump_amount: 0.44f, + copper_bump_amount: 1.0f + ); + + + + // --------------------------- + +export material Copper_Antique_Brushed_Crusted_Patina(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Copper - Pure Crusted Patina"), + ::anno::description("A copper material that starts building a patina on top of its surface."), + ::anno::key_words(string[]("design", "metal", "copper", "antique", "corrosion", "oxidized", "aged", "bumped", "brushed", "scratched", "patina", "green", "rust")), + ::anno::thumbnail("./.thumbs/Copper_Antique_Brushed_Patinated.Copper_Antique_Brushed_Crusted_Patina.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Copper_Antique_Brushed_Patinated( + metal_roughness: 0.5f, + patina_metal_blend: 1.0f, + patina_metal_blend_softness:0.4f, + corrosion_offset: 0.2f, + patina_brightness: 0.75f, + smudge_amount: 0.0f, + patina_bump_amount: 1.0f, + copper_bump_amount: 1.0f + ); + + + diff --git a/code/third_party/vMaterials_2/Metal/Copper_Brushed.mdl b/code/third_party/vMaterials_2/Metal/Copper_Brushed.mdl new file mode 100644 index 0000000000000000000000000000000000000000..498da5eb61d7c71465660a458f57ed8e8096cac4 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Copper_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 Copper_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 = float2(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 = float2(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 Copper - Strong Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Copper_Brushed.Copper_Brushed.png"), + ::anno::key_words(string[]("aec", "metal", "copper", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] + = + let { + color normal_reflectivity = color(0.9654565f, 0.6899602f, 0.4830392f); + 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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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 Copper_Brushed_Light_Brushing(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Brushed Copper - Light Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Copper_Brushed.Copper_Brushed_Light_Brushing.png"), + ::anno::key_words(string[]("aec", "metal", "copper", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] + = Copper_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + +export material Copper_Brushed_Medium_Light_Brushing(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Brushed Copper - Medium Light Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Copper_Brushed.Copper_Brushed_Medium_Light_Brushing.png"), + ::anno::key_words(string[]("aec", "metal", "copper", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] += Copper_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + +export material Copper_Brushed_Medium_Brushing(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Brushed Copper - Medium Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Copper_Brushed.Copper_Brushed_Medium_Brushing.png"), + ::anno::key_words(string[]("aec", "metal", "copper", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] += Copper_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Copper_Brushed_Very_Strong_Brushing(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Brushed Copper - Very Strong Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Copper_Brushed.Copper_Brushed_Very_Strong_Brushing.png"), + ::anno::key_words(string[]("aec", "metal", "copper", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] += Copper_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + + diff --git a/code/third_party/vMaterials_2/Metal/Copper_Foil.mdl b/code/third_party/vMaterials_2/Metal/Copper_Foil.mdl new file mode 100644 index 0000000000000000000000000000000000000000..4cbadddd183dc0ebf45a1f2916b159f4c43a5c19 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/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 = float2(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 = float2(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("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear); + texture_2d smudge_splotch_tex = texture_2d("./textures/foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear); + texture_2d norm_tex = texture_2d("./textures/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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + + + + + + + + + + + + diff --git a/code/third_party/vMaterials_2/Metal/Copper_Hammered.mdl b/code/third_party/vMaterials_2/Metal/Copper_Hammered.mdl new file mode 100644 index 0000000000000000000000000000000000000000..e0f3be8de36bf09794556bcce89cb58c6b510f8a --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Copper_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 Copper_Hammered( + color metal_color = color(0.38854f, 0.18195f, 0.10889f) [[ + ::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 = float2(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 = float2(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 Copper - Dark Pits"), + ::anno::author("NVIDIA vMaterials"), + ::anno::in_group("Metal"), + ::anno::key_words(string[]("metal", "copper", "hammered", "blackened", "design", "classic", "architecture", "pattern", "reflective", "rough", "bumped", "conductor", "warm")), + ::anno::thumbnail("./.thumbs/Copper_Hammered.Copper_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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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 Copper_Hammered_Shiny(*) +[[ + ::anno::display_name("Hammered Copper - Shiny"), + ::anno::author("NVIDIA vMaterials"), + ::anno::in_group("Metal"), + ::anno::key_words(string[]("metal", "copper", "hammered", "design", "classic", "architecture", "pattern", "reflective", "rough", "bumped", "conductor", "shiny", "warm")), + ::anno::thumbnail("./.thumbs/Copper_Hammered.Copper_Hammered_Shiny.png"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT) +]] + = Copper_Hammered( + metal_color: color(0.38854f, 0.18195f, 0.10889f), + 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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + +export material Copper_Hammered_Dull(*) +[[ + ::anno::display_name("Hammered Copper - Dull"), + ::anno::author("NVIDIA vMaterials"), + ::anno::in_group("Metal"), + ::anno::key_words(string[]("metal", "copper", "hammered", "design", "classic", "architecture", "pattern", "reflective", "rough", "bumped", "conductor", "matte", "dull", "warm")), + ::anno::thumbnail("./.thumbs/Copper_Hammered.Copper_Hammered_Dull.png"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT) +]] + = Copper_Hammered( + metal_color: color(0.38854f, 0.18195f, 0.10889f), + 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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Metal/Copper_Knurling.mdl b/code/third_party/vMaterials_2/Metal/Copper_Knurling.mdl new file mode 100644 index 0000000000000000000000000000000000000000..8c2c69a0a95261425e3f64c425f0b59f439196d4 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Copper_Knurling.mdl @@ -0,0 +1,359 @@ +/****************************************************************************** + * 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 ::df::*; +import ::tex::*; +import ::math::*; +import ::base::*; +import ::state::*; +import ::anno::*; +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 = "Metal with a diamond knurling finish"; + +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; + //TODO: at least also handle sign of z? + //TODO: handle tangent becoming 0 + + + 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)); +} + +export material Copper_Knurling( + //Appearance + float brightness = float(0.7f) [[ + ::anno::description("Adjusts the brightness of the material."), + ::anno::display_name("Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.0f, 1.0f) + ]], + float roughness = float(0.5f) [[ + ::anno::description("Higher values lead to a rougher appearance of the material."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.0f, 1.0f) + ]], + float grooves_dirt = float(0.4f) [[ + ::anno::description("Adds dirt in the grooves of the knurling pattern."), + ::anno::display_name("Grooves Dirt"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.0f, 1.0f) + ]], + uniform float bump_strength = float(0.8f) [[ + ::anno::description("Adds dirt in the grooves of the knurling pattern."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.0f, 1.0f) + ]], + + // Round Corners + 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("Sets the radius of the round corners in millimeters."), + ::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") + ]], + //Transform + float2 texture_translate = float2(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"), + ::anno::soft_range(0.f, 360.f) + ]], + float2 texture_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(0.35f, .35f)), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + + // Advanced + uniform int uv_space_index = 0 [[ + ::anno::description("Uses the selected UV space index."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced"), + ::anno::soft_range(0, 4) + ]] +) +[[ + ::anno::display_name("Metal Knurling Copper"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Copper_Knurling.Copper_Knurling.png"), + ::anno::key_words(string[]("metal", "copper", "knurled", "knurling", "pattern", "design", "warm", "bumped")), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials") +]] += let +{ + color metal_tint = color(0.9654565f, 0.6899602f, 0.4830392f); + + // Texture setup + texture_2d normal_tex = texture_2d("./textures/metal_knurling_norm.jpg", ::tex::gamma_linear); + texture_2d multi_heights_tex = texture_2d("./textures/metal_knurling_multi_heights.jpg", ::tex::gamma_linear); + texture_2d diff_rough_grunge_tex = texture_2d("./textures/metal_knurling_multi_R_diff_G_rough_B_grunge.jpg", ::tex::gamma_linear); + + // Coordinate setup + ::base::texture_coordinate_info uvw = vmat_transform( + translation: texture_translate, + rotation: texture_rotate, + scaling: texture_scale, + system: ::base::texture_coordinate_uvw, + uv_space: uv_space_index + ); + + // ---------- Diff Rough Grunge Lookup ---------- + + float3 diff_rough_grunge_lookup = float3( + ::base::file_texture( + texture: diff_rough_grunge_tex, + uvw: uvw, + mono_source: ::base::mono_average + ).tint ); + + float3 multi_height_lookup = float3( + ::base::file_texture( + texture: multi_heights_tex, + uvw: uvw, + mono_source: ::base::mono_average + ).tint ); + + float3 norm = ::base::tangent_space_normal_texture( + texture: normal_tex, + factor: bump_strength, + uvw: uvw + ); + + + float remap_rough = histogram_range( + input: diff_rough_grunge_lookup.y, + range: 1.0f, + position: 0.234f + ); + + + float roughness_mapped = remap_rough + (roughness * multi_height_lookup.y); + + float remapped_diff = histogram_range( + input: diff_rough_grunge_lookup.x, + range: 1.0f, + position: (brightness * 0.4f) + 0.4f + ); + + float diff_contribution = ::math::pow(remapped_diff - ((grooves_dirt * 0.5) * multi_height_lookup.x * diff_rough_grunge_lookup.z), 2.67f); + + bsdf ggx_smith_bumped = ::df::weighted_layer( + layer: ::df::microfacet_ggx_smith_bsdf( + roughness_u: roughness_mapped * roughness_mapped, + roughness_v: roughness_mapped * roughness_mapped, + tint: color(diff_contribution), + mode: ::df::scatter_reflect + ), + base: bsdf(), + weight: 1.0f, + normal: norm + ); + + bsdf diff_bsdf = ::df::diffuse_reflection_bsdf( + tint: color(diff_contribution) + ); + + + bsdf final_bsdf = ::df::weighted_layer( + weight: 1.0f - (diff_rough_grunge_lookup.z * multi_height_lookup.x * grooves_dirt), + layer: ::df::directional_factor( + normal_tint: metal_tint, + grazing_tint: color(1.0f), + base: ggx_smith_bumped + ), + base: diff_bsdf + ); + + + // Round Corners + float3 round_normal = enable_round_corners ? + ::state::rounded_corner_normal( + radius: roundcorner_radius * 0.001, + across_materials: across_materials + ) : ::state::normal(); +} +in material ( + + surface: material_surface( + scattering: final_bsdf + ), + geometry: material_geometry( + normal: round_normal + ) +); + + +export material Copper_Knurling_Worn(*) +[[ + ::anno::display_name("Metal Knurling - Copper Worn"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Copper_Knurling.Copper_Knurling_Worn.png"), + ::anno::key_words(string[]("metal", "copper", "knurled", "pattern", "knurling", "design", "bumped", "warm", "worn")), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials") +]] = Copper_Knurling( + brightness: 0.4f, + roughness: 1.0f, + grooves_dirt: 1.0f, + bump_strength: 0.8f, + + enable_round_corners: false, + roundcorner_radius: 1.2f, + across_materials: false, + + texture_translate: float2(0.0f), + texture_rotate: 0.f, + texture_scale: float2(1.0f), + + uv_space_index: 0 +); + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/code/third_party/vMaterials_2/Metal/Copper_Scratched.mdl b/code/third_party/vMaterials_2/Metal/Copper_Scratched.mdl new file mode 100644 index 0000000000000000000000000000000000000000..a39d890491dfddf05b576e064b0f210b576855e6 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Copper_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 Copper_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 = float2(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 = float2(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("Copper Scratched"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "copper", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped")), + ::anno::thumbnail("./.thumbs/Copper_Scratched.Copper_Scratched.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = + let { + float brush_scratches_weight = 0.5f; + // Copper Reflection Color + color reflection_color = color(0.9654565f, 0.6899602f, 0.4830392f); + 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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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 Copper_Scratched_Light_Bumpy(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Copper Scratched - Bright and Bumped"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "copper", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "shiny")), + ::anno::thumbnail("./.thumbs/Copper_Scratched.Copper_Scratched_Light_Bumpy.png"), + ::anno::copyright_notice(COPYRIGHT) +]]= Copper_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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); + + + +export material Copper_Scratched_Dark_Shiny(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Copper Scratched - Dark Shiny"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "copper", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "shiny", "dark")), + ::anno::thumbnail("./.thumbs/Copper_Scratched.Copper_Scratched_Dark_Shiny.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Copper_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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); + + +export material Copper_Scratched_Dark_Matte(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Copper Scratched - Dark Matte"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "copper", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "matte", "dark")), + ::anno::thumbnail("./.thumbs/Copper_Scratched.Copper_Scratched_Dark_Matte.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Copper_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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); + + + + +export material Copper_Scratched_Scuffs_and_Grime(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Copper Scratched - Scuffs and Grime"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "copper", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "matte", "dark")), + ::anno::thumbnail("./.thumbs/Copper_Scratched.Copper_Scratched_Scuffs_and_Grime.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Copper_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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); + + + + +export material Copper_Scratched_Dirty_Rough(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Copper Scratched - Dirty Rough"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "copper", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "matte", "dark")), + ::anno::thumbnail("./.thumbs/Copper_Scratched.Copper_Scratched_Dirty_Rough.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Copper_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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); diff --git a/code/third_party/vMaterials_2/Metal/Copper_Sheet.mdl b/code/third_party/vMaterials_2/Metal/Copper_Sheet.mdl new file mode 100644 index 0000000000000000000000000000000000000000..90b6ec403e18fb511a1354231dbdd885977e3208 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Copper_Sheet.mdl @@ -0,0 +1,1337 @@ +/****************************************************************************** + * 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 copper 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) + float2(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 Copper_Sheet( + 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::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::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 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 = float2(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 = float2(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 Copper - New Clean"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Copper_Sheet.Copper_Sheet.png"), + ::anno::key_words(string[]("metal", "sheet", "copper", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "warm")) +]] + = + let { + color normal_reflectivity = color(0.9654565f, 0.6899602f, 0.4830392f); + 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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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 Copper_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 = float2(.5f, .5f) + [[ + ::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) + ]], + + + +// Copper 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.4f [[ + ::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.3f [[ + ::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 = .98 [[ + ::anno::display_name("Splotchy Imperfection Ratio"), + ::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 = float2(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 = float2(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::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Copper Sheet - Circular Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Copper_Sheet.Copper_Sheet_Punched.png"), + ::anno::key_words(string[]("metal", "sheet", "copper", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "circular", "warm")) +]] = let +{ + material base_mat = Copper_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("./textures/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 + ) +); + +// ----------------------------- Copper Sheet Presets --------------------------- + +export material Copper_Sheet_Soft_Splotches(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Copper - Soft Splotches"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Copper_Sheet.Copper_Sheet_Soft_Splotches.png"), + ::anno::key_words(string[]("metal", "sheet", "copper", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "warm")) +]] += Copper_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + + +export material Copper_Sheet_Matte_Imperfections(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Copper - Matte Imperfections"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Copper_Sheet.Copper_Sheet_Matte_Imperfections.png"), + ::anno::key_words(string[]("metal", "sheet", "copper", "imperfections", "new", "matte", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "warm")) +]]= Copper_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + + +export material Copper_Sheet_Glossy_Imperfections(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Copper - Glossy Imperfections"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Copper_Sheet.Copper_Sheet_Glossy_Imperfections.png"), + ::anno::key_words(string[]("metal", "sheet", "copper", "imperfections", "new", "glossy", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "warm")) +]] += Copper_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + + +export material Copper_Sheet_Splotchy_Streaks(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Copper - Splotchy Streaks"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Copper_Sheet.Copper_Sheet_Splotchy_Streaks.png"), + ::anno::key_words(string[]("metal", "sheet", "copper", "imperfections", "new", "glossy", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "warm")) +]]= Copper_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + +export material Copper_Sheet_Glossy_Streaks(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Copper - Glossy Streaks"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Copper_Sheet.Copper_Sheet_Glossy_Streaks.png"), + ::anno::key_words(string[]("metal", "sheet", "copper", "imperfections", "new", "glossy", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "warm")) +]] += Copper_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// ------------------------ Punched Copper Sheet Presets ------------------------ +export material Copper_Sheet_Punched_Circular_Small(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Copper Sheet - Small Circular Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Copper_Sheet.Copper_Sheet_Punched_Circular_Small.png"), + ::anno::key_words(string[]("metal", "sheet", "copper", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "warm")) +]] = Copper_Sheet_Punched( + shape_select: pattern_circle, + punching_grid_size: float2(.6f), + 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, + // Punchig Parameters + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.5f, + roughness: 0.4f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.3f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.93f, + impurities_weight_3: 0.98f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Copper_Sheet_Punched_Hexagonal(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Copper Sheet - Hexagonal Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Copper_Sheet.Copper_Sheet_Punched_Hexagonal.png"), + ::anno::key_words(string[]("metal", "sheet", "copper", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "hexagonal", "warm")) +]] = Copper_Sheet_Punched( + // Punchig Parameters + shape_select: pattern_hexagon, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.5f, + roughness: 0.4f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.3f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.93f, + impurities_weight_3: 0.98f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Copper_Sheet_Punched_Hexagonal_Small(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Copper Sheet - Small Hexagonal Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Copper_Sheet.Copper_Sheet_Punched_Hexagonal_Small.png"), + ::anno::key_words(string[]("metal", "sheet", "copper", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "hexagonal", "warm")) +]] = Copper_Sheet_Punched( + // Punchig 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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.5f, + roughness: 0.4f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.3f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.93f, + impurities_weight_3: 0.98f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Copper_Sheet_Punched_Square(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Copper Sheet - Square Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Copper_Sheet.Copper_Sheet_Punched_Square.png"), + ::anno::key_words(string[]("metal", "sheet", "copper", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "square", "warm")) +]] = Copper_Sheet_Punched( + // Punchig Parameters + shape_select: pattern_square, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.5f, + roughness: 0.4f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.3f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.93f, + impurities_weight_3: 0.98f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + +export material Copper_Sheet_Punched_Line(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Copper Sheet - Line Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Copper_Sheet.Copper_Sheet_Punched_Line.png"), + ::anno::key_words(string[]("metal", "sheet", "copper", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "line", "warm")) +]] = Copper_Sheet_Punched( + // Punchig Parameters + shape_select: pattern_line, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.5f, + roughness: 0.4f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.3f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.93f, + impurities_weight_3: 0.98f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Copper_Sheet_Punched_Cross(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Copper Sheet - Cross Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Copper_Sheet.Copper_Sheet_Punched_Cross.png"), + ::anno::key_words(string[]("metal", "sheet", "copper", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "cross", "warm")) +]] = Copper_Sheet_Punched( + // Punchig Parameters + shape_select: pattern_cross, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.5f, + roughness: 0.4f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.3f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.93f, + impurities_weight_3: 0.98f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Copper_Sheet_Punched_Rhombus(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Copper Sheet - Rhombus Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Copper_Sheet.Copper_Sheet_Punched_Rhombus.png"), + ::anno::key_words(string[]("metal", "sheet", "copper", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "rhombus", "warm")) +]] = Copper_Sheet_Punched( + // Punchig Parameters + shape_select: pattern_rhombus, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.5f, + roughness: 0.4f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.3f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.93f, + impurities_weight_3: 0.98f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Copper_Sheet_Punched_Triangle(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Copper Sheet - Triangle Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Copper_Sheet.Copper_Sheet_Punched_Triangle.png"), + ::anno::key_words(string[]("metal", "sheet", "copper", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "triangle", "warm")) +]] = Copper_Sheet_Punched( + // Punchig Parameters + shape_select: pattern_triangle, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.5f, + roughness: 0.4f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.3f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.93f, + impurities_weight_3: 0.98f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + +export material Copper_Sheet_Punched_Star(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Copper Sheet - Star Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Copper_Sheet.Copper_Sheet_Punched_Star.png"), + ::anno::key_words(string[]("metal", "sheet", "copper", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "star", "warm")) +]] = Copper_Sheet_Punched( + // Punchig Parameters + shape_select: pattern_star, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.5f, + roughness: 0.4f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.3f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.93f, + impurities_weight_3: 0.98f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Metal/Diamond_Plate_Double_Tear.mdl b/code/third_party/vMaterials_2/Metal/Diamond_Plate_Double_Tear.mdl new file mode 100644 index 0000000000000000000000000000000000000000..91165c6e6491faf0afe6258c60030dc3861d3007 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Diamond_Plate_Double_Tear.mdl @@ -0,0 +1,547 @@ + + +/****************************************************************************** + * 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 diamont metal plate material. The added texture reduces the risk of slipping, " +"making diamond plate a solution for stairs, catwalks, walkways, and ramps in industrial settings"; + + +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); +} + +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]); +} + +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; +} + + +float contrast_brightness( + float input = 0.5f, + float contrast = 0.5f, + float brightness = 0.5f +) +{ + 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; +} + +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)); +} + +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); +} + +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 = float2(1.0f) +) +{ + uv.uv /= scale; + return uv; +} + +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(800); // 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); +} + +::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(); +} + +export material Diamond_Plate_Double_Tear( + float metal_roughness = 0.27f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Metal Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(0) + ]], + float roughness_variation = 0.05f [[ + ::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(1) + ]], + float pattern_shininess = 0.f [[ + ::anno::description("Simulates abrasion of the shape tops by making them more shiny."), + ::anno::display_name("Pattern Shininess"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float dirt_amount = .0f [[ + ::anno::description("The amount of dirt applied to the material."), + ::anno::display_name("Dirt Amount"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float dirt_weight = 0.f [[ + ::anno::description("Makes the dirt transition sharper and more defined."), + ::anno::display_name("Dirt Weight"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + float dirt_brightness = 0.38f [[ + ::anno::description("Makes the dirt darker or brighter."), + ::anno::display_name("Dirt Brightness"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(5) + ]], + float2 texture_translate = float2(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::ui_order(7) + ]], + float2 texture_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), + ::anno::in_group("Transform"), + ::anno::ui_order(8) + ]], + uniform int uv_space_index = 0 [[ + ::anno::description("Uses selected UV space."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced"), + ::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.f [[ + ::anno::description("Radius of the rounded corners."), + ::anno::display_name("Round Corner Radius"), + ::anno::in_group("Round Corners"), + ::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) + ]]) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Diamond Plate 2x - New Shiny"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "plate", "diamond", "reflective", "pattern", "safety", "bumped", "embossed", "infinite tiling", "architecture", "naval", "sanitary", "interior", "exterior", "new", "shiny", "gray")), + ::anno::thumbnail("./.thumbs/Diamond_Plate_Double_Tear.Diamond_Plate_Double_Tear.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = + let { + + float2 texture_rescale = texture_scale * 0.15f; + bool tmp0 = false; + texture_2d shape_multi_ao_height = texture_2d("./textures/doubletear_shape_multi_R_ao_G_height_B_opacity.png", ::tex::gamma_linear); + texture_2d shape_norm = texture_2d("./textures/doubletear_shape_norm.jpg", ::tex::gamma_linear); + + material_surface tmp1(::df::weighted_layer(contrast_brightness(::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f), 0.659999967f, 0.5f), ::df::microfacet_ggx_smith_bsdf(::math::lerp(0.639999986f, histogram_range(vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, roughness_variation * 0.400000006f, metal_roughness * 0.629999995f + 0.0500000007f) + roughness_variation * 0.299999982f * ::math::pow(1.f - float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 1.26999998f), ::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f)) * (1.f - pattern_shininess * float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y) * (::math::lerp(0.639999986f, histogram_range(vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, roughness_variation * 0.400000006f, metal_roughness * 0.629999995f + 0.0500000007f) + roughness_variation * 0.299999982f * ::math::pow(1.f - float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 1.26999998f), ::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f)) * (1.f - pattern_shininess * float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y)), ::math::lerp(0.639999986f, histogram_range(vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, roughness_variation * 0.400000006f, metal_roughness * 0.629999995f + 0.0500000007f) + roughness_variation * 0.299999982f * ::math::pow(1.f - float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 1.26999998f), ::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f)) * (1.f - pattern_shininess * float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y) * (::math::lerp(0.639999986f, histogram_range(vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, roughness_variation * 0.400000006f, metal_roughness * 0.629999995f + 0.0500000007f) + roughness_variation * 0.299999982f * ::math::pow(1.f - float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 1.26999998f), ::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f)) * (1.f - pattern_shininess * float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y)), color(0.387622833f, 0.387622833f, 0.387622833f), color(0.387622833f, 0.387622833f, 0.387622833f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(vm_tex_lookup(texture_2d("./textures/dirt.jpg", ::tex::gamma_srgb), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(0.5f)), mono_average, float4(dirt_brightness * 0.620000005f + 0.0599999987f)).tint, 0.f), bsdf(), add_detail_normal(::math::lerp(vm_tex_normal_lookup(texture_2d("./textures/plate_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), 1.f), ::state::normal(), contrast_brightness(::math::pow(::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f), 0.229999989f), 0.699999988f, 0.5f)), vm_tex_normal_lookup(shape_norm, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), 1.f))), add_detail_normal(::math::lerp(vm_tex_normal_lookup(texture_2d("./textures/plate_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), 1.f), ::state::normal(), contrast_brightness(::math::pow(::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f), 0.229999989f), 0.699999988f, 0.5f)), vm_tex_normal_lookup(shape_norm, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), 1.f))), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + 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); + + +// 2 +export material Diamond_Plate_Double_Tear_Glossy(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Diamond Plate 2x - Glossy"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "plate", "diamond", "pattern", "safety", "bumped", "embossed", "infinite tiling", "architecture", "naval", "sanitary", "interior", "exterior", "gray", "glossy")), + ::anno::thumbnail("./.thumbs/Diamond_Plate_Double_Tear.Diamond_Plate_Double_Tear_Glossy.png"), + ::anno::copyright_notice(COPYRIGHT) +]] += Diamond_Plate_Double_Tear ( + metal_roughness: 0.4f, + roughness_variation: 0.47f, + pattern_shininess: 0.0f, + dirt_amount: 0.0f, + dirt_weight: 1.0f, + dirt_brightness: 0.38f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 1.5f, + roundcorners_across_materials: false +); + + +// 3 +export material Diamond_Plate_Double_Tear_Shiny_Tops(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Diamond Plate 2x - Shiny Tops"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "plate", "diamond", "pattern", "safety", "bumped", "embossed", "infinite tiling", "architecture", "naval", "sanitary", "interior", "exterior", "shiny", "gray")), + ::anno::thumbnail("./.thumbs/Diamond_Plate_Double_Tear.Diamond_Plate_Double_Tear_Shiny_Tops.png"), + ::anno::copyright_notice(COPYRIGHT) +]] += Diamond_Plate_Double_Tear ( + metal_roughness: 0.4f, + roughness_variation: 0.47f, + pattern_shininess: 0.75f, + dirt_amount: 0.0f, + dirt_weight: 1.0f, + dirt_brightness: 0.38f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 1.5f, + roundcorners_across_materials: false +); + +// 4 +export material Diamond_Plate_Double_Tear_Matte_Aged(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Diamond Plate 2x - Matte Aged"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "plate", "diamond", "pattern", "safety", "bumped", "embossed", "infinite tiling", "architecture", "naval", "sanitary", "interior", "exterior", "matte", "aged", "gray")), + ::anno::thumbnail("./.thumbs/Diamond_Plate_Double_Tear.Diamond_Plate_Double_Tear_Matte_Aged.png"), + ::anno::copyright_notice(COPYRIGHT) +]] += Diamond_Plate_Double_Tear ( + metal_roughness: 0.63f, + roughness_variation: 0.72f, + pattern_shininess: 0.0f, + dirt_amount: 0.0f, + dirt_weight: 1.0f, + dirt_brightness: 0.4f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 1.5f, + roundcorners_across_materials: false +); + + +// 5 +export material Diamond_Plate_Double_Tear_Dirty_Worn(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Diamond Plate 2x - Dirty Worn"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "plate", "diamond", "pattern", "safety", "bumped", "embossed", "infinite tiling", "architecture", "naval", "sanitary", "interior", "exterior", "gray", "worn", "old", "dirty", "decayed")), + ::anno::thumbnail("./.thumbs/Diamond_Plate_Double_Tear.Diamond_Plate_Double_Tear_Dirty_Worn.png"), + ::anno::copyright_notice(COPYRIGHT) +]] += Diamond_Plate_Double_Tear ( + metal_roughness: 0.38f, + roughness_variation: 0.53f, + pattern_shininess: 0.0f, + dirt_amount: 0.38f, + dirt_weight: 1.0f, + dirt_brightness: 0.4f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 1.5f, + roundcorners_across_materials: false +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Metal/Diamond_Plate_Quadruple_Tear.mdl b/code/third_party/vMaterials_2/Metal/Diamond_Plate_Quadruple_Tear.mdl new file mode 100644 index 0000000000000000000000000000000000000000..b3d2f107843a95b021c75b19453536fbb2dd6982 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Diamond_Plate_Quadruple_Tear.mdl @@ -0,0 +1,543 @@ +/****************************************************************************** + * 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 diamont metal plate material. The added texture reduces the risk of slipping, " +"making diamond plate a solution for stairs, catwalks, walkways, and ramps in industrial settings"; + + +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); +} + +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]); +} + +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; +} + +float contrast_brightness( + float input = 0.5f, + float contrast = 0.5f, + float brightness = 0.5f +) +{ + 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; +} + +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)); +} + +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); +} + +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 = float2(1.0f) +) +{ + uv.uv /= scale; + return uv; +} + +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(800); // 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); +} + +::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(); +} + +export material Diamond_Plate_Quadruple_Tear( + float metal_roughness = 0.27f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Metal Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(0) + ]], + float roughness_variation = 0.05f [[ + ::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(1) + ]], + float pattern_shininess = 0.f [[ + ::anno::description("Simulates abrasion of the shape tops by making them more shiny."), + ::anno::display_name("Pattern Shininess"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float dirt_amount = 0.f [[ + ::anno::description("The amount of dirt applied to the material."), + ::anno::display_name("Dirt Amount"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float dirt_weight = 1.f [[ + ::anno::description("Makes the dirt transition sharper and more defined."), + ::anno::display_name("Dirt Weight"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + float dirt_brightness = 0.38f [[ + ::anno::description("Amkes the dirt arker or brighter."), + ::anno::display_name("Dirt Brightness"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(5) + ]], + float2 texture_translate = float2(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::ui_order(7) + ]], + float2 texture_scale = float2(1.0f) [[ + ::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."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced"), + ::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."), + ::anno::display_name("Round Corner Radius"), + ::anno::in_group("Round Corners"), + ::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) + ]]) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Diamond Plate 4x - New Shiny"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "plate", "diamond", "reflective", "pattern", "safety", "bumped", "embossed", "infinite tiling", "architecture", "naval", "sanitary", "interior", "exterior", "new", "shiny", "gray")), + ::anno::thumbnail("./.thumbs/Diamond_Plate_Quadruple_Tear.Diamond_Plate_Quadruple_Tear.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = + let { + + float2 texture_rescale = texture_scale * 0.15f; + bool tmp0 = false; + texture_2d shape_multi_ao_height = texture_2d("./textures/fourtear_shape_multi_R_ao_G_height.png", ::tex::gamma_linear); + texture_2d shape_norm = texture_2d("./textures/fourtear_shape_norm.jpg", ::tex::gamma_linear); + + material_surface tmp1(::df::weighted_layer(contrast_brightness(::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f), 0.659999967f, 0.5f), ::df::microfacet_ggx_smith_bsdf(::math::lerp(0.639999986f, histogram_range(vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, roughness_variation * 0.400000006f, metal_roughness * 0.629999995f + 0.0500000007f) + roughness_variation * 0.299999982f * ::math::pow(1.f - float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 1.26999998f), ::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f)) * (1.f - pattern_shininess * float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y) * (::math::lerp(0.639999986f, histogram_range(vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, roughness_variation * 0.400000006f, metal_roughness * 0.629999995f + 0.0500000007f) + roughness_variation * 0.299999982f * ::math::pow(1.f - float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 1.26999998f), ::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f)) * (1.f - pattern_shininess * float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y)), ::math::lerp(0.639999986f, histogram_range(vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, roughness_variation * 0.400000006f, metal_roughness * 0.629999995f + 0.0500000007f) + roughness_variation * 0.299999982f * ::math::pow(1.f - float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 1.26999998f), ::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f)) * (1.f - pattern_shininess * float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y) * (::math::lerp(0.639999986f, histogram_range(vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, roughness_variation * 0.400000006f, metal_roughness * 0.629999995f + 0.0500000007f) + roughness_variation * 0.299999982f * ::math::pow(1.f - float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 1.26999998f), ::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f)) * (1.f - pattern_shininess * float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y)), color(0.387622833f, 0.387622833f, 0.387622833f), color(0.387622833f, 0.387622833f, 0.387622833f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(vm_tex_lookup(texture_2d("./textures/dirt.jpg", ::tex::gamma_srgb), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(0.5f)), mono_average, float4(dirt_brightness * 0.620000005f + 0.0599999987f)).tint, 0.f), bsdf(), add_detail_normal(::math::lerp(vm_tex_normal_lookup(texture_2d("./textures/plate_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), 1.f), ::state::normal(), contrast_brightness(::math::pow(::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f), 0.229999989f), 0.699999988f, 0.5f)), vm_tex_normal_lookup(shape_norm, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), 1.f))), add_detail_normal(::math::lerp(vm_tex_normal_lookup(texture_2d("./textures/plate_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), 1.f), ::state::normal(), contrast_brightness(::math::pow(::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f), 0.229999989f), 0.699999988f, 0.5f)), vm_tex_normal_lookup(shape_norm, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), 1.f))), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + 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); + +// 2 +export material Diamond_Plate_Quadruple_Tear_Glossy(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Diamond Plate 4x - Glossy"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "plate", "diamond", "pattern", "safety", "bumped", "embossed", "infinite tiling", "architecture", "naval", "sanitary", "interior", "exterior", "gray", "glossy")), + ::anno::thumbnail("./.thumbs/Diamond_Plate_Quadruple_Tear.Diamond_Plate_Quadruple_Tear_Glossy.png"), + ::anno::copyright_notice(COPYRIGHT) +]] += Diamond_Plate_Quadruple_Tear ( + metal_roughness: 0.4f, + roughness_variation: 0.47f, + pattern_shininess: 0.0f, + dirt_amount: 0.0f, + dirt_weight: 1.0f, + dirt_brightness: 0.38f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 1.5f, + roundcorners_across_materials: false +); + + +// 3 +export material Diamond_Plate_Quadruple_Tear_Shiny_Tops(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Diamond Plate 4x - Shiny Tops"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "plate", "diamond", "pattern", "safety", "bumped", "embossed", "infinite tiling", "architecture", "naval", "sanitary", "interior", "exterior", "shiny", "gray")), + ::anno::thumbnail("./.thumbs/Diamond_Plate_Quadruple_Tear.Diamond_Plate_Quadruple_Tear_Shiny_Tops.png"), + ::anno::copyright_notice(COPYRIGHT) +]] += Diamond_Plate_Quadruple_Tear ( + metal_roughness: 0.4f, + roughness_variation: 0.47f, + pattern_shininess: 0.75f, + dirt_amount: 0.0f, + dirt_weight: 1.0f, + dirt_brightness: 0.38f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 1.5f, + roundcorners_across_materials: false +); + +// 4 +export material Diamond_Plate_Quadruple_Tear_Matte_Aged(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Diamond Plate 4x - Matte Aged"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "plate", "diamond", "pattern", "safety", "bumped", "embossed", "infinite tiling", "architecture", "naval", "sanitary", "interior", "exterior", "matte", "aged", "gray")), + ::anno::thumbnail("./.thumbs/Diamond_Plate_Quadruple_Tear.Diamond_Plate_Quadruple_Tear_Matte_Aged.png"), + ::anno::copyright_notice(COPYRIGHT) +]] += Diamond_Plate_Quadruple_Tear ( + metal_roughness: 0.63f, + roughness_variation: 0.72f, + pattern_shininess: 0.0f, + dirt_amount: 0.0f, + dirt_weight: 1.0f, + dirt_brightness: 0.4f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 1.5f, + roundcorners_across_materials: false +); + + +// 5 +export material Diamond_Plate_Quadruple_Tear_Dirty_Worn(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Diamond Plate 4x - Dirty Worn"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "plate", "diamond", "pattern", "safety", "bumped", "embossed", "infinite tiling", "architecture", "naval", "sanitary", "interior", "exterior", "gray", "worn", "old", "dirty", "decayed")), + ::anno::thumbnail("./.thumbs/Diamond_Plate_Quadruple_Tear.Diamond_Plate_Quadruple_Tear_Dirty_Worn.png"), + ::anno::copyright_notice(COPYRIGHT) +]] += Diamond_Plate_Quadruple_Tear ( + metal_roughness: 0.38f, + roughness_variation: 0.53f, + pattern_shininess: 0.0f, + dirt_amount: 0.38f, + dirt_weight: 1.0f, + dirt_brightness: 0.4f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 1.5f, + roundcorners_across_materials: false +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Metal/Diamond_Plate_Quintuple_Tear.mdl b/code/third_party/vMaterials_2/Metal/Diamond_Plate_Quintuple_Tear.mdl new file mode 100644 index 0000000000000000000000000000000000000000..24d6594666f0780424dc1db465bec04a03e51cc6 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Diamond_Plate_Quintuple_Tear.mdl @@ -0,0 +1,544 @@ +/****************************************************************************** + * 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 diamont metal plate material. The added texture reduces the risk of slipping, " +"making diamond plate a solution for stairs, catwalks, walkways, and ramps in industrial settings"; + + +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); +} + +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]); +} + +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; +} + +float contrast_brightness( + float input = 0.5f, + float contrast = 0.5f, + float brightness = 0.5f +) +{ + 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; +} + +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)); +} + +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); +} + +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 = float2(1.0f) +) +{ + uv.uv /= scale; + return uv; +} + +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(800); // 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); +} + +::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(); +} + +export material Diamond_Plate_Quintuple_Tear( + float metal_roughness = 0.27f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Metal Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(0) + ]], + float roughness_variation = 0.05f [[ + ::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(1) + ]], + float pattern_shininess = 0.f [[ + ::anno::description("Simulates abrasion of the shape tops by making them more shiny."), + ::anno::display_name("Pattern Shininess"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float dirt_amount = 0.f [[ + ::anno::description("The amount of dirt applied to the material."), + ::anno::display_name("Dirt Amount"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float dirt_weight = 1.f [[ + ::anno::description("Makes the dirt transition sharper and more defined."), + ::anno::display_name("Dirt Weight"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + float dirt_brightness = 0.38f [[ + ::anno::description("Amkes the dirt arker or brighter."), + ::anno::display_name("Dirt Brightness"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(5) + ]], + float2 texture_translate = float2(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::ui_order(7) + ]], + float2 texture_scale = float2(1.0f) [[ + ::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."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced"), + ::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."), + ::anno::display_name("Round Corner Radius"), + ::anno::in_group("Round Corners"), + ::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) + ]]) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Diamond Plate 5x - New Shiny"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "plate", "diamond", "reflective", "pattern", "safety", "bumped", "embossed", "infinite tiling", "architecture", "naval", "sanitary", "interior", "exterior", "new", "shiny", "gray")), + ::anno::thumbnail("./.thumbs/Diamond_Plate_Quintuple_Tear.Diamond_Plate_Quintuple_Tear.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = + let { + + float2 texture_rescale = texture_scale * 0.15f; + bool tmp0 = false; + texture_2d shape_multi_ao_height = texture_2d("./textures/fivetear_shape_multi_R_ao_G_height_B_opacity.jpg", ::tex::gamma_linear); + texture_2d shape_norm = texture_2d("./textures/fivetear_shape_norm.jpg", ::tex::gamma_linear); + + material_surface tmp1(::df::weighted_layer(contrast_brightness(::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f), 0.659999967f, 0.5f), ::df::microfacet_ggx_smith_bsdf(::math::lerp(0.639999986f, histogram_range(vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, roughness_variation * 0.400000006f, metal_roughness * 0.629999995f + 0.0500000007f) + roughness_variation * 0.299999982f * ::math::pow(1.f - float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 1.26999998f), ::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f)) * (1.f - pattern_shininess * float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y) * (::math::lerp(0.639999986f, histogram_range(vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, roughness_variation * 0.400000006f, metal_roughness * 0.629999995f + 0.0500000007f) + roughness_variation * 0.299999982f * ::math::pow(1.f - float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 1.26999998f), ::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f)) * (1.f - pattern_shininess * float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y)), ::math::lerp(0.639999986f, histogram_range(vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, roughness_variation * 0.400000006f, metal_roughness * 0.629999995f + 0.0500000007f) + roughness_variation * 0.299999982f * ::math::pow(1.f - float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 1.26999998f), ::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f)) * (1.f - pattern_shininess * float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y) * (::math::lerp(0.639999986f, histogram_range(vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, roughness_variation * 0.400000006f, metal_roughness * 0.629999995f + 0.0500000007f) + roughness_variation * 0.299999982f * ::math::pow(1.f - float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 1.26999998f), ::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f)) * (1.f - pattern_shininess * float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y)), color(0.387622833f, 0.387622833f, 0.387622833f), color(0.387622833f, 0.387622833f, 0.387622833f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(vm_tex_lookup(texture_2d("./textures/dirt.jpg", ::tex::gamma_srgb), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(0.5f)), mono_average, float4(dirt_brightness * 0.620000005f + 0.0599999987f)).tint, 0.f), bsdf(), add_detail_normal(::math::lerp(vm_tex_normal_lookup(texture_2d("./textures/plate_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), 1.f), ::state::normal(), contrast_brightness(::math::pow(::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f), 0.229999989f), 0.699999988f, 0.5f)), vm_tex_normal_lookup(shape_norm, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), 1.f))), add_detail_normal(::math::lerp(vm_tex_normal_lookup(texture_2d("./textures/plate_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), 1.f), ::state::normal(), contrast_brightness(::math::pow(::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f), 0.229999989f), 0.699999988f, 0.5f)), vm_tex_normal_lookup(shape_norm, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), 1.f))), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + 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); + + +// 2 +export material Diamond_Plate_Quintuple_Tear_Glossy(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Diamond Plate 5x - Glossy"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "plate", "diamond", "pattern", "safety", "bumped", "embossed", "infinite tiling", "architecture", "naval", "sanitary", "interior", "exterior", "gray", "glossy")), + ::anno::thumbnail("./.thumbs/Diamond_Plate_Quintuple_Tear.Diamond_Plate_Quintuple_Tear_Glossy.png"), + ::anno::copyright_notice(COPYRIGHT) +]] += Diamond_Plate_Quintuple_Tear ( + metal_roughness: 0.4f, + roughness_variation: 0.47f, + pattern_shininess: 0.0f, + dirt_amount: 0.0f, + dirt_weight: 1.0f, + dirt_brightness: 0.38f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 1.5f, + roundcorners_across_materials: false +); + + +// 3 +export material Diamond_Plate_Quintuple_Tear_Shiny_Tops(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Diamond Plate 5x - Shiny Tops"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "plate", "diamond", "pattern", "safety", "bumped", "embossed", "infinite tiling", "architecture", "naval", "sanitary", "interior", "exterior", "shiny", "gray")), + ::anno::thumbnail("./.thumbs/Diamond_Plate_Quintuple_Tear.Diamond_Plate_Quintuple_Tear_Shiny_Tops.png"), + ::anno::copyright_notice(COPYRIGHT) +]] += Diamond_Plate_Quintuple_Tear ( + metal_roughness: 0.4f, + roughness_variation: 0.47f, + pattern_shininess: 0.75f, + dirt_amount: 0.0f, + dirt_weight: 1.0f, + dirt_brightness: 0.38f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 1.5f, + roundcorners_across_materials: false +); + +// 4 +export material Diamond_Plate_Quintuple_Tear_Matte_Aged(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Diamond Plate 5x - Matte Aged"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "plate", "diamond", "pattern", "safety", "bumped", "embossed", "infinite tiling", "architecture", "naval", "sanitary", "interior", "exterior", "matte", "aged", "gray")), + ::anno::thumbnail("./.thumbs/Diamond_Plate_Quintuple_Tear.Diamond_Plate_Quintuple_Tear_Matte_Aged.png"), + ::anno::copyright_notice(COPYRIGHT) +]] += Diamond_Plate_Quintuple_Tear ( + metal_roughness: 0.63f, + roughness_variation: 0.72f, + pattern_shininess: 0.0f, + dirt_amount: 0.0f, + dirt_weight: 1.0f, + dirt_brightness: 0.4f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 1.5f, + roundcorners_across_materials: false +); + + +// 5 +export material Diamond_Plate_Quintuple_Tear_Dirty_Worn(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Diamond Plate 5x - Dirty Worn"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "plate", "diamond", "pattern", "safety", "bumped", "embossed", "infinite tiling", "architecture", "naval", "sanitary", "interior", "exterior", "shiny", "gray", "worn", "old", "dirty", "decayed")), + ::anno::thumbnail("./.thumbs/Diamond_Plate_Quintuple_Tear.Diamond_Plate_Quintuple_Tear_Dirty_Worn.png"), + ::anno::copyright_notice(COPYRIGHT) +]] += Diamond_Plate_Quintuple_Tear ( + metal_roughness: 0.38f, + roughness_variation: 0.53f, + pattern_shininess: 0.0f, + dirt_amount: 0.38f, + dirt_weight: 1.0f, + dirt_brightness: 0.4f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 1.5f, + roundcorners_across_materials: false +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Metal/Diamond_Plate_Single_Tear.mdl b/code/third_party/vMaterials_2/Metal/Diamond_Plate_Single_Tear.mdl new file mode 100644 index 0000000000000000000000000000000000000000..2e41f8b60dda736587acd42c0bb00a3a286b8c4d --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Diamond_Plate_Single_Tear.mdl @@ -0,0 +1,546 @@ +/****************************************************************************** + * 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 diamont metal plate material. The added texture reduces the risk of slipping, " +"making diamond plate a solution for stairs, catwalks, walkways, and ramps in industrial settings"; + + +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); +} + +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]); +} + +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; +} + + +float contrast_brightness( + float input = 0.5f, + float contrast = 0.5f, + float brightness = 0.5f +) +{ + 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; +} + +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)); +} + +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); +} + +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 = float2(1.0f) +) +{ + uv.uv /= scale; + return uv; +} + +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(800); // 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); +} + +::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(); +} + +export material Diamond_Plate_Single_Tear( + float metal_roughness = 0.27f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Metal Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(0) + ]], + float roughness_variation = 0.05f [[ + ::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(1) + ]], + float pattern_shininess = 0.f [[ + ::anno::description("Simulates abrasion of the shape tops by making them more shiny."), + ::anno::display_name("Pattern Shininess"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float dirt_amount = 0.f [[ + ::anno::description("The amount of dirt applied to the material."), + ::anno::display_name("Dirt Amount"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float dirt_weight = 1.f [[ + ::anno::description("Makes the dirt transition sharper and more defined."), + ::anno::display_name("Dirt Weight"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + float dirt_brightness = 0.38f [[ + ::anno::description("Amkes the dirt arker or brighter."), + ::anno::display_name("Dirt Brightness"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(5) + ]], + float2 texture_translate = float2(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::ui_order(7) + ]], + float2 texture_scale = float2(1.0f) [[ + ::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."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced"), + ::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."), + ::anno::display_name("Round Corner Radius"), + ::anno::in_group("Round Corners"), + ::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) + ]]) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Diamond Plate 1x - New Shiny"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "plate", "diamond", "reflective", "pattern", "safety", "bumped", "embossed", "infinite tiling", "architecture", "naval", "sanitary", "interior", "exterior", "new", "shiny", "gray")), + ::anno::thumbnail("./.thumbs/Diamond_Plate_Single_Tear.Diamond_Plate_Single_Tear.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = + let { + + float2 texture_rescale = texture_scale * 0.15f; + bool tmp0 = false; + texture_2d shape_multi_ao_height = texture_2d("./textures/tear_multi_ao_height.png", ::tex::gamma_linear); + texture_2d shape_norm = texture_2d("./textures/tear_norm.jpg", ::tex::gamma_linear); + + material_surface tmp1(::df::weighted_layer(contrast_brightness(::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f), 0.659999967f, 0.5f), ::df::microfacet_ggx_smith_bsdf(::math::lerp(0.639999986f, histogram_range(vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, roughness_variation * 0.400000006f, metal_roughness * 0.629999995f + 0.0500000007f) + roughness_variation * 0.299999982f * ::math::pow(1.f - float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 1.26999998f), ::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f)) * (1.f - pattern_shininess * float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y) * (::math::lerp(0.639999986f, histogram_range(vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, roughness_variation * 0.400000006f, metal_roughness * 0.629999995f + 0.0500000007f) + roughness_variation * 0.299999982f * ::math::pow(1.f - float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 1.26999998f), ::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f)) * (1.f - pattern_shininess * float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y)), ::math::lerp(0.639999986f, histogram_range(vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, roughness_variation * 0.400000006f, metal_roughness * 0.629999995f + 0.0500000007f) + roughness_variation * 0.299999982f * ::math::pow(1.f - float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 1.26999998f), ::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f)) * (1.f - pattern_shininess * float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y) * (::math::lerp(0.639999986f, histogram_range(vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, roughness_variation * 0.400000006f, metal_roughness * 0.629999995f + 0.0500000007f) + roughness_variation * 0.299999982f * ::math::pow(1.f - float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 1.26999998f), ::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f)) * (1.f - pattern_shininess * float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y)), color(0.387622833f, 0.387622833f, 0.387622833f), color(0.387622833f, 0.387622833f, 0.387622833f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(vm_tex_lookup(texture_2d("./textures/dirt.jpg", ::tex::gamma_srgb), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(0.5f)), mono_average, float4(dirt_brightness * 0.620000005f + 0.0599999987f)).tint, 0.f), bsdf(), add_detail_normal(::math::lerp(vm_tex_normal_lookup(texture_2d("./textures/plate_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), 1.f), ::state::normal(), contrast_brightness(::math::pow(::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f), 0.229999989f), 0.699999988f, 0.5f)), vm_tex_normal_lookup(shape_norm, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), 1.f))), add_detail_normal(::math::lerp(vm_tex_normal_lookup(texture_2d("./textures/plate_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), 1.f), ::state::normal(), contrast_brightness(::math::pow(::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f), 0.229999989f), 0.699999988f, 0.5f)), vm_tex_normal_lookup(shape_norm, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), 1.f))), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + 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); + + + +// 2 +export material Diamond_Plate_Single_Tear_Glossy(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Diamond Plate 1x - Glossy"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "plate", "diamond", "pattern", "safety", "bumped", "embossed", "infinite tiling", "architecture", "naval", "sanitary", "interior", "exterior", "gray", "glossy")), + ::anno::thumbnail("./.thumbs/Diamond_Plate_Single_Tear.Diamond_Plate_Single_Tear_Glossy.png"), + ::anno::copyright_notice(COPYRIGHT) +]] += Diamond_Plate_Single_Tear ( + metal_roughness: 0.4f, + roughness_variation: 0.47f, + pattern_shininess: 0.0f, + dirt_amount: 0.0f, + dirt_weight: 1.0f, + dirt_brightness: 0.38f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 1.5f, + roundcorners_across_materials: false +); + + +// 3 +export material Diamond_Plate_Single_Tear_Shiny_Tops(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Diamond Plate 1x - Shiny Tops"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "plate", "diamond", "pattern", "safety", "bumped", "embossed", "infinite tiling", "architecture", "naval", "sanitary", "interior", "exterior", "shiny", "gray")), + ::anno::thumbnail("./.thumbs/Diamond_Plate_Single_Tear.Diamond_Plate_Single_Tear_Shiny_Tops.png"), + ::anno::copyright_notice(COPYRIGHT) +]] += Diamond_Plate_Single_Tear ( + metal_roughness: 0.4f, + roughness_variation: 0.47f, + pattern_shininess: 0.75f, + dirt_amount: 0.0f, + dirt_weight: 1.0f, + dirt_brightness: 0.38f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 1.5f, + roundcorners_across_materials: false +); + +// 4 +export material Diamond_Plate_Single_Tear_Matte_Aged(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Diamond Plate 1x - Matte Aged"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "plate", "diamond", "pattern", "safety", "bumped", "embossed", "infinite tiling", "architecture", "naval", "sanitary", "interior", "exterior", "matte", "aged", "gray")), + ::anno::thumbnail("./.thumbs/Diamond_Plate_Single_Tear.Diamond_Plate_Single_Tear_Matte_Aged.png"), + ::anno::copyright_notice(COPYRIGHT) +]] += Diamond_Plate_Single_Tear ( + metal_roughness: 0.63f, + roughness_variation: 0.72f, + pattern_shininess: 0.0f, + dirt_amount: 0.0f, + dirt_weight: 1.0f, + dirt_brightness: 0.4f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 1.5f, + roundcorners_across_materials: false +); + + +// 5 +export material Diamond_Plate_Single_Tear_Dirty_Worn(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Diamond Plate 1x - Dirty Worn"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "plate", "diamond", "pattern", "safety", "bumped", "embossed", "infinite tiling", "architecture", "naval", "sanitary", "interior", "exterior", "gray", "worn", "old", "dirty", "decayed")), + ::anno::thumbnail("./.thumbs/Diamond_Plate_Single_Tear.Diamond_Plate_Single_Tear_Dirty_Worn.png"), + ::anno::copyright_notice(COPYRIGHT) +]] += Diamond_Plate_Single_Tear ( + metal_roughness: 0.38f, + roughness_variation: 0.53f, + pattern_shininess: 0.0f, + dirt_amount: 0.38f, + dirt_weight: 1.0f, + dirt_brightness: 0.4f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 1.5f, + roundcorners_across_materials: false +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Metal/Diamond_Plate_Spike.mdl b/code/third_party/vMaterials_2/Metal/Diamond_Plate_Spike.mdl new file mode 100644 index 0000000000000000000000000000000000000000..df6f6d8dd7899b0b0c4efabd6dd58119681c2475 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Diamond_Plate_Spike.mdl @@ -0,0 +1,545 @@ +/****************************************************************************** + * 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 diamont metal plate material. The added texture reduces the risk of slipping, " +"making diamond plate a solution for stairs, catwalks, walkways, and ramps in industrial settings"; + + +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); +} + +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]); +} + +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; +} + + +float contrast_brightness( + float input = 0.5f, + float contrast = 0.5f, + float brightness = 0.5f +) +{ + 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; +} + +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)); +} + +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); +} + +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 = float2(1.0f) +) +{ + uv.uv /= scale; + return uv; +} + +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(800); // 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); +} + +::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(); +} + +export material Diamond_Plate_Spike( + float metal_roughness = 0.27f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Metal Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(0) + ]], + float roughness_variation = 0.05f [[ + ::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(1) + ]], + float pattern_shininess = 0.f [[ + ::anno::description("Simulates abrasion of the shape tops by making them more shiny."), + ::anno::display_name("Pattern Shininess"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float dirt_amount = 0.f [[ + ::anno::description("The amount of dirt applied to the material."), + ::anno::display_name("Dirt Amount"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float dirt_weight = 1.f [[ + ::anno::description("Makes the dirt transition sharper and more defined."), + ::anno::display_name("Dirt Weight"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + float dirt_brightness = 0.38f [[ + ::anno::description("Amkes the dirt arker or brighter."), + ::anno::display_name("Dirt Brightness"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(5) + ]], + float2 texture_translate = float2(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::ui_order(7) + ]], + float2 texture_scale = float2(1.0f) [[ + ::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."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced"), + ::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."), + ::anno::display_name("Round Corner Radius"), + ::anno::in_group("Round Corners"), + ::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) + ]]) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Diamond Plate Spike - New Shiny"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "plate", "spike", "reflective", "pattern", "safety", "bumped", "embossed", "infinite tiling", "architecture", "naval", "sanitary", "interior", "exterior", "new", "shiny", "gray")), + ::anno::thumbnail("./.thumbs/Diamond_Plate_Spike.Diamond_Plate_Spike.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = + let { + + float2 texture_rescale = texture_scale * 0.15f; + bool tmp0 = false; + texture_2d shape_multi_ao_height = texture_2d("./textures/circdiam_multi_ao_height.png", ::tex::gamma_linear); + texture_2d shape_norm = texture_2d("./textures/circdiam_norm.jpg", ::tex::gamma_linear); + + material_surface tmp1(::df::weighted_layer(contrast_brightness(::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f), 0.659999967f, 0.5f), ::df::microfacet_ggx_smith_bsdf(::math::lerp(0.639999986f, histogram_range(vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, roughness_variation * 0.400000006f, metal_roughness * 0.629999995f + 0.0500000007f) + roughness_variation * 0.299999982f * ::math::pow(1.f - float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 1.26999998f), ::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f)) * (1.f - pattern_shininess * float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y) * (::math::lerp(0.639999986f, histogram_range(vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, roughness_variation * 0.400000006f, metal_roughness * 0.629999995f + 0.0500000007f) + roughness_variation * 0.299999982f * ::math::pow(1.f - float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 1.26999998f), ::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f)) * (1.f - pattern_shininess * float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y)), ::math::lerp(0.639999986f, histogram_range(vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, roughness_variation * 0.400000006f, metal_roughness * 0.629999995f + 0.0500000007f) + roughness_variation * 0.299999982f * ::math::pow(1.f - float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 1.26999998f), ::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f)) * (1.f - pattern_shininess * float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y) * (::math::lerp(0.639999986f, histogram_range(vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, roughness_variation * 0.400000006f, metal_roughness * 0.629999995f + 0.0500000007f) + roughness_variation * 0.299999982f * ::math::pow(1.f - float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 1.26999998f), ::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f)) * (1.f - pattern_shininess * float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y)), color(0.387622833f, 0.387622833f, 0.387622833f), color(0.387622833f, 0.387622833f, 0.387622833f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(vm_tex_lookup(texture_2d("./textures/dirt.jpg", ::tex::gamma_srgb), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(0.5f)), mono_average, float4(dirt_brightness * 0.620000005f + 0.0599999987f)).tint, 0.f), bsdf(), add_detail_normal(::math::lerp(vm_tex_normal_lookup(texture_2d("./textures/plate_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), 1.f), ::state::normal(), contrast_brightness(::math::pow(::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f), 0.229999989f), 0.699999988f, 0.5f)), vm_tex_normal_lookup(shape_norm, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), 1.f))), add_detail_normal(::math::lerp(vm_tex_normal_lookup(texture_2d("./textures/plate_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), 1.f), ::state::normal(), contrast_brightness(::math::pow(::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f), 0.229999989f), 0.699999988f, 0.5f)), vm_tex_normal_lookup(shape_norm, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), 1.f))), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + 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); + + + +// 2 +export material Diamond_Plate_Spike_Glossy(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Diamond Plate Spike - Glossy"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "plate", "spike", "pattern", "safety", "bumped", "embossed", "infinite tiling", "architecture", "naval", "sanitary", "interior", "exterior", "gray", "glossy")), + ::anno::thumbnail("./.thumbs/Diamond_Plate_Spike.Diamond_Plate_Spike_Glossy.png"), + ::anno::copyright_notice(COPYRIGHT) +]] += Diamond_Plate_Spike ( + metal_roughness: 0.4f, + roughness_variation: 0.47f, + pattern_shininess: 0.0f, + dirt_amount: 0.0f, + dirt_weight: 1.0f, + dirt_brightness: 0.38f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 1.5f, + roundcorners_across_materials: false +); + + +// 3 +export material Diamond_Plate_Spike_Shiny_Tops(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Diamond Plate Spike - Shiny Tops"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "plate", "spike", "pattern", "safety", "bumped", "embossed", "infinite tiling", "architecture", "naval", "sanitary", "interior", "exterior", "shiny", "gray")), + ::anno::thumbnail("./.thumbs/Diamond_Plate_Spike.Diamond_Plate_Spike_Shiny_Tops.png"), + ::anno::copyright_notice(COPYRIGHT) +]] += Diamond_Plate_Spike ( + metal_roughness: 0.4f, + roughness_variation: 0.47f, + pattern_shininess: 0.75f, + dirt_amount: 0.0f, + dirt_weight: 1.0f, + dirt_brightness: 0.38f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 1.5f, + roundcorners_across_materials: false +); + +// 4 +export material Diamond_Plate_Spike_Matte_Aged(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Diamond Plate Spike - Matte Aged"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "plate", "spike", "pattern", "safety", "bumped", "embossed", "infinite tiling", "architecture", "naval", "sanitary", "interior", "exterior", "matte", "aged", "gray")), + ::anno::thumbnail("./.thumbs/Diamond_Plate_Spike.Diamond_Plate_Spike_Matte_Aged.png"), + ::anno::copyright_notice(COPYRIGHT) +]] += Diamond_Plate_Spike ( + metal_roughness: 0.63f, + roughness_variation: 0.72f, + pattern_shininess: 0.0f, + dirt_amount: 0.0f, + dirt_weight: 1.0f, + dirt_brightness: 0.4f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 1.5f, + roundcorners_across_materials: false +); + + +// 5 +export material Diamond_Plate_Spike_Dirty_Worn(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Diamond Plate Spike - Dirty Worn"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "plate", "spike", "pattern", "safety", "bumped", "embossed", "infinite tiling", "architecture", "naval", "sanitary", "interior", "exterior", "gray", "worn", "old", "dirty", "decayed")), + ::anno::thumbnail("./.thumbs/Diamond_Plate_Spike.Diamond_Plate_Spike_Dirty_Worn.png"), + ::anno::copyright_notice(COPYRIGHT) +]] += Diamond_Plate_Spike ( + metal_roughness: 0.38f, + roughness_variation: 0.53f, + pattern_shininess: 0.0f, + dirt_amount: 0.38f, + dirt_weight: 1.0f, + dirt_brightness: 0.4f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 1.5f, + roundcorners_across_materials: false +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Metal/Diamond_Plate_Triple_Tear.mdl b/code/third_party/vMaterials_2/Metal/Diamond_Plate_Triple_Tear.mdl new file mode 100644 index 0000000000000000000000000000000000000000..28d9fb84b9c3c5796e4ceede287175962afaad72 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Diamond_Plate_Triple_Tear.mdl @@ -0,0 +1,546 @@ +/****************************************************************************** + * 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 diamont metal plate material. The added texture reduces the risk of slipping, " +"making diamond plate a solution for stairs, catwalks, walkways, and ramps in industrial settings"; + + +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); +} + +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]); +} + +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; +} + + +float contrast_brightness( + float input = 0.5f, + float contrast = 0.5f, + float brightness = 0.5f +) +{ + 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; +} + +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)); +} + +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); +} + +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 = float2(1.0f) +) +{ + uv.uv /= scale; + return uv; +} + +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(800); // 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); +} + +::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(); +} + +export material Diamond_Plate_Triple_Tear( + float metal_roughness = 0.27f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Metal Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(0) + ]], + float roughness_variation = 0.05f [[ + ::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(1) + ]], + float pattern_shininess = 0.f [[ + ::anno::description("Simulates abrasion of the shape tops by making them more shiny."), + ::anno::display_name("Pattern Shininess"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float dirt_amount = 0.f [[ + ::anno::description("The amount of dirt applied to the material."), + ::anno::display_name("Dirt Amount"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float dirt_weight = 1.f [[ + ::anno::description("Makes the dirt transition sharper and more defined."), + ::anno::display_name("Dirt Weight"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + float dirt_brightness = 0.38f [[ + ::anno::description("Amkes the dirt arker or brighter."), + ::anno::display_name("Dirt Brightness"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(5) + ]], + float2 texture_translate = float2(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::ui_order(7) + ]], + float2 texture_scale = float2(1.0f) [[ + ::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."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced"), + ::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."), + ::anno::display_name("Round Corner Radius"), + ::anno::in_group("Round Corners"), + ::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) + ]]) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Diamond Plate 3x - New Shiny"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "plate", "diamond", "reflective", "pattern", "safety", "bumped", "embossed", "infinite tiling", "architecture", "naval", "sanitary", "interior", "exterior", "new", "shiny", "gray")), + ::anno::thumbnail("./.thumbs/Diamond_Plate_Triple_Tear.Diamond_Plate_Triple_Tear.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = + let { + + float2 texture_rescale = texture_scale * 0.15f; + bool tmp0 = false; + texture_2d shape_multi_ao_height = texture_2d("./textures/tripletear_multi_ao_height.png", ::tex::gamma_linear); + texture_2d shape_norm = texture_2d("./textures/tripletear_shape_normal.jpg", ::tex::gamma_linear); + + material_surface tmp1(::df::weighted_layer(contrast_brightness(::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f), 0.659999967f, 0.5f), ::df::microfacet_ggx_smith_bsdf(::math::lerp(0.639999986f, histogram_range(vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, roughness_variation * 0.400000006f, metal_roughness * 0.629999995f + 0.0500000007f) + roughness_variation * 0.299999982f * ::math::pow(1.f - float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 1.26999998f), ::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f)) * (1.f - pattern_shininess * float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y) * (::math::lerp(0.639999986f, histogram_range(vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, roughness_variation * 0.400000006f, metal_roughness * 0.629999995f + 0.0500000007f) + roughness_variation * 0.299999982f * ::math::pow(1.f - float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 1.26999998f), ::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f)) * (1.f - pattern_shininess * float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y)), ::math::lerp(0.639999986f, histogram_range(vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, roughness_variation * 0.400000006f, metal_roughness * 0.629999995f + 0.0500000007f) + roughness_variation * 0.299999982f * ::math::pow(1.f - float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 1.26999998f), ::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f)) * (1.f - pattern_shininess * float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y) * (::math::lerp(0.639999986f, histogram_range(vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, roughness_variation * 0.400000006f, metal_roughness * 0.629999995f + 0.0500000007f) + roughness_variation * 0.299999982f * ::math::pow(1.f - float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 1.26999998f), ::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f)) * (1.f - pattern_shininess * float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y)), color(0.387622833f, 0.387622833f, 0.387622833f), color(0.387622833f, 0.387622833f, 0.387622833f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(vm_tex_lookup(texture_2d("./textures/dirt.jpg", ::tex::gamma_srgb), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(0.5f)), mono_average, float4(dirt_brightness * 0.620000005f + 0.0599999987f)).tint, 0.f), bsdf(), add_detail_normal(::math::lerp(vm_tex_normal_lookup(texture_2d("./textures/plate_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), 1.f), ::state::normal(), contrast_brightness(::math::pow(::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f), 0.229999989f), 0.699999988f, 0.5f)), vm_tex_normal_lookup(shape_norm, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), 1.f))), add_detail_normal(::math::lerp(vm_tex_normal_lookup(texture_2d("./textures/plate_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), 1.f), ::state::normal(), contrast_brightness(::math::pow(::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f), 0.229999989f), 0.699999988f, 0.5f)), vm_tex_normal_lookup(shape_norm, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), 1.f))), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + 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); + + + +// 2 +export material Diamond_Plate_Triple_Tear_Glossy(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Diamond Plate 3x - Glossy"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "plate", "diamond", "pattern", "safety", "bumped", "embossed", "infinite tiling", "architecture", "naval", "sanitary", "interior", "exterior", "gray", "glossy")), + ::anno::thumbnail("./.thumbs/Diamond_Plate_Triple_Tear.Diamond_Plate_Triple_Tear_Glossy.png"), + ::anno::copyright_notice(COPYRIGHT) +]] += Diamond_Plate_Triple_Tear ( + metal_roughness: 0.4f, + roughness_variation: 0.47f, + pattern_shininess: 0.0f, + dirt_amount: 0.0f, + dirt_weight: 1.0f, + dirt_brightness: 0.38f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 1.5f, + roundcorners_across_materials: false +); + + +// 3 +export material Diamond_Plate_Triple_Tear_Shiny_Tops(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Diamond Plate 3x - Shiny Tops"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "plate", "diamond", "pattern", "safety", "bumped", "embossed", "infinite tiling", "architecture", "naval", "sanitary", "interior", "exterior", "shiny", "gray")), + ::anno::thumbnail("./.thumbs/Diamond_Plate_Triple_Tear.Diamond_Plate_Triple_Tear_Shiny_Tops.png"), + ::anno::copyright_notice(COPYRIGHT) +]] += Diamond_Plate_Triple_Tear ( + metal_roughness: 0.4f, + roughness_variation: 0.47f, + pattern_shininess: 0.75f, + dirt_amount: 0.0f, + dirt_weight: 1.0f, + dirt_brightness: 0.38f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 1.5f, + roundcorners_across_materials: false +); + +// 4 +export material Diamond_Plate_Triple_Tear_Matte_Aged(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Diamond Plate 3x - Matte Aged"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "plate", "diamond", "pattern", "safety", "bumped", "embossed", "infinite tiling", "architecture", "naval", "sanitary", "interior", "exterior", "matte", "aged", "gray")), + ::anno::thumbnail("./.thumbs/Diamond_Plate_Triple_Tear.Diamond_Plate_Triple_Tear_Matte_Aged.png"), + ::anno::copyright_notice(COPYRIGHT) +]] += Diamond_Plate_Triple_Tear ( + metal_roughness: 0.63f, + roughness_variation: 0.72f, + pattern_shininess: 0.0f, + dirt_amount: 0.0f, + dirt_weight: 1.0f, + dirt_brightness: 0.4f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 1.5f, + roundcorners_across_materials: false +); + + +// 5 +export material Diamond_Plate_Triple_Tear_Dirty_Worn(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Diamond Plate 3x - Dirty Worn"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "plate", "diamond", "pattern", "safety", "bumped", "embossed", "infinite tiling", "architecture", "naval", "sanitary", "interior", "exterior", "gray", "worn", "old", "dirty", "decayed")), + ::anno::thumbnail("./.thumbs/Diamond_Plate_Triple_Tear.Diamond_Plate_Triple_Tear_Dirty_Worn.png"), + ::anno::copyright_notice(COPYRIGHT) +]] += Diamond_Plate_Triple_Tear ( + metal_roughness: 0.38f, + roughness_variation: 0.53f, + pattern_shininess: 0.0f, + dirt_amount: 0.38f, + dirt_weight: 1.0f, + dirt_brightness: 0.4f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 1.5f, + roundcorners_across_materials: false +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Metal/Gold.mdl b/code/third_party/vMaterials_2/Metal/Gold.mdl new file mode 100644 index 0000000000000000000000000000000000000000..22371d6675c54cc6b8d3a9ad3e4cb9b621f94863 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Gold.mdl @@ -0,0 +1,380 @@ +/****************************************************************************** + * 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 Gold( + 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 = 0.03f [[ + ::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::description("When enabled the round corner effect is applied across different materials."), + ::anno::in_group("Round Corners") + ]], + uniform float2 texture_translate = float2(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 = float2(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("Gold"), + ::anno::description("Pure metal material with optional smudges."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Gold.Gold.png"), + ::anno::key_words(string[]("metal", "pure", "smudged", "design", "reflective", "infinite tiling", "smooth", "conductor", "new", "polished", "gold", "yellow", "warm")) +]] + = + let { + + color normal_reflectivity = color(1.0f,0.722306985258f,0.340058756743f); + 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(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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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, across_materials, 1.f) : ::state::normal()); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + + +export material Gold_Polished(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Gold Polished"), + ::anno::description("Pure metal material with optional smudges."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Gold.Gold_Polished.png"), + ::anno::key_words(string[]("metal", "pure", "design", "reflective", "infinite tiling", "smooth", "conductor", "new", "polished", "gold", "yellow", "warm")) +]] += Gold( + 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 Gold_Glossy_Fingerprints(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Gold Glossy Fingerprints"), + ::anno::description("Pure metal material with optional smudges."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Gold.Gold_Glossy_Fingerprints.png"), + ::anno::key_words(string[]("metal", "pure", "design", "smudged", "reflective", "infinite tiling", "smooth", "conductor", "new", "polished", "gold", "yellow", "warm")) +]] += Gold( + 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/code/third_party/vMaterials_2/Metal/Gold_Brushed.mdl b/code/third_party/vMaterials_2/Metal/Gold_Brushed.mdl new file mode 100644 index 0000000000000000000000000000000000000000..195dc5ebf9d6bbfdbde12995951225a4104656ad --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Gold_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 Gold_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::display_name("Scratch Variation Amount"), + ::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::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance") + ]], + float scratch_reflection_variation = 0.4f [[ + ::anno::display_name("Scratch Reflection Variation"), + ::anno::description("Attenuates the reflection of the brushed metal which will also make the material appear darker."), + ::anno::hard_range(0.0f, 1.0f), + ::anno::in_group("Appearance") + ]], + float scratches_bump = 0.65f [[ + ::anno::display_name("Scratches Bump Amount"), + ::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::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 = float2(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 = float2(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 Gold - Strong Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Gold_Brushed.Gold_Brushed.png"), + ::anno::key_words(string[]("aec", "metal", "gold", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] + = + let { + color normal_reflectivity = color(1.0f,0.722306985258f,0.340058756743f); + 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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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 Gold_Brushed_Light_Brushing(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Brushed Gold - Light Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Gold_Brushed.Gold_Brushed_Light_Brushing.png"), + ::anno::key_words(string[]("aec", "metal", "gold", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] + = Gold_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + +export material Gold_Brushed_Medium_Light_Brushing(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Brushed Gold - Medium Light Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Gold_Brushed.Gold_Brushed_Medium_Light_Brushing.png"), + ::anno::key_words(string[]("aec", "metal", "gold", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] += Gold_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + +export material Gold_Brushed_Medium_Brushing(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Brushed Gold - Medium Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Gold_Brushed.Gold_Brushed_Medium_Brushing.png"), + ::anno::key_words(string[]("aec", "metal", "gold", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] += Gold_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Gold_Brushed_Very_Strong_Brushing(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Brushed Gold - Very Strong Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Gold_Brushed.Gold_Brushed_Very_Strong_Brushing.png"), + ::anno::key_words(string[]("aec", "metal", "gold", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] += Gold_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + + diff --git a/code/third_party/vMaterials_2/Metal/Gold_Foil.mdl b/code/third_party/vMaterials_2/Metal/Gold_Foil.mdl new file mode 100644 index 0000000000000000000000000000000000000000..6b8da9170abce39b46ab1157f657dc38381c4796 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/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 = float2(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 = float2(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("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear); + texture_2d smudge_splotch_tex = texture_2d("./textures/foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear); + texture_2d norm_tex = texture_2d("./textures/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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + + + + + + + + + + + + diff --git a/code/third_party/vMaterials_2/Metal/Gold_Hammered.mdl b/code/third_party/vMaterials_2/Metal/Gold_Hammered.mdl new file mode 100644 index 0000000000000000000000000000000000000000..a08447192936efbab9c107c221e39dacfa58da40 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Gold_Hammered.mdl @@ -0,0 +1,264 @@ +/****************************************************************************** + * 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 Gold_Hammered( + // color metal_color = color(0.780f, 0.626f, 0.327f) [[ + color metal_color = color(0.782f, 0.548f, 0.239f) [[ + ::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 = float2(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 = float2(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 Gold - Dark Pits"), + ::anno::author("NVIDIA vMaterials"), + ::anno::in_group("Metal"), + ::anno::key_words(string[]("metal", "gold", "blackened", "hammered", "design", "classic", "architecture", "pattern", "reflective", "rough", "bumped", "conductor", "warm")), + ::anno::thumbnail("./.thumbs/Gold_Hammered.Gold_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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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 Gold_Hammered_Shiny(*) +[[ + ::anno::display_name("Hammered Gold - Shiny"), + ::anno::author("NVIDIA vMaterials"), + ::anno::in_group("Metal"), + ::anno::key_words(string[]("metal", "gold", "hammered", "design", "classic", "architecture", "pattern", "reflective", "rough", "bumped", "conductor", "shiny", "warm")), + ::anno::thumbnail("./.thumbs/Gold_Hammered.Gold_Hammered_Shiny.png"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT) +]] + = Gold_Hammered( + metal_color: color(0.782f, 0.548f, 0.239f), + 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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + +export material Gold_Hammered_Dull(*) +[[ + ::anno::display_name("Hammered Gold - Dull"), + ::anno::author("NVIDIA vMaterials"), + ::anno::in_group("Metal"), + ::anno::key_words(string[]("metal", "gold", "hammered", "design", "classic", "architecture", "pattern", "reflective", "rough", "bumped", "conductor", "matte", "dull", "warm")), + ::anno::thumbnail("./.thumbs/Gold_Hammered.Gold_Hammered_Dull.png"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT) +]] + = Gold_Hammered( + metal_color: color(0.782f, 0.548f, 0.239f), + 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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Metal/Gold_Knurling.mdl b/code/third_party/vMaterials_2/Metal/Gold_Knurling.mdl new file mode 100644 index 0000000000000000000000000000000000000000..680abc78d8a9a726890b04a8f84bad88e2bc6ec1 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Gold_Knurling.mdl @@ -0,0 +1,359 @@ +/****************************************************************************** + * 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 ::df::*; +import ::tex::*; +import ::math::*; +import ::base::*; +import ::state::*; +import ::anno::*; +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 = "Metal with a diamond knurling finish"; + +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; + //TODO: at least also handle sign of z? + //TODO: handle tangent becoming 0 + + + 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)); +} + +export material Gold_Knurling( + //Appearance + float brightness = float(0.7f) [[ + ::anno::description("Adjusts the brightness of the material."), + ::anno::display_name("Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.0f, 1.0f) + ]], + float roughness = float(0.5f) [[ + ::anno::description("Higher values lead to a rougher appearance of the material."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.0f, 1.0f) + ]], + float grooves_dirt = float(0.4f) [[ + ::anno::description("Adds dirt in the grooves of the knurling pattern."), + ::anno::display_name("Grooves Dirt"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.0f, 1.0f) + ]], + uniform float bump_strength = float(0.8f) [[ + ::anno::description("Adds dirt in the grooves of the knurling pattern."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.0f, 1.0f) + ]], + + // Round Corners + 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("Sets the radius of the round corners in millimeters."), + ::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") + ]], + //Transform + float2 texture_translate = float2(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"), + ::anno::soft_range(0.f, 360.f) + ]], + float2 texture_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(0.35f, .35f)), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + + // Advanced + uniform int uv_space_index = 0 [[ + ::anno::description("uses the selected UV space index."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced"), + ::anno::soft_range(0, 4) + ]] +) +[[ + ::anno::display_name("Metal Knurling Gold"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Gold_Knurling.Gold_Knurling.png"), + ::anno::key_words(string[]("metal", "gold", "knurled", "knurling", "pattern", "design", "yellow", "warm", "bumped")), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials") +]] += let +{ + color metal_tint = color(1.0f, 0.722306985258f, 0.340058756743f); + + // Texture setup + texture_2d normal_tex = texture_2d("./textures/metal_knurling_norm.jpg", ::tex::gamma_linear); + texture_2d multi_heights_tex = texture_2d("./textures/metal_knurling_multi_heights.jpg", ::tex::gamma_linear); + texture_2d diff_rough_grunge_tex = texture_2d("./textures/metal_knurling_multi_R_diff_G_rough_B_grunge.jpg", ::tex::gamma_linear); + + // Coordinate setup + ::base::texture_coordinate_info uvw = vmat_transform( + translation: texture_translate, + rotation: texture_rotate, + scaling: texture_scale, + system: ::base::texture_coordinate_uvw, + uv_space: uv_space_index + ); + + // ---------- Diff Rough Grunge Lookup ---------- + + float3 diff_rough_grunge_lookup = float3( + ::base::file_texture( + texture: diff_rough_grunge_tex, + uvw: uvw, + mono_source: ::base::mono_average + ).tint ); + + float3 multi_height_lookup = float3( + ::base::file_texture( + texture: multi_heights_tex, + uvw: uvw, + mono_source: ::base::mono_average + ).tint ); + + float3 norm = ::base::tangent_space_normal_texture( + texture: normal_tex, + factor: bump_strength, + uvw: uvw + ); + + + float remap_rough = histogram_range( + input: diff_rough_grunge_lookup.y, + range: 1.0f, + position: 0.234f + ); + + + float roughness_mapped = remap_rough + (roughness * multi_height_lookup.y); + + float remapped_diff = histogram_range( + input: diff_rough_grunge_lookup.x, + range: 1.0f, + position: (brightness * 0.4f) + 0.4f + ); + + float diff_contribution = ::math::pow(remapped_diff - ((grooves_dirt * 0.5) * multi_height_lookup.x * diff_rough_grunge_lookup.z), 2.67f); + + bsdf ggx_smith_bumped = ::df::weighted_layer( + layer: ::df::microfacet_ggx_smith_bsdf( + roughness_u: roughness_mapped * roughness_mapped, + roughness_v: roughness_mapped * roughness_mapped, + tint: color(diff_contribution), + mode: ::df::scatter_reflect + ), + base: bsdf(), + weight: 1.0f, + normal: norm + ); + + bsdf diff_bsdf = ::df::diffuse_reflection_bsdf( + tint: color(diff_contribution) + ); + + + bsdf final_bsdf = ::df::weighted_layer( + weight: 1.0f - (diff_rough_grunge_lookup.z * multi_height_lookup.x * grooves_dirt), + layer: ::df::directional_factor( + normal_tint: metal_tint, + grazing_tint: color(1.0f), + base: ggx_smith_bumped + ), + base: diff_bsdf + ); + + + // Round Corners + float3 round_normal = enable_round_corners ? + ::state::rounded_corner_normal( + radius: roundcorner_radius * 0.001, + across_materials: across_materials + ) : ::state::normal(); +} +in material ( + + surface: material_surface( + scattering: final_bsdf + ), + geometry: material_geometry( + normal: round_normal + ) +); + + +export material Gold_Knurling_Worn(*) +[[ + ::anno::display_name("Metal Knurling - Gold Worn"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Gold_Knurling.Gold_Knurling_Worn.png"), + ::anno::key_words(string[]("metal", "gold", "knurled", "pattern", "knurling", "design", "bumped", "yellow", "warm", "worn")), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials") +]] = Gold_Knurling( + brightness: 0.4f, + roughness: 1.0f, + grooves_dirt: 1.0f, + bump_strength: 0.8f, + + enable_round_corners: false, + roundcorner_radius: 1.2f, + across_materials: false, + + texture_translate: float2(0.0f), + texture_rotate: 0.f, + texture_scale: float2(1.0f), + + uv_space_index: 0 +); + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/code/third_party/vMaterials_2/Metal/Gold_Scratched.mdl b/code/third_party/vMaterials_2/Metal/Gold_Scratched.mdl new file mode 100644 index 0000000000000000000000000000000000000000..59e61ee076ef3bb595452e6cec9de0403c3690f4 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Gold_Scratched.mdl @@ -0,0 +1,595 @@ +/****************************************************************************** + * 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 Gold_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 = float2(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 = float2(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("Gold Scratched"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "gold", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "yellow", "warm")), + ::anno::thumbnail("./.thumbs/Gold_Scratched.Gold_Scratched.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = + let { + float brush_scratches_weight = 0.5f; + // Gold Reflection Color + color reflection_color = color(1.0f,0.722306985258f,0.340058756743f); + 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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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 Gold_Scratched_Light_Bumpy(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Gold Scratched - Bright and Bumped"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "gold", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "yellow", "warm", "shiny")), + ::anno::thumbnail("./.thumbs/Gold_Scratched.Gold_Scratched_Light_Bumpy.png"), + ::anno::copyright_notice(COPYRIGHT) +]]= Gold_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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); + + + +export material Gold_Scratched_Dark_Shiny(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Gold Scratched - Dark Shiny"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "gold", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "yellow", "warm", "shiny", "dark")), + ::anno::thumbnail("./.thumbs/Gold_Scratched.Gold_Scratched_Dark_Shiny.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Gold_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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); + + +export material Gold_Scratched_Dark_Matte(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Gold Scratched - Dark Matte"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "gold", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "yellow", "warm", "matte", "dark")), + ::anno::thumbnail("./.thumbs/Gold_Scratched.Gold_Scratched_Dark_Matte.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Gold_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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); + + + + +export material Gold_Scratched_Scuffs_and_Grime(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Gold Scratched - Scuffs and Grime"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "gold", "scratched", "worn", "dirty", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "yellow", "warm", "matte", "dark")), + ::anno::thumbnail("./.thumbs/Gold_Scratched.Gold_Scratched_Scuffs_and_Grime.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Gold_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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); + + + + +export material Gold_Scratched_Dirty_Rough(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Gold Scratched - Dirty Rough"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "gold", "scratched", "worn", "dirt", "dirty", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "yellow", "warm", "matte", "dark")), + ::anno::thumbnail("./.thumbs/Gold_Scratched.Gold_Scratched_Dirty_Rough.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Gold_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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); diff --git a/code/third_party/vMaterials_2/Metal/Gold_Sheet.mdl b/code/third_party/vMaterials_2/Metal/Gold_Sheet.mdl new file mode 100644 index 0000000000000000000000000000000000000000..223b9d5f25ff3ec71444f3c3b16fa92a3d052f61 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Gold_Sheet.mdl @@ -0,0 +1,1345 @@ +/****************************************************************************** + * 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 gold 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) + float2(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 Gold_Sheet( + 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::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::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 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 = float2(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 = float2(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 Gold - New Clean"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Gold_Sheet.Gold_Sheet.png"), + ::anno::key_words(string[]("metal", "sheet", "gold", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "warm")) +]] + = + let { + color normal_reflectivity = color(1.0f, 0.722306985258f, 0.340058756743f); + 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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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 Gold_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 = float2(.5f, .5f) + [[ + ::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) + ]], + + + +// Gold 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::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::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 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 = float2(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 = float2(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::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Gold Sheet - Circular Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Gold_Sheet.Gold_Sheet_Punched.png"), + ::anno::key_words(string[]("metal", "sheet", "gold", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "punched", "punching", "circular", "warm")) +]] = let +{ + material base_mat = Gold_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("./textures/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 + ) +); + + +// ------------------ Gold Sheet Presets ------------------ + +export material Gold_Sheet_Soft_Splotches(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Gold - Soft Splotches"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Gold_Sheet.Gold_Sheet_Soft_Splotches.png"), + ::anno::key_words(string[]("metal", "sheet", "gold", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "warm")) +]] += Gold_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + + +export material Gold_Sheet_Matte_Imperfections(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Gold - Matte Imperfections"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Gold_Sheet.Gold_Sheet_Matte_Imperfections.png"), + ::anno::key_words(string[]("metal", "sheet", "gold", "imperfections", "new", "matte", "unfinished", "reflective", "design", "infinite tiling", "warm")) +]]= Gold_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + + +export material Gold_Sheet_Glossy_Imperfections(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Gold - Glossy Imperfections"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Gold_Sheet.Gold_Sheet_Glossy_Imperfections.png"), + ::anno::key_words(string[]("metal", "sheet", "gold", "imperfections", "new", "glossy", "unfinished", "reflective", "design", "infinite tiling", "warm")) +]] += Gold_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + + +export material Gold_Sheet_Splotchy_Streaks(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Gold - Splotchy Streaks"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Gold_Sheet.Gold_Sheet_Splotchy_Streaks.png"), + ::anno::key_words(string[]("metal", "sheet", "gold", "imperfections", "new", "glossy", "unfinished", "reflective", "design", "infinite tiling", "warm")) +]]= Gold_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + +export material Gold_Sheet_Glossy_Streaks(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Gold - Glossy Streaks"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Gold_Sheet.Gold_Sheet_Glossy_Streaks.png"), + ::anno::key_words(string[]("metal", "sheet", "gold", "imperfections", "new", "glossy", "unfinished", "reflective", "design", "infinite tiling", "warm")) +]] += Gold_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// -------------------- Punched Gold Sheet Presets -------------------- + +export material Gold_Sheet_Punched_Circular_Small(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Gold Sheet - Small Circular Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Gold_Sheet.Gold_Sheet_Punched_Circular_Small.png"), + ::anno::key_words(string[]("metal", "sheet", "gold", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "punched", "punching", "circular", "warm")) +]] += Gold_Sheet_Punched( + // Punching Parameters + shape_select: pattern_circle, + punching_grid_size: float2(.6f), + 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, + + // Gold Sheet Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.4f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.4f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.89f, + impurities_weight_3: 0.86f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Gold_Sheet_Punched_Hexagonal(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Gold Sheet - Hexagonal Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Gold_Sheet.Gold_Sheet_Punched_Hexagonal.png"), + ::anno::key_words(string[]("metal", "sheet", "gold", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "punched", "punching", "hexagonal", "warm")) +]] += Gold_Sheet_Punched( + // Punching Parameters + shape_select: pattern_hexagon, + punching_grid_size: float2(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, + + // Gold Sheet Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.4f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.4f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.89f, + impurities_weight_3: 0.86f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Gold_Sheet_Punched_Hexagonal_Small(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Gold Sheet - Small Hexagonal Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Gold_Sheet.Gold_Sheet_Punched_Hexagonal_Small.png"), + ::anno::key_words(string[]("metal", "sheet", "gold", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "punched", "punching", "hexagonal", "warm")) +]] += Gold_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, + + // Gold Sheet Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.4f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.4f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.89f, + impurities_weight_3: 0.86f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Gold_Sheet_Punched_Square(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Gold Sheet - Square Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Gold_Sheet.Gold_Sheet_Punched_Square.png"), + ::anno::key_words(string[]("metal", "sheet", "gold", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "punched", "punching", "square", "warm")) +]] += Gold_Sheet_Punched( + // Punching Parameters + shape_select: pattern_square, + punching_grid_size: float2(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, + + // Gold Sheet Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.4f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.4f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.89f, + impurities_weight_3: 0.86f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Gold_Sheet_Punched_Line(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Gold Sheet - Line Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Gold_Sheet.Gold_Sheet_Punched_Line.png"), + ::anno::key_words(string[]("metal", "sheet", "gold", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "punched", "punching", "line", "warm")) +]] += Gold_Sheet_Punched( + // Punching Parameters + shape_select: pattern_line, + punching_grid_size: float2(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, + + // Gold Sheet Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.4f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.4f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.89f, + impurities_weight_3: 0.86f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Gold_Sheet_Punched_Cross(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Gold Sheet - Cross Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Gold_Sheet.Gold_Sheet_Punched_Cross.png"), + ::anno::key_words(string[]("metal", "sheet", "gold", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "punched", "punching", "cross", "warm")) +]] += Gold_Sheet_Punched( + // Punching Parameters + shape_select: pattern_cross, + punching_grid_size: float2(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, + + // Gold Sheet Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.4f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.4f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.89f, + impurities_weight_3: 0.86f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Gold_Sheet_Punched_Rhombus(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Gold Sheet - Rhombus Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Gold_Sheet.Gold_Sheet_Punched_Rhombus.png"), + ::anno::key_words(string[]("metal", "sheet", "gold", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "punched", "punching", "rhombus", "warm")) +]] += Gold_Sheet_Punched( + // Punching Parameters + shape_select: pattern_rhombus, + punching_grid_size: float2(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, + + // Gold Sheet Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.4f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.4f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.89f, + impurities_weight_3: 0.86f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Gold_Sheet_Punched_Triangle(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Gold Sheet - Triangle Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Gold_Sheet.Gold_Sheet_Punched_Triangle.png"), + ::anno::key_words(string[]("metal", "sheet", "gold", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "punched", "punching", "triangle", "warm")) +]] += Gold_Sheet_Punched( + // Punching Parameters + shape_select: pattern_triangle, + punching_grid_size: float2(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, + + // Gold Sheet Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.4f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.4f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.89f, + impurities_weight_3: 0.86f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Gold_Sheet_Punched_Star(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Gold Sheet - Star Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Gold_Sheet.Gold_Sheet_Punched_Star.png"), + ::anno::key_words(string[]("metal", "sheet", "gold", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "punched", "punching", "star", "warm")) +]] += Gold_Sheet_Punched( + // Punching Parameters + shape_select: pattern_star, + punching_grid_size: float2(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, + + // Gold Sheet Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.4f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.4f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.89f, + impurities_weight_3: 0.86f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Metal/Iron.mdl b/code/third_party/vMaterials_2/Metal/Iron.mdl new file mode 100644 index 0000000000000000000000000000000000000000..cde8e67373523ff3e7b8c307ea453e49c22764bc --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Iron.mdl @@ -0,0 +1,379 @@ +/****************************************************************************** + * 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 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 Iron( + 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 = 0.03f [[ + ::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::description("When enabled the round corner effect is applied across different materials."), + ::anno::in_group("Round Corners") + ]], + uniform float2 texture_translate = float2(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 = float2(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("Iron"), + ::anno::description("Pure metal material with optional smudges."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Iron.Iron.png"), + ::anno::key_words(string[]("metal", "pure", "smudged", "design", "reflective", "infinite tiling", "smooth", "conductor", "new", "polished", "iron")) +]] + = + let { + + color normal_reflectivity = color(0.5293683f, 0.5132565f, 0.4942483f); + 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(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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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, across_materials, 1.f) : ::state::normal()); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + + +export material Iron_Polished(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Iron Polished"), + ::anno::description("Pure metal material with optional smudges."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Iron.Iron_Polished.png"), + ::anno::key_words(string[]("metal", "pure", "design", "reflective", "infinite tiling", "smooth", "conductor", "new", "polished", "iron")) +]] += Iron( + 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 Iron_Glossy_Fingerprints(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Iron Glossy Fingerprints"), + ::anno::description("Pure metal material with optional smudges."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Iron.Iron_Glossy_Fingerprints.png"), + ::anno::key_words(string[]("metal", "pure", "design", "smudged", "reflective", "infinite tiling", "smooth", "conductor", "new", "polished", "iron")) +]] += Iron( + 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/code/third_party/vMaterials_2/Metal/Iron_Brushed.mdl b/code/third_party/vMaterials_2/Metal/Iron_Brushed.mdl new file mode 100644 index 0000000000000000000000000000000000000000..4624264a31011d7c0221e404bff07600eaa7e41e --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Iron_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 Iron_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 = float2(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 = float2(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 Iron - Strong Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Iron_Brushed.Iron_Brushed.png"), + ::anno::key_words(string[]("aec", "metal", "iron", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] + = + let { + color normal_reflectivity = color(0.5293683f, 0.5132565f, 0.4942483f); + 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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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 Iron_Brushed_Light_Brushing(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Brushed Iron - Light Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Iron_Brushed.Iron_Brushed_Light_Brushing.png"), + ::anno::key_words(string[]("aec", "metal", "iron", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] + = Iron_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + +export material Iron_Brushed_Medium_Light_Brushing(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Brushed Iron - Medium Light Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Iron_Brushed.Iron_Brushed_Medium_Light_Brushing.png"), + ::anno::key_words(string[]("aec", "metal", "iron", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] += Iron_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + +export material Iron_Brushed_Medium_Brushing(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Brushed Iron - Medium Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Iron_Brushed.Iron_Brushed_Medium_Brushing.png"), + ::anno::key_words(string[]("aec", "metal", "iron", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] += Iron_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Iron_Brushed_Very_Strong_Brushing(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Brushed Iron - Very Strong Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Iron_Brushed.Iron_Brushed_Very_Strong_Brushing.png"), + ::anno::key_words(string[]("aec", "metal", "iron", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] += Iron_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + + diff --git a/code/third_party/vMaterials_2/Metal/Iron_Foil.mdl b/code/third_party/vMaterials_2/Metal/Iron_Foil.mdl new file mode 100644 index 0000000000000000000000000000000000000000..81b8997b35e3c3b8c1f93425a5e2f37c363e6b7e --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Iron_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 Iron_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 = float2(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 = float2(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("Iron Foil - Slightly Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Iron_Foil.Iron_Foil.png"), + ::anno::key_words(string[]("design", "metal", "iron", "foil", "smooth", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral")) +]] + = + let { + color normal_reflectivity = color(0.5293683f, 0.5132565f, 0.4942483f); + color grazing_reflectivity = color(0.99942f, 1.f, 1.f); + + texture_2d rough_ao_tex = texture_2d("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear); + texture_2d smudge_splotch_tex = texture_2d("./textures/foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear); + texture_2d norm_tex = texture_2d("./textures/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 Iron_Foil_Smudged_Foil(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Iron Foil - Smudgy Foil"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Iron_Foil.Iron_Foil_Smudged_Foil.png"), + ::anno::key_words(string[]("design", "metal", "iron", "foil", "smooth", "unfinished", "decorative", "creative", "neutral")) +]] += Iron_Foil( + infinite_tiling: true, + roughness: 0.15f, + roughness_variation: 0.84f, + smudges: 0.35f, + bump_strength: 0.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + +export material Iron_Foil_Shiny_Wrinkled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Iron Foil - Shiny Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Iron_Foil.Iron_Foil_Shiny_Wrinkled.png"), + ::anno::key_words(string[]("design", "metal", "iron", "foil", "shiny", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral")) +]] += Iron_Foil( + infinite_tiling: true, + roughness: 0.25f, + roughness_variation: 0.25f, + smudges: 0.75f, + bump_strength: 0.25f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + + +export material Iron_Foil_Matte_Wrinkled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Iron Foil - Matte Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Iron_Foil.Iron_Foil_Matte_Wrinkled.png"), + ::anno::key_words(string[]("design", "metal", "iron", "foil", "matte", "smooth", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral", "gray")) +]] += Iron_Foil( + infinite_tiling: true, + roughness: 0.65f, + roughness_variation: 1.0f, + smudges: 0.4f, + bump_strength: 0.15f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + +export material Iron_Foil_Heavy_Glossy_Wrinkles(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Iron Foil - Heavy Glossy Wrinkles"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Iron_Foil.Iron_Foil_Heavy_Glossy_Wrinkles.png"), + ::anno::key_words(string[]("design", "metal", "iron", "foil", "smooth", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral")) +]] += Iron_Foil( + infinite_tiling: true, + roughness: 0.164f, + roughness_variation: 0.021f, + smudges: 0.143f, + bump_strength: 0.99f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + +export material Iron_Foil_Heavy_Matte_Wrinkled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Iron Foil - Heavy Matte Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Iron_Foil.Iron_Foil_Heavy_Matte_Wrinkled.png"), + ::anno::key_words(string[]("design", "metal", "iron", "foil", "matte", "bumped", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral", "gray")) +]] += Iron_Foil( + infinite_tiling: true, + roughness: 0.889f, + roughness_variation: 0.018f, + smudges: 0.246f, + bump_strength: 0.732f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + + + + + + + + + + + + diff --git a/code/third_party/vMaterials_2/Metal/Iron_Hammered.mdl b/code/third_party/vMaterials_2/Metal/Iron_Hammered.mdl new file mode 100644 index 0000000000000000000000000000000000000000..6909a7b61fea26df3313a5d008132e82365d80bb --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/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 = float2(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 = float2(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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Metal/Iron_Knurling.mdl b/code/third_party/vMaterials_2/Metal/Iron_Knurling.mdl new file mode 100644 index 0000000000000000000000000000000000000000..b168468313dce82ed4431a8113a4adb2b3ce9318 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Iron_Knurling.mdl @@ -0,0 +1,359 @@ +/****************************************************************************** + * 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 ::df::*; +import ::tex::*; +import ::math::*; +import ::base::*; +import ::state::*; +import ::anno::*; +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 = "Metal with a diamond knurling finish"; + +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; + //TODO: at least also handle sign of z? + //TODO: handle tangent becoming 0 + + + 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)); +} + +export material Iron_Knurling( + //Appearance + float brightness = float(0.7f) [[ + ::anno::description("Adjusts the brightness of the material."), + ::anno::display_name("Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.0f, 1.0f) + ]], + float roughness = float(0.5f) [[ + ::anno::description("Higher values lead to a rougher appearance of the material."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.0f, 1.0f) + ]], + float grooves_dirt = float(0.4f) [[ + ::anno::description("Adds dirt in the grooves of the knurling pattern."), + ::anno::display_name("Grooves Dirt"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.0f, 1.0f) + ]], + uniform float bump_strength = float(0.8f) [[ + ::anno::description("Adds dirt in the grooves of the knurling pattern."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.0f, 1.0f) + ]], + + // Round Corners + 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("Sets the radius of the round corners in millimeters."), + ::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") + ]], + //Transform + float2 texture_translate = float2(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"), + ::anno::soft_range(0.f, 360.f) + ]], + float2 texture_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(0.35f, .35f)), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + + // Advanced + uniform int uv_space_index = 0 [[ + ::anno::description("Uses the selected UV space index."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced"), + ::anno::soft_range(0, 4) + ]] +) +[[ + ::anno::display_name("Metal Knurling Iron"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Iron_Knurling.Iron_Knurling.png"), + ::anno::key_words(string[]("metal", "iron", "knurled", "knurling", "pattern", "design", "bumped")), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials") +]] += let +{ + color metal_tint = color(0.5293683f, 0.5132565f, 0.4942483f); // Iron + + // Texture setup + texture_2d normal_tex = texture_2d("./textures/metal_knurling_norm.jpg", ::tex::gamma_linear); + texture_2d multi_heights_tex = texture_2d("./textures/metal_knurling_multi_heights.jpg", ::tex::gamma_linear); + texture_2d diff_rough_grunge_tex = texture_2d("./textures/metal_knurling_multi_R_diff_G_rough_B_grunge.jpg", ::tex::gamma_linear); + + // Coordinate setup + ::base::texture_coordinate_info uvw = vmat_transform( + translation: texture_translate, + rotation: texture_rotate, + scaling: texture_scale, + system: ::base::texture_coordinate_uvw, + uv_space: uv_space_index + ); + + // ---------- Diff Rough Grunge Lookup ---------- + + float3 diff_rough_grunge_lookup = float3( + ::base::file_texture( + texture: diff_rough_grunge_tex, + uvw: uvw, + mono_source: ::base::mono_average + ).tint ); + + float3 multi_height_lookup = float3( + ::base::file_texture( + texture: multi_heights_tex, + uvw: uvw, + mono_source: ::base::mono_average + ).tint ); + + float3 norm = ::base::tangent_space_normal_texture( + texture: normal_tex, + factor: bump_strength, + uvw: uvw + ); + + + float remap_rough = histogram_range( + input: diff_rough_grunge_lookup.y, + range: 1.0f, + position: 0.234f + ); + + + float roughness_mapped = remap_rough + (roughness * multi_height_lookup.y); + + float remapped_diff = histogram_range( + input: diff_rough_grunge_lookup.x, + range: 1.0f, + position: (brightness * 0.4f) + 0.4f + ); + + float diff_contribution = ::math::pow(remapped_diff - ((grooves_dirt * 0.5) * multi_height_lookup.x * diff_rough_grunge_lookup.z), 2.67f); + + bsdf ggx_smith_bumped = ::df::weighted_layer( + layer: ::df::microfacet_ggx_smith_bsdf( + roughness_u: roughness_mapped * roughness_mapped, + roughness_v: roughness_mapped * roughness_mapped, + tint: color(diff_contribution), + mode: ::df::scatter_reflect + ), + base: bsdf(), + weight: 1.0f, + normal: norm + ); + + bsdf diff_bsdf = ::df::diffuse_reflection_bsdf( + tint: color(diff_contribution) + ); + + + bsdf final_bsdf = ::df::weighted_layer( + weight: 1.0f - (diff_rough_grunge_lookup.z * multi_height_lookup.x * grooves_dirt), + layer: ::df::directional_factor( + normal_tint: metal_tint, + grazing_tint: color(1.0f), + base: ggx_smith_bumped + ), + base: diff_bsdf + ); + + + // Round Corners + float3 round_normal = enable_round_corners ? + ::state::rounded_corner_normal( + radius: roundcorner_radius * 0.001, + across_materials: across_materials + ) : ::state::normal(); +} +in material ( + + surface: material_surface( + scattering: final_bsdf + ), + geometry: material_geometry( + normal: round_normal + ) +); + + +export material Iron_Knurling_Worn(*) +[[ + ::anno::display_name("Metal Knurling - Iron Worn"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Iron_Knurling.Iron_Knurling_Worn.png"), + ::anno::key_words(string[]("metal", "iron", "knurled", "pattern", "knurling", "design", "bumped", "worn")), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials") +]] = Iron_Knurling( + brightness: 0.4f, + roughness: 1.0f, + grooves_dirt: 1.0f, + bump_strength: 0.8f, + + enable_round_corners: false, + roundcorner_radius: 1.2f, + across_materials: false, + + texture_translate: float2(0.0f), + texture_rotate: 0.f, + texture_scale: float2(1.0f), + + uv_space_index: 0 +); + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/code/third_party/vMaterials_2/Metal/Iron_Pitted_Steel.mdl b/code/third_party/vMaterials_2/Metal/Iron_Pitted_Steel.mdl new file mode 100644 index 0000000000000000000000000000000000000000..ff50104761b45245851b42b6f732bcfe6080d7da --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Iron_Pitted_Steel.mdl @@ -0,0 +1,506 @@ +/****************************************************************************** + * 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 ::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"; + +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; +} + + +// remaps a value that lies between low_1 and high_1 to range between low_2 and high_2 +// This is the general case for range remapping +float remap(float x, float low_1, float high_1, float low_2, float high_2) +{ + return low_2 + ((x - low_1) * (high_2 - low_2))/(high_1 - low_1); +} + + +// Returns the normal n in tangent space, given n is in internal space. +float3 transform_internal_to_tangent(float3 n) +{ + 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) +{ + 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. +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_return blend_colors( + color color_1 = color(1.0, 0.0, 0.0), + color color_2 = color(0.0, 1.0, 0.0), + float blend = 0.5 +) +[[ + ::anno::hidden() +]] +{ + return ::base::blend_color_layers( + layers: ::base::color_layer[]( + ::base::color_layer( + layer_color: color_2, + weight: blend, + mode: ::base::color_layer_blend + )), + base: color_1 + ); +} + + +::base::texture_return overlay_colors( + color color_1 = color(1.0, 0.0, 0.0), + color color_2 = color(0.0, 1.0, 0.0), + float weight = 0.5 +) +[[ + ::anno::hidden() +]] +{ + return ::base::blend_color_layers( + layers: ::base::color_layer[]( + ::base::color_layer( + layer_color: color_2, + weight: weight, + mode: ::base::color_layer_overlay + )), + base: color_1 + ); +} + +export enum pit_textures +[[ + ::anno::description("The available pit textures."), + ::anno::hidden() +]] +{ + LightPits, + MediumPits, + StrongPits +}; + + +export material Iron_Pitted_Steel ( + uniform pit_textures pit_texture_selection = LightPits + [[ + ::anno::display_name("Pits Texture Selection"), + ::anno::in_group("Appearance"), + ::anno::description("Chooses between various textures for the pits.") + ]], + float steel_roughness = 0.0 + [[ + ::anno::display_name("Steel Roughness"), + ::anno::in_group("Appearance"), + ::anno::description("Adjusts the principal roughness of the steel material.") + ]], + float heat_treatment_amount = 0.0 + [[ + ::anno::display_name("Heat Treatment Amount"), + ::anno::in_group("Appearance"), + ::anno::description("Adjusts the amount of coloring due to the results of heat treatment.") + ]], + float rust_brightness = 0.0 + [[ + ::anno::display_name("Rust Pits Brightness"), + ::anno::in_group("Appearance"), + ::anno::description("Adjusts thebrightness of the rust.") + ]], + uniform float bump_amount_1 = 0.6 + [[ + ::anno::display_name("Steel Bump Strength"), + ::anno::description("Specifies the intensity of the normal texture."), + ::anno::in_group("Appearance") + ]], + + // ----------------------- Adjustments Group ----------------------- + uniform float2 texture_translate = float2(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 = float2(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") + ]], + + //----------------------- Advanced ----------------------- + uniform int uv_space_index = 0 + [[ + ::anno::display_name("UV Space Index"), + ::anno::description("UV Space Index."), + ::anno::in_group("Advanced"), + ::anno::soft_range(0, 3) + ]] +) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Pitted Steel"), + ::anno::description("A worn and decayed steel material with rusty pits."), + ::anno::key_words(string[]("metal", "steel", "pitted", "decayed", "oxidized", "worn", "matte", "brown", "gray")), + ::anno::thumbnail("./.thumbs/Iron_Pitted_Steel.Iron_Pitted_Steel.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = let { + + float steel_roughness_remapped = steel_roughness * 0.33; + float specular_level = float(0.5); + + texture_2d pitsteel_diffuse = texture_2d("./textures/iron_pitted_steel_no_dents_diff.jpg", ::tex::gamma_srgb); + texture_2d pitsteel_heatcoloring = texture_2d("./textures/iron_pitted_steel_heat_diff.jpg", ::tex::gamma_srgb); + texture_2d pitsteel_rust_diffuse = texture_2d("./textures/iron_pitted_steel_rust_diffuse.jpg", ::tex::gamma_srgb); + texture_2d pitsteel_metallic = texture_2d("./textures/iron_pitted_steel_no_spots_metal.png", ::tex::gamma_srgb); + texture_2d pitsteel_normal = texture_2d("./textures/iron_pitted_steel_norm.jpg", ::tex::gamma_linear); + texture_2d pitsteel_roughness = texture_2d("./textures/iron_pitted_steel_roughness_no_spots.jpg", ::tex::gamma_linear); + + uniform texture_2d pitsteel_spots_bump_mask = + (pit_texture_selection == LightPits) ? texture_2d("./textures/iron_pitted_steel_dents_bump.png", ::tex::gamma_linear) : + (pit_texture_selection == MediumPits) ? texture_2d("./textures/iron_pitted_steel_dents_bump_03.png", ::tex::gamma_linear) : + texture_2d("./textures/iron_pitted_steel_dents_bump_02.png", ::tex::gamma_linear); + + + float ior = 1.5; + float bump_amount_1_mapped = bump_amount_1 * 0.2; + float bump_amount_2_mapped = -16.0; + float rust_brightness_mapped = rust_brightness * 0.15; + float pit_transition_softness = 0.0; + float heat_treatment_amount_mapped = heat_treatment_amount * 0.15; + + + ::base::texture_coordinate_info uvw = ::base::coordinate_source( + coordinate_system: ::base::texture_coordinate_uvw, + texture_space: uv_space_index + ); + + ::base::texture_coordinate_info transformed_uvw = ::base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(texture_scale.x, 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 + ); + + // Spots mask lookup + float spots_mask_lookup = ::base::file_texture( + texture: pitsteel_spots_bump_mask, + 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; + + // Diffuse lookup + color base_color = ::base::file_texture( + texture: pitsteel_diffuse, + 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 rust_color = ::base::file_texture( + texture: pitsteel_rust_diffuse, + color_offset: color(rust_brightness_mapped), + color_scale: color(1.0, 1.0, 1.0), + mono_source: ::base::mono_average, + uvw: transformed_uvw, + clip: false + ).tint; + + color heat_color = ::base::file_texture( + texture: pitsteel_heatcoloring, + color_offset: color(0.0), + color_scale: color(1.0), + mono_source: ::base::mono_average, + uvw: transformed_uvw, + clip: false + ).tint; + + float spots_mask = ::math::clamp(remap(spots_mask_lookup, 0.0, pit_transition_softness, 0.0, 1.0), 0.0, 1.0); + + color steel_base_color = blend_colors( base_color, rust_color, spots_mask).tint; + color steel_final_base_color = overlay_colors( steel_base_color, heat_color, heat_treatment_amount_mapped).tint; + + + // Roughness lookup & Compositing + float roughness = ::base::file_texture( + texture: pitsteel_roughness, + 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 + spots_mask * .45 + steel_roughness_remapped; + + + // Metallic lookup + float metallic = ::base::file_texture( + texture: pitsteel_metallic, + 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 - spots_mask * 2.0; + + + // Composit spots mask + + bsdf diffuse_bsdf = ::df::diffuse_reflection_bsdf( + roughness: 0.0f, + tint: steel_final_base_color + ); + + bsdf ggx_smith_bsdf = ::df::microfacet_ggx_smith_bsdf( + roughness_u: roughness*roughness, + roughness_v: roughness*roughness, + 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: 5.0, + weight: 1.0, + layer: ggx_smith_bsdf, + base: diffuse_bsdf + ); + + bsdf directional_factor_bsdf = ::df::directional_factor( + normal_tint: steel_final_base_color, + grazing_tint: color(1.0, 1.0, 1.0), + exponent: 3.0f, + base: ggx_smith_bsdf + ); + + bsdf final_bsdf = ::df::weighted_layer( + weight: metallic, + layer: directional_factor_bsdf, + base: custom_curve_layer_bsdf + ); + + // Normal lookup + float3 the_normal = ::base::tangent_space_normal_texture( + texture: pitsteel_normal, + factor: bump_amount_1_mapped, + uvw: transformed_uvw, + flip_tangent_u: false, + flip_tangent_v: false + ); + + // Dents bumpmap lookup + float3 dents_normal = ::base::file_bump_texture( + texture: pitsteel_spots_bump_mask, + factor: bump_amount_2_mapped, + bump_source: ::base::mono_average, + uvw: transformed_uvw + ); + + float3 the_final_normal = add_detail_normal(the_normal, dents_normal); + +} in material ( + ior: color(ior), + surface: material_surface( + scattering: final_bsdf + ), + geometry: material_geometry( + normal: the_final_normal + ) +); + + + +// 01 - Light Pitted Steel +export material light_pitted_steel(*) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Pitted Steel - Light"), + ::anno::description("A worn and decayed steel material with rusty pits."), + ::anno::key_words(string[]("metal", "steel", "pitted", "decayed", "oxidized", "worn", "matte", "brown", "gray")), + ::anno::thumbnail("./.thumbs/Iron_Pitted_Steel.light_pitted_steel.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Iron_Pitted_Steel ( + pit_texture_selection: LightPits, + steel_roughness: 0.0, + heat_treatment_amount: 0.0, + rust_brightness: 0.0, + bump_amount_1: 0.6, + + // Adjustments Group + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + + //Advanced + uv_space_index: 0 +); + + +// 02 - Medium Pitted Steel +export material medium_pitted_steel(*) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Pitted Steel - Medium"), + ::anno::description("A worn and decayed steel material with rusty pits."), + ::anno::key_words(string[]("metal", "steel", "pitted", "decayed", "oxidized", "worn", "matte", "brown", "gray")), + ::anno::thumbnail("./.thumbs/Iron_Pitted_Steel.medium_pitted_steel.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Iron_Pitted_Steel ( + pit_texture_selection: MediumPits, + steel_roughness: 0.0, + heat_treatment_amount: 0.0, + rust_brightness: 0.0, + bump_amount_1: 0.6, + + // Adjustments Group + texture_translate: float2(0.0), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + + //Advanced + uv_space_index: 0 +); + + +// 03 - Strong Pitted Steel +export material strong_pitted_steel(*) +[[ + ::anno::author("NVIDIA ARC"), + ::anno::display_name("Pitted Steel - Strong"), + ::anno::description("A worn and decayed steel material with rusty pits."), + ::anno::key_words(string[]("metal", "steel", "pitted", "decayed", "oxidized", "worn", "matte", "brown", "gray")), + ::anno::thumbnail("./.thumbs/Iron_Pitted_Steel.strong_pitted_steel.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = Iron_Pitted_Steel ( + pit_texture_selection: StrongPits, + steel_roughness: 0.0, + heat_treatment_amount: 0.0, + rust_brightness: 0.0, + bump_amount_1: 0.6, + + // Adjustments Group + texture_translate: float2(0.0), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + + //Advanced + uv_space_index: 0 +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Metal/Iron_Scratched.mdl b/code/third_party/vMaterials_2/Metal/Iron_Scratched.mdl new file mode 100644 index 0000000000000000000000000000000000000000..b38e2c23ef64663175c1e628beba1d64a2b05a90 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Iron_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 Iron_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 = float2(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 = float2(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("Iron Scratched"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "iron", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "gray", "neutral")), + ::anno::thumbnail("./.thumbs/Iron_Scratched.Iron_Scratched.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = + let { + float brush_scratches_weight = 0.5f; + // Iron Reflection Color + color reflection_color = color(0.5293683f, 0.5132565f, 0.4942483f); + 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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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 Iron_Scratched_Light_Bumpy(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Iron Scratched - Bright and Bumped"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "iron", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "gray", "neutral", "shiny")), + ::anno::thumbnail("./.thumbs/Iron_Scratched.Iron_Scratched_Light_Bumpy.png"), + ::anno::copyright_notice(COPYRIGHT) +]]= Iron_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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); + + + +export material Iron_Scratched_Dark_Shiny(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Iron Scratched - Dark Shiny"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "iron", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "gray", "neutral", "shiny", "dark")), + ::anno::thumbnail("./.thumbs/Iron_Scratched.Iron_Scratched_Dark_Shiny.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Iron_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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); + + +export material Iron_Scratched_Dark_Matte(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Iron Scratched - Dark Matte"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "iron", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "gray", "neutral", "matte", "dark")), + ::anno::thumbnail("./.thumbs/Iron_Scratched.Iron_Scratched_Dark_Matte.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Iron_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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); + + + + +export material Iron_Scratched_Scuffs_and_Grime(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Iron Scratched - Scuffs and Grime"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "iron", "scratched", "worn", "dirty", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "gray", "neutral", "matte", "dark")), + ::anno::thumbnail("./.thumbs/Iron_Scratched.Iron_Scratched_Scuffs_and_Grime.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Iron_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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); + + + + +export material Iron_Scratched_Dirty_Rough(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Iron Scratched - Dirty Rough"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "iron", "scratched", "worn", "dirt", "dirty", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "gray", "neutral", "matte", "dark")), + ::anno::thumbnail("./.thumbs/Iron_Scratched.Iron_Scratched_Dirty_Rough.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Iron_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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); diff --git a/code/third_party/vMaterials_2/Metal/Iron_Sheet.mdl b/code/third_party/vMaterials_2/Metal/Iron_Sheet.mdl new file mode 100644 index 0000000000000000000000000000000000000000..89bb342fc1bbdba661dee981e193d8c7652862eb --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Iron_Sheet.mdl @@ -0,0 +1,1343 @@ +/****************************************************************************** + * 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 = "Iron sheet metal material with adjustable imperfections."; +const string DESCRIPTION_PUNCH = "Punched Iron 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) + float2(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 Iron_Sheet( + 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::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::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 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 = float2(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 = float2(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 Iron - New Clean"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Iron_Sheet.Iron_Sheet.png"), + ::anno::key_words(string[]("metal", "sheet", "iron", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "neutral")) +]] + = + let { + color normal_reflectivity = color(0.5293683f, 0.5132565f, 0.4942483f); + 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("./textures/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.2f), ::math::lerp(0.f, 0.3f, streaks))), ::df::weighted_layer(0.07f, ::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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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 Iron_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 = float2(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) + ]], + + + +// Iron 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::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::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 = float2(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 = float2(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("Iron Sheet - Circular Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Iron_Sheet.Iron_Sheet_Punched.png"), + ::anno::key_words(string[]("metal", "sheet", "iron", "decorative", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "circular", "neutral")) +]] = let +{ + material base_mat = Iron_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("./textures/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 + ) +); + + +// ---------------------- Iron Sheet Material Presets ---------------------- +export material Iron_Sheet_Soft_Splotches(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Iron - Soft Splotches"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Iron_Sheet.Iron_Sheet_Soft_Splotches.png"), + ::anno::key_words(string[]("metal", "sheet", "iron", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "neutral", "gray")) +]] += Iron_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + + +export material Iron_Sheet_Matte_Imperfections(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Iron - Matte Imperfections"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Iron_Sheet.Iron_Sheet_Matte_Imperfections.png"), + ::anno::key_words(string[]("metal", "sheet", "iron", "imperfections", "new", "matte", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "neutral")) +]]= Iron_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + + +export material Iron_Sheet_Glossy_Imperfections(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Iron - Glossy Imperfections"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Iron_Sheet.Iron_Sheet_Glossy_Imperfections.png"), + ::anno::key_words(string[]("metal", "sheet", "iron", "imperfections", "new", "glossy", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "neutral")) +]] += Iron_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + + +export material Iron_Sheet_Splotchy_Streaks(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Iron - Splotchy Streaks"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Iron_Sheet.Iron_Sheet_Splotchy_Streaks.png"), + ::anno::key_words(string[]("metal", "sheet", "iron", "imperfections", "new", "glossy", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "neutral")) +]]= Iron_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + +export material Iron_Sheet_Glossy_Streaks(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Iron - Glossy Streaks"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Iron_Sheet.Iron_Sheet_Glossy_Streaks.png"), + ::anno::key_words(string[]("metal", "sheet", "iron", "imperfections", "new", "glossy", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "neutral")) +]] += Iron_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + +// -------------------- Punched Iron Sheet Material Presets -------------------- +export material Iron_Sheet_Punched_Small_Circular(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Iron Sheet - Small Circular Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Iron_Sheet.Iron_Sheet_Punched_Small_Circular.png"), + ::anno::key_words(string[]("metal", "sheet", "iron", "decorative", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "circular", "neutral")) +]] += Iron_Sheet_Punched( + // Punching Parameters + shape_select: pattern_circle, + punching_grid_size: float2(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, + + // Iron Sheet Parameters + 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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Iron_Sheet_Punched_Hexagonal(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Iron Sheet - Hexagonal Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Iron_Sheet.Iron_Sheet_Punched_Hexagonal.png"), + ::anno::key_words(string[]("metal", "sheet", "iron", "decorative", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "hexagonal", "neutral")) +]] += Iron_Sheet_Punched( + // Punching Parameters + shape_select: pattern_hexagon, + punching_grid_size: float2(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, + + // Iron Sheet Parameters + 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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Iron_Sheet_Punched_Hexagonal_Small(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Iron Sheet - Small Hexagonal Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Iron_Sheet.Iron_Sheet_Punched_Hexagonal_Small.png"), + ::anno::key_words(string[]("metal", "sheet", "iron", "decorative", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "hexagonal", "neutral")) +]] += Iron_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, + + // Iron Sheet Parameters + 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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Iron_Sheet_Punched_Square(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Iron Sheet - Square Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Iron_Sheet.Iron_Sheet_Punched_Square.png"), + ::anno::key_words(string[]("metal", "sheet", "iron", "decorative", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "square", "neutral")) +]] += Iron_Sheet_Punched( + // Punching Parameters + shape_select: pattern_square, + punching_grid_size: float2(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, + + // Iron Sheet Parameters + 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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Iron_Sheet_Punched_Line(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Iron Sheet - Line Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Iron_Sheet.Iron_Sheet_Punched_Line.png"), + ::anno::key_words(string[]("metal", "sheet", "iron", "decorative", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "line", "neutral")) +]] += Iron_Sheet_Punched( + // Punching Parameters + shape_select: pattern_line, + punching_grid_size: float2(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, + + // Iron Sheet Parameters + 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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + + +export material Iron_Sheet_Punched_Cross(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Iron Sheet - Cross Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Iron_Sheet.Iron_Sheet_Punched_Cross.png"), + ::anno::key_words(string[]("metal", "sheet", "iron", "decorative", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "cross", "neutral")) +]] += Iron_Sheet_Punched( + // Punching Parameters + shape_select: pattern_cross, + punching_grid_size: float2(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, + + // Iron Sheet Parameters + 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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + +export material Iron_Sheet_Punched_Rhombus(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Iron Sheet - Rhombus Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Iron_Sheet.Iron_Sheet_Punched_Rhombus.png"), + ::anno::key_words(string[]("metal", "sheet", "iron", "decorative", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "rhombus", "neutral")) +]] += Iron_Sheet_Punched( + // Punching Parameters + shape_select: pattern_rhombus, + punching_grid_size: float2(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, + + // Iron Sheet Parameters + 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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Iron_Sheet_Punched_Triangle(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Iron Sheet - Triangle Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Iron_Sheet.Iron_Sheet_Punched_Triangle.png"), + ::anno::key_words(string[]("metal", "sheet", "iron", "decorative", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "triangle", "neutral")) +]] += Iron_Sheet_Punched( + // Punching Parameters + shape_select: pattern_triangle, + punching_grid_size: float2(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, + + // Iron Sheet Parameters + 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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Iron_Sheet_Punched_Star(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Iron Sheet - Star Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Iron_Sheet.Iron_Sheet_Punched_Star.png"), + ::anno::key_words(string[]("metal", "sheet", "iron", "decorative", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "star", "neutral")) +]] += Iron_Sheet_Punched( + // Punching Parameters + shape_select: pattern_star, + punching_grid_size: float2(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, + + // Iron Sheet Parameters + 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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Metal/Mercury.mdl b/code/third_party/vMaterials_2/Metal/Mercury.mdl new file mode 100644 index 0000000000000000000000000000000000000000..b399f64a7a7df994c8319e63451362566ed77688 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Mercury.mdl @@ -0,0 +1,328 @@ +/****************************************************************************** + * 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 Mercury( + 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.0f [[ + ::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.0f [[ + ::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 = true [[ + ::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.03f [[ + ::anno::description("Radius of the rounded corners."), + ::anno::display_name("Round Corner Radius"), + ::anno::in_group("Round Corners") + ]], + uniform bool across_materials = true [[ + ::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 = float2(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 = float2(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("Mercury"), + ::anno::description("Pure metal material with optional smudges."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Mercury.Mercury.png"), + ::anno::key_words(string[]("metal", "pure", "smudged", "design", "reflective", "infinite tiling", "smooth", "conductor", "new", "mercury")) +]] + = + let { + + color normal_reflectivity = color(0.780978740699f, 0.779541528985f, 0.778441417779f); + 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(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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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, across_materials, 1.f) : ::state::normal()); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + +/* +- 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/code/third_party/vMaterials_2/Metal/Metal_Cast.mdl b/code/third_party/vMaterials_2/Metal/Metal_Cast.mdl new file mode 100644 index 0000000000000000000000000000000000000000..689c1f24f3ba0d09819d0dd33285c3ee30faf729 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Metal_Cast.mdl @@ -0,0 +1,901 @@ +/****************************************************************************** + * 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 overlay(float base, float layer, float weight) +{ + return base + (1.0f - base) * layer * weight; +} + +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 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)) - 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 Metal_Cast( + 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"), + ::anno::ui_order(0) + ]], + float roughness = 0.129999995f [[ + ::anno::description("Higher values lead to blurrier reflections and make the material appear rough."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float roughness_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("Roughness Variation"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float metalness = 0.f [[ + ::anno::description("Makes the material more reflective."), + ::anno::display_name("Metalness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + color metal_tint = color(1.f, 1.f, 1.f) [[ + ::anno::description("Change the color of the reflection of the metal with this control."), + ::anno::display_name("Metal Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(4) + ]], + float smudges = 0.099999994f [[ + ::anno::description("Adds smudges on top of the material."), + ::anno::display_name("Smudges"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(5) + ]], + float bump_strength = 1.f [[ + ::anno::description("Adjusts the bumpiness of the surface."), + ::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(6) + ]], + uniform float2 texture_translate = float2(0.f) [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform"), + ::anno::ui_order(7) + ]], + 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(8) + ]], + uniform float2 texture_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(0.4f, 0.4f)), + ::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::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Cast Metal"), + ::anno::description("A generic material with a cast metal bump. The appearance can be blended between metallic and dielectric behavior to simulate painted metal as well."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Metal_Cast.Metal_Cast.png"), + ::anno::key_words(string[]("metal", "cast", "bumped", "template", "generic", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior")), + ::anno::hidden() +]] + = + let { + bool tmp0 = false; + material_surface tmp1(::df::weighted_layer(0.0149999997f, ::df::microfacet_ggx_smith_bsdf(0.560000002f, 0.560000002f, 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(metalness, ::df::color_custom_curve_layer(nvidia::core_definitions::blend_colors(metal_tint, color(0.577580988f, 0.577580988f, 0.577580988f), ::base::color_layer_multiply, 1.f, true).tint, color(1.f, 1.f, 1.f), 3.f, color(1.f, 1.f, 1.f), ::df::microfacet_ggx_smith_bsdf(overlay(histogram_range(float3(infinite_tiling ? ::base::file_texture(texture_2d("./textures/cast_metal_multi_R_rough_G_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::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 : endless_texture(texture_2d("./textures/cast_metal_multi_R_rough_G_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.414000005f, 0.109999999f, 0.5f), 8.f, false)).x, roughness_variation, roughness * 0.600000024f + 0.0799999982f), float3(infinite_tiling ? ::base::file_texture(texture_2d("./textures/cast_metal_multi_R_rough_G_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::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 : endless_texture(texture_2d("./textures/cast_metal_multi_R_rough_G_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.414000005f, 0.109999999f, 0.5f), 8.f, false)).y, smudges) * overlay(histogram_range(float3(infinite_tiling ? ::base::file_texture(texture_2d("./textures/cast_metal_multi_R_rough_G_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::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 : endless_texture(texture_2d("./textures/cast_metal_multi_R_rough_G_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.414000005f, 0.109999999f, 0.5f), 8.f, false)).x, roughness_variation, roughness * 0.600000024f + 0.0799999982f), float3(infinite_tiling ? ::base::file_texture(texture_2d("./textures/cast_metal_multi_R_rough_G_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::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 : endless_texture(texture_2d("./textures/cast_metal_multi_R_rough_G_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.414000005f, 0.109999999f, 0.5f), 8.f, false)).y, smudges), overlay(histogram_range(float3(infinite_tiling ? ::base::file_texture(texture_2d("./textures/cast_metal_multi_R_rough_G_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::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 : endless_texture(texture_2d("./textures/cast_metal_multi_R_rough_G_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.414000005f, 0.109999999f, 0.5f), 8.f, false)).x, roughness_variation, roughness * 0.600000024f + 0.0799999982f), float3(infinite_tiling ? ::base::file_texture(texture_2d("./textures/cast_metal_multi_R_rough_G_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::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 : endless_texture(texture_2d("./textures/cast_metal_multi_R_rough_G_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.414000005f, 0.109999999f, 0.5f), 8.f, false)).y, smudges) * overlay(histogram_range(float3(infinite_tiling ? ::base::file_texture(texture_2d("./textures/cast_metal_multi_R_rough_G_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::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 : endless_texture(texture_2d("./textures/cast_metal_multi_R_rough_G_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.414000005f, 0.109999999f, 0.5f), 8.f, false)).x, roughness_variation, roughness * 0.600000024f + 0.0799999982f), float3(infinite_tiling ? ::base::file_texture(texture_2d("./textures/cast_metal_multi_R_rough_G_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::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 : endless_texture(texture_2d("./textures/cast_metal_multi_R_rough_G_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.414000005f, 0.109999999f, 0.5f), 8.f, false)).y, smudges), color(1.f, 1.f, 1.f), color(0.f, 0.f, 0.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), bsdf(), infinite_tiling ? endless_normal(texture_2d("./textures/cast_metal_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.5f, 0.5f, 0.991999984f), 8.f) : normalmap_normal(texture_2d("./textures/cast_metal_norm.jpg", ::tex::gamma_linear), bump_strength, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index))), ::df::color_custom_curve_layer(color(0.0100229997f, 0.0100229997f, 0.0100229997f), color(1.f, 1.f, 1.f), 3.f, color(1.f, 1.f, 1.f), ::df::microfacet_ggx_smith_bsdf(overlay(histogram_range(float3(infinite_tiling ? ::base::file_texture(texture_2d("./textures/cast_metal_multi_R_rough_G_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::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 : endless_texture(texture_2d("./textures/cast_metal_multi_R_rough_G_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.414000005f, 0.109999999f, 0.5f), 8.f, false)).x, roughness_variation, roughness * 0.600000024f + 0.0799999982f), float3(infinite_tiling ? ::base::file_texture(texture_2d("./textures/cast_metal_multi_R_rough_G_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::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 : endless_texture(texture_2d("./textures/cast_metal_multi_R_rough_G_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.414000005f, 0.109999999f, 0.5f), 8.f, false)).y, smudges) * overlay(histogram_range(float3(infinite_tiling ? ::base::file_texture(texture_2d("./textures/cast_metal_multi_R_rough_G_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::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 : endless_texture(texture_2d("./textures/cast_metal_multi_R_rough_G_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.414000005f, 0.109999999f, 0.5f), 8.f, false)).x, roughness_variation, roughness * 0.600000024f + 0.0799999982f), float3(infinite_tiling ? ::base::file_texture(texture_2d("./textures/cast_metal_multi_R_rough_G_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::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 : endless_texture(texture_2d("./textures/cast_metal_multi_R_rough_G_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.414000005f, 0.109999999f, 0.5f), 8.f, false)).y, smudges), overlay(histogram_range(float3(infinite_tiling ? ::base::file_texture(texture_2d("./textures/cast_metal_multi_R_rough_G_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::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 : endless_texture(texture_2d("./textures/cast_metal_multi_R_rough_G_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.414000005f, 0.109999999f, 0.5f), 8.f, false)).x, roughness_variation, roughness * 0.600000024f + 0.0799999982f), float3(infinite_tiling ? ::base::file_texture(texture_2d("./textures/cast_metal_multi_R_rough_G_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::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 : endless_texture(texture_2d("./textures/cast_metal_multi_R_rough_G_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.414000005f, 0.109999999f, 0.5f), 8.f, false)).y, smudges) * overlay(histogram_range(float3(infinite_tiling ? ::base::file_texture(texture_2d("./textures/cast_metal_multi_R_rough_G_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::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 : endless_texture(texture_2d("./textures/cast_metal_multi_R_rough_G_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.414000005f, 0.109999999f, 0.5f), 8.f, false)).x, roughness_variation, roughness * 0.600000024f + 0.0799999982f), float3(infinite_tiling ? ::base::file_texture(texture_2d("./textures/cast_metal_multi_R_rough_G_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::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 : endless_texture(texture_2d("./textures/cast_metal_multi_R_rough_G_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.414000005f, 0.109999999f, 0.5f), 8.f, false)).y, smudges), color(1.f, 1.f, 1.f), color(0.f, 0.f, 0.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(metal_tint, color(0.507079005f, 0.507079005f, 0.507079005f), ::base::color_layer_multiply, 1.f, true).tint, 0.f), infinite_tiling ? endless_normal(texture_2d("./textures/cast_metal_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.5f, 0.5f, 0.991999984f), 8.f) : normalmap_normal(texture_2d("./textures/cast_metal_norm.jpg", ::tex::gamma_linear), bump_strength, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index))), ::state::normal()), infinite_tiling ? endless_normal(texture_2d("./textures/cast_metal_norm.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.5f, 0.5f, 0.991999984f), 8.f) : normalmap_normal(texture_2d("./textures/cast_metal_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, 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); + +// Material above serves as template and is supposed to remain hidden +// 1 +export material Iron_Cast( + 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"), + ::anno::ui_order(0) + ]], + float roughness = 0.33f [[ + ::anno::description("Higher values lead to blurrier reflections and make the material appear rough."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float roughness_variation = 0.67f [[ + ::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(2) + ]], + color metal_tint = color(0.019f) [[ + ::anno::description("Change the color of the reflection of the metal with this control."), + ::anno::display_name("Metal Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(4) + ]], + float smudges = 0.17f [[ + ::anno::description("Adds smudges on top of the material."), + ::anno::display_name("Smudges"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(5) + ]], + float bump_strength = 1.f [[ + ::anno::description("Adjusts the bumpiness of the surface."), + ::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(6) + ]], + uniform float2 texture_translate = float2(0.f) [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform"), + ::anno::ui_order(7) + ]], + 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(8) + ]], + uniform float2 texture_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(0.4f, 0.4f)), + ::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::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Cast Iron - Black"), + ::anno::description("A cast iron material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Metal_Cast.Iron_Cast.png"), + ::anno::key_words(string[]("metal", "cast", "bumped", "iron", "design", "kitchen", "construction", "architecture", "interior", "exterior", "black", "dark", "neutral")) +]] = Metal_Cast( + infinite_tiling: infinite_tiling, + roughness: roughness, + roughness_variation: roughness_variation, + metalness: 1.0, + metal_tint: metal_tint, + smudges: smudges, + 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 +); + +// 2 +export material Iron_Cast_Black_Matte(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Cast Iron - Black Matte"), + ::anno::description("A cast iron material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Metal_Cast.Iron_Cast_Black_Matte.png"), + ::anno::key_words(string[]("metal", "cast", "bumped", "iron", "design", "kitchen", "construction", "architecture", "interior", "exterior", "black", "dark", "neutral")) +]] = Iron_Cast +( + infinite_tiling: true, + roughness: .84f, + roughness_variation: 1.0f, + metal_tint: color(0.019f), + smudges: .45f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +// 3 +export material Stainless_Steel_Cast_Shiny(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Cast Stainless Steel - Shiny"), + ::anno::description("A cast stainless steel material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Metal_Cast.Stainless_Steel_Cast_Shiny.png"), + ::anno::key_words(string[]("metal", "cast", "bumped", "steel", "stainless", "design", "kitchen", "construction", "architecture", "interior", "exterior", "shiny", "reflective")) +]] = Iron_Cast +( + infinite_tiling: true, + roughness: 0.27f, + roughness_variation: 0.51f, + metal_tint: color(0.679542f), + smudges: .2f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 4 +export material Stainless_Steel_Cast_Rough(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Cast Stainless Steel - Rough"), + ::anno::description("A cast stainless steel material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Metal_Cast.Stainless_Steel_Cast_Rough.png"), + ::anno::key_words(string[]("metal", "cast", "bumped", "steel", "stainless", "design", "kitchen", "construction", "architecture", "interior", "exterior", "rough", "matte", "gray", "matte")) +]] = Iron_Cast +( + infinite_tiling: true, + roughness: 0.74f, + roughness_variation: 0.4f, + metal_tint: color(0.679542f), + smudges: .30f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 5 +export material Aluminum_Cast_Shiny(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Cast Aluminum - Shiny"), + ::anno::description("A cast aluminum material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Metal_Cast.Aluminum_Cast_Shiny.png"), + ::anno::key_words(string[]("metal", "cast", "bumped", "aluminum", "design", "kitchen", "construction", "architecture", "interior", "exterior", "rough", "reflective", "shiny")) +]] = Iron_Cast +( + infinite_tiling: true, + roughness: 0.51f, + roughness_variation: 0.51f, + metal_tint: color(0.514918f, 0.571125f, 0.623960f), + smudges: .0f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 6 +export material Aluminum_Cast_Rough(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Cast Aluminum - Rough"), + ::anno::description("A cast aluminum material."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Metal_Cast.Aluminum_Cast_Rough.png"), + ::anno::key_words(string[]("metal", "cast", "bumped", "aluminum", "design", "kitchen", "construction", "architecture", "interior", "exterior", "rough", "matte", "gray")) +]] = Iron_Cast +( + infinite_tiling: true, + roughness: 0.91f, + roughness_variation: 0.51f, + metal_tint: color(0.514918f, 0.571125f, 0.623960f), + smudges: .0f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +// 7 +// Cast Metal with a diffuse dielectic paint layer +export material Metal_Cast_Painted( + 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"), + ::anno::ui_order(0) + ]], + float roughness = 0.25f [[ + ::anno::description("Higher values lead to blurrier reflections and make the material appear rough."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float roughness_variation = 0.67f [[ + ::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(2) + ]], + color metal_tint = color(0.029557f, 0.135633f, 0.491021f) [[ + ::anno::description("Changes the color of the paint."), + ::anno::display_name("Paint Color"), + ::anno::in_group("Appearance"), + ::anno::ui_order(4) + ]], + float smudges = 0.17f [[ + ::anno::description("Adds smudges on top of the material."), + ::anno::display_name("Smudges"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(5) + ]], + float bump_strength = 1.f [[ + ::anno::description("Adjusts the bumpiness of the surface."), + ::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(6) + ]], + uniform float2 texture_translate = float2(0.f) [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform"), + ::anno::ui_order(7) + ]], + 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(8) + ]], + uniform float2 texture_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(0.4f, 0.4f)), + ::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::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Painted Cast Metal - Blue"), + ::anno::description("A painted cast material. The metal itself is underneath the paint layer, therefore it is a 'generic' metal."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Metal_Cast.Metal_Cast_Painted.png"), + ::anno::key_words(string[]("metal", "cast", "bumped", "painted", "design", "kitchen", "construction", "architecture", "interior", "exterior", "shiny", "blue", "cool", "saturated")) +]] = Metal_Cast( + infinite_tiling: infinite_tiling, + roughness: roughness, + roughness_variation: roughness_variation, + metalness: 0.0f, + metal_tint: metal_tint, + smudges: smudges, + 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 +); + +// 8 Red +export material Metal_Cast_Painted_Red(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Painted Cast Metal - Red"), + ::anno::description("A painted cast material. The metal itself is underneath the paint layer, therefore it is a 'generic' metal."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Metal_Cast.Metal_Cast_Painted_Red.png"), + ::anno::key_words(string[]("metal", "cast", "bumped", "painted", "design", "kitchen", "construction", "architecture", "interior", "exterior", "shiny", "red", "warm", "saturated")) +]] = Metal_Cast_Painted +( + infinite_tiling: true, + roughness: .25f, + roughness_variation: .67f, + metal_tint: color(0.491021f, 0.029557f, 0.029557f), + smudges: .17f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 0.5, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 9 Gray +export material Metal_Cast_Painted_Gray(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Painted Cast Metal - Gray"), + ::anno::description("A painted cast material. The metal itself is underneath the paint layer, therefore it is a 'generic' metal."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Metal_Cast.Metal_Cast_Painted_Gray.png"), + ::anno::key_words(string[]("metal", "cast", "bumped", "painted", "design", "kitchen", "construction", "architecture", "interior", "exterior", "shiny", "gray", "neutral")) +]] = Metal_Cast_Painted +( + infinite_tiling: true, + roughness: .25f, + roughness_variation: .67f, + metal_tint: color(0.332452f, 0.332452f, 0.332452f), + smudges: .17f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 0.5, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 10 Antique White +export material Metal_Cast_Painted_Antique_White(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Painted Cast Metal - Antique White"), + ::anno::description("A painted cast material. The metal itself is underneath the paint layer, therefore it is a 'generic' metal."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Metal_Cast.Metal_Cast_Painted_Antique_White.png"), + ::anno::key_words(string[]("metal", "cast", "bumped", "painted", "design", "kitchen", "construction", "architecture", "interior", "exterior", "shiny", "antique", "white", "light")) +]] = Metal_Cast_Painted +( + infinite_tiling: true, + roughness: .25f, + roughness_variation: .67f, + metal_tint: color(0.799103f, 0.708376f, 0.539479f), + smudges: .17f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 0.5, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 11 White +export material Metal_Cast_Painted_White(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Painted Cast Metal - White"), + ::anno::description("A painted cast material. The metal itself is underneath the paint layer, therefore it is a 'generic' metal."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Metal_Cast.Metal_Cast_Painted_White.png"), + ::anno::key_words(string[]("metal", "cast", "bumped", "painted", "design", "kitchen", "construction", "architecture", "interior", "exterior", "shiny", "white", "light")) +]] = Metal_Cast_Painted +( + infinite_tiling: true, + roughness: .25f, + roughness_variation: .67f, + metal_tint: color(0.693872f, 0.693872f, 0.693872f), + smudges: .17f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 0.5, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 12 Petrol +export material Metal_Cast_Painted_Petrol(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Painted Cast Metal - Petrol"), + ::anno::description("A painted cast material. The metal itself is underneath the paint layer, therefore it is a 'generic' metal."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Metal_Cast.Metal_Cast_Painted_Petrol.png"), + ::anno::key_words(string[]("metal", "cast", "bumped", "painted", "design", "kitchen", "construction", "architecture", "interior", "exterior", "shiny", "petrol")) +]] = Metal_Cast_Painted +( + infinite_tiling: true, + roughness: .25f, + roughness_variation: .67f, + metal_tint: color(0.144128f, 0.212231f, 0.223228f), + smudges: .17f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 0.5, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + + + + + + diff --git a/code/third_party/vMaterials_2/Metal/Nickel.mdl b/code/third_party/vMaterials_2/Metal/Nickel.mdl new file mode 100644 index 0000000000000000000000000000000000000000..0bbe60e25c67fa2966b68d8d95dfad89f92eb627 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Nickel.mdl @@ -0,0 +1,379 @@ +/****************************************************************************** + * 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 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( + 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 = 0.03f [[ + ::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::description("When enabled the round corner effect is applied across different materials."), + ::anno::in_group("Round Corners") + ]], + uniform float2 texture_translate = float2(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 = float2(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("Nickel"), + ::anno::description("Pure metal material with optional smudges."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Nickel.Nickel.png"), + ::anno::key_words(string[]("metal", "pure", "smudged", "design", "reflective", "infinite tiling", "smooth", "conductor", "new", "polished", "nickel")) +]] + = + 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(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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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, across_materials, 1.f) : ::state::normal()); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + + + +export material Nickel_Polished(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Nickel Polished"), + ::anno::description("Pure metal material with optional smudges."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Nickel.Nickel_Polished.png"), + ::anno::key_words(string[]("metal", "pure", "design", "reflective", "infinite tiling", "smooth", "conductor", "new", "polished", "nickel")) +]] += Nickel( + 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 Nickel_Glossy_Fingerprints(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Nickel Glossy Fingerprints"), + ::anno::description("Pure metal material with optional smudges."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Nickel.Nickel_Glossy_Fingerprints.png"), + ::anno::key_words(string[]("metal", "pure", "design", "smudged", "reflective", "infinite tiling", "smooth", "conductor", "new", "polished", "nickel")) +]] += Nickel( + 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/code/third_party/vMaterials_2/Metal/Nickel_Brushed.mdl b/code/third_party/vMaterials_2/Metal/Nickel_Brushed.mdl new file mode 100644 index 0000000000000000000000000000000000000000..944d600401b554dda26f631c7efd085dec91431a --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Nickel_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 Nickel_Brushed( + float brush_width = 1.0f [[ + ::anno::display_name("Roughness Width"), + ::anno::description("Widens the anisotropic metal reflections." + "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 = float2(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 = float2(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 Nickel - Strong Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Nickel_Brushed.Nickel_Brushed.png"), + ::anno::key_words(string[]("aec", "metal", "nickel", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "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(::nvidia::core_definitions::blend_colors(normal_reflectivity, color(float3(::base::file_texture(texture_2d("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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 Nickel_Brushed_Light_Brushing(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Brushed Nickel - Light Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Nickel_Brushed.Nickel_Brushed_Light_Brushing.png"), + ::anno::key_words(string[]("aec", "metal", "nickel", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] + = Nickel_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + +export material Nickel_Brushed_Medium_Light_Brushing(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Brushed Nickel - Medium Light Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Nickel_Brushed.Nickel_Brushed_Medium_Light_Brushing.png"), + ::anno::key_words(string[]("aec", "metal", "nickel", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] += Nickel_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + +export material Nickel_Brushed_Medium_Brushing(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Brushed Nickel - Medium Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Nickel_Brushed.Nickel_Brushed_Medium_Brushing.png"), + ::anno::key_words(string[]("aec", "metal", "nickel", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] += Nickel_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Nickel_Brushed_Very_Strong_Brushing(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Brushed Nickel - Very Strong Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Nickel_Brushed.Nickel_Brushed_Very_Strong_Brushing.png"), + ::anno::key_words(string[]("aec", "metal", "nickel", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] += Nickel_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + + diff --git a/code/third_party/vMaterials_2/Metal/Nickel_Foil.mdl b/code/third_party/vMaterials_2/Metal/Nickel_Foil.mdl new file mode 100644 index 0000000000000000000000000000000000000000..7e0bd99f767190686bd2388b50c626f4cf3140a6 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Nickel_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.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 = "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 Nickel_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 = float2(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 = float2(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::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("Nickel Foil - Slightly Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Nickel_Foil.Nickel_Foil.png"), + ::anno::key_words(string[]("design", "metal", "nickel", "foil", "smooth", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral")) +]] + = + let { + color normal_reflectivity = color(0.696691094703f,0.640529134605f,0.563260231405f); // Nickel + color grazing_reflectivity = color(0.99942f, 1.f, 1.f); + + texture_2d rough_ao_tex = texture_2d("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear); + texture_2d smudge_splotch_tex = texture_2d("./textures/foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear); + texture_2d norm_tex = texture_2d("./textures/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 Nickel_Foil_Smudged_Foil(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Nickel Foil - Smudgy Foil"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Nickel_Foil.Nickel_Foil_Smudged_Foil.png"), + ::anno::key_words(string[]("design", "metal", "nickel", "foil", "smooth", "unfinished", "decorative", "creative", "neutral")) +]] += Nickel_Foil( + infinite_tiling: true, + roughness: 0.15f, + roughness_variation: 0.84f, + smudges: 0.35f, + bump_strength: 0.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + +export material Nickel_Foil_Shiny_Wrinkled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Nickel Foil - Shiny Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Nickel_Foil.Nickel_Foil_Shiny_Wrinkled.png"), + ::anno::key_words(string[]("design", "metal", "nickel", "foil", "shiny", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral")) +]] += Nickel_Foil( + infinite_tiling: true, + roughness: 0.25f, + roughness_variation: 0.25f, + smudges: 0.75f, + bump_strength: 0.25f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + + +export material Nickel_Foil_Matte_Wrinkled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Nickel Foil - Matte Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Nickel_Foil.Nickel_Foil_Matte_Wrinkled.png"), + ::anno::key_words(string[]("design", "metal", "nickel", "foil", "matte", "smooth", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral", "gray")) +]] += Nickel_Foil( + infinite_tiling: true, + roughness: 0.65f, + roughness_variation: 1.0f, + smudges: 0.4f, + bump_strength: 0.15f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + +export material Nickel_Foil_Heavy_Glossy_Wrinkles(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Nickel Foil - Heavy Glossy Wrinkles"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Nickel_Foil.Nickel_Foil_Heavy_Glossy_Wrinkles.png"), + ::anno::key_words(string[]("design", "metal", "nickel", "foil", "smooth", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral")) +]] += Nickel_Foil( + infinite_tiling: true, + roughness: 0.164f, + roughness_variation: 0.021f, + smudges: 0.143f, + bump_strength: 0.99f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + +export material Nickel_Foil_Heavy_Matte_Wrinkled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Nickel Foil - Heavy Matte Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Nickel_Foil.Nickel_Foil_Heavy_Matte_Wrinkled.png"), + ::anno::key_words(string[]("design", "metal", "nickel", "foil", "matte", "bumped", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral", "gray")) +]] += Nickel_Foil( + infinite_tiling: true, + roughness: 0.889f, + roughness_variation: 0.018f, + smudges: 0.246f, + bump_strength: 0.732f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + + + + + + + + + + + + diff --git a/code/third_party/vMaterials_2/Metal/Nickel_Hammered.mdl b/code/third_party/vMaterials_2/Metal/Nickel_Hammered.mdl new file mode 100644 index 0000000000000000000000000000000000000000..4f120a32cd670dc131020e0380e47a1cfd4eba65 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Nickel_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 Nickel_Hammered( + color metal_color = color(0.5f, 0.459f, 0.405f) [[ + ::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 = float2(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 = float2(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 Nickel - Dark Pits"), + ::anno::author("NVIDIA vMaterials"), + ::anno::in_group("Metal"), + ::anno::key_words(string[]("metal", "nickel", "blackened", "hammered", "design", "classic", "architecture", "pattern", "reflective", "rough", "bumped", "conductor")), + ::anno::thumbnail("./.thumbs/Nickel_Hammered.Nickel_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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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 Nickel_Hammered_Shiny(*) +[[ + ::anno::display_name("Hammered Nickel - Shiny"), + ::anno::author("NVIDIA vMaterials"), + ::anno::in_group("Metal"), + ::anno::key_words(string[]("metal", "nickel", "hammered", "design", "classic", "architecture", "pattern", "reflective", "rough", "bumped", "conductor", "shiny")), + ::anno::thumbnail("./.thumbs/Nickel_Hammered.Nickel_Hammered_Shiny.png"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT) +]] + = Nickel_Hammered( + metal_color: color(0.5f, 0.459f, 0.405f), + 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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + +export material Nickel_Hammered_Dull(*) +[[ + ::anno::display_name("Hammered Nickel - Dull"), + ::anno::author("NVIDIA vMaterials"), + ::anno::in_group("Metal"), + ::anno::key_words(string[]("metal", "nickel", "hammered", "design", "classic", "architecture", "pattern", "reflective", "rough", "bumped", "conductor", "matte", "dull")), + ::anno::thumbnail("./.thumbs/Nickel_Hammered.Nickel_Hammered_Dull.png"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT) +]] + = Nickel_Hammered( + metal_color: color(0.5f, 0.459f, 0.405f), + 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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Metal/Nickel_Knurling.mdl b/code/third_party/vMaterials_2/Metal/Nickel_Knurling.mdl new file mode 100644 index 0000000000000000000000000000000000000000..5f11b2c518581f82799c512402a02390682804ab --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Nickel_Knurling.mdl @@ -0,0 +1,359 @@ +/****************************************************************************** + * 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 ::df::*; +import ::tex::*; +import ::math::*; +import ::base::*; +import ::state::*; +import ::anno::*; +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 = "Metal with a diamond knurling finish"; + +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; + //TODO: at least also handle sign of z? + //TODO: handle tangent becoming 0 + + + 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)); +} + +export material Nickel_Knurling( + //Appearance + float brightness = float(0.7f) [[ + ::anno::description("Adjusts the brightness of the material."), + ::anno::display_name("Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.0f, 1.0f) + ]], + float roughness = float(0.5f) [[ + ::anno::description("Higher values lead to a rougher appearance of the material."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.0f, 1.0f) + ]], + float grooves_dirt = float(0.4f) [[ + ::anno::description("Adds dirt in the grooves of the knurling pattern."), + ::anno::display_name("Grooves Dirt"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.0f, 1.0f) + ]], + uniform float bump_strength = float(0.8f) [[ + ::anno::description("Adds dirt in the grooves of the knurling pattern."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.0f, 1.0f) + ]], + + // Round Corners + 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("Sets the radius of the round corners in millimeters."), + ::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") + ]], + //Transform + float2 texture_translate = float2(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"), + ::anno::soft_range(0.f, 360.f) + ]], + float2 texture_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(0.35f, .35f)), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + + // Advanced + uniform int uv_space_index = 0 [[ + ::anno::description("Uses the selected UV space index."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced"), + ::anno::soft_range(0, 4) + ]] +) +[[ + ::anno::display_name("Metal Knurling Nickel"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Nickel_Knurling.Nickel_Knurling.png"), + ::anno::key_words(string[]("metal", "nickel", "knurled", "knurling", "pattern", "design", "bumped")), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials") +]] += let +{ + color metal_tint = color(0.696691094703f,0.640529134605f,0.563260231405f); // Nickel + + // Texture setup + texture_2d normal_tex = texture_2d("./textures/metal_knurling_norm.jpg", ::tex::gamma_linear); + texture_2d multi_heights_tex = texture_2d("./textures/metal_knurling_multi_heights.jpg", ::tex::gamma_linear); + texture_2d diff_rough_grunge_tex = texture_2d("./textures/metal_knurling_multi_R_diff_G_rough_B_grunge.jpg", ::tex::gamma_linear); + + // Coordinate setup + ::base::texture_coordinate_info uvw = vmat_transform( + translation: texture_translate, + rotation: texture_rotate, + scaling: texture_scale, + system: ::base::texture_coordinate_uvw, + uv_space: uv_space_index + ); + + // ---------- Diff Rough Grunge Lookup ---------- + + float3 diff_rough_grunge_lookup = float3( + ::base::file_texture( + texture: diff_rough_grunge_tex, + uvw: uvw, + mono_source: ::base::mono_average + ).tint ); + + float3 multi_height_lookup = float3( + ::base::file_texture( + texture: multi_heights_tex, + uvw: uvw, + mono_source: ::base::mono_average + ).tint ); + + float3 norm = ::base::tangent_space_normal_texture( + texture: normal_tex, + factor: bump_strength, + uvw: uvw + ); + + + float remap_rough = histogram_range( + input: diff_rough_grunge_lookup.y, + range: 1.0f, + position: 0.234f + ); + + + float roughness_mapped = remap_rough + (roughness * multi_height_lookup.y); + + float remapped_diff = histogram_range( + input: diff_rough_grunge_lookup.x, + range: 1.0f, + position: (brightness * 0.4f) + 0.4f + ); + + float diff_contribution = ::math::pow(remapped_diff - ((grooves_dirt * 0.5) * multi_height_lookup.x * diff_rough_grunge_lookup.z), 2.67f); + + bsdf ggx_smith_bumped = ::df::weighted_layer( + layer: ::df::microfacet_ggx_smith_bsdf( + roughness_u: roughness_mapped * roughness_mapped, + roughness_v: roughness_mapped * roughness_mapped, + tint: color(diff_contribution), + mode: ::df::scatter_reflect + ), + base: bsdf(), + weight: 1.0f, + normal: norm + ); + + bsdf diff_bsdf = ::df::diffuse_reflection_bsdf( + tint: color(diff_contribution) + ); + + + bsdf final_bsdf = ::df::weighted_layer( + weight: 1.0f - (diff_rough_grunge_lookup.z * multi_height_lookup.x * grooves_dirt), + layer: ::df::directional_factor( + normal_tint: metal_tint, + grazing_tint: color(1.0f), + base: ggx_smith_bumped + ), + base: diff_bsdf + ); + + + // Round Corners + float3 round_normal = enable_round_corners ? + ::state::rounded_corner_normal( + radius: roundcorner_radius * 0.001, + across_materials: across_materials + ) : ::state::normal(); +} +in material ( + + surface: material_surface( + scattering: final_bsdf + ), + geometry: material_geometry( + normal: round_normal + ) +); + + +export material Nickel_Knurling_Worn(*) +[[ + ::anno::display_name("Metal Knurling - Nickel Worn"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Nickel_Knurling.Nickel_Knurling_Worn.png"), + ::anno::key_words(string[]("metal", "nickel", "knurled", "pattern", "knurling", "design", "bumped", "worn")), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials") +]] = Nickel_Knurling( + brightness: 0.4f, + roughness: 1.0f, + grooves_dirt: 1.0f, + bump_strength: 0.8f, + + enable_round_corners: false, + roundcorner_radius: 1.2f, + across_materials: false, + + texture_translate: float2(0.0f), + texture_rotate: 0.f, + texture_scale: float2(1.0f), + + uv_space_index: 0 +); + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/code/third_party/vMaterials_2/Metal/Nickel_Scratched.mdl b/code/third_party/vMaterials_2/Metal/Nickel_Scratched.mdl new file mode 100644 index 0000000000000000000000000000000000000000..d49ef02de3db550b887020b6a1f007c1cb9a32a0 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/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 = float2(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 = float2(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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); diff --git a/code/third_party/vMaterials_2/Metal/Nickel_Sheet.mdl b/code/third_party/vMaterials_2/Metal/Nickel_Sheet.mdl new file mode 100644 index 0000000000000000000000000000000000000000..a4249cf851cf2f88dfd07a241eafcb9b8fefab6e --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/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) + float2(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 = float2(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 = float2(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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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 = float2(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 = float2(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 = float2(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("./textures/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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Metal/PCB_Copper.mdl b/code/third_party/vMaterials_2/Metal/PCB_Copper.mdl new file mode 100644 index 0000000000000000000000000000000000000000..2ae4a89a93ebe32d7eb564459658e4ddec27f90a --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/PCB_Copper.mdl @@ -0,0 +1,342 @@ +/****************************************************************************** + * 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 copper metal material for printed circuit boards (PCB)"; + +::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 PCB_Copper( + float coppery = 0.5f [[ + ::anno::description("Set to 1 it appears a clear copper. Set to 0 its appearance is a more altered copper."), + ::anno::display_name("Coppery"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(0) + ]], + color grazing_reflectivity = color(1.f, 1.f, 1.f) [[ + ::anno::description("Sets the reflection color at grazing reflectivity levels."), + ::anno::display_name("Grazing Reflectivity"), + ::anno::in_group("Appearance"), + ::anno::ui_order(1) + ]], + float reflection_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 reflection_smooth = 0.f [[ + ::anno::description("Adds blurrier reflection that follow the intensities of the Roughness texture on top."), + ::anno::display_name("Reflection Smooth"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + uniform float bump_strength = .3f [[ + ::anno::description("Specifies the strength of the bump. \nWhile No UV is set to false do not over exaggerate it. The normal map will brake at 0.75\nThe exaggeration is an option while using tri planar mapping. ."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 3.f), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + uniform float2 texture_translate = float2(0.f) [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("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("Rotate"), + ::anno::in_group("Transform"), + ::anno::ui_order(6) + ]], + uniform float2 texture_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Scale"), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(.1f, .1f)), + ::anno::ui_order(7) + ]], + 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(8) + ]], + uniform float radius = 0.0299999993f [[ + ::anno::description("Radius of the rounded corners."), + ::anno::display_name("Round Corner Radius"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(9) + ]], + 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(10) + ]], + uniform bool no_uv = false [[ + ::anno::description("Set this to true if your model has no UV layout."), + ::anno::display_name("No UV"), + ::anno::in_group("Advanced", "Projection"), + ::anno::ui_order(11) + ]], + uniform ::base::projection_mode projection_type = ::base::projection_planar [[ + ::anno::description("Projection method to be used to generate the coordinates."), + ::anno::display_name("Projection Type"), + ::anno::in_group("Advanced", "Projection"), + ::anno::ui_order(12) + ]], + uniform float scale = 1.f [[ + ::anno::description("Scales the texture while No UV is true."), + ::anno::display_name("Scale Projection"), + ::anno::in_group("Advanced", "Projection"), + ::anno::ui_order(13) + ]], + uniform ::base::texture_coordinate_system coordinate_system = ::base::texture_coordinate_object [[ + ::anno::description("The projection can be done based on world or object space. Do not use uvw space. Since it is disabled while No UV is set to true."), + ::anno::display_name("Coordinate System"), + ::anno::in_group("Advanced", "Projection"), + ::anno::ui_order(14) + ]], + 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(15) + ]]) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("PCB Copper"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("conductiv", "metal", "copper", "pcb", "plate", "computer", "orange", "shiny", "bumped", "metallic", "construction", "light", "warm", "reflective")), + ::anno::thumbnail("./.thumbs/PCB_Copper.PCB_Copper.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] + = + let { + bool tmp0 = false; + material_surface tmp1(::df::custom_curve_layer(coppery, 1.f, 5.f, 1.f, ::df::color_custom_curve_layer(color(0.9654565f, 0.6899602f, 0.4830392f), grazing_reflectivity, 5.f, color(1.f, 1.f, 1.f), ::df::microfacet_ggx_smith_bsdf(::math::lerp(::math::lerp(0.f, 0.899999976f, reflection_roughness) * ::math::lerp(0.f, 0.899999976f, reflection_roughness), ::math::lerp(0.f, 0.899999976f, reflection_roughness) * ::math::lerp(0.f, 0.899999976f, reflection_roughness) + reflection_smooth * (1.f - ::math::lerp(0.f, 0.899999976f, reflection_roughness) * ::math::lerp(0.f, 0.899999976f, reflection_roughness)), ::base::file_texture(texture_2d("./textures/pcb_copper_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, no_uv ? ::base::coordinate_projection(coordinate_system, uv_space_index, projection_type, float4x4(scale)) : vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono) * ::math::lerp(::math::lerp(0.f, 0.899999976f, reflection_roughness) * ::math::lerp(0.f, 0.899999976f, reflection_roughness), ::math::lerp(0.f, 0.899999976f, reflection_roughness) * ::math::lerp(0.f, 0.899999976f, reflection_roughness) + reflection_smooth * (1.f - ::math::lerp(0.f, 0.899999976f, reflection_roughness) * ::math::lerp(0.f, 0.899999976f, reflection_roughness)), ::base::file_texture(texture_2d("./textures/pcb_copper_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, no_uv ? ::base::coordinate_projection(coordinate_system, uv_space_index, projection_type, float4x4(scale)) : vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono), ::math::lerp(::math::lerp(0.f, 0.899999976f, reflection_roughness) * ::math::lerp(0.f, 0.899999976f, reflection_roughness), ::math::lerp(0.f, 0.899999976f, reflection_roughness) * ::math::lerp(0.f, 0.899999976f, reflection_roughness) + reflection_smooth * (1.f - ::math::lerp(0.f, 0.899999976f, reflection_roughness) * ::math::lerp(0.f, 0.899999976f, reflection_roughness)), ::base::file_texture(texture_2d("./textures/pcb_copper_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, no_uv ? ::base::coordinate_projection(coordinate_system, uv_space_index, projection_type, float4x4(scale)) : vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono) * ::math::lerp(::math::lerp(0.f, 0.899999976f, reflection_roughness) * ::math::lerp(0.f, 0.899999976f, reflection_roughness), ::math::lerp(0.f, 0.899999976f, reflection_roughness) * ::math::lerp(0.f, 0.899999976f, reflection_roughness) + reflection_smooth * (1.f - ::math::lerp(0.f, 0.899999976f, reflection_roughness) * ::math::lerp(0.f, 0.899999976f, reflection_roughness)), ::base::file_texture(texture_2d("./textures/pcb_copper_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, no_uv ? ::base::coordinate_projection(coordinate_system, uv_space_index, projection_type, float4x4(scale)) : vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), bsdf(), ::base::tangent_space_normal_texture(texture_2d("./textures/pcb_copper_norm.jpg", ::tex::gamma_linear), ::math::lerp(0.f, 2.f, bump_strength), false, false, no_uv ? ::base::coordinate_projection(coordinate_system, uv_space_index, projection_type, float4x4(scale)) : vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), ::df::diffuse_reflection_bsdf(::base::file_texture(texture_2d("./textures/pcb_copper_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, no_uv ? ::base::coordinate_projection(coordinate_system, uv_space_index, projection_type, float4x4(scale)) : vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, 0.f), ::base::tangent_space_normal_texture(texture_2d("./textures/pcb_copper_norm.jpg", ::tex::gamma_linear), ::math::lerp(0.f, 2.f, bump_strength), false, false, no_uv ? ::base::coordinate_projection(coordinate_system, uv_space_index, projection_type, float4x4(scale)) : vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + 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 PCB_Copper_Smooth(*) +[[ + ::anno::display_name("PCB Copper Smooth"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("conductiv", "metal", "copper", "pcb", "plate", "computer", "orange", "shiny", "smooth", "metallic", "construction", "light", "warm", "reflective")), + ::anno::thumbnail("./.thumbs/PCB_Copper.PCB_Copper_Smooth.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += PCB_Copper +( + coppery: .6f, + grazing_reflectivity: color(1.f, 1.f, 1.f), + reflection_roughness: .6f, + reflection_smooth: .0f, + bump_strength: .3f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius: 1.5f, + across_materials: false, + no_uv: false, + projection_type: ::base::projection_planar, + scale: 1.f, + coordinate_system: ::base::texture_coordinate_object, + uv_space_index: 0 +); +export material PCB_Copper_Beige(*) +[[ + ::anno::display_name("PCB Copper Beige"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("conductiv", "metal", "copper", "pcb", "plate", "computer", "beige", "shiny", "bumped", "metallic", "construction", "light", "warm", "reflective")), + ::anno::thumbnail("./.thumbs/PCB_Copper.PCB_Copper_Beige.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += PCB_Copper +( + coppery: .7f, + grazing_reflectivity: color(1.f, 1.f, 1.f), + reflection_roughness: .7f, + reflection_smooth: .4f, + bump_strength: .2f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius: 1.5f, + across_materials: false, + no_uv: false, + projection_type: ::base::projection_planar, + scale: 1.f, + coordinate_system: ::base::texture_coordinate_object, + uv_space_index: 0 +); +export material PCB_Coppery(*) +[[ + ::anno::display_name("PCB Coppery"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("conductiv", "metal", "copper", "pcb", "plate", "computer", "orange", "shiny", "bumped", "metallic", "construction", "light", "warm", "reflective")), + ::anno::thumbnail("./.thumbs/PCB_Copper.PCB_Coppery.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += PCB_Copper +( + coppery: 1.f, + grazing_reflectivity: color(1.f, 1.f, 1.f), + reflection_roughness: .2f, + reflection_smooth: .0f, + bump_strength: .3f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius: 1.5f, + across_materials: false, + no_uv: false, + projection_type: ::base::projection_planar, + scale: 1.f, + coordinate_system: ::base::texture_coordinate_object, + uv_space_index: 0 +); +export material PCB_Coppery_Soft(*) +[[ + ::anno::display_name("PCB Coppery Soft"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("conductiv", "metal", "copper", "pcb", "plate", "computer", "orange", "shiny", "bumped", "metallic", "construction", "light", "warm", "soft", "reflective")), + ::anno::thumbnail("./.thumbs/PCB_Copper.PCB_Coppery_Soft.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += PCB_Copper +( + coppery: 1.f, + grazing_reflectivity: color(1.f, 1.f, 1.f), + reflection_roughness: .7f, + reflection_smooth: .4f, + bump_strength: .3f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius: 1.5f, + across_materials: false, + no_uv: false, + projection_type: ::base::projection_planar, + scale: 1.f, + coordinate_system: ::base::texture_coordinate_object, + uv_space_index: 0 +); + diff --git a/code/third_party/vMaterials_2/Metal/PCB_Goldfinger.mdl b/code/third_party/vMaterials_2/Metal/PCB_Goldfinger.mdl new file mode 100644 index 0000000000000000000000000000000000000000..7aa1c030a760f89ece477e89848c2249910edc57 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/PCB_Goldfinger.mdl @@ -0,0 +1,272 @@ +/****************************************************************************** + * 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 gold metal material for printed circuit boards (PCB)"; + +::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 PCB_Goldfinger( + color grazing_reflectivity = color(1.f, 1.f, 1.f) [[ + ::anno::description("Sets the reflection color at grazing reflectivity levels."), + ::anno::display_name("Grazing Reflectivity"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + float reflection_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(1) + ]], + float reflection_smooth = 0.f [[ + ::anno::description("Adds blurrier reflection that follow the intensities of the Roughness texture on top."), + ::anno::display_name("Reflection Smooth"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + uniform float bump_strength = .2f [[ + ::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 = float2(0.f) [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("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("Rotate"), + ::anno::in_group("Transform"), + ::anno::ui_order(5) + ]], + uniform float2 texture_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Scale"), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(.4f, .4f)), + ::anno::ui_order(6) + ]], + 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(7) + ]], + uniform float radius = 0.0340000018f [[ + ::anno::description("Radius of the rounded corners."), + ::anno::display_name("Round Corner Radius"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(8) + ]], + 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(9) + ]], + uniform bool no_uv = false [[ + ::anno::description("Set this to true if your model has no UV layout."), + ::anno::display_name("No UV"), + ::anno::in_group("Advanced", "Projection"), + ::anno::ui_order(10) + ]], + uniform ::base::projection_mode projection_type = ::base::projection_planar [[ + ::anno::description("Projection method to be used to generate the coordinates."), + ::anno::display_name("Projection Type"), + ::anno::in_group("Advanced", "Projection"), + ::anno::ui_order(11) + ]], + uniform float scale = 1.f [[ + ::anno::description("Scales the texture while No UV is true."), + ::anno::display_name("Scale Projection"), + ::anno::in_group("Advanced", "Projection"), + ::anno::ui_order(12) + ]], + uniform ::base::texture_coordinate_system coordinate_system = ::base::texture_coordinate_object [[ + ::anno::description("The projection can be done based on world or object space. Do not use uvw space. Since it is disabled while No UV is set to true."), + ::anno::display_name("Coordinate System"), + ::anno::in_group("Advanced", "Projection"), + ::anno::ui_order(13) + ]], + 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(14) + ]]) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("PCB Goldfinger"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("conductiv", "metal", "gold", "finger", "pcb", "plate", "computer", "yellow", "shiny", "bumped", "metallic", "construction", "light", "warm", "reflective")), + ::anno::thumbnail("./.thumbs/PCB_Goldfinger.PCB_Goldfinger.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] + = + let { + bool tmp0 = false; + material_surface tmp1(::df::color_custom_curve_layer(color(1.f, 0.766744, 0.334458f), grazing_reflectivity, 5.f, color(1.f, 1.f, 1.f), ::df::microfacet_ggx_smith_bsdf(::math::lerp(::math::lerp(0.f, 0.800000012f, reflection_roughness) * ::math::lerp(0.f, 0.800000012f, reflection_roughness), ::math::lerp(0.f, 0.800000012f, reflection_roughness) * ::math::lerp(0.f, 0.800000012f, reflection_roughness) + reflection_smooth * (1.f - ::math::lerp(0.f, 0.800000012f, reflection_roughness) * ::math::lerp(0.f, 0.800000012f, reflection_roughness)), ::base::file_texture(texture_2d("./textures/pcb_goldfinger_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, no_uv ? ::base::coordinate_projection(coordinate_system, uv_space_index, projection_type, float4x4(scale)) : vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono) * ::math::lerp(::math::lerp(0.f, 0.800000012f, reflection_roughness) * ::math::lerp(0.f, 0.800000012f, reflection_roughness), ::math::lerp(0.f, 0.800000012f, reflection_roughness) * ::math::lerp(0.f, 0.800000012f, reflection_roughness) + reflection_smooth * (1.f - ::math::lerp(0.f, 0.800000012f, reflection_roughness) * ::math::lerp(0.f, 0.800000012f, reflection_roughness)), ::base::file_texture(texture_2d("./textures/pcb_goldfinger_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, no_uv ? ::base::coordinate_projection(coordinate_system, uv_space_index, projection_type, float4x4(scale)) : vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono), ::math::lerp(::math::lerp(0.f, 0.800000012f, reflection_roughness) * ::math::lerp(0.f, 0.800000012f, reflection_roughness), ::math::lerp(0.f, 0.800000012f, reflection_roughness) * ::math::lerp(0.f, 0.800000012f, reflection_roughness) + reflection_smooth * (1.f - ::math::lerp(0.f, 0.800000012f, reflection_roughness) * ::math::lerp(0.f, 0.800000012f, reflection_roughness)), ::base::file_texture(texture_2d("./textures/pcb_goldfinger_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, no_uv ? ::base::coordinate_projection(coordinate_system, uv_space_index, projection_type, float4x4(scale)) : vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono) * ::math::lerp(::math::lerp(0.f, 0.800000012f, reflection_roughness) * ::math::lerp(0.f, 0.800000012f, reflection_roughness), ::math::lerp(0.f, 0.800000012f, reflection_roughness) * ::math::lerp(0.f, 0.800000012f, reflection_roughness) + reflection_smooth * (1.f - ::math::lerp(0.f, 0.800000012f, reflection_roughness) * ::math::lerp(0.f, 0.800000012f, reflection_roughness)), ::base::file_texture(texture_2d("./textures/pcb_goldfinger_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, no_uv ? ::base::coordinate_projection(coordinate_system, uv_space_index, projection_type, float4x4(scale)) : vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), bsdf(), ::base::tangent_space_normal_texture(texture_2d("./textures/pcb_goldfinger_norm.jpg", ::tex::gamma_linear), ::math::lerp(0.f, 2.f, bump_strength), false, false, no_uv ? ::base::coordinate_projection(coordinate_system, uv_space_index, projection_type, float4x4(scale)) : vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + 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 PCB_Goldfinger_Smooth(*) +[[ + ::anno::display_name("PCB Goldfinger Smooth"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("conductiv", "metal", "gold", "finger", "pcb", "plate", "computer", "yellow", "shiny", "bumped", "metallic", "construction", "light", "warm", "reflective", "smooth")), + ::anno::thumbnail("./.thumbs/PCB_Goldfinger.PCB_Goldfinger_Smooth.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += PCB_Goldfinger +( + grazing_reflectivity: color(1.f, 1.f, 1.f), + reflection_roughness: .0f, + reflection_smooth: .8f, + bump_strength: .2f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius: 1.5f, + across_materials: false, + no_uv: false, + projection_type: ::base::projection_planar, + scale: 1.f, + coordinate_system: ::base::texture_coordinate_object, + uv_space_index: 0 +); + +export material PCB_Goldfinger_Soft(*) +[[ + ::anno::display_name("PCB Goldfinger Soft"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("conductiv", "metal", "gold", "finger", "pcb", "plate", "computer", "yellow", "shiny", "bumped", "metallic", "construction", "light", "warm", "reflective", "smoft")), + ::anno::thumbnail("./.thumbs/PCB_Goldfinger.PCB_Goldfinger_Soft.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += PCB_Goldfinger +( + grazing_reflectivity: color(1.f, 1.f, 1.f), + reflection_roughness: .5f, + reflection_smooth: .8f, + bump_strength: .5f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius: 1.5f, + across_materials: false, + no_uv: false, + projection_type: ::base::projection_planar, + scale: 1.f, + coordinate_system: ::base::texture_coordinate_object, + uv_space_index: 0 +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Metal/Platinum.mdl b/code/third_party/vMaterials_2/Metal/Platinum.mdl new file mode 100644 index 0000000000000000000000000000000000000000..5fe0e5336281196417bcb0a50aed5165e2765b0c --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Platinum.mdl @@ -0,0 +1,380 @@ +/****************************************************************************** + * 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 Platinum( + 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 = 0.03f [[ + ::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::description("When enabled the round corner effect is applied across different materials."), + ::anno::in_group("Round Corners") + ]], + uniform float2 texture_translate = float2(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 = float2(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("Platinum"), + ::anno::description("Pure metal material with optional smudges."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Platinum.Platinum.png"), + ::anno::key_words(string[]("metal", "pure", "smudged", "design", "reflective", "infinite tiling", "smooth", "conductor", "new", "polished", "platinum")) +]] + = + let { + + color normal_reflectivity = color(0.678533319955f, 0.639590890417f, 0.583638675413f); // Platinum + 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(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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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, across_materials, 1.f) : ::state::normal()); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + + +export material Platinum_Polished(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Platinum Polished"), + ::anno::description("Pure metal material with optional smudges."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Platinum.Platinum_Polished.png"), + ::anno::key_words(string[]("metal", "pure", "design", "reflective", "infinite tiling", "smooth", "conductor", "new", "polished", "platinum")) +]] += Platinum( + 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 Platinum_Glossy_Fingerprints(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Platinum Glossy Fingerprints"), + ::anno::description("Pure metal material with optional smudges."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Platinum.Platinum_Glossy_Fingerprints.png"), + ::anno::key_words(string[]("metal", "pure", "design", "smudged", "reflective", "infinite tiling", "smooth", "conductor", "new", "polished", "platinum")) +]] += Platinum( + 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/code/third_party/vMaterials_2/Metal/Platinum_Brushed.mdl b/code/third_party/vMaterials_2/Metal/Platinum_Brushed.mdl new file mode 100644 index 0000000000000000000000000000000000000000..9d5159352d1a30bde403533f6f332f739576f67c --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Platinum_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 Platinum_Brushed( + float brush_width = 1.0f [[ + ::anno::display_name("Roughness Width"), + ::anno::description("Widens the anisotropic metal reflections." + "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 = float2(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 = float2(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 Platinum - Strong Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Platinum_Brushed.Platinum_Brushed.png"), + ::anno::key_words(string[]("aec", "metal", "platinum", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] + = + let { + color normal_reflectivity = color(0.678533319955f, 0.639590890417f, 0.583638675413f); // Platinum + 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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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 Platinum_Brushed_Light_Brushing(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Brushed Platinum - Light Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Platinum_Brushed.Platinum_Brushed_Light_Brushing.png"), + ::anno::key_words(string[]("aec", "metal", "platinum", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] + = Platinum_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + +export material Platinum_Brushed_Medium_Light_Brushing(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Brushed Platinum - Medium Light Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Platinum_Brushed.Platinum_Brushed_Medium_Light_Brushing.png"), + ::anno::key_words(string[]("aec", "metal", "platinum", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] += Platinum_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + +export material Platinum_Brushed_Medium_Brushing(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Brushed Platinum - Medium Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Platinum_Brushed.Platinum_Brushed_Medium_Brushing.png"), + ::anno::key_words(string[]("aec", "metal", "platinum", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] += Platinum_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Platinum_Brushed_Very_Strong_Brushing(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Brushed Platinum - Very Strong Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Platinum_Brushed.Platinum_Brushed_Very_Strong_Brushing.png"), + ::anno::key_words(string[]("aec", "metal", "platinum", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] += Platinum_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + + diff --git a/code/third_party/vMaterials_2/Metal/Platinum_Foil.mdl b/code/third_party/vMaterials_2/Metal/Platinum_Foil.mdl new file mode 100644 index 0000000000000000000000000000000000000000..5844cae412295437e8d49508e8782ebbc85ca708 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Platinum_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.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 = "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 Platinum_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 = float2(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 = float2(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("Platinum Foil - Slightly Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Platinum_Foil.Platinum_Foil.png"), + ::anno::key_words(string[]("design", "metal", "platinum", "foil", "smooth", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral")) +]] + = + let { + color normal_reflectivity = color(0.678533319955f, 0.639590890417f, 0.583638675413f); // Platinum + color grazing_reflectivity = color(0.99942f, 1.f, 1.f); + + texture_2d rough_ao_tex = texture_2d("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear); + texture_2d smudge_splotch_tex = texture_2d("./textures/foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear); + texture_2d norm_tex = texture_2d("./textures/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 Platinum_Foil_Smudged_Foil(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Platinum Foil - Smudgy Foil"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Platinum_Foil.Platinum_Foil_Smudged_Foil.png"), + ::anno::key_words(string[]("design", "metal", "platinum", "foil", "smooth", "unfinished", "decorative", "creative", "neutral")) +]] += Platinum_Foil( + infinite_tiling: true, + roughness: 0.15f, + roughness_variation: 0.84f, + smudges: 0.35f, + bump_strength: 0.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + +export material Platinum_Foil_Shiny_Wrinkled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Platinum Foil - Shiny Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Platinum_Foil.Platinum_Foil_Shiny_Wrinkled.png"), + ::anno::key_words(string[]("design", "metal", "platinum", "foil", "shiny", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral")) +]] += Platinum_Foil( + infinite_tiling: true, + roughness: 0.25f, + roughness_variation: 0.25f, + smudges: 0.75f, + bump_strength: 0.25f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + + +export material Platinum_Foil_Matte_Wrinkled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Platinum Foil - Matte Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Platinum_Foil.Platinum_Foil_Matte_Wrinkled.png"), + ::anno::key_words(string[]("design", "metal", "platinum", "foil", "matte", "smooth", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral", "gray")) +]] += Platinum_Foil( + infinite_tiling: true, + roughness: 0.65f, + roughness_variation: 1.0f, + smudges: 0.4f, + bump_strength: 0.15f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + +export material Platinum_Foil_Heavy_Glossy_Wrinkles(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Platinum Foil - Heavy Glossy Wrinkles"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Platinum_Foil.Platinum_Foil_Heavy_Glossy_Wrinkles.png"), + ::anno::key_words(string[]("design", "metal", "platinum", "foil", "smooth", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral")) +]] += Platinum_Foil( + infinite_tiling: true, + roughness: 0.164f, + roughness_variation: 0.021f, + smudges: 0.143f, + bump_strength: 0.99f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + +export material Platinum_Foil_Heavy_Matte_Wrinkled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Platinum Foil - Heavy Matte Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Platinum_Foil.Platinum_Foil_Heavy_Matte_Wrinkled.png"), + ::anno::key_words(string[]("design", "metal", "platinum", "foil", "matte", "bumped", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral", "gray")) +]] += Platinum_Foil( + infinite_tiling: true, + roughness: 0.889f, + roughness_variation: 0.018f, + smudges: 0.246f, + bump_strength: 0.732f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + + + + + + + + + + + + diff --git a/code/third_party/vMaterials_2/Metal/Platinum_Hammered.mdl b/code/third_party/vMaterials_2/Metal/Platinum_Hammered.mdl new file mode 100644 index 0000000000000000000000000000000000000000..a8c81bc5ac52fbb5012f0ddc6de959270eeb8c09 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Platinum_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 Platinum_Hammered( + color metal_color = color(0.542f, 0.511f, 0.47f) [[ + ::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 = float2(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 = float2(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 Platinum - Dark Pits"), + ::anno::author("NVIDIA vMaterials"), + ::anno::in_group("Metal"), + ::anno::key_words(string[]("metal", "platinum", "blackened", "hammered", "design", "classic", "architecture", "pattern", "reflective", "rough", "bumped", "conductor")), + ::anno::thumbnail("./.thumbs/Platinum_Hammered.Platinum_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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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 Platinum_Hammered_Shiny(*) +[[ + ::anno::display_name("Hammered Platinum - Shiny"), + ::anno::author("NVIDIA vMaterials"), + ::anno::in_group("Metal"), + ::anno::key_words(string[]("metal", "platinum", "hammered", "design", "classic", "architecture", "pattern", "reflective", "rough", "bumped", "conductor", "shiny")), + ::anno::thumbnail("./.thumbs/Platinum_Hammered.Platinum_Hammered_Shiny.png"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT) +]] + = Platinum_Hammered( + metal_color: color(0.542f, 0.511f, 0.47f), + 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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + +export material Platinum_Hammered_Dull(*) +[[ + ::anno::display_name("Hammered Platinum - Dull"), + ::anno::author("NVIDIA vMaterials"), + ::anno::in_group("Metal"), + ::anno::key_words(string[]("metal", "platinum", "hammered", "design", "classic", "architecture", "pattern", "reflective", "rough", "bumped", "conductor", "matte", "dull")), + ::anno::thumbnail("./.thumbs/Platinum_Hammered.Platinum_Hammered_Dull.png"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT) +]] + = Platinum_Hammered( + metal_color: color(0.542f, 0.511f, 0.47f), + 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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Metal/Platinum_Knurling.mdl b/code/third_party/vMaterials_2/Metal/Platinum_Knurling.mdl new file mode 100644 index 0000000000000000000000000000000000000000..0d00ab8ba50f6e4c70d6e078fe646f9309f1193f --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Platinum_Knurling.mdl @@ -0,0 +1,359 @@ +/****************************************************************************** + * 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 ::df::*; +import ::tex::*; +import ::math::*; +import ::base::*; +import ::state::*; +import ::anno::*; +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 = "Metal with a diamond knurling finish"; + +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; + //TODO: at least also handle sign of z? + //TODO: handle tangent becoming 0 + + + 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)); +} + +export material Platinum_Knurling( + //Appearance + float brightness = float(0.7f) [[ + ::anno::description("Adjusts the brightness of the material."), + ::anno::display_name("Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.0f, 1.0f) + ]], + float roughness = float(0.5f) [[ + ::anno::description("Higher values lead to a rougher appearance of the material."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.0f, 1.0f) + ]], + float grooves_dirt = float(0.4f) [[ + ::anno::description("Adds dirt in the grooves of the knurling pattern."), + ::anno::display_name("Grooves Dirt"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.0f, 1.0f) + ]], + uniform float bump_strength = float(0.8f) [[ + ::anno::description("Adds dirt in the grooves of the knurling pattern."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.0f, 1.0f) + ]], + + // Round Corners + 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("Sets the radius of the round corners in millimeters."), + ::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") + ]], + //Transform + float2 texture_translate = float2(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"), + ::anno::soft_range(0.f, 360.f) + ]], + float2 texture_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(0.35f, .35f)), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + + // Advanced + uniform int uv_space_index = 0 [[ + ::anno::description("Uses the selected UV space index."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced"), + ::anno::soft_range(0, 4) + ]] +) +[[ + ::anno::display_name("Metal Knurling Platinum"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Platinum_Knurling.Platinum_Knurling.png"), + ::anno::key_words(string[]("metal", "platinum", "knurled", "knurling", "pattern", "design", "bumped")), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials") +]] += let +{ + color metal_tint = color(0.678533319955f, 0.639590890417f, 0.583638675413f); // Platinum + + // Texture setup + texture_2d normal_tex = texture_2d("./textures/metal_knurling_norm.jpg", ::tex::gamma_linear); + texture_2d multi_heights_tex = texture_2d("./textures/metal_knurling_multi_heights.jpg", ::tex::gamma_linear); + texture_2d diff_rough_grunge_tex = texture_2d("./textures/metal_knurling_multi_R_diff_G_rough_B_grunge.jpg", ::tex::gamma_linear); + + // Coordinate setup + ::base::texture_coordinate_info uvw = vmat_transform( + translation: texture_translate, + rotation: texture_rotate, + scaling: texture_scale, + system: ::base::texture_coordinate_uvw, + uv_space: uv_space_index + ); + + // ---------- Diff Rough Grunge Lookup ---------- + + float3 diff_rough_grunge_lookup = float3( + ::base::file_texture( + texture: diff_rough_grunge_tex, + uvw: uvw, + mono_source: ::base::mono_average + ).tint ); + + float3 multi_height_lookup = float3( + ::base::file_texture( + texture: multi_heights_tex, + uvw: uvw, + mono_source: ::base::mono_average + ).tint ); + + float3 norm = ::base::tangent_space_normal_texture( + texture: normal_tex, + factor: bump_strength, + uvw: uvw + ); + + + float remap_rough = histogram_range( + input: diff_rough_grunge_lookup.y, + range: 1.0f, + position: 0.234f + ); + + + float roughness_mapped = remap_rough + (roughness * multi_height_lookup.y); + + float remapped_diff = histogram_range( + input: diff_rough_grunge_lookup.x, + range: 1.0f, + position: (brightness * 0.4f) + 0.4f + ); + + float diff_contribution = ::math::pow(remapped_diff - ((grooves_dirt * 0.5) * multi_height_lookup.x * diff_rough_grunge_lookup.z), 2.67f); + + bsdf ggx_smith_bumped = ::df::weighted_layer( + layer: ::df::microfacet_ggx_smith_bsdf( + roughness_u: roughness_mapped * roughness_mapped, + roughness_v: roughness_mapped * roughness_mapped, + tint: color(diff_contribution), + mode: ::df::scatter_reflect + ), + base: bsdf(), + weight: 1.0f, + normal: norm + ); + + bsdf diff_bsdf = ::df::diffuse_reflection_bsdf( + tint: color(diff_contribution) + ); + + + bsdf final_bsdf = ::df::weighted_layer( + weight: 1.0f - (diff_rough_grunge_lookup.z * multi_height_lookup.x * grooves_dirt), + layer: ::df::directional_factor( + normal_tint: metal_tint, + grazing_tint: color(1.0f), + base: ggx_smith_bumped + ), + base: diff_bsdf + ); + + + // Round Corners + float3 round_normal = enable_round_corners ? + ::state::rounded_corner_normal( + radius: roundcorner_radius * 0.001, + across_materials: across_materials + ) : ::state::normal(); +} +in material ( + + surface: material_surface( + scattering: final_bsdf + ), + geometry: material_geometry( + normal: round_normal + ) +); + + +export material Platinum_Knurling_Worn(*) +[[ + ::anno::display_name("Metal Knurling - Platinum Worn"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Platinum_Knurling.Platinum_Knurling_Worn.png"), + ::anno::key_words(string[]("metal", "platinum", "knurled", "pattern", "knurling", "design", "bumped", "worn")), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials") +]] = Platinum_Knurling( + brightness: 0.4f, + roughness: 1.0f, + grooves_dirt: 1.0f, + bump_strength: 0.8f, + + enable_round_corners: false, + roundcorner_radius: 1.2f, + across_materials: false, + + texture_translate: float2(0.0f), + texture_rotate: 0.f, + texture_scale: float2(1.0f), + + uv_space_index: 0 +); + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/code/third_party/vMaterials_2/Metal/Platinum_Scratched.mdl b/code/third_party/vMaterials_2/Metal/Platinum_Scratched.mdl new file mode 100644 index 0000000000000000000000000000000000000000..08be075d18b912a7ec52ea52362941483de8a220 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Platinum_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 Platinum_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 = float2(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 = float2(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 Platinum"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "platinum", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped")), + ::anno::thumbnail("./.thumbs/Platinum_Scratched.Platinum_Scratched.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = + let { + float brush_scratches_weight = 0.5f; + // Platinum Reflection Color + color reflection_color = color(0.678533319955f, 0.639590890417f, 0.583638675413f); // Platinum + 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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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 Platinum_Scratched_Light_Bumpy(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Scratched Platinum - Bright and Bumped"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "platinum", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "shiny")), + ::anno::thumbnail("./.thumbs/Platinum_Scratched.Platinum_Scratched_Light_Bumpy.png"), + ::anno::copyright_notice(COPYRIGHT) +]]= Platinum_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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); + + + +export material Platinum_Scratched_Dark_Shiny(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Scratched Platinum - Dark Shiny"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "platinum", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "shiny", "dark")), + ::anno::thumbnail("./.thumbs/Platinum_Scratched.Platinum_Scratched_Dark_Shiny.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Platinum_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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); + + +export material Platinum_Scratched_Dark_Matte(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Scratched Platinum - Dark Matte"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "platinum", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "matte", "dark")), + ::anno::thumbnail("./.thumbs/Platinum_Scratched.Platinum_Scratched_Dark_Matte.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Platinum_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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); + + + + +export material Platinum_Scratched_Scuffs_and_Grime(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Scratched Platinum - Scuffs and Grime"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "platinum", "scratched", "worn", "dirty", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "matte", "dark")), + ::anno::thumbnail("./.thumbs/Platinum_Scratched.Platinum_Scratched_Scuffs_and_Grime.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Platinum_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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); + + + + +export material Platinum_Scratched_Dirty_Rough(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Scratched Platinum - Dirty Rough"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "platinum", "scratched", "worn", "dirt", "dirty", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "matte", "dark")), + ::anno::thumbnail("./.thumbs/Platinum_Scratched.Platinum_Scratched_Dirty_Rough.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Platinum_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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); diff --git a/code/third_party/vMaterials_2/Metal/Platinum_Sheet.mdl b/code/third_party/vMaterials_2/Metal/Platinum_Sheet.mdl new file mode 100644 index 0000000000000000000000000000000000000000..a3372a3004196061f115908df9ddf5bb05692f84 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Platinum_Sheet.mdl @@ -0,0 +1,1345 @@ +/****************************************************************************** + * 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 platinum 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) + float2(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 Platinum_Sheet( + 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::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::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 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 = float2(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 = float2(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 Platinum - New Clean"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Platinum_Sheet.Platinum_Sheet.png"), + ::anno::key_words(string[]("metal", "sheet", "platinum", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "neutral")) +]] + = + let { + color normal_reflectivity = color(0.678533319955f, 0.639590890417f, 0.583638675413f); // Platinum + 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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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 Platinum_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 = float2(.5f, .5f) + [[ + ::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) + ]], + + + +// Platinum 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::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::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 = float2(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 = float2(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("Platinum Sheet - Circular Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Platinum_Sheet.Platinum_Sheet_Punched.png"), + ::anno::key_words(string[]("metal", "sheet", "platinum", "decorative", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "punched", "punching", "circular", "neutral")) +]] = let +{ + material base_mat = Platinum_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("./textures/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 + ) +); + + + + +// ------------------ Platinum Sheet Material Presets-------------------- +export material Platinum_Sheet_Soft_Splotches(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Platinum - Soft Splotches"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Platinum_Sheet.Platinum_Sheet_Soft_Splotches.png"), + ::anno::key_words(string[]("metal", "sheet", "platinum", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "neutral", "gray")) +]] += Platinum_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + + +export material Platinum_Sheet_Matte_Imperfections(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Platinum - Matte Imperfections"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Platinum_Sheet.Platinum_Sheet_Matte_Imperfections.png"), + ::anno::key_words(string[]("metal", "sheet", "platinum", "imperfections", "new", "matte", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "neutral")) +]]= Platinum_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + + +export material Platinum_Sheet_Glossy_Imperfections(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Platinum - Glossy Imperfections"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Platinum_Sheet.Platinum_Sheet_Glossy_Imperfections.png"), + ::anno::key_words(string[]("metal", "sheet", "platinum", "imperfections", "new", "glossy", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "neutral")) +]] += Platinum_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + + +export material Platinum_Sheet_Splotchy_Streaks(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Platinum - Splotchy Streaks"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Platinum_Sheet.Platinum_Sheet_Splotchy_Streaks.png"), + ::anno::key_words(string[]("metal", "sheet", "platinum", "imperfections", "new", "glossy", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "neutral")) +]]= Platinum_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + +export material Platinum_Sheet_Glossy_Streaks(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Platinum - Glossy Streaks"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Platinum_Sheet.Platinum_Sheet_Glossy_Streaks.png"), + ::anno::key_words(string[]("metal", "sheet", "platinum", "imperfections", "new", "glossy", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "neutral")) +]] += Platinum_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// ------------------ Platinum Sheet Material Presets-------------------- + +export material Platinum_Sheet_Punched_Small_Circular(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Platinum Sheet - Small Circular Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Platinum_Sheet.Platinum_Sheet_Punched_Small_Circular.png"), + ::anno::key_words(string[]("metal", "sheet", "platinum", "decorative", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "punched", "punching", "circular", "neutral")) +]] += Platinum_Sheet_Punched( + // Punching Parameters + shape_select: pattern_circle, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.4f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.2f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.5f, + impurities_weight_3: 0.86f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + +export material Platinum_Sheet_Punched_Hexagonal(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Platinum Sheet - Hexagonal Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Platinum_Sheet.Platinum_Sheet_Punched_Hexagonal.png"), + ::anno::key_words(string[]("metal", "sheet", "platinum", "decorative", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "punched", "punching", "hexagonal", "neutral")) +]] += Platinum_Sheet_Punched( + // Punching Parameters + shape_select: pattern_hexagon, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.4f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.2f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.5f, + impurities_weight_3: 0.86f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Platinum_Sheet_Punched_Hexagonal_Small(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Platinum Sheet - Small Hexagonal Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Platinum_Sheet.Platinum_Sheet_Punched_Hexagonal_Small.png"), + ::anno::key_words(string[]("metal", "sheet", "platinum", "decorative", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "punched", "punching", "hexagonal", "neutral")) +]] += Platinum_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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.4f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.2f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.5f, + impurities_weight_3: 0.86f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Platinum_Sheet_Punched_Square(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Platinum Sheet - Square Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Platinum_Sheet.Platinum_Sheet_Punched_Square.png"), + ::anno::key_words(string[]("metal", "sheet", "platinum", "decorative", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "punched", "punching", "square", "neutral")) +]] += Platinum_Sheet_Punched( + // Punching Parameters + shape_select: pattern_square, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.4f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.2f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.5f, + impurities_weight_3: 0.86f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Platinum_Sheet_Punched_Line(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Platinum Sheet - Line Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Platinum_Sheet.Platinum_Sheet_Punched_Line.png"), + ::anno::key_words(string[]("metal", "sheet", "platinum", "decorative", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "punched", "punching", "line", "neutral")) +]] += Platinum_Sheet_Punched( + // Punching Parameters + shape_select: pattern_line, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.4f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.2f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.5f, + impurities_weight_3: 0.86f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Platinum_Sheet_Punched_Cross(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Platinum Sheet - Cross Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Platinum_Sheet.Platinum_Sheet_Punched_Cross.png"), + ::anno::key_words(string[]("metal", "sheet", "platinum", "decorative", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "punched", "punching", "cross", "neutral")) +]] += Platinum_Sheet_Punched( + // Punching Parameters + shape_select: pattern_cross, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.4f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.2f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.5f, + impurities_weight_3: 0.86f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Platinum_Sheet_Punched_Rhombus(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Platinum Sheet - Rhombus Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Platinum_Sheet.Platinum_Sheet_Punched_Rhombus.png"), + ::anno::key_words(string[]("metal", "sheet", "platinum", "decorative", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "punched", "punching", "rhombus", "neutral")) +]] += Platinum_Sheet_Punched( + // Punching Parameters + shape_select: pattern_rhombus, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.4f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.2f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.5f, + impurities_weight_3: 0.86f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Platinum_Sheet_Punched_Triangle(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Platinum Sheet - Triangle Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Platinum_Sheet.Platinum_Sheet_Punched_Triangle.png"), + ::anno::key_words(string[]("metal", "sheet", "platinum", "decorative", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "punched", "punching", "triangle", "neutral")) +]] += Platinum_Sheet_Punched( + // Punching Parameters + shape_select: pattern_triangle, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.4f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.2f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.5f, + impurities_weight_3: 0.86f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Platinum_Sheet_Punched_Star(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Platinum Sheet - Star Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Platinum_Sheet.Platinum_Sheet_Punched_Star.png"), + ::anno::key_words(string[]("metal", "sheet", "platinum", "decorative", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "punched", "punching", "star", "neutral")) +]] += Platinum_Sheet_Punched( + // Punching Parameters + shape_select: pattern_star, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.4f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.2f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.5f, + impurities_weight_3: 0.86f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Metal/Punched_Circular_Plate.mdl b/code/third_party/vMaterials_2/Metal/Punched_Circular_Plate.mdl new file mode 100644 index 0000000000000000000000000000000000000000..f71324fd39f7a78d9f2ab8a4339c2ff9af8ee91e --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Punched_Circular_Plate.mdl @@ -0,0 +1,512 @@ +/****************************************************************************** + * 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 diamont metal plate material. The added texture reduces the risk of slipping, " +"making diamond plate a solution for stairs, catwalks, walkways, and ramps in industrial settings"; + + +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); +} + +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]); +} + +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; +} + +float contrast_brightness( + float input = 0.5f, + float contrast = 0.5f, + float brightness = 0.5f +) +{ + 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; +} + +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)); +} + +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); +} + +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 = float2(1.0f) +) +{ + uv.uv /= scale; + return uv; +} + +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(800); // 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); +} + +::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(); +} + +export material Punched_Circular_Plate( + float metal_roughness = 0.27f [[ + ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), + ::anno::display_name("Metal Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(0) + ]], + float roughness_variation = 0.06f [[ + ::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(1) + ]], + float dirt_amount = 0.f [[ + ::anno::description("The amount of dirt applied to the material."), + ::anno::display_name("Dirt Amount"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float dirt_weight = 1.f [[ + ::anno::description("Makes the dirt transition sharper and more defined."), + ::anno::display_name("Dirt Weight"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + float dirt_brightness = 0.38f [[ + ::anno::description("Amkes the dirt arker or brighter."), + ::anno::display_name("Dirt Brightness"), + ::anno::in_group("Appearance", "Dirt"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(5) + ]], + float2 texture_translate = float2(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::ui_order(7) + ]], + float2 texture_scale = float2(1.0f) [[ + ::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."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced"), + ::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.f [[ + ::anno::description("Radius of the rounded corners."), + ::anno::display_name("Round Corner Radius"), + ::anno::in_group("Round Corners"), + ::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) + ]]) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Punched Circular Plate - New Shiny"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "plate", "diamond", "reflective", "pattern", "safety", "bumped", "embossed", "infinite tiling", "architecture", "construction", "naval", "exterior", "new", "shiny", "gray")), + ::anno::thumbnail("./.thumbs/Punched_Circular_Plate.Punched_Circular_Plate.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = + let { + + bool tmp0 = false; + float pattern_shininess = 0.f; + float2 texture_rescale = texture_scale * 0.13f; + + // replace the textures here for different punched cutout shapes + texture_2d shape_multi_ao_height = texture_2d("./textures/circle_shape_multi_R_ao_G_height_B_opacity.jpg", ::tex::gamma_linear); + texture_2d shape_norm = texture_2d("./textures/circle_shape_norm.jpg", ::tex::gamma_linear); + + material_surface tmp1(::df::weighted_layer(contrast_brightness(::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f), 0.659999967f, 0.5f), ::df::microfacet_ggx_smith_bsdf(::math::lerp(0.639999986f, histogram_range(vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, roughness_variation * 0.400000006f, metal_roughness * 0.629999995f + 0.0500000007f) + roughness_variation * 0.299999982f * ::math::pow(1.f - float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 1.26999998f), ::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f)) * (1.f - pattern_shininess * float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y) * (::math::lerp(0.639999986f, histogram_range(vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, roughness_variation * 0.400000006f, metal_roughness * 0.629999995f + 0.0500000007f) + roughness_variation * 0.299999982f * ::math::pow(1.f - float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 1.26999998f), ::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f)) * (1.f - pattern_shininess * float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y)), ::math::lerp(0.639999986f, histogram_range(vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, roughness_variation * 0.400000006f, metal_roughness * 0.629999995f + 0.0500000007f) + roughness_variation * 0.299999982f * ::math::pow(1.f - float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 1.26999998f), ::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f)) * (1.f - pattern_shininess * float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y) * (::math::lerp(0.639999986f, histogram_range(vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, roughness_variation * 0.400000006f, metal_roughness * 0.629999995f + 0.0500000007f) + roughness_variation * 0.299999982f * ::math::pow(1.f - float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 1.26999998f), ::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f)) * (1.f - pattern_shininess * float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y)), color(0.387622833f, 0.387622833f, 0.387622833f), color(0.387622833f, 0.387622833f, 0.387622833f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(vm_tex_lookup(texture_2d("./textures/dirt.jpg", ::tex::gamma_srgb), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(0.5f)), mono_average, float4(dirt_brightness * 0.620000005f + 0.0599999987f)).tint, 0.f), bsdf(), add_detail_normal(::math::lerp(vm_tex_normal_lookup(texture_2d("./textures/plate_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), 1.f), ::state::normal(), contrast_brightness(::math::pow(::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f), 0.229999989f), 0.699999988f, 0.5f)), vm_tex_normal_lookup(shape_norm, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), 1.f))), add_detail_normal(::math::lerp(vm_tex_normal_lookup(texture_2d("./textures/plate_dirt_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), 1.f), ::state::normal(), contrast_brightness(::math::pow(::math::clamp(::math::lerp(1.f, histogram_scan_big(vm_tex_infinite(texture_2d("./textures/transition_noise.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float2(5.f)), float3(0.50999999f), 1.f, true, 2.20000005f).x, 0.620000005f, dirt_amount) + ::math::max(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, ::math::pow(float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).x, 0.680000007f) * ::math::pow(1.f - vm_tex_infinite(texture_2d("./textures/plate_dirt.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), float3(0.647000015f), 1.f, false, 2.20000005f).x, 0.969999969f)), ::math::pow(dirt_weight, 0.280000001f)), 0.f, 1.f), 0.229999989f), 0.699999988f, 0.5f)), vm_tex_normal_lookup(shape_norm, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), 1.f))), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + 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), float3(vm_tex_lookup(shape_multi_ao_height, vm_coord(texture_translate, texture_rotate, texture_rescale, uv_space_index), mono_a, float4(1.f)).tint).z, 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); + + + +// 2 +export material Punched_Circular_Plate_Glossy(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Punched Circular Plate - Glossy"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "plate", "diamond", "pattern", "safety", "bumped", "embossed", "infinite tiling", "architecture", "construction", "naval", "exterior", "gray", "glossy")), + ::anno::thumbnail("./.thumbs/Punched_Circular_Plate.Punched_Circular_Plate_Glossy.png"), + ::anno::copyright_notice(COPYRIGHT) +]] += Punched_Circular_Plate ( + metal_roughness: 0.4f, + roughness_variation: 0.47f, + dirt_amount: 0.0f, + dirt_weight: 1.0f, + dirt_brightness: 0.38f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 1.5f, + roundcorners_across_materials: false +); + + + +// 3 +export material Punched_Circular_Plate_Matte_Aged(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Punched Circular Plate - Matte Aged"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "plate", "diamond", "pattern", "safety", "bumped", "embossed", "infinite tiling", "architecture", "construction", "naval", "exterior", "matte", "aged", "gray")), + ::anno::thumbnail("./.thumbs/Punched_Circular_Plate.Punched_Circular_Plate_Matte_Aged.png"), + ::anno::copyright_notice(COPYRIGHT) +]] += Punched_Circular_Plate ( + metal_roughness: 0.63f, + roughness_variation: 0.72f, + dirt_amount: 0.0f, + dirt_weight: 1.0f, + dirt_brightness: 0.4f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 1.5f, + roundcorners_across_materials: false +); + + +// 4 +export material Punched_Circular_Plate_Dirty_Worn(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Punched Circular Plate - Dirty Worn"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "plate", "diamond", "pattern", "safety", "bumped", "embossed", "infinite tiling", "architecture", "construction", "naval", "exterior", "gray", "worn", "old", "dirty", "decayed")), + ::anno::thumbnail("./.thumbs/Punched_Circular_Plate.Punched_Circular_Plate_Dirty_Worn.png"), + ::anno::copyright_notice(COPYRIGHT) +]] += Punched_Circular_Plate ( + metal_roughness: 0.38f, + roughness_variation: 0.53f, + dirt_amount: 0.38f, + dirt_weight: 1.0f, + dirt_brightness: 0.4f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 1.5f, + roundcorners_across_materials: false +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Metal/Silver.mdl b/code/third_party/vMaterials_2/Metal/Silver.mdl new file mode 100644 index 0000000000000000000000000000000000000000..790a9ca1cea954e47b77c5550c97cb8c4a9a819e --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Silver.mdl @@ -0,0 +1,378 @@ +/****************************************************************************** + * 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 Silver( + 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 = 0.03f [[ + ::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::description("When enabled the round corner effect is applied across different materials."), + ::anno::in_group("Round Corners") + ]], + uniform float2 texture_translate = float2(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 = float2(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("Silver"), + ::anno::description("Pure metal material with optional smudges."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silver.Silver.png"), + ::anno::key_words(string[]("metal", "pure", "smudged", "design", "reflective", "infinite tiling", "smooth", "conductor", "new", "polished", "silver")) +]] + = + let { + + color normal_reflectivity = color(0.9614253056f, 0.948983344333f, 0.918968346466f); // Silver + 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(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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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, across_materials, 1.f) : ::state::normal()); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + +export material Silver_Polished(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Silver Polished"), + ::anno::description("Pure metal material with optional smudges."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silver.Silver_Polished.png"), + ::anno::key_words(string[]("metal", "pure", "design", "reflective", "infinite tiling", "smooth", "conductor", "new", "polished", "silver")) +]] += Silver( + 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 Silver_Glossy_Fingerprints(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Silver Glossy Fingerprints"), + ::anno::description("Pure metal material with optional smudges."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silver.Silver_Glossy_Fingerprints.png"), + ::anno::key_words(string[]("metal", "pure", "design", "smudged", "reflective", "infinite tiling", "smooth", "conductor", "new", "polished", "Silver")) +]] += Silver( + 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/code/third_party/vMaterials_2/Metal/Silver_Brushed.mdl b/code/third_party/vMaterials_2/Metal/Silver_Brushed.mdl new file mode 100644 index 0000000000000000000000000000000000000000..4c063a4dd966bfd55f554e5b19752fc0c1d2cd90 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Silver_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 Silver_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 = float2(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 = float2(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 Silver - Strong Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silver_Brushed.Silver_Brushed.png"), + ::anno::key_words(string[]("aec", "metal", "silver", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] + = + let { + color normal_reflectivity = color(0.9614253056f, 0.948983344333f, 0.918968346466f); // Silver + 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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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 Silver_Brushed_Light_Brushing(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Brushed Silver - Light Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silver_Brushed.Silver_Brushed_Light_Brushing.png"), + ::anno::key_words(string[]("aec", "metal", "silver", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] + = Silver_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + +export material Silver_Brushed_Medium_Light_Brushing(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Brushed Silver - Medium Light Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silver_Brushed.Silver_Brushed_Medium_Light_Brushing.png"), + ::anno::key_words(string[]("aec", "metal", "silver", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] += Silver_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + +export material Silver_Brushed_Medium_Brushing(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Brushed Silver - Medium Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silver_Brushed.Silver_Brushed_Medium_Brushing.png"), + ::anno::key_words(string[]("aec", "metal", "silver", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] += Silver_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Silver_Brushed_Very_Strong_Brushing(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Brushed Silver - Very Strong Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silver_Brushed.Silver_Brushed_Very_Strong_Brushing.png"), + ::anno::key_words(string[]("aec", "metal", "silver", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] += Silver_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + + diff --git a/code/third_party/vMaterials_2/Metal/Silver_Foil.mdl b/code/third_party/vMaterials_2/Metal/Silver_Foil.mdl new file mode 100644 index 0000000000000000000000000000000000000000..c80b2c5820910e6bf8f5400e53326e771b03a940 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Silver_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::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 Silver_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 = float2(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 = float2(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("Silver Foil - Slightly Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silver_Foil.Silver_Foil.png"), + ::anno::key_words(string[]("design", "metal", "silver", "foil", "smooth", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral")) +]] + = + let { + color normal_reflectivity = color(0.9614253056f, 0.948983344333f, 0.918968346466f); // Silver + color grazing_reflectivity = color(0.99942f, 1.f, 1.f); + + texture_2d rough_ao_tex = texture_2d("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear); + texture_2d smudge_splotch_tex = texture_2d("./textures/foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear); + texture_2d norm_tex = texture_2d("./textures/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 Silver_Foil_Smudged_Foil(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Silver Foil - Smudgy Foil"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silver_Foil.Silver_Foil_Smudged_Foil.png"), + ::anno::key_words(string[]("design", "metal", "silver", "foil", "smooth", "unfinished", "decorative", "creative", "neutral")) +]] += Silver_Foil( + infinite_tiling: true, + roughness: 0.15f, + roughness_variation: 0.84f, + smudges: 0.35f, + bump_strength: 0.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + +export material Silver_Foil_Shiny_Wrinkled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Silver Foil - Shiny Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silver_Foil.Silver_Foil_Shiny_Wrinkled.png"), + ::anno::key_words(string[]("design", "metal", "silver", "foil", "shiny", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral")) +]] += Silver_Foil( + infinite_tiling: true, + roughness: 0.25f, + roughness_variation: 0.25f, + smudges: 0.75f, + bump_strength: 0.25f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + + +export material Silver_Foil_Matte_Wrinkled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Silver Foil - Matte Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silver_Foil.Silver_Foil_Matte_Wrinkled.png"), + ::anno::key_words(string[]("design", "metal", "silver", "foil", "matte", "smooth", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral", "gray")) +]] += Silver_Foil( + infinite_tiling: true, + roughness: 0.65f, + roughness_variation: 1.0f, + smudges: 0.4f, + bump_strength: 0.15f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + +export material Silver_Foil_Heavy_Glossy_Wrinkles(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Silver Foil - Heavy Glossy Wrinkles"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silver_Foil.Silver_Foil_Heavy_Glossy_Wrinkles.png"), + ::anno::key_words(string[]("design", "metal", "silver", "foil", "smooth", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral")) +]] += Silver_Foil( + infinite_tiling: true, + roughness: 0.164f, + roughness_variation: 0.021f, + smudges: 0.143f, + bump_strength: 0.99f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + +export material Silver_Foil_Heavy_Matte_Wrinkled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Silver Foil - Heavy Matte Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silver_Foil.Silver_Foil_Heavy_Matte_Wrinkled.png"), + ::anno::key_words(string[]("design", "metal", "silver", "foil", "matte", "bumped", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral", "gray")) +]] += Silver_Foil( + infinite_tiling: true, + roughness: 0.889f, + roughness_variation: 0.018f, + smudges: 0.246f, + bump_strength: 0.732f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + + + + + + + + + + + + diff --git a/code/third_party/vMaterials_2/Metal/Silver_Hammered.mdl b/code/third_party/vMaterials_2/Metal/Silver_Hammered.mdl new file mode 100644 index 0000000000000000000000000000000000000000..6687f4bfdcaf488e525fd3e9b87239021491045b --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Silver_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 Silver_Hammered( + color metal_color = color(0.767f, 0.759f, 0.737f) [[ + ::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 = float2(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 = float2(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 Silver - Dark Pits"), + ::anno::author("NVIDIA vMaterials"), + ::anno::in_group("Metal"), + ::anno::key_words(string[]("metal", "silver", "blackened", "hammered", "design", "classic", "architecture", "pattern", "reflective", "rough", "bumped", "conductor")), + ::anno::thumbnail("./.thumbs/Silver_Hammered.Silver_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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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 Silver_Hammered_Shiny(*) +[[ + ::anno::display_name("Hammered Silver - Shiny"), + ::anno::author("NVIDIA vMaterials"), + ::anno::in_group("Metal"), + ::anno::key_words(string[]("metal", "silver", "hammered", "design", "classic", "architecture", "pattern", "reflective", "rough", "bumped", "conductor", "shiny")), + ::anno::thumbnail("./.thumbs/Silver_Hammered.Silver_Hammered_Shiny.png"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT) +]] + = Silver_Hammered( + metal_color: color(0.767f, 0.759f, 0.737f), + 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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + +export material Silver_Hammered_Dull(*) +[[ + ::anno::display_name("Hammered Silver - Dull"), + ::anno::author("NVIDIA vMaterials"), + ::anno::in_group("Metal"), + ::anno::key_words(string[]("metal", "silver", "hammered", "design", "classic", "architecture", "pattern", "reflective", "rough", "bumped", "conductor", "matte", "dull")), + ::anno::thumbnail("./.thumbs/Silver_Hammered.Silver_Hammered_Dull.png"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT) +]] + = Silver_Hammered( + metal_color: color(0.767f, 0.759f, 0.737f), + 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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Metal/Silver_Knurling.mdl b/code/third_party/vMaterials_2/Metal/Silver_Knurling.mdl new file mode 100644 index 0000000000000000000000000000000000000000..508b016920a5e5e98a7157401d858e4f932fbc60 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Silver_Knurling.mdl @@ -0,0 +1,359 @@ +/****************************************************************************** + * 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 ::df::*; +import ::tex::*; +import ::math::*; +import ::base::*; +import ::state::*; +import ::anno::*; +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 = "Metal with a diamond knurling finish"; + +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; + //TODO: at least also handle sign of z? + //TODO: handle tangent becoming 0 + + + 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)); +} + +export material Silver_Knurling( + //Appearance + float brightness = float(0.7f) [[ + ::anno::description("Adjusts the brightness of the material."), + ::anno::display_name("Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.0f, 1.0f) + ]], + float roughness = float(0.5f) [[ + ::anno::description("Higher values lead to a rougher appearance of the material."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.0f, 1.0f) + ]], + float grooves_dirt = float(0.4f) [[ + ::anno::description("Adds dirt in the grooves of the knurling pattern."), + ::anno::display_name("Grooves Dirt"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.0f, 1.0f) + ]], + uniform float bump_strength = float(0.8f) [[ + ::anno::description("Adds dirt in the grooves of the knurling pattern."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.0f, 1.0f) + ]], + + // Round Corners + 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("Sets the radius of the round corners in millimeters."), + ::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") + ]], + //Transform + float2 texture_translate = float2(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"), + ::anno::soft_range(0.f, 360.f) + ]], + float2 texture_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(0.35f, .35f)), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + + // Advanced + uniform int uv_space_index = 0 [[ + ::anno::description("Uses the selected UV space index."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced"), + ::anno::soft_range(0, 4) + ]] +) +[[ + ::anno::display_name("Metal Knurling Silver"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silver_Knurling.Silver_Knurling.png"), + ::anno::key_words(string[]("metal", "silver", "knurled", "knurling", "pattern", "design", "bumped")), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials") +]] += let +{ + color metal_tint = color(0.9614253056f, 0.948983344333f, 0.918968346466f); // Silver + + // Texture setup + texture_2d normal_tex = texture_2d("./textures/metal_knurling_norm.jpg", ::tex::gamma_linear); + texture_2d multi_heights_tex = texture_2d("./textures/metal_knurling_multi_heights.jpg", ::tex::gamma_linear); + texture_2d diff_rough_grunge_tex = texture_2d("./textures/metal_knurling_multi_R_diff_G_rough_B_grunge.jpg", ::tex::gamma_linear); + + // Coordinate setup + ::base::texture_coordinate_info uvw = vmat_transform( + translation: texture_translate, + rotation: texture_rotate, + scaling: texture_scale, + system: ::base::texture_coordinate_uvw, + uv_space: uv_space_index + ); + + // ---------- Diff Rough Grunge Lookup ---------- + + float3 diff_rough_grunge_lookup = float3( + ::base::file_texture( + texture: diff_rough_grunge_tex, + uvw: uvw, + mono_source: ::base::mono_average + ).tint ); + + float3 multi_height_lookup = float3( + ::base::file_texture( + texture: multi_heights_tex, + uvw: uvw, + mono_source: ::base::mono_average + ).tint ); + + float3 norm = ::base::tangent_space_normal_texture( + texture: normal_tex, + factor: bump_strength, + uvw: uvw + ); + + + float remap_rough = histogram_range( + input: diff_rough_grunge_lookup.y, + range: 1.0f, + position: 0.234f + ); + + + float roughness_mapped = remap_rough + (roughness * multi_height_lookup.y); + + float remapped_diff = histogram_range( + input: diff_rough_grunge_lookup.x, + range: 1.0f, + position: (brightness * 0.4f) + 0.4f + ); + + float diff_contribution = ::math::pow(remapped_diff - ((grooves_dirt * 0.5) * multi_height_lookup.x * diff_rough_grunge_lookup.z), 2.67f); + + bsdf ggx_smith_bumped = ::df::weighted_layer( + layer: ::df::microfacet_ggx_smith_bsdf( + roughness_u: roughness_mapped * roughness_mapped, + roughness_v: roughness_mapped * roughness_mapped, + tint: color(diff_contribution), + mode: ::df::scatter_reflect + ), + base: bsdf(), + weight: 1.0f, + normal: norm + ); + + bsdf diff_bsdf = ::df::diffuse_reflection_bsdf( + tint: color(diff_contribution) + ); + + + bsdf final_bsdf = ::df::weighted_layer( + weight: 1.0f - (diff_rough_grunge_lookup.z * multi_height_lookup.x * grooves_dirt), + layer: ::df::directional_factor( + normal_tint: metal_tint, + grazing_tint: color(1.0f), + base: ggx_smith_bumped + ), + base: diff_bsdf + ); + + + // Round Corners + float3 round_normal = enable_round_corners ? + ::state::rounded_corner_normal( + radius: roundcorner_radius * 0.001, + across_materials: across_materials + ) : ::state::normal(); +} +in material ( + + surface: material_surface( + scattering: final_bsdf + ), + geometry: material_geometry( + normal: round_normal + ) +); + + +export material Silver_Knurling_Worn(*) +[[ + ::anno::display_name("Metal Knurling - Silver Worn"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silver_Knurling.Silver_Knurling_Worn.png"), + ::anno::key_words(string[]("metal", "silver", "knurled", "pattern", "knurling", "design", "bumped", "worn")), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials") +]] = Silver_Knurling( + brightness: 0.4f, + roughness: 1.0f, + grooves_dirt: 1.0f, + bump_strength: 0.8f, + + enable_round_corners: false, + roundcorner_radius: 1.2f, + across_materials: false, + + texture_translate: float2(0.0f), + texture_rotate: 0.f, + texture_scale: float2(1.0f), + + uv_space_index: 0 +); + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/code/third_party/vMaterials_2/Metal/Silver_Scratched.mdl b/code/third_party/vMaterials_2/Metal/Silver_Scratched.mdl new file mode 100644 index 0000000000000000000000000000000000000000..73f9fc24d0a9a667ca981bcf917d050ea49d084b --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Silver_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 Silver_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::description("Sets the roughness of the scratches"), + ::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 = float2(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 = float2(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("Silver Scratched"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "silver", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "neutral", "gray")), + ::anno::thumbnail("./.thumbs/Silver_Scratched.Silver_Scratched.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = + let { + float brush_scratches_weight = 0.5f; + // Silver Reflection Color + color reflection_color = color(0.9614253056f, 0.948983344333f, 0.918968346466f); // Silver + 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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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 Silver_Scratched_Light_Bumpy(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Silver Scratched - Bright and Bumped"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "silver", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "neutral", "gray", "shiny")), + ::anno::thumbnail("./.thumbs/Silver_Scratched.Silver_Scratched_Light_Bumpy.png"), + ::anno::copyright_notice(COPYRIGHT) +]]= Silver_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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); + + + +export material Silver_Scratched_Dark_Shiny(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Silver Scratched - Dark Shiny"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "silver", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "neutral", "gray", "shiny", "dark")), + ::anno::thumbnail("./.thumbs/Silver_Scratched.Silver_Scratched_Dark_Shiny.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Silver_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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); + + +export material Silver_Scratched_Dark_Matte(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Silver Scratched - Dark Matte"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "silver", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "neutral", "gray", "matte", "dark")), + ::anno::thumbnail("./.thumbs/Silver_Scratched.Silver_Scratched_Dark_Matte.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Silver_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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); + + + + +export material Silver_Scratched_Scuffs_and_Grime(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Silver Scratched - Scuffs and Grime"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "silver", "scratched", "worn", "dirty", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "neutral", "gray", "matte", "dark")), + ::anno::thumbnail("./.thumbs/Silver_Scratched.Silver_Scratched_Scuffs_and_Grime.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Silver_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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); + + + + +export material Silver_Scratched_Dirty_Rough(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Silver Scratched - Dirty Rough"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "silver", "scratched", "worn", "dirt", "dirty", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "neutral", "gray", "matte", "dark")), + ::anno::thumbnail("./.thumbs/Silver_Scratched.Silver_Scratched_Dirty_Rough.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Silver_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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); diff --git a/code/third_party/vMaterials_2/Metal/Silver_Sheet.mdl b/code/third_party/vMaterials_2/Metal/Silver_Sheet.mdl new file mode 100644 index 0000000000000000000000000000000000000000..5032bf222be1480764692392776719585ba9965e --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Silver_Sheet.mdl @@ -0,0 +1,1343 @@ +/****************************************************************************** + * 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 silver 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) + float2(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 Silver_Sheet( + 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::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::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 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 = float2(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 = float2(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 Silver - New Clean"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silver_Sheet.Silver_Sheet.png"), + ::anno::key_words(string[]("metal", "sheet", "silver", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "neutral")) +]] + = + let { + color normal_reflectivity = color(0.9614253056f, 0.948983344333f, 0.918968346466f); // Silver + 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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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 Silver_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 = float2(.5f, .5f) + [[ + ::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) + ]], + + + +// Silver 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::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::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 = float2(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 = float2(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("Silver Sheet - Circular Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silver_Sheet.Silver_Sheet_Punched.png"), + ::anno::key_words(string[]("metal", "sheet", "silver", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "circular", "neutral")) +]] = let +{ + material base_mat = Silver_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, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + enable_round_corners: enable_round_corners, + roundcorner_radius: roundcorner_radius, + across_materials: across_materials + ); + texture_2d punching_cutout = texture_2d("./textures/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 + ) +); + + +// ------------------------ Silver Sheet Presets ------------------------ +export material Silver_Sheet_Soft_Splotches(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Silver - Soft Splotches"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silver_Sheet.Silver_Sheet_Soft_Splotches.png"), + ::anno::key_words(string[]("metal", "sheet", "silver", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "neutral", "gray")) +]] += Silver_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + + +export material Silver_Sheet_Matte_Imperfections(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Silver - Matte Imperfections"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silver_Sheet.Silver_Sheet_Matte_Imperfections.png"), + ::anno::key_words(string[]("metal", "sheet", "silver", "imperfections", "new", "matte", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "neutral")) +]]= Silver_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + + +export material Silver_Sheet_Glossy_Imperfections(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Silver - Glossy Imperfections"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silver_Sheet.Silver_Sheet_Glossy_Imperfections.png"), + ::anno::key_words(string[]("metal", "sheet", "silver", "imperfections", "new", "glossy", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "neutral")) +]] += Silver_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + + +export material Silver_Sheet_Splotchy_Streaks(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Silver - Splotchy Streaks"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silver_Sheet.Silver_Sheet_Splotchy_Streaks.png"), + ::anno::key_words(string[]("metal", "sheet", "silver", "imperfections", "new", "glossy", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "neutral")) +]]= Silver_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + +export material Silver_Sheet_Glossy_Streaks(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Silver - Glossy Streaks"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silver_Sheet.Silver_Sheet_Glossy_Streaks.png"), + ::anno::key_words(string[]("metal", "sheet", "silver", "imperfections", "new", "glossy", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "neutral")) +]] += Silver_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// ------------------------ Punched Silver Sheet Presets ------------------------ + +export material Silver_Sheet_Punched_Small_Circular(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Silver Sheet - Small Circular Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silver_Sheet.Silver_Sheet_Punched_Small_Circular.png"), + ::anno::key_words(string[]("metal", "sheet", "silver", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "circular", "neutral")) +]] += Silver_Sheet_Punched( + // Punching Parameters + shape_select: pattern_circle, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.4f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.2f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.5f, + impurities_weight_3: 0.86f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Silver_Sheet_Punched_Hexagonal(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Silver Sheet - Hexagonal Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silver_Sheet.Silver_Sheet_Punched_Hexagonal.png"), + ::anno::key_words(string[]("metal", "sheet", "silver", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "hexagonal", "neutral")) +]] += Silver_Sheet_Punched( + // Punching Parameters + shape_select: pattern_hexagon, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.4f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.2f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.5f, + impurities_weight_3: 0.86f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + +export material Silver_Sheet_Punched_Hexagonal_Small(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Silver Sheet - Small Hexagonal Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silver_Sheet.Silver_Sheet_Punched_Hexagonal_Small.png"), + ::anno::key_words(string[]("metal", "sheet", "silver", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "hexagonal", "neutral")) +]] += Silver_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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.4f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.2f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.5f, + impurities_weight_3: 0.86f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Silver_Sheet_Punched_Square(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Silver Sheet - Square Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silver_Sheet.Silver_Sheet_Punched_Square.png"), + ::anno::key_words(string[]("metal", "sheet", "silver", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "square", "neutral")) +]] += Silver_Sheet_Punched( + // Punching Parameters + shape_select: pattern_square, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.4f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.2f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.5f, + impurities_weight_3: 0.86f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Silver_Sheet_Punched_Line(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Silver Sheet - Line Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silver_Sheet.Silver_Sheet_Punched_Line.png"), + ::anno::key_words(string[]("metal", "sheet", "silver", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "line", "neutral")) +]] += Silver_Sheet_Punched( + // Punching Parameters + shape_select: pattern_line, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.4f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.2f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.5f, + impurities_weight_3: 0.86f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Silver_Sheet_Punched_Cross(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Silver Sheet - Cross Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silver_Sheet.Silver_Sheet_Punched_Cross.png"), + ::anno::key_words(string[]("metal", "sheet", "silver", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "cross", "neutral")) +]] += Silver_Sheet_Punched( + // Punching Parameters + shape_select: pattern_cross, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.4f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.2f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.5f, + impurities_weight_3: 0.86f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Silver_Sheet_Punched_Rhombus(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Silver Sheet - Rhombus Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silver_Sheet.Silver_Sheet_Punched_Rhombus.png"), + ::anno::key_words(string[]("metal", "sheet", "silver", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "rhombus", "neutral")) +]] += Silver_Sheet_Punched( + // Punching Parameters + shape_select: pattern_rhombus, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.4f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.2f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.5f, + impurities_weight_3: 0.86f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Silver_Sheet_Punched_Triangle(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Silver Sheet - Triangle Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silver_Sheet.Silver_Sheet_Punched_Triangle.png"), + ::anno::key_words(string[]("metal", "sheet", "silver", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "triangle", "neutral")) +]] += Silver_Sheet_Punched( + // Punching Parameters + shape_select: pattern_triangle, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.4f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.2f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.5f, + impurities_weight_3: 0.86f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Silver_Sheet_Punched_Star(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Silver Sheet - Star Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Silver_Sheet.Silver_Sheet_Punched_Star.png"), + ::anno::key_words(string[]("metal", "sheet", "silver", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "punched", "punching", "star", "neutral")) +]] += Silver_Sheet_Punched( + // Punching Parameters + shape_select: pattern_star, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.4f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.2f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.5f, + impurities_weight_3: 0.86f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Metal/Solder_Paste.mdl b/code/third_party/vMaterials_2/Metal/Solder_Paste.mdl new file mode 100644 index 0000000000000000000000000000000000000000..fe4d4f132116dbe0c14c5afc48763e0ed17570da --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Solder_Paste.mdl @@ -0,0 +1,313 @@ +/****************************************************************************** + * 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 solder paste material for printed circuit boards (PCB)"; + +::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 Solder_Paste( + color normal_reflectivity = color(0.5686277, 0.5686277, 0.5686277) [[ + ::anno::description("Sets the reflection color at normal reflectivity levels."), + ::anno::display_name("Normal Reflectivity"), + ::anno::in_group("Appearance"), + ::anno::ui_order(0) + ]], + color grazing_reflectivity = color(0.8362571, 0.848853f, 1.f) [[ + ::anno::description("Sets the reflection color at grazing reflectivity levels."), + ::anno::display_name("Grazing Reflectivity"), + ::anno::in_group("Appearance"), + ::anno::ui_order(1) + ]], + float reflection_roughness = 0.2f [[ + ::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 reflection_smooth = 1.f [[ + ::anno::description("Adds blurrier reflection that follow the intensities of the Roughness texture on top."), + ::anno::display_name("Reflection Smooth"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + uniform 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, 4.f), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + uniform float2 texture_translate = float2(0.f) [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("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("Rotate"), + ::anno::in_group("Transform"), + ::anno::ui_order(6) + ]], + uniform float2 texture_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Scale"), + ::nvidia::core_definitions::dimension(float2(.1f, .1f)), + ::anno::in_group("Transform"), + ::anno::ui_order(7) + ]], + 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(8) + ]], + uniform float radius = 0.03f [[ + ::anno::description("Radius of the rounded corners."), + ::anno::display_name("Round Corner Radius"), + ::anno::in_group("Round Corners"), + ::anno::ui_order(9) + ]], + 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(10) + ]], + uniform bool no_uv = false [[ + ::anno::description("Set this to true if your model has no UV layout."), + ::anno::display_name("No UV"), + ::anno::in_group("Advanced", "Projection"), + ::anno::ui_order(11) + ]], + uniform ::base::projection_mode projection_type = ::base::projection_planar [[ + ::anno::description("Projection method to be used to generate the coordinates."), + ::anno::display_name("Projection Type"), + ::anno::in_group("Advanced", "Projection"), + ::anno::ui_order(12) + ]], + uniform float scale = 1.f [[ + ::anno::description("Scales the texture while No UV is true."), + ::anno::display_name("Scale Projection"), + ::anno::in_group("Advanced", "Projection"), + ::anno::ui_order(13) + ]], + uniform ::base::texture_coordinate_system coordinate_system = ::base::texture_coordinate_object [[ + ::anno::description("The projection can be done based on world or object space. Do not use uvw space. Since it is disabled while No UV is set to true."), + ::anno::display_name("Coordinate System"), + ::anno::in_group("Advanced", "Projection"), + ::anno::ui_order(14) + ]], + 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(15) + ]]) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Solder Paste"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("conductiv", "metal", "solder", "paste", "pcb", "plate", "computer", "silver", "gray", "shiny", "smooth", "metallic", "construction", "light", "warm", "tin", "creamy", "reflective", "bluish")), + ::anno::thumbnail("./.thumbs/Solder_Paste.Solder_Paste.png"), + ::anno::author("Nvidia vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] + = + let { + 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.800000012f, reflection_roughness) * ::math::lerp(0.f, 0.800000012f, reflection_roughness), ::math::lerp(0.f, 0.800000012f, reflection_roughness) * ::math::lerp(0.f, 0.800000012f, reflection_roughness) + reflection_smooth * (1.f - ::math::lerp(0.f, 0.800000012f, reflection_roughness) * ::math::lerp(0.f, 0.800000012f, reflection_roughness)), ::base::file_texture(texture_2d("./textures/solder_paste_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, no_uv ? ::base::coordinate_projection(coordinate_system, uv_space_index, projection_type, float4x4(scale)) : vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono) * ::math::lerp(::math::lerp(0.f, 0.800000012f, reflection_roughness) * ::math::lerp(0.f, 0.800000012f, reflection_roughness), ::math::lerp(0.f, 0.800000012f, reflection_roughness) * ::math::lerp(0.f, 0.800000012f, reflection_roughness) + reflection_smooth * (1.f - ::math::lerp(0.f, 0.800000012f, reflection_roughness) * ::math::lerp(0.f, 0.800000012f, reflection_roughness)), ::base::file_texture(texture_2d("./textures/solder_paste_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, no_uv ? ::base::coordinate_projection(coordinate_system, uv_space_index, projection_type, float4x4(scale)) : vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono), ::math::lerp(::math::lerp(0.f, 0.800000012f, reflection_roughness) * ::math::lerp(0.f, 0.800000012f, reflection_roughness), ::math::lerp(0.f, 0.800000012f, reflection_roughness) * ::math::lerp(0.f, 0.800000012f, reflection_roughness) + reflection_smooth * (1.f - ::math::lerp(0.f, 0.800000012f, reflection_roughness) * ::math::lerp(0.f, 0.800000012f, reflection_roughness)), ::base::file_texture(texture_2d("./textures/solder_paste_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, no_uv ? ::base::coordinate_projection(coordinate_system, uv_space_index, projection_type, float4x4(scale)) : vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono) * ::math::lerp(::math::lerp(0.f, 0.800000012f, reflection_roughness) * ::math::lerp(0.f, 0.800000012f, reflection_roughness), ::math::lerp(0.f, 0.800000012f, reflection_roughness) * ::math::lerp(0.f, 0.800000012f, reflection_roughness) + reflection_smooth * (1.f - ::math::lerp(0.f, 0.800000012f, reflection_roughness) * ::math::lerp(0.f, 0.800000012f, reflection_roughness)), ::base::file_texture(texture_2d("./textures/solder_paste_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, no_uv ? ::base::coordinate_projection(coordinate_system, uv_space_index, projection_type, float4x4(scale)) : vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), bsdf(), ::base::tangent_space_normal_texture(texture_2d("./textures/solder_paste_norm.jpg", ::tex::gamma_linear), ::math::lerp(0.f, 2.f, bump_strength), false, false, no_uv ? ::base::coordinate_projection(coordinate_system, uv_space_index, projection_type, float4x4(scale)) : vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); + 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 Solder_Paste_Fresh(*) +[[ + ::anno::display_name("Solder Paste Fresh"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("conductiv", "metal", "solder", "paste", "pcb", "plate", "computer", "silver","gray", "shiny", "smooth", "metallic", "construction", "light", "warm", "tin", "creamy", "reflective", "bluish", "fresh")), + ::anno::thumbnail("./.thumbs/Solder_Paste.Solder_Paste_Fresh.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Solder_Paste +( + normal_reflectivity: color(.57f, 0.57f, 0.57f), + grazing_reflectivity: color(0.84f, 0.85f, 1.f), + reflection_roughness: .6f, + reflection_smooth: .5f, + bump_strength: .15f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius: 1.5f, + across_materials: false, + no_uv: false, + projection_type: ::base::projection_planar, + scale: 1.f, + coordinate_system: ::base::texture_coordinate_object, + uv_space_index: 0 +); + +export material Solder_Paste_Dull(*) +[[ + ::anno::display_name("Solder Paste Dull"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("conductiv", "metal", "solder", "paste", "pcb", "plate", "computer", "silver","gray", "shiny", "smooth", "metallic", "construction", "light", "warm", "tin", "creamy", "reflective", "bluish", "dull")), + ::anno::thumbnail("./.thumbs/Solder_Paste.Solder_Paste_Dull.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Solder_Paste +( + normal_reflectivity: color(.57f, 0.57f, 0.57f), + grazing_reflectivity: color(0.84f, 0.85f, 1.f), + reflection_roughness: .95f, + reflection_smooth: .0f, + bump_strength: .1f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius: 1.5f, + across_materials: false, + no_uv: false, + projection_type: ::base::projection_planar, + scale: 1.f, + coordinate_system: ::base::texture_coordinate_object, + uv_space_index: 0 +); + +export material Solder_Paste_Bumpy(*) +[[ + ::anno::display_name("Solder Paste Bumpy"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("conductiv", "metal", "solder", "paste", "pcb", "plate", "computer", "silver","gray", "shiny", "smooth", "metallic", "construction", "light", "warm", "tin", "creamy", "reflective", "bluish", "bumpy")), + ::anno::thumbnail("./.thumbs/Solder_Paste.Solder_Paste_Bumpy.png"), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab") +]] += Solder_Paste +( + normal_reflectivity: color(.57f, 0.57f, 0.57f), + grazing_reflectivity: color(0.84f, 0.85f, 1.f), + reflection_roughness: .8f, + reflection_smooth: .9f, + bump_strength: .6f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius: 1.5f, + across_materials: false, + no_uv: false, + projection_type: ::base::projection_planar, + scale: 1.f, + coordinate_system: ::base::texture_coordinate_object, + uv_space_index: 0 +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Metal/Stainless_Steel.mdl b/code/third_party/vMaterials_2/Metal/Stainless_Steel.mdl new file mode 100644 index 0000000000000000000000000000000000000000..13179f381d5d1e0409447759a7667599a286fb20 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Stainless_Steel.mdl @@ -0,0 +1,612 @@ +/****************************************************************************** + * 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 stainless steel material with adjustable roughness and controls to add secondary effects \n" +"such as stains, smudges and mechanical damage"; + + +::base::texture_coordinate_info vmat_transform_post_scale( + ::base::texture_coordinate_info uvw, + float2 scale = float2(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 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))); +} + +float overlay(float base, float layer, float weight) +{ + return base + (1.0f - base) * layer * weight; +} + +// 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)); +} + + + +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 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 Stainless_Steel( + 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"), + ::anno::ui_order(0) + ]], + float roughness = 0.f [[ + ::anno::description("Higher values lead to blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float roughness_variation = 0.21f [[ + ::anno::description("Adds variation to the roughness following the shape of the milling bump map."), + ::anno::display_name("Roughness Variation"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float cloudiness = 0.3f [[ + ::anno::description("Adds a cloudy reflection to the metal material."), + ::anno::display_name("Cloudiness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float brightness = 0.5f [[ + ::anno::description("Low values make the metal darker and add slight variation to the brightness while a high value gives it a bright uniform look."), + ::anno::display_name("Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + float milling_bump_strength = 0.0f [[ + ::anno::description("Adds milled grooves on the metal."), + ::anno::display_name("Milling Bump Strength"), + ::anno::in_group("Appearance", "Bump"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(5) + ]], + float dents_bump_strength = 0.01f [[ + ::anno::description("Adds dents and bumps."), + ::anno::display_name("Dents Bump Strength"), + ::anno::in_group("Appearance", "Bump"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(6) + ]], + float dents_scale = 1.f [[ + ::anno::description("Scales the size of the dents pattern on the material."), + ::anno::display_name("Dents Scale"), + ::anno::in_group("Appearance", "Bump"), + ::anno::ui_order(7) + ]], + float smudges_1_weight = 0.f [[ + ::anno::description("Adds smudges on the material which impact the reflectivity."), + ::anno::display_name("Smudges Weight"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(8) + ]], + float smudges_2_weight = 0.f [[ + ::anno::description("Adds imperfections that resemble stains on the material which impact the reflectivity."), + ::anno::display_name("Stains Weight"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(9) + ]], + float smudges_falloff = .45f [[ + ::anno::description("Controls the falloff of the smudges and stains on the surface. Low values make the smudges wide and soft while high values make them small."), + ::anno::display_name("Smudges Falloff"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(10) + ]], + float smudges_scale = 1.f [[ + ::anno::description("Scales the smudges relative to the overal scale of the material."), + ::anno::display_name("Smudges and Stains Scale"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(11) + ]], + uniform float2 texture_translate = float2(0.f) [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform"), + ::anno::ui_order(12) + ]], + 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(13) + ]], + uniform float2 texture_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(0.70f, 0.70f)), + ::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 rquired 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) + ]], + 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(18) + ]]) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Stainless Steel"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Stainless_Steel.Stainless_Steel.png"), + ::anno::key_words(string[]("metal", "steel", "stainless", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "new", "shiny", "smooth", "reflective", "plain", "gray")) +]] + = + let { + bool tmp0 = false; + float2 texture_rescale = texture_scale * float2(0.55f); + + material_surface tmp1(::df::custom_curve_layer(0.799999952f, 1.f, 3.0999999f, 1.f, ::df::weighted_layer(cloudiness * 0.330000013f, ::df::microfacet_ggx_smith_bsdf(0.159999996f, 0.159999996f, color(brightness * 0.300000012f + 0.600000024f), color(brightness * 0.300000012f + 0.600000024f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(0.799999952f, ::df::microfacet_ggx_smith_bsdf(overlay((histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(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).y, ::math::lerp(0.f, 0.430000007f, roughness_variation), ::math::lerp(0.0299999993f, 0.349999994f, roughness)) - float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(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).z * ::math::lerp(0.0299999993f, 0.349999994f, roughness) * dents_bump_strength) * (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(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).y, ::math::lerp(0.f, 0.430000007f, roughness_variation), ::math::lerp(0.0299999993f, 0.349999994f, roughness)) - float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(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).z * ::math::lerp(0.0299999993f, 0.349999994f, roughness) * dents_bump_strength), overlay(smudges_1_weight * ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).x, ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).y, smudges_2_weight), 0.429999977f), overlay((histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(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).y, ::math::lerp(0.f, 0.430000007f, roughness_variation), ::math::lerp(0.0299999993f, 0.349999994f, roughness)) - float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(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).z * ::math::lerp(0.0299999993f, 0.349999994f, roughness) * dents_bump_strength) * (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(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).y, ::math::lerp(0.f, 0.430000007f, roughness_variation), ::math::lerp(0.0299999993f, 0.349999994f, roughness)) - float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(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).z * ::math::lerp(0.0299999993f, 0.349999994f, roughness) * dents_bump_strength), overlay(smudges_1_weight * ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).x, ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).y, smudges_2_weight), 0.429999977f), color(brightness * 0.300000012f + 0.600000024f), color(brightness * 0.300000012f + 0.600000024f), ::state::texture_tangent_u(0), ::df::scatter_reflect), bsdf(), add_detail_normal(infinite_tiling ? endless_normal(texture_2d("./textures/stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, false, false, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale)), 9.13999939f, float3(0.5f, 0.5f, 0.999000013f), 8.38000011f) : normalmap_normal(texture_2d("./textures/stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale))), infinite_tiling ? endless_normal(texture_2d("./textures/stainless_norm.jpg", ::tex::gamma_linear), milling_bump_strength, false, false, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.5f)), 9.13999939f, float3(0.5f, 0.5f, 0.999000013f), 8.38000011f) : normalmap_normal(texture_2d("./textures/stainless_norm.jpg", ::tex::gamma_linear), milling_bump_strength, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.5f))))), add_detail_normal(infinite_tiling ? endless_normal(texture_2d("./textures/stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, false, false, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale)), 9.13999939f, float3(0.5f, 0.5f, 0.999000013f), 8.38000011f) : normalmap_normal(texture_2d("./textures/stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale))), infinite_tiling ? endless_normal(texture_2d("./textures/stainless_norm.jpg", ::tex::gamma_linear), milling_bump_strength, false, false, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.5f)), 9.13999939f, float3(0.5f, 0.5f, 0.999000013f), 8.38000011f) : normalmap_normal(texture_2d("./textures/stainless_norm.jpg", ::tex::gamma_linear), milling_bump_strength, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.5f))))), ::df::tint(color(0.f, 0.f, 0.f), ::df::weighted_layer(cloudiness * 0.330000013f, ::df::microfacet_ggx_smith_bsdf(0.159999996f, 0.159999996f, color(brightness * 0.300000012f + 0.600000024f), color(brightness * 0.300000012f + 0.600000024f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(0.799999952f, ::df::microfacet_ggx_smith_bsdf(overlay((histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(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).y, ::math::lerp(0.f, 0.430000007f, roughness_variation), ::math::lerp(0.0299999993f, 0.349999994f, roughness)) - float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(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).z * ::math::lerp(0.0299999993f, 0.349999994f, roughness) * dents_bump_strength) * (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(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).y, ::math::lerp(0.f, 0.430000007f, roughness_variation), ::math::lerp(0.0299999993f, 0.349999994f, roughness)) - float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(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).z * ::math::lerp(0.0299999993f, 0.349999994f, roughness) * dents_bump_strength), overlay(smudges_1_weight * ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).x, ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).y, smudges_2_weight), 0.429999977f), overlay((histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(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).y, ::math::lerp(0.f, 0.430000007f, roughness_variation), ::math::lerp(0.0299999993f, 0.349999994f, roughness)) - float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(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).z * ::math::lerp(0.0299999993f, 0.349999994f, roughness) * dents_bump_strength) * (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(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).y, ::math::lerp(0.f, 0.430000007f, roughness_variation), ::math::lerp(0.0299999993f, 0.349999994f, roughness)) - float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(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).z * ::math::lerp(0.0299999993f, 0.349999994f, roughness) * dents_bump_strength), overlay(smudges_1_weight * ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).x, ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).y, smudges_2_weight), 0.429999977f), color(brightness * 0.300000012f + 0.600000024f), color(brightness * 0.300000012f + 0.600000024f), ::state::texture_tangent_u(0), ::df::scatter_reflect), bsdf(), add_detail_normal(infinite_tiling ? endless_normal(texture_2d("./textures/stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, false, false, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale)), 9.13999939f, float3(0.5f, 0.5f, 0.999000013f), 8.38000011f) : normalmap_normal(texture_2d("./textures/stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale))), infinite_tiling ? endless_normal(texture_2d("./textures/stainless_norm.jpg", ::tex::gamma_linear), milling_bump_strength, false, false, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.5f)), 9.13999939f, float3(0.5f, 0.5f, 0.999000013f), 8.38000011f) : normalmap_normal(texture_2d("./textures/stainless_norm.jpg", ::tex::gamma_linear), milling_bump_strength, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.5f))))), add_detail_normal(infinite_tiling ? endless_normal(texture_2d("./textures/stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, false, false, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale)), 9.13999939f, float3(0.5f, 0.5f, 0.999000013f), 8.38000011f) : normalmap_normal(texture_2d("./textures/stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale))), infinite_tiling ? endless_normal(texture_2d("./textures/stainless_norm.jpg", ::tex::gamma_linear), milling_bump_strength, false, false, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.5f)), 9.13999939f, float3(0.5f, 0.5f, 0.999000013f), 8.38000011f) : normalmap_normal(texture_2d("./textures/stainless_norm.jpg", ::tex::gamma_linear), milling_bump_strength, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.5f)))))), ::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); + + +// ----------------------- Stainless Steel Presets ----------------------- +// 2 Shiny Worn +export material Stainless_Steel_Shiny_Worn(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Stainless Steel - Shiny Worn"), + ::anno::description("Shiny stainless steel with signs of mechanical wear"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Stainless_Steel.Stainless_Steel_Shiny_Worn.png"), + ::anno::key_words(string[]("metal", "steel", "stainless", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "dented", "worn", "shiny", "reflective", "plain", "gray")) +]] = Stainless_Steel( + infinite_tiling: true, + roughness: 0.0f, + roughness_variation: 0.21f, + cloudiness: 0.3f, + brightness: 0.5f, + milling_bump_strength: 0.0f, + dents_bump_strength: 0.9f, + dents_scale: 1.00f, + smudges_1_weight: 0.0f, + smudges_2_weight: 0.0f, + smudges_falloff: 0.45f, + smudges_scale: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 3 Shiny Smudged +export material Stainless_Steel_Shiny_Smudged(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Stainless Steel - Shiny Smudged"), + ::anno::description("Shiny stainless steel with signs of mechanical wear. Material offers optional controls \n" + "to add secondary effects such as stains, smudges and mechanical damage"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Stainless_Steel.Stainless_Steel_Shiny_Smudged.png"), + ::anno::key_words(string[]("metal", "steel", "stainless", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "smudged", "dirty", "shiny", "smooth", "reflective", "plain", "gray")) +]] = Stainless_Steel( + infinite_tiling: true, + roughness: 0.0f, + roughness_variation: 0.25f, + cloudiness: 0.3f, + brightness: 0.5f, + milling_bump_strength: 0.0f, + dents_bump_strength: 0.0f, + dents_scale: 1.0f, + smudges_1_weight: 0.7f, + smudges_2_weight: 0.58f, + smudges_falloff: 0.45f, + smudges_scale: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + + +// 4 Glossy +export material Stainless_Steel_Glossy(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Stainless Steel - Glossy"), + ::anno::description("Glossy stainless steel with optional controls for secondary effects \n" +"such as stains, smudges and mechanical damage"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Stainless_Steel.Stainless_Steel_Glossy.png"), + ::anno::key_words(string[]("metal", "steel", "stainless", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "smudged", "dirty", "glossy", "smooth", "reflective", "plain", "gray")) +]] = Stainless_Steel( + infinite_tiling: true, + roughness: 0.44f, + roughness_variation: 0.05f, + cloudiness: 0.44f, + brightness: 0.5f, + milling_bump_strength: 0.24f, + dents_bump_strength: 0.0f, + dents_scale: 1.0f, + smudges_1_weight: 0.0f, + smudges_2_weight: 0.0f, + smudges_falloff: 0.45f, + smudges_scale: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + + +// 5 Matte +export material Stainless_Steel_Matte(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Stainless Steel - Matte"), + ::anno::description("Matte stainless steel with optional controls for secondary effects \n" +"such as stains, smudges and mechanical damage"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Stainless_Steel.Stainless_Steel_Matte.png"), + ::anno::key_words(string[]("metal", "steel", "stainless", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "smudged", "dirty", "matte", "smooth", "reflective", "plain", "gray")) +]] = Stainless_Steel( + infinite_tiling: true, + roughness: 1.00f, + roughness_variation: 0.0f, + cloudiness: 1.0f, + brightness: 0.5f, + milling_bump_strength: 0.4f, + dents_bump_strength: 0.0f, + dents_scale: 1.0f, + smudges_1_weight: 0.0f, + smudges_2_weight: 0.0f, + smudges_falloff: 0.45f, + smudges_scale: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false, + uv_space_index: 0 +); diff --git a/code/third_party/vMaterials_2/Metal/Stainless_Steel_Brushed.mdl b/code/third_party/vMaterials_2/Metal/Stainless_Steel_Brushed.mdl new file mode 100644 index 0000000000000000000000000000000000000000..b6a2839f37e7609872a641fa9a7db58f03d4545d --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Stainless_Steel_Brushed.mdl @@ -0,0 +1,639 @@ +/****************************************************************************** + * 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 stainless steel material with adjustable roughness and controls to add secondary effects \n" +"such as stains, smudges and mechanical damage"; + + +::base::texture_coordinate_info vmat_transform_post_scale( + ::base::texture_coordinate_info uvw, + float2 scale = float2(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 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))); +} + +float overlay(float base, float layer, float weight) +{ + return base + (1.0f - base) * layer * weight; +} + +// 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)); +} + + + +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 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 Stainless_Steel_Brushed( + 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 roughness = 0.18f [[ + ::anno::description("Softens the reflections in the direction of the brushing."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float steel_anisotropy = 0.53f [[ + ::anno::description("Higher values lengthen the reflections perpendicular to the brushing direction."), + ::anno::display_name("Roughness Anisotropy"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float cloudiness = 0.5f [[ + ::anno::description("Adds a cloudy reflection to the metal material which results in a more grayish appearance."), + ::anno::display_name("Cloudiness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float brightness = .5f [[ + ::anno::description("Low values make the metal darker and add slight variation to the brightness while a high value gives it a bright uniform look."), + ::anno::display_name("Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + float brush_brightness_variation = 0.91f [[ + ::anno::description("Enhances the brushing effect by adding variations to the brightness. This makes the overall appearance darker."), + ::anno::display_name("Brushing Brightness Variation"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(5) + ]], + float brushing_bump_strength = 0.f [[ + ::anno::description("Adds a milled grooves on the metal."), + ::anno::display_name("Brushing Bump Strength"), + ::anno::in_group("Appearance", "Bump"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(6) + ]], + float dents_bump_strength = 0.f [[ + ::anno::description("Adds dents and bumps."), + ::anno::display_name("Dents Bump Strength"), + ::anno::in_group("Appearance", "Bump"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(7) + ]], + float dents_scale = 1.2f [[ + ::anno::description("Scales the size of the dents that are scattered across the surface."), + ::anno::display_name("Dents Scale"), + ::anno::in_group("Appearance", "Bump"), + ::anno::ui_order(8) + ]], + float smudges_1_weight = 0.f [[ + ::anno::description("Adjusts the weight of the primary smudges."), + ::anno::display_name("Smudges Weight"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(9) + ]], + float smudges_2_weight = 0.f [[ + ::anno::description("Adjusts the weight of the secondary smudges."), + ::anno::display_name("Stains Weight"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(10) + ]], + float smudges_falloff = 0.1f [[ + ::anno::description("Controls the falloff of the smudges on the surface. Low values make the smudges wide and soft while high values make them small."), + ::anno::display_name("Smudges Falloff"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(11) + ]], + float smudges_scale = 2.f [[ + ::anno::description("Scales the smudges relative to the overal scale of the material."), + ::anno::display_name("Smudges and Stains Scale"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(12) + ]], + float brightness_variation = 0.0f [[ + ::anno::description("A value of 0 makes the material reflect light in a uniform manner while higher values introduce variations to the brightness."), + ::anno::display_name("Brightness Variation"), + ::anno::in_group("Appearance", "Advanced"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(13) + ]], + float brush_gloss_variation = 0.0f [[ + ::anno::description("Adds more variation to the roughness of the brushing with a more uneven and noisy appearance."), + ::anno::display_name("Brushing Gloss Variation"), + ::anno::in_group("Appearance", "Advanced"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(14) + ]], + uniform float2 texture_translate = float2(0.f) [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform"), + ::anno::ui_order(15) + ]], + 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(16) + ]], + uniform float2 texture_scale = float2(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(17) + ]], + 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(18) + ]], + 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(19) + ]], + 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(20) + ]], + 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(21) + ]]) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Stainless Steel Brushed"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Stainless_Steel_Brushed.Stainless_Steel_Brushed.png"), + ::anno::key_words(string[]("metal", "steel", "anisotropic", "stainless", "brushed", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "new", "shiny", "smooth", "reflective", "plain", "gray")) +]] + = + let { + bool tmp0 = false; + float2 texture_rescale = texture_scale * 0.33; + + material_surface tmp1(::df::custom_curve_layer(0.799999952f, 1.f, 3.0999999f, 1.f, ::df::weighted_layer(overlay(cloudiness * 0.330000013f, overlay(smudges_1_weight * ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.463f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).x, ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.463f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).y, smudges_2_weight), 1.f), ::df::microfacet_ggx_smith_bsdf(histogram_range(overlay(cloudiness * 0.330000013f, overlay(smudges_1_weight * ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.463f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).x, ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.463f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).y, smudges_2_weight), 1.f), 0.199999988f, 0.300000012f - cloudiness * 0.100000001f), histogram_range(overlay(cloudiness * 0.330000013f, overlay(smudges_1_weight * ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.463f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).x, ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.463f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).y, smudges_2_weight), 1.f), 0.199999988f, 0.300000012f - cloudiness * 0.100000001f), color(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.159999996f, 0.569000006f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::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, 1.f, ::math::lerp(1.f, 0.670000017f, brush_brightness_variation)) * (histogram_range(::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.463f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).z, 1.f, 1.f - brightness_variation * 0.300000012f) * (brightness * 0.300000012f + 0.600000024f))), color(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.159999996f, 0.569000006f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::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, 1.f, ::math::lerp(1.f, 0.670000017f, brush_brightness_variation)) * (histogram_range(::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.463f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).z, 1.f, 1.f - brightness_variation * 0.300000012f) * (brightness * 0.300000012f + 0.600000024f))), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(0.799999952f, ::df::microfacet_ggx_smith_bsdf(overlay(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.159999996f, 0.569000006f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::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.560000002f, ::math::lerp(0.0299999993f, 0.25f, roughness)), float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.159999996f, 0.569000006f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::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, brush_gloss_variation) * overlay(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.159999996f, 0.569000006f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::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.560000002f, ::math::lerp(0.0299999993f, 0.25f, roughness)), float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.159999996f, 0.569000006f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::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, brush_gloss_variation), overlay(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.159999996f, 0.569000006f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::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.189999998f, ::math::lerp(0.099999994f, 0.5f, steel_anisotropy) + ::math::lerp(0.0299999993f, 0.25f, roughness)), float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.159999996f, 0.569000006f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::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, brush_gloss_variation) * overlay(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.159999996f, 0.569000006f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::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.189999998f, ::math::lerp(0.099999994f, 0.5f, steel_anisotropy) + ::math::lerp(0.0299999993f, 0.25f, roughness)), float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.159999996f, 0.569000006f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::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, brush_gloss_variation), color(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.159999996f, 0.569000006f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::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, 1.f, ::math::lerp(1.f, 0.670000017f, brush_brightness_variation)) * (histogram_range(::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.463f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).z, 1.f, 1.f - brightness_variation * 0.300000012f) * (brightness * 0.300000012f + 0.600000024f))), color(0.f, 0.f, 0.f), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index).tangent_u, ::df::scatter_reflect), bsdf(), add_detail_normal(infinite_tiling ? endless_normal(texture_2d("./textures/stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, false, false, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale)), 9.13999939f, float3(0.5f, 0.5f, 0.999000013f), 8.38000011f) : normalmap_normal(texture_2d("./textures/stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale))), infinite_tiling ? endless_normal(texture_2d("./textures/stainless_brushed_norm.jpg", ::tex::gamma_linear), brushing_bump_strength * 0.400000006f, false, false, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.5f, 0.5f, 0.999000013f), 8.38000011f) : normalmap_normal(texture_2d("./textures/stainless_brushed_norm.jpg", ::tex::gamma_linear), brushing_bump_strength * 0.400000006f, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index)))), add_detail_normal(infinite_tiling ? endless_normal(texture_2d("./textures/stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, false, false, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale)), 9.13999939f, float3(0.5f, 0.5f, 0.999000013f), 8.38000011f) : normalmap_normal(texture_2d("./textures/stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale))), infinite_tiling ? endless_normal(texture_2d("./textures/stainless_brushed_norm.jpg", ::tex::gamma_linear), brushing_bump_strength * 0.400000006f, false, false, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.5f, 0.5f, 0.999000013f), 8.38000011f) : normalmap_normal(texture_2d("./textures/stainless_brushed_norm.jpg", ::tex::gamma_linear), brushing_bump_strength * 0.400000006f, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index)))), ::df::tint(color(0.f, 0.f, 0.f), ::df::weighted_layer(overlay(cloudiness * 0.330000013f, overlay(smudges_1_weight * ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.463f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).x, ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.463f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).y, smudges_2_weight), 1.f), ::df::microfacet_ggx_smith_bsdf(histogram_range(overlay(cloudiness * 0.330000013f, overlay(smudges_1_weight * ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.463f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).x, ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.463f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).y, smudges_2_weight), 1.f), 0.199999988f, 0.300000012f - cloudiness * 0.100000001f), histogram_range(overlay(cloudiness * 0.330000013f, overlay(smudges_1_weight * ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.463f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).x, ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.463f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).y, smudges_2_weight), 1.f), 0.199999988f, 0.300000012f - cloudiness * 0.100000001f), color(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.159999996f, 0.569000006f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::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, 1.f, ::math::lerp(1.f, 0.670000017f, brush_brightness_variation)) * (histogram_range(::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.463f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).z, 1.f, 1.f - brightness_variation * 0.300000012f) * (brightness * 0.300000012f + 0.600000024f))), color(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.159999996f, 0.569000006f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::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, 1.f, ::math::lerp(1.f, 0.670000017f, brush_brightness_variation)) * (histogram_range(::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.463f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).z, 1.f, 1.f - brightness_variation * 0.300000012f) * (brightness * 0.300000012f + 0.600000024f))), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(0.799999952f, ::df::microfacet_ggx_smith_bsdf(overlay(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.159999996f, 0.569000006f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::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.560000002f, ::math::lerp(0.0299999993f, 0.25f, roughness)), float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.159999996f, 0.569000006f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::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, brush_gloss_variation) * overlay(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.159999996f, 0.569000006f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::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.560000002f, ::math::lerp(0.0299999993f, 0.25f, roughness)), float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.159999996f, 0.569000006f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::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, brush_gloss_variation), overlay(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.159999996f, 0.569000006f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::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.189999998f, ::math::lerp(0.099999994f, 0.5f, steel_anisotropy) + ::math::lerp(0.0299999993f, 0.25f, roughness)), float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.159999996f, 0.569000006f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::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, brush_gloss_variation) * overlay(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.159999996f, 0.569000006f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::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.189999998f, ::math::lerp(0.099999994f, 0.5f, steel_anisotropy) + ::math::lerp(0.0299999993f, 0.25f, roughness)), float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.159999996f, 0.569000006f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::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, brush_gloss_variation), color(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.159999996f, 0.569000006f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::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, 1.f, ::math::lerp(1.f, 0.670000017f, brush_brightness_variation)) * (histogram_range(::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.463f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).z, 1.f, 1.f - brightness_variation * 0.300000012f) * (brightness * 0.300000012f + 0.600000024f))), color(0.f, 0.f, 0.f), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index).tangent_u, ::df::scatter_reflect), bsdf(), add_detail_normal(infinite_tiling ? endless_normal(texture_2d("./textures/stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, false, false, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale)), 9.13999939f, float3(0.5f, 0.5f, 0.999000013f), 8.38000011f) : normalmap_normal(texture_2d("./textures/stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale))), infinite_tiling ? endless_normal(texture_2d("./textures/stainless_brushed_norm.jpg", ::tex::gamma_linear), brushing_bump_strength * 0.400000006f, false, false, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.5f, 0.5f, 0.999000013f), 8.38000011f) : normalmap_normal(texture_2d("./textures/stainless_brushed_norm.jpg", ::tex::gamma_linear), brushing_bump_strength * 0.400000006f, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index)))), add_detail_normal(infinite_tiling ? endless_normal(texture_2d("./textures/stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, false, false, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale)), 9.13999939f, float3(0.5f, 0.5f, 0.999000013f), 8.38000011f) : normalmap_normal(texture_2d("./textures/stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale))), infinite_tiling ? endless_normal(texture_2d("./textures/stainless_brushed_norm.jpg", ::tex::gamma_linear), brushing_bump_strength * 0.400000006f, false, false, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.5f, 0.5f, 0.999000013f), 8.38000011f) : normalmap_normal(texture_2d("./textures/stainless_brushed_norm.jpg", ::tex::gamma_linear), brushing_bump_strength * 0.400000006f, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::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()); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + + +// ------------------------ Stainless Steel Brushed Presets ------------------------ + +// 2 Medium Brushing +export material Steel_Brushed_Medium_Brushing(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Stainless Steel Brushed - Medium Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Stainless_Steel_Brushed.Steel_Brushed_Medium_Brushing.png"), + ::anno::key_words(string[]("metal", "steel", "anisotropic", "stainless", "brushed", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "new", "glossy", "smooth", "reflective", "plain", "gray")) +]] = Stainless_Steel_Brushed( + infinite_tiling: true, + roughness: .61f, + steel_anisotropy: 0.53f, + cloudiness: 0.5f, + brightness: 0.5f, + brush_brightness_variation: 0.91f, + brushing_bump_strength: 0.33f, + dents_bump_strength: 0.0f, + dents_scale: 1.2f, + smudges_1_weight: 0.0f, + smudges_2_weight: 0.0f, + smudges_falloff: 0.1f, + smudges_scale: 2.0f, + brightness_variation: 0.0f, + brush_gloss_variation: 0.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 3 Matte Brushing +export material Steel_Brushed_Matte_Brushing(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Stainless Steel Brushed - Matte Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Stainless_Steel_Brushed.Steel_Brushed_Matte_Brushing.png"), + ::anno::key_words(string[]("metal", "steel", "anisotropic", "stainless", "brushed", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "new", "matte", "smooth", "reflective", "plain", "gray")) +]] = Stainless_Steel_Brushed( + infinite_tiling: true, + roughness: .61f, + steel_anisotropy: 0.53f, + cloudiness: 0.5f, + brightness: 0.5f, + brush_brightness_variation: 0.91f, + brushing_bump_strength: 0.33f, + dents_bump_strength: 0.0f, + dents_scale: 1.2f, + smudges_1_weight: 0.0f, + smudges_2_weight: 0.0f, + smudges_falloff: 0.1f, + smudges_scale: 2.0f, + brightness_variation: 0.0f, + brush_gloss_variation: 0.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 4 Clean Polished Brushing +export material Steel_Brushed_Clean_Polished(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Stainless Steel Brushed - Clean Polished"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Stainless_Steel_Brushed.Steel_Brushed_Clean_Polished.png"), + ::anno::key_words(string[]("metal", "steel", "anisotropic", "stainless", "brushed", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "new", "shiny", "smooth", "reflective", "plain", "gray")) +]] = Stainless_Steel_Brushed( + infinite_tiling: true, + roughness: .01f, + steel_anisotropy: 0.0f, + cloudiness: 0.5f, + brightness: 0.5f, + brush_brightness_variation: 0.54f, + brushing_bump_strength: 0.0f, + dents_bump_strength: 0.0f, + dents_scale: 1.2f, + smudges_1_weight: 0.0f, + smudges_2_weight: 0.0f, + smudges_falloff: 0.1f, + smudges_scale: 2.0f, + brightness_variation: 0.0f, + brush_gloss_variation: 0.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +// 5 Worn +export material Steel_Brushed_Worn(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Stainless Steel Brushed - Worn"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Stainless_Steel_Brushed.Steel_Brushed_Worn.png"), + ::anno::key_words(string[]("metal", "steel", "anisotropic", "stainless", "brushed", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "shiny", "worn", "smooth", "reflective", "plain", "gray")) +]] = Stainless_Steel_Brushed( + infinite_tiling: true, + roughness: .35f, + steel_anisotropy: 0.7f, + cloudiness: 0.5f, + brightness: 0.5f, + brush_brightness_variation: 0.74f, + brushing_bump_strength: 0.0f, + dents_bump_strength: 1.0f, + dents_scale: 1.2f, + smudges_1_weight: 1.0f, + smudges_2_weight: 1.0f, + smudges_falloff: 0.1f, + smudges_scale: 2.0f, + brightness_variation: 0.8f, + brush_gloss_variation: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false, + uv_space_index: 0 +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Metal/Stainless_Steel_Brushed_Punched.mdl b/code/third_party/vMaterials_2/Metal/Stainless_Steel_Brushed_Punched.mdl new file mode 100644 index 0000000000000000000000000000000000000000..6630c7d4312731626813c36d28a9eeea7abaf210 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Stainless_Steel_Brushed_Punched.mdl @@ -0,0 +1,1506 @@ +/****************************************************************************** + * 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 stainless steel material with adjustable roughness and controls to add secondary effects \n" +"such as stains, smudges and mechanical damage"; + + +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) + float2(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 +) +{ + // if (horizontal_offset) + // { + // uv.uv = float2( uv.uv.x + ::math::floor(uv.uv.y) * offset, uv.uv.y); + // } + // else + // { + // uv.uv = float2(uv.uv.x, uv.uv.y + ::math::floor(uv.uv.x) * offset); + // } + + // Workaround + 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")]] +}; + +::base::texture_coordinate_info vmat_transform_post_scale( + ::base::texture_coordinate_info uvw, + float2 scale = float2(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 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))); +} + +float overlay(float base, float layer, float weight) +{ + return base + (1.0f - base) * layer * weight; +} + +// 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)); +} + + + +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 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 Stainless_Steel_Brushed_Punched( + 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 roughness = 0.18f [[ + ::anno::description("Softens the reflections in the direction of the brushing."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float steel_anisotropy = 0.53f [[ + ::anno::description("Higher values lengthen the reflections perpendicular to the brushing direction."), + ::anno::display_name("Roughness Anisotropy"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float cloudiness = 0.5f [[ + ::anno::description("Adds a cloudy reflection to the metal material which results in a more grayish appearance."), + ::anno::display_name("Cloudiness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float brightness = .5f [[ + ::anno::description("Low values make the metal darker and add slight variation to the brightness while a high value gives it a bright uniform look."), + ::anno::display_name("Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + float brush_brightness_variation = 0.91f [[ + ::anno::description("Enhances the brushing effect by adding variations to the brightness. This makes the overall appearance darker."), + ::anno::display_name("Brushing Brightness Variation"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(5) + ]], + float brushing_bump_strength = 0.f [[ + ::anno::description("Adds a milled grooves on the metal."), + ::anno::display_name("Brushing Bump Strength"), + ::anno::in_group("Appearance", "Bump"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(6) + ]], + float dents_bump_strength = 0.f [[ + ::anno::description("Adds dents and bumps."), + ::anno::display_name("Dents Bump Strength"), + ::anno::in_group("Appearance", "Bump"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(7) + ]], + float dents_scale = 1.2f [[ + ::anno::description("Scales the size of the dents that are scattered across the surface."), + ::anno::display_name("Dents Scale"), + ::anno::in_group("Appearance", "Bump"), + ::anno::ui_order(8) + ]], + float smudges_1_weight = 0.f [[ + ::anno::description("Adjusts the weight of the primary smudges."), + ::anno::display_name("Smudges Weight"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(9) + ]], + float smudges_2_weight = 0.f [[ + ::anno::description("Adjusts the weight of the secondary smudges."), + ::anno::display_name("Stains Weight"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(10) + ]], + float smudges_falloff = 0.1f [[ + ::anno::description("Controls the falloff of the smudges on the surface. Low values make the smudges wide and soft while high values make them small."), + ::anno::display_name("Smudges Falloff"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(11) + ]], + float smudges_scale = 2.f [[ + ::anno::description("Scales the smudges relative to the overal scale of the material."), + ::anno::display_name("Smudges and Stains Scale"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(12) + ]], + float brightness_variation = 0.0f [[ + ::anno::description("A value of 0 makes the material reflect light in a uniform manner while higher values introduce variations to the brightness."), + ::anno::display_name("Brightness Variation"), + ::anno::in_group("Appearance", "Advanced"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(13) + ]], + float brush_gloss_variation = 0.0f [[ + ::anno::description("Adds more variation to the roughness of the brushing with a more uneven and noisy appearance."), + ::anno::display_name("Brushing Gloss Variation"), + ::anno::in_group("Appearance", "Advanced"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(14) + ]], + uniform float2 texture_translate = float2(0.f) [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform"), + ::anno::ui_order(15) + ]], + 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(16) + ]], + uniform float2 texture_scale = float2(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(17) + ]], + 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(18) + ]], + 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(19) + ]], + 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(20) + ]], + 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(21) + ]]) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Stainless Steel Brushed - Template"), + ::anno::description(DESCRIPTION), + ::anno::hidden(), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Stainless_Steel_Brushed_Punched.Stainless_Steel_Brushed_Punched.png"), + ::anno::key_words(string[]("metal", "steel", "anisotropic", "stainless", "brushed", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "new", "shiny", "smooth", "reflective", "plain", "gray")) +]] + = + let { + bool tmp0 = false; + float2 texture_rescale = texture_scale * 0.33; + + material_surface tmp1(::df::custom_curve_layer(0.799999952f, 1.f, 3.0999999f, 1.f, ::df::weighted_layer(overlay(cloudiness * 0.330000013f, overlay(smudges_1_weight * ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.463f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).x, ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.463f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).y, smudges_2_weight), 1.f), ::df::microfacet_ggx_smith_bsdf(histogram_range(overlay(cloudiness * 0.330000013f, overlay(smudges_1_weight * ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.463f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).x, ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.463f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).y, smudges_2_weight), 1.f), 0.199999988f, 0.300000012f - cloudiness * 0.100000001f), histogram_range(overlay(cloudiness * 0.330000013f, overlay(smudges_1_weight * ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.463f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).x, ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.463f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).y, smudges_2_weight), 1.f), 0.199999988f, 0.300000012f - cloudiness * 0.100000001f), color(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.159999996f, 0.569000006f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::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, 1.f, ::math::lerp(1.f, 0.670000017f, brush_brightness_variation)) * (histogram_range(::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.463f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).z, 1.f, 1.f - brightness_variation * 0.300000012f) * (brightness * 0.300000012f + 0.600000024f))), color(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.159999996f, 0.569000006f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::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, 1.f, ::math::lerp(1.f, 0.670000017f, brush_brightness_variation)) * (histogram_range(::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.463f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).z, 1.f, 1.f - brightness_variation * 0.300000012f) * (brightness * 0.300000012f + 0.600000024f))), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(0.799999952f, ::df::microfacet_ggx_smith_bsdf(overlay(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.159999996f, 0.569000006f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::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.560000002f, ::math::lerp(0.0299999993f, 0.25f, roughness)), float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.159999996f, 0.569000006f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::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, brush_gloss_variation) * overlay(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.159999996f, 0.569000006f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::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.560000002f, ::math::lerp(0.0299999993f, 0.25f, roughness)), float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.159999996f, 0.569000006f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::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, brush_gloss_variation), overlay(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.159999996f, 0.569000006f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::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.189999998f, ::math::lerp(0.099999994f, 0.5f, steel_anisotropy) + ::math::lerp(0.0299999993f, 0.25f, roughness)), float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.159999996f, 0.569000006f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::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, brush_gloss_variation) * overlay(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.159999996f, 0.569000006f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::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.189999998f, ::math::lerp(0.099999994f, 0.5f, steel_anisotropy) + ::math::lerp(0.0299999993f, 0.25f, roughness)), float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.159999996f, 0.569000006f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::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, brush_gloss_variation), color(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.159999996f, 0.569000006f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::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, 1.f, ::math::lerp(1.f, 0.670000017f, brush_brightness_variation)) * (histogram_range(::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.463f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).z, 1.f, 1.f - brightness_variation * 0.300000012f) * (brightness * 0.300000012f + 0.600000024f))), color(0.f, 0.f, 0.f), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index).tangent_u, ::df::scatter_reflect), bsdf(), add_detail_normal(infinite_tiling ? endless_normal(texture_2d("./textures/stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, false, false, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale)), 9.13999939f, float3(0.5f, 0.5f, 0.999000013f), 8.38000011f) : normalmap_normal(texture_2d("./textures/stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale))), infinite_tiling ? endless_normal(texture_2d("./textures/stainless_brushed_norm.jpg", ::tex::gamma_linear), brushing_bump_strength * 0.400000006f, false, false, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.5f, 0.5f, 0.999000013f), 8.38000011f) : normalmap_normal(texture_2d("./textures/stainless_brushed_norm.jpg", ::tex::gamma_linear), brushing_bump_strength * 0.400000006f, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index)))), add_detail_normal(infinite_tiling ? endless_normal(texture_2d("./textures/stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, false, false, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale)), 9.13999939f, float3(0.5f, 0.5f, 0.999000013f), 8.38000011f) : normalmap_normal(texture_2d("./textures/stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale))), infinite_tiling ? endless_normal(texture_2d("./textures/stainless_brushed_norm.jpg", ::tex::gamma_linear), brushing_bump_strength * 0.400000006f, false, false, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.5f, 0.5f, 0.999000013f), 8.38000011f) : normalmap_normal(texture_2d("./textures/stainless_brushed_norm.jpg", ::tex::gamma_linear), brushing_bump_strength * 0.400000006f, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index)))), ::df::tint(color(0.f, 0.f, 0.f), ::df::weighted_layer(overlay(cloudiness * 0.330000013f, overlay(smudges_1_weight * ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.463f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).x, ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.463f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).y, smudges_2_weight), 1.f), ::df::microfacet_ggx_smith_bsdf(histogram_range(overlay(cloudiness * 0.330000013f, overlay(smudges_1_weight * ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.463f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).x, ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.463f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).y, smudges_2_weight), 1.f), 0.199999988f, 0.300000012f - cloudiness * 0.100000001f), histogram_range(overlay(cloudiness * 0.330000013f, overlay(smudges_1_weight * ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.463f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).x, ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.463f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).y, smudges_2_weight), 1.f), 0.199999988f, 0.300000012f - cloudiness * 0.100000001f), color(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.159999996f, 0.569000006f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::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, 1.f, ::math::lerp(1.f, 0.670000017f, brush_brightness_variation)) * (histogram_range(::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.463f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).z, 1.f, 1.f - brightness_variation * 0.300000012f) * (brightness * 0.300000012f + 0.600000024f))), color(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.159999996f, 0.569000006f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::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, 1.f, ::math::lerp(1.f, 0.670000017f, brush_brightness_variation)) * (histogram_range(::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.463f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).z, 1.f, 1.f - brightness_variation * 0.300000012f) * (brightness * 0.300000012f + 0.600000024f))), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(0.799999952f, ::df::microfacet_ggx_smith_bsdf(overlay(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.159999996f, 0.569000006f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::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.560000002f, ::math::lerp(0.0299999993f, 0.25f, roughness)), float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.159999996f, 0.569000006f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::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, brush_gloss_variation) * overlay(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.159999996f, 0.569000006f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::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.560000002f, ::math::lerp(0.0299999993f, 0.25f, roughness)), float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.159999996f, 0.569000006f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::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, brush_gloss_variation), overlay(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.159999996f, 0.569000006f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::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.189999998f, ::math::lerp(0.099999994f, 0.5f, steel_anisotropy) + ::math::lerp(0.0299999993f, 0.25f, roughness)), float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.159999996f, 0.569000006f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::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, brush_gloss_variation) * overlay(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.159999996f, 0.569000006f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::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.189999998f, ::math::lerp(0.099999994f, 0.5f, steel_anisotropy) + ::math::lerp(0.0299999993f, 0.25f, roughness)), float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.159999996f, 0.569000006f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::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, brush_gloss_variation), color(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.159999996f, 0.569000006f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_multi_R_impurities_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::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, 1.f, ::math::lerp(1.f, 0.670000017f, brush_brightness_variation)) * (histogram_range(::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.463f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_brushed_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).z, 1.f, 1.f - brightness_variation * 0.300000012f) * (brightness * 0.300000012f + 0.600000024f))), color(0.f, 0.f, 0.f), vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index).tangent_u, ::df::scatter_reflect), bsdf(), add_detail_normal(infinite_tiling ? endless_normal(texture_2d("./textures/stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, false, false, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale)), 9.13999939f, float3(0.5f, 0.5f, 0.999000013f), 8.38000011f) : normalmap_normal(texture_2d("./textures/stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale))), infinite_tiling ? endless_normal(texture_2d("./textures/stainless_brushed_norm.jpg", ::tex::gamma_linear), brushing_bump_strength * 0.400000006f, false, false, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.5f, 0.5f, 0.999000013f), 8.38000011f) : normalmap_normal(texture_2d("./textures/stainless_brushed_norm.jpg", ::tex::gamma_linear), brushing_bump_strength * 0.400000006f, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index)))), add_detail_normal(infinite_tiling ? endless_normal(texture_2d("./textures/stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, false, false, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale)), 9.13999939f, float3(0.5f, 0.5f, 0.999000013f), 8.38000011f) : normalmap_normal(texture_2d("./textures/stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale))), infinite_tiling ? endless_normal(texture_2d("./textures/stainless_brushed_norm.jpg", ::tex::gamma_linear), brushing_bump_strength * 0.400000006f, false, false, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.5f, 0.5f, 0.999000013f), 8.38000011f) : normalmap_normal(texture_2d("./textures/stainless_brushed_norm.jpg", ::tex::gamma_linear), brushing_bump_strength * 0.400000006f, vmat_transform(texture_translate, texture_rotate, texture_rescale * 0.200000003f, ::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); + + + + +export material Stainless_Steel_Brushed_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 = float2(.5f, .5f) + [[ + ::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) + ]], + + + +// Stainless Steel 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(9) + ]], + float roughness = 0.18f [[ + ::anno::description("Softens the reflections in the direction of the brushing."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(10) + ]], + float steel_anisotropy = 0.53f [[ + ::anno::description("Higher values lengthen the reflections perpendicular to the brushing direction."), + ::anno::display_name("Roughness Anisotropy"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(11) + ]], + float cloudiness = 0.5f [[ + ::anno::description("Adds a cloudy reflection to the metal material which results in a more grayish appearance."), + ::anno::display_name("Cloudiness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(12) + ]], + float brightness = .5f [[ + ::anno::description("Low values make the metal darker and add slight variation to the brightness while a high value gives it a bright uniform look."), + ::anno::display_name("Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(13) + ]], + float brush_brightness_variation = 0.91f [[ + ::anno::description("Enhances the brushing effect by adding variations to the brightness. This makes the overall appearance darker."), + ::anno::display_name("Brushing Brightness Variation"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(14) + ]], + float brushing_bump_strength = 0.f [[ + ::anno::description("Adds a milled grooves on the metal."), + ::anno::display_name("Brushing Bump Strength"), + ::anno::in_group("Appearance", "Bump"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(15) + ]], + float dents_bump_strength = 0.f [[ + ::anno::description("Adds dents and bumps."), + ::anno::display_name("Dents Bump Strength"), + ::anno::in_group("Appearance", "Bump"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(16) + ]], + float dents_scale = 1.2f [[ + ::anno::description("Scales the size of the dents that are scattered across the surface."), + ::anno::display_name("Dents Scale"), + ::anno::in_group("Appearance", "Bump"), + ::anno::ui_order(17) + ]], + float smudges_1_weight = 0.f [[ + ::anno::description("Adjusts the weight of the primary smudges."), + ::anno::display_name("Smudges Weight"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(18) + ]], + float smudges_2_weight = 0.f [[ + ::anno::description("Adjusts the weight of the secondary smudges."), + ::anno::display_name("Stains Weight"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(19) + ]], + float smudges_falloff = 0.1f [[ + ::anno::description("Controls the falloff of the smudges on the surface. Low values make the smudges wide and soft while high values make them small."), + ::anno::display_name("Smudges Falloff"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(20) + ]], + float smudges_scale = 2.f [[ + ::anno::description("Scales the smudges relative to the overal scale of the material."), + ::anno::display_name("Smudges and Stains Scale"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(21) + ]], + float brightness_variation = 0.0f [[ + ::anno::description("A value of 0 makes the material reflect light in a uniform manner while higher values introduce variations to the brightness."), + ::anno::display_name("Brightness Variation"), + ::anno::in_group("Appearance", "Advanced"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(22) + ]], + float brush_gloss_variation = 0.0f [[ + ::anno::description("Adds more variation to the roughness of the brushing with a more uneven and noisy appearance."), + ::anno::display_name("Brushing Gloss Variation"), + ::anno::in_group("Appearance", "Advanced"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(23) + ]], + uniform float2 texture_translate = float2(0.f) [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform"), + ::anno::ui_order(24) + ]], + 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(25) + ]], + uniform float2 texture_scale = float2(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(26) + ]], + 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::hard_range(0, 10), + ::anno::ui_order(27) + ]], + 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(28) + ]], + 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(29) + ]], + 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(30) + ]] + +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Stainless Steel Brushed - Circular Punched"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Stainless_Steel_Brushed_Punched.Stainless_Steel_Brushed_Punched_.png"), + ::anno::key_words(string[]("metal", "steel", "anisotropic", "stainless", "brushed", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "new", "shiny", "smooth", "reflective", "plain", "punched", "punching", "gray")) +]] = let +{ + material base_mat = Stainless_Steel_Brushed_Punched( + infinite_tiling: infinite_tiling, + roughness: roughness, + steel_anisotropy: steel_anisotropy, + cloudiness: cloudiness, + brightness: brightness, + brush_brightness_variation: brush_brightness_variation, + brushing_bump_strength: brushing_bump_strength, + dents_bump_strength: dents_bump_strength, + dents_scale: dents_scale, + smudges_1_weight: smudges_1_weight, + smudges_2_weight: smudges_2_weight, + smudges_falloff: smudges_falloff, + smudges_scale: smudges_scale, + brightness_variation: brightness_variation, + brush_gloss_variation: brush_gloss_variation, + 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 + ); + texture_2d punching_cutout = texture_2d("./textures/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 + ) +); + + +export material Stainless_Steel_Brushed_Punched_Small_Circular(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Stainless Steel Brushed - Small Circular Punch"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Stainless_Steel_Brushed_Punched.Stainless_Steel_Brushed_Punched_Small_Circular.png"), + ::anno::key_words(string[]("metal", "steel", "anisotropic", "stainless", "brushed", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "new", "shiny", "smooth", "reflective", "plain", "punched", "punching", "circular", "gray")) +]] = Stainless_Steel_Brushed_Punched_ ( + shape_select: pattern_circle, + punching_grid_size: float2(.6f), + 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, + + infinite_tiling: true, + roughness: 0.18f, + steel_anisotropy: 0.53f, + cloudiness: 0.5f, + brightness: 0.5f, + brush_brightness_variation: 0.91f, + brushing_bump_strength: 0.0f, + dents_bump_strength: 0.0f, + dents_scale: 1.2f, + smudges_1_weight: 0.0f, //Smudges Weight + smudges_2_weight: 0.0f, //Stains Weight + smudges_falloff: 0.1f, + smudges_scale: 2.0f, + brightness_variation: 0.0f, + brush_gloss_variation: 0.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + +export material Stainless_Steel_Brushed_Punched_Hexagonal(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Stainless Steel Brushed - Hexagonal Punch"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Stainless_Steel_Brushed_Punched.Stainless_Steel_Brushed_Punched_Hexagonal.png"), + ::anno::key_words(string[]("metal", "steel", "anisotropic", "stainless", "brushed", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "new", "shiny", "smooth", "reflective", "plain", "punched", "punching", "hexagon", "hexagonal", "gray")) +]] = Stainless_Steel_Brushed_Punched_ ( + shape_select: pattern_hexagon, + punching_grid_size: float2(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, + + infinite_tiling: true, + roughness: 0.18f, + steel_anisotropy: 0.53f, + cloudiness: 0.5f, + brightness: 0.5f, + brush_brightness_variation: 0.91f, + brushing_bump_strength: 0.0f, + dents_bump_strength: 0.0f, + dents_scale: 1.2f, + smudges_1_weight: 0.0f, //Smudges Weight + smudges_2_weight: 0.0f, //Stains Weight + smudges_falloff: 0.1f, + smudges_scale: 2.0f, + brightness_variation: 0.0f, + brush_gloss_variation: 0.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + + +export material Stainless_Steel_Brushed_Punched_Hexagonal_Small(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Stainless Steel Brushed - Small Hexagonal Punch"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Stainless_Steel_Brushed_Punched.Stainless_Steel_Brushed_Punched_Hexagonal_Small.png"), + ::anno::key_words(string[]("metal", "steel", "anisotropic", "stainless", "brushed", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "new", "shiny", "smooth", "reflective", "plain", "punched", "punching", "hexagon", "hexagonal", "gray")) +]] = Stainless_Steel_Brushed_Punched_ ( + 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, + + infinite_tiling: true, + roughness: 0.18f, + steel_anisotropy: 0.53f, + cloudiness: 0.5f, + brightness: 0.5f, + brush_brightness_variation: 0.91f, + brushing_bump_strength: 0.0f, + dents_bump_strength: 0.0f, + dents_scale: 1.2f, + smudges_1_weight: 0.0f, //Smudges Weight + smudges_2_weight: 0.0f, //Stains Weight + smudges_falloff: 0.1f, + smudges_scale: 2.0f, + brightness_variation: 0.0f, + brush_gloss_variation: 0.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + +// Square punch +export material Stainless_Steel_Brushed_Punched_Square(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Stainless Steel Brushed - Square Punch"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Stainless_Steel_Brushed_Punched.Stainless_Steel_Brushed_Punched_Square.png"), + ::anno::key_words(string[]("metal", "steel", "anisotropic", "stainless", "brushed", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "new", "shiny", "smooth", "reflective", "plain", "punched", "punching", "square", "gray")) +]] = Stainless_Steel_Brushed_Punched_ ( + shape_select: pattern_square, + punching_grid_size: float2(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, + + infinite_tiling: true, + roughness: 0.18f, + steel_anisotropy: 0.53f, + cloudiness: 0.5f, + brightness: 0.5f, + brush_brightness_variation: 0.91f, + brushing_bump_strength: 0.0f, + dents_bump_strength: 0.0f, + dents_scale: 1.2f, + smudges_1_weight: 0.0f, //Smudges Weight + smudges_2_weight: 0.0f, //Stains Weight + smudges_falloff: 0.1f, + smudges_scale: 2.0f, + brightness_variation: 0.0f, + brush_gloss_variation: 0.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + +// Line punch +export material Stainless_Steel_Brushed_Punched_Line(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Stainless Steel Brushed - Line Punch"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Stainless_Steel_Brushed_Punched.Stainless_Steel_Brushed_Punched_Line.png"), + ::anno::key_words(string[]("metal", "steel", "anisotropic", "stainless", "brushed", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "new", "shiny", "smooth", "reflective", "plain", "punched", "punching", "line", "gray")) +]] = Stainless_Steel_Brushed_Punched_ ( + shape_select: pattern_line, + punching_grid_size: float2(.8f), + 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, + + infinite_tiling: true, + roughness: 0.18f, + steel_anisotropy: 0.53f, + cloudiness: 0.5f, + brightness: 0.5f, + brush_brightness_variation: 0.91f, + brushing_bump_strength: 0.0f, + dents_bump_strength: 0.0f, + dents_scale: 1.2f, + smudges_1_weight: 0.0f, //Smudges Weight + smudges_2_weight: 0.0f, //Stains Weight + smudges_falloff: 0.1f, + smudges_scale: 2.0f, + brightness_variation: 0.0f, + brush_gloss_variation: 0.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + + +// Cross punch +export material Stainless_Steel_Brushed_Punched_Cross(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Stainless Steel Brushed - Cross Punch"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Stainless_Steel_Brushed_Punched.Stainless_Steel_Brushed_Punched_Cross.png"), + ::anno::key_words(string[]("metal", "steel", "anisotropic", "stainless", "brushed", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "new", "shiny", "smooth", "reflective", "plain", "punched", "punching", "cross", "gray")) +]] = Stainless_Steel_Brushed_Punched_ ( + shape_select: pattern_cross, + punching_grid_size: float2(.8f), + 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, + + infinite_tiling: true, + roughness: 0.18f, + steel_anisotropy: 0.53f, + cloudiness: 0.5f, + brightness: 0.5f, + brush_brightness_variation: 0.91f, + brushing_bump_strength: 0.0f, + dents_bump_strength: 0.0f, + dents_scale: 1.2f, + smudges_1_weight: 0.0f, //Smudges Weight + smudges_2_weight: 0.0f, //Stains Weight + smudges_falloff: 0.1f, + smudges_scale: 2.0f, + brightness_variation: 0.0f, + brush_gloss_variation: 0.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + +// Rhombus punch +export material Stainless_Steel_Brushed_Punched_Rhombus(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Stainless Steel Brushed - Rhombus Punch"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Stainless_Steel_Brushed_Punched.Stainless_Steel_Brushed_Punched_Rhombus.png"), + ::anno::key_words(string[]("metal", "steel", "anisotropic", "stainless", "brushed", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "new", "shiny", "smooth", "reflective", "plain", "punched", "punching", "rhombus", "gray")) +]] = Stainless_Steel_Brushed_Punched_ ( + shape_select: pattern_rhombus, + punching_grid_size: float2(.8f), + 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, + + infinite_tiling: true, + roughness: 0.18f, + steel_anisotropy: 0.53f, + cloudiness: 0.5f, + brightness: 0.5f, + brush_brightness_variation: 0.91f, + brushing_bump_strength: 0.0f, + dents_bump_strength: 0.0f, + dents_scale: 1.2f, + smudges_1_weight: 0.0f, //Smudges Weight + smudges_2_weight: 0.0f, //Stains Weight + smudges_falloff: 0.1f, + smudges_scale: 2.0f, + brightness_variation: 0.0f, + brush_gloss_variation: 0.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + + +// Triangle punch +export material Stainless_Steel_Brushed_Punched_Triangle(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Stainless Steel Brushed - Triangle Punch"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Stainless_Steel_Brushed_Punched.Stainless_Steel_Brushed_Punched_Triangle.png"), + ::anno::key_words(string[]("metal", "steel", "anisotropic", "stainless", "brushed", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "new", "shiny", "smooth", "reflective", "plain", "punched", "punching", "triangle", "gray")) +]] = Stainless_Steel_Brushed_Punched_ ( + shape_select: pattern_triangle, + punching_grid_size: float2(.8f), + 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, + + infinite_tiling: true, + roughness: 0.18f, + steel_anisotropy: 0.53f, + cloudiness: 0.5f, + brightness: 0.5f, + brush_brightness_variation: 0.91f, + brushing_bump_strength: 0.0f, + dents_bump_strength: 0.0f, + dents_scale: 1.2f, + smudges_1_weight: 0.0f, //Smudges Weight + smudges_2_weight: 0.0f, //Stains Weight + smudges_falloff: 0.1f, + smudges_scale: 2.0f, + brightness_variation: 0.0f, + brush_gloss_variation: 0.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + +// Star punch +export material Stainless_Steel_Brushed_Punched_Star(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Stainless Steel Brushed - Star Punch"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Stainless_Steel_Brushed_Punched.Stainless_Steel_Brushed_Punched_Star.png"), + ::anno::key_words(string[]("metal", "steel", "anisotropic", "stainless", "brushed", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "new", "shiny", "smooth", "reflective", "plain", "punched", "punching", "star", "gray")) +]] = Stainless_Steel_Brushed_Punched_ ( + shape_select: pattern_star, + punching_grid_size: float2(.8f), + 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, + + infinite_tiling: true, + roughness: 0.18f, + steel_anisotropy: 0.53f, + cloudiness: 0.5f, + brightness: 0.5f, + brush_brightness_variation: 0.91f, + brushing_bump_strength: 0.0f, + dents_bump_strength: 0.0f, + dents_scale: 1.2f, + smudges_1_weight: 0.0f, //Smudges Weight + smudges_2_weight: 0.0f, //Stains Weight + smudges_falloff: 0.1f, + smudges_scale: 2.0f, + brightness_variation: 0.0f, + brush_gloss_variation: 0.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + +// Additional fancier Presets + +// Cross punch +export material Stainless_Steel_Brushed_Punched_Cross_Special(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Stainless Steel Brushed - Special Cross Punch"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Stainless_Steel_Brushed_Punched.Stainless_Steel_Brushed_Punched_Cross_Special.png"), + ::anno::key_words(string[]("metal", "steel", "anisotropic", "stainless", "brushed", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "new", "shiny", "smooth", "reflective", "plain", "punched", "punching", "cross", "gray")) +]] = Stainless_Steel_Brushed_Punched_ ( + shape_select: pattern_cross, + punching_grid_size: float2(.8f), + cutout_size: 0.67f, + cutout_roundness: 0.1f, + cutout_bevel_width: 0.4f, + cutout_bump_strength: 1.5f, + hexagonal_grid: false, + square_grid_offset: 0.0f, + horizontal_offset: true, + + infinite_tiling: true, + roughness: 0.18f, + steel_anisotropy: 0.53f, + cloudiness: 0.5f, + brightness: 0.5f, + brush_brightness_variation: 0.91f, + brushing_bump_strength: 0.0f, + dents_bump_strength: 0.0f, + dents_scale: 1.2f, + smudges_1_weight: 0.0f, //Smudges Weight + smudges_2_weight: 0.0f, //Stains Weight + smudges_falloff: 0.1f, + smudges_scale: 2.0f, + brightness_variation: 0.0f, + brush_gloss_variation: 0.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Metal/Stainless_Steel_Milled.mdl b/code/third_party/vMaterials_2/Metal/Stainless_Steel_Milled.mdl new file mode 100644 index 0000000000000000000000000000000000000000..e3265c339f6f0f51f929636c59b1ad0db7179f9c --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Stainless_Steel_Milled.mdl @@ -0,0 +1,327 @@ +/****************************************************************************** + * 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 stainless steel material with adjustable roughness and controls to add secondary effects \n" +"such as stains, smudges and mechanical damage"; + +::base::texture_coordinate_info vmat_transform_post_scale( + ::base::texture_coordinate_info uvw, + float2 scale = float2(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 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))); +} + + +// 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 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); +} + + +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); +} + + +export material Stainless_Steel_Milled( + float roughness = 0.67f [[ + ::anno::description("Higher values lead to blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float cloudiness = 0.89f [[ + ::anno::description("Adds a cloudy reflection to the metal material."), + ::anno::display_name("Cloudiness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float brightness = .6f [[ + ::anno::description("Low values make the metal darker and add slight variation to the brightness while a high value gives it a bright uniform look."), + ::anno::display_name("Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float milling_bump_strength = 1.f [[ + ::anno::description("Adds milled grooves on the metal."), + ::anno::display_name("Milling Bump Strength"), + ::anno::in_group("Appearance", "Bump"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + float dents_bump_strength = 0.0f [[ + ::anno::description("Adds dents and bumps."), + ::anno::display_name("Dents Bump Strength"), + ::anno::in_group("Appearance", "Bump"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(5) + ]], + float dents_scale = 0.52f [[ + ::anno::description("Larger numbers increase the size of the dents."), + ::anno::display_name("Dents Scale"), + ::anno::in_group("Appearance", "Bump"), + ::anno::ui_order(6) + ]], + uniform float2 texture_translate = float2(0.f) [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform"), + ::anno::ui_order(7) + ]], + 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(8) + ]], + uniform float2 texture_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(0.33f, 0.33f)), + ::anno::ui_order(9) + ]], + uniform bool roundcorners_enable = true [[ + ::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 = 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(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("Advanced"), + ::anno::hard_range(0, 10), + ::anno::ui_order(13) + ]]) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Stainless Steel Milled - New"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Stainless_Steel_Milled.Stainless_Steel_Milled.png"), + ::anno::key_words(string[]("metal", "steel", "stainless", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "new", "shiny", "milled", "reflective", "gray")) +]] + = + let { + bool tmp0 = false; + material_surface tmp1(::df::custom_curve_layer(0.799999952f, 1.f, 3.0999999f, 1.f, ::df::weighted_layer(cloudiness * 0.330000013f, ::df::microfacet_ggx_smith_bsdf(0.159999996f, 0.159999996f, color((brightness * 0.300000012f + 0.600000024f) * ::math::lerp(1.f, ::math::pow(float3(::base::file_texture(texture_2d("./textures/stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.200000003f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, 1.40999997f), milling_bump_strength * 0.850000024f + 0.150000006f)), color((brightness * 0.300000012f + 0.600000024f) * ::math::lerp(1.f, ::math::pow(float3(::base::file_texture(texture_2d("./textures/stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.200000003f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, 1.40999997f), milling_bump_strength * 0.850000024f + 0.150000006f)), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(0.799999952f, ::df::microfacet_ggx_smith_bsdf((histogram_range(float3(::base::file_texture(texture_2d("./textures/stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.200000003f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).y, ::math::lerp(0.f, 0.870000005f, roughness), ::math::lerp(0.0299999993f, 0.349999994f, roughness)) - float3(::base::file_texture(texture_2d("./textures/stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.200000003f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).z * ::math::lerp(0.0299999993f, 0.349999994f, roughness) * dents_bump_strength) * (histogram_range(float3(::base::file_texture(texture_2d("./textures/stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.200000003f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).y, ::math::lerp(0.f, 0.870000005f, roughness), ::math::lerp(0.0299999993f, 0.349999994f, roughness)) - float3(::base::file_texture(texture_2d("./textures/stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.200000003f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).z * ::math::lerp(0.0299999993f, 0.349999994f, roughness) * dents_bump_strength), (histogram_range(float3(::base::file_texture(texture_2d("./textures/stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.200000003f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).y, ::math::lerp(0.f, 0.870000005f, roughness), ::math::lerp(0.0299999993f, 0.349999994f, roughness)) - float3(::base::file_texture(texture_2d("./textures/stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.200000003f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).z * ::math::lerp(0.0299999993f, 0.349999994f, roughness) * dents_bump_strength) * (histogram_range(float3(::base::file_texture(texture_2d("./textures/stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.200000003f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).y, ::math::lerp(0.f, 0.870000005f, roughness), ::math::lerp(0.0299999993f, 0.349999994f, roughness)) - float3(::base::file_texture(texture_2d("./textures/stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.200000003f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).z * ::math::lerp(0.0299999993f, 0.349999994f, roughness) * dents_bump_strength), color((brightness * 0.300000012f + 0.600000024f) * ::math::lerp(1.f, ::math::pow(float3(::base::file_texture(texture_2d("./textures/stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.200000003f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, 1.40999997f), milling_bump_strength * 0.850000024f + 0.150000006f)), color((brightness * 0.300000012f + 0.600000024f) * ::math::lerp(1.f, ::math::pow(float3(::base::file_texture(texture_2d("./textures/stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.200000003f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, 1.40999997f), milling_bump_strength * 0.850000024f + 0.150000006f)), ::state::texture_tangent_u(0), ::df::scatter_reflect), bsdf(), add_detail_normal(normalmap_normal(texture_2d("./textures/stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale * 4.f))), normalmap_normal(texture_2d("./textures/stainless_milled_norm.jpg", ::tex::gamma_linear), (milling_bump_strength * 0.850000024f + 0.150000006f) * histogram_scan_big(1.f - float3(::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale * 4.f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).z, 0.189999998f, dents_bump_strength * 0.75999999f), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.200000003f))))), add_detail_normal(normalmap_normal(texture_2d("./textures/stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale * 4.f))), normalmap_normal(texture_2d("./textures/stainless_milled_norm.jpg", ::tex::gamma_linear), (milling_bump_strength * 0.850000024f + 0.150000006f) * histogram_scan_big(1.f - float3(::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale * 4.f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).z, 0.189999998f, dents_bump_strength * 0.75999999f), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.200000003f))))), ::df::tint(color(0.f, 0.f, 0.f), ::df::weighted_layer(cloudiness * 0.330000013f, ::df::microfacet_ggx_smith_bsdf(0.159999996f, 0.159999996f, color((brightness * 0.300000012f + 0.600000024f) * ::math::lerp(1.f, ::math::pow(float3(::base::file_texture(texture_2d("./textures/stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.200000003f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, 1.40999997f), milling_bump_strength * 0.850000024f + 0.150000006f)), color((brightness * 0.300000012f + 0.600000024f) * ::math::lerp(1.f, ::math::pow(float3(::base::file_texture(texture_2d("./textures/stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.200000003f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, 1.40999997f), milling_bump_strength * 0.850000024f + 0.150000006f)), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(0.799999952f, ::df::microfacet_ggx_smith_bsdf((histogram_range(float3(::base::file_texture(texture_2d("./textures/stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.200000003f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).y, ::math::lerp(0.f, 0.870000005f, roughness), ::math::lerp(0.0299999993f, 0.349999994f, roughness)) - float3(::base::file_texture(texture_2d("./textures/stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.200000003f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).z * ::math::lerp(0.0299999993f, 0.349999994f, roughness) * dents_bump_strength) * (histogram_range(float3(::base::file_texture(texture_2d("./textures/stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.200000003f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).y, ::math::lerp(0.f, 0.870000005f, roughness), ::math::lerp(0.0299999993f, 0.349999994f, roughness)) - float3(::base::file_texture(texture_2d("./textures/stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.200000003f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).z * ::math::lerp(0.0299999993f, 0.349999994f, roughness) * dents_bump_strength), (histogram_range(float3(::base::file_texture(texture_2d("./textures/stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.200000003f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).y, ::math::lerp(0.f, 0.870000005f, roughness), ::math::lerp(0.0299999993f, 0.349999994f, roughness)) - float3(::base::file_texture(texture_2d("./textures/stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.200000003f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).z * ::math::lerp(0.0299999993f, 0.349999994f, roughness) * dents_bump_strength) * (histogram_range(float3(::base::file_texture(texture_2d("./textures/stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.200000003f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).y, ::math::lerp(0.f, 0.870000005f, roughness), ::math::lerp(0.0299999993f, 0.349999994f, roughness)) - float3(::base::file_texture(texture_2d("./textures/stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.200000003f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).z * ::math::lerp(0.0299999993f, 0.349999994f, roughness) * dents_bump_strength), color((brightness * 0.300000012f + 0.600000024f) * ::math::lerp(1.f, ::math::pow(float3(::base::file_texture(texture_2d("./textures/stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.200000003f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, 1.40999997f), milling_bump_strength * 0.850000024f + 0.150000006f)), color((brightness * 0.300000012f + 0.600000024f) * ::math::lerp(1.f, ::math::pow(float3(::base::file_texture(texture_2d("./textures/stainless_milled_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.200000003f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, 1.40999997f), milling_bump_strength * 0.850000024f + 0.150000006f)), ::state::texture_tangent_u(0), ::df::scatter_reflect), bsdf(), add_detail_normal(normalmap_normal(texture_2d("./textures/stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale * 4.f))), normalmap_normal(texture_2d("./textures/stainless_milled_norm.jpg", ::tex::gamma_linear), (milling_bump_strength * 0.850000024f + 0.150000006f) * histogram_scan_big(1.f - float3(::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale * 4.f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).z, 0.189999998f, dents_bump_strength * 0.75999999f), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.200000003f))))), add_detail_normal(normalmap_normal(texture_2d("./textures/stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale * 4.f))), normalmap_normal(texture_2d("./textures/stainless_milled_norm.jpg", ::tex::gamma_linear), (milling_bump_strength * 0.850000024f + 0.150000006f) * histogram_scan_big(1.f - float3(::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale * 4.f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).z, 0.189999998f, dents_bump_strength * 0.75999999f), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.349999994f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.200000003f)))))), ::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); + + + +export material Stainless_Steel_Milled_Worn(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Stainless Steel Milled - Worn"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Stainless_Steel_Milled.Stainless_Steel_Milled_Worn.png"), + ::anno::key_words(string[]("metal", "steel", "stainless", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "new", "shiny", "milled", "reflective", "gray")) +]] = Stainless_Steel_Milled( + roughness: 0.67f, + cloudiness: 0.89f, + brightness: 0.6f, + milling_bump_strength: 1.0f, + dents_bump_strength: 1.0f, + dents_scale: 0.52f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + + + diff --git a/code/third_party/vMaterials_2/Metal/Stainless_Steel_Punched.mdl b/code/third_party/vMaterials_2/Metal/Stainless_Steel_Punched.mdl new file mode 100644 index 0000000000000000000000000000000000000000..d0f4c0e477ed10a596796af2c1ebedbfc66685dd --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Stainless_Steel_Punched.mdl @@ -0,0 +1,1392 @@ +/****************************************************************************** + * 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 stainless steel material with adjustable roughness and controls to add secondary effects \n" +"such as stains, smudges and mechanical damage"; + + + +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) + float2(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")]] +}; + + + +::base::texture_coordinate_info vmat_transform_post_scale( + ::base::texture_coordinate_info uvw, + float2 scale = float2(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 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))); +} + +float overlay(float base, float layer, float weight) +{ + return base + (1.0f - base) * layer * weight; +} + +// 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)); +} + + + +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 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 Stainless_Steel_Punched( + 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"), + ::anno::ui_order(0) + ]], + float roughness = 0.f [[ + ::anno::description("Higher values lead to blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float roughness_variation = 0.21f [[ + ::anno::description("Adds variation to the roughness following the shape of the milling bump map."), + ::anno::display_name("Roughness Variation"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float cloudiness = 0.3f [[ + ::anno::description("Adds a cloudy reflection to the metal material."), + ::anno::display_name("Cloudiness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float brightness = 0.5f [[ + ::anno::description("Low values make the metal darker and add slight variation to the brightness while a high value gives it a bright uniform look."), + ::anno::display_name("Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + float milling_bump_strength = 0.0f [[ + ::anno::description("Adds milled grooves on the metal."), + ::anno::display_name("Milling Bump Strength"), + ::anno::in_group("Appearance", "Bump"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(5) + ]], + float dents_bump_strength = 0.01f [[ + ::anno::description("Adds dents and bumps."), + ::anno::display_name("Dents Bump Strength"), + ::anno::in_group("Appearance", "Bump"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(6) + ]], + float dents_scale = 1.f [[ + ::anno::description("Scales the size of the dents pattern on the material."), + ::anno::display_name("Dents Scale"), + ::anno::in_group("Appearance", "Bump"), + ::anno::ui_order(7) + ]], + float smudges_1_weight = 0.f [[ + ::anno::description("Adds smudges on the material which impact the reflectivity."), + ::anno::display_name("Smudges Weight"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(8) + ]], + float smudges_2_weight = 0.f [[ + ::anno::description("Adds imperfections that resemble stains on the material which impact the reflectivity."), + ::anno::display_name("Stains Weight"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(9) + ]], + float smudges_falloff = .45f [[ + ::anno::description("Controls the falloff of the smudges and stains on the surface. Low values make the smudges wide and soft while high values make them small."), + ::anno::display_name("Smudges Falloff"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(10) + ]], + float smudges_scale = 1.f [[ + ::anno::description("Scales the smudges relative to the overal scale of the material."), + ::anno::display_name("Smudges and Stains Scale"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(11) + ]], + uniform float2 texture_translate = float2(0.f) [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform"), + ::anno::ui_order(12) + ]], + 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(13) + ]], + uniform float2 texture_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(0.70f, 0.70f)), + ::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) + ]], + 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(18) + ]]) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Stainless Steel - Template"), + ::anno::hidden(), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Stainless_Steel_Punched.Stainless_Steel_Punched.png"), + ::anno::key_words(string[]("metal", "steel", "stainless", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "decorative", "new", "shiny", "smooth", "reflective", "plain", "gray")) +]] + = + let { + bool tmp0 = false; + float2 texture_rescale = texture_scale * float2(0.55f); + + material_surface tmp1(::df::custom_curve_layer(0.799999952f, 1.f, 3.0999999f, 1.f, ::df::weighted_layer(cloudiness * 0.330000013f, ::df::microfacet_ggx_smith_bsdf(0.159999996f, 0.159999996f, color(brightness * 0.300000012f + 0.600000024f), color(brightness * 0.300000012f + 0.600000024f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(0.799999952f, ::df::microfacet_ggx_smith_bsdf(overlay((histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(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).y, ::math::lerp(0.f, 0.430000007f, roughness_variation), ::math::lerp(0.0299999993f, 0.349999994f, roughness)) - float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(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).z * ::math::lerp(0.0299999993f, 0.349999994f, roughness) * dents_bump_strength) * (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(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).y, ::math::lerp(0.f, 0.430000007f, roughness_variation), ::math::lerp(0.0299999993f, 0.349999994f, roughness)) - float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(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).z * ::math::lerp(0.0299999993f, 0.349999994f, roughness) * dents_bump_strength), overlay(smudges_1_weight * ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).x, ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).y, smudges_2_weight), 0.429999977f), overlay((histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(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).y, ::math::lerp(0.f, 0.430000007f, roughness_variation), ::math::lerp(0.0299999993f, 0.349999994f, roughness)) - float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(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).z * ::math::lerp(0.0299999993f, 0.349999994f, roughness) * dents_bump_strength) * (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(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).y, ::math::lerp(0.f, 0.430000007f, roughness_variation), ::math::lerp(0.0299999993f, 0.349999994f, roughness)) - float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(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).z * ::math::lerp(0.0299999993f, 0.349999994f, roughness) * dents_bump_strength), overlay(smudges_1_weight * ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).x, ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).y, smudges_2_weight), 0.429999977f), color(brightness * 0.300000012f + 0.600000024f), color(brightness * 0.300000012f + 0.600000024f), ::state::texture_tangent_u(0), ::df::scatter_reflect), bsdf(), add_detail_normal(infinite_tiling ? endless_normal(texture_2d("./textures/stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, false, false, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale)), 9.13999939f, float3(0.5f, 0.5f, 0.999000013f), 8.38000011f) : normalmap_normal(texture_2d("./textures/stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale))), infinite_tiling ? endless_normal(texture_2d("./textures/stainless_norm.jpg", ::tex::gamma_linear), milling_bump_strength, false, false, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.5f)), 9.13999939f, float3(0.5f, 0.5f, 0.999000013f), 8.38000011f) : normalmap_normal(texture_2d("./textures/stainless_norm.jpg", ::tex::gamma_linear), milling_bump_strength, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.5f))))), add_detail_normal(infinite_tiling ? endless_normal(texture_2d("./textures/stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, false, false, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale)), 9.13999939f, float3(0.5f, 0.5f, 0.999000013f), 8.38000011f) : normalmap_normal(texture_2d("./textures/stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale))), infinite_tiling ? endless_normal(texture_2d("./textures/stainless_norm.jpg", ::tex::gamma_linear), milling_bump_strength, false, false, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.5f)), 9.13999939f, float3(0.5f, 0.5f, 0.999000013f), 8.38000011f) : normalmap_normal(texture_2d("./textures/stainless_norm.jpg", ::tex::gamma_linear), milling_bump_strength, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.5f))))), ::df::tint(color(0.f, 0.f, 0.f), ::df::weighted_layer(cloudiness * 0.330000013f, ::df::microfacet_ggx_smith_bsdf(0.159999996f, 0.159999996f, color(brightness * 0.300000012f + 0.600000024f), color(brightness * 0.300000012f + 0.600000024f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(0.799999952f, ::df::microfacet_ggx_smith_bsdf(overlay((histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(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).y, ::math::lerp(0.f, 0.430000007f, roughness_variation), ::math::lerp(0.0299999993f, 0.349999994f, roughness)) - float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(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).z * ::math::lerp(0.0299999993f, 0.349999994f, roughness) * dents_bump_strength) * (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(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).y, ::math::lerp(0.f, 0.430000007f, roughness_variation), ::math::lerp(0.0299999993f, 0.349999994f, roughness)) - float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(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).z * ::math::lerp(0.0299999993f, 0.349999994f, roughness) * dents_bump_strength), overlay(smudges_1_weight * ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).x, ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).y, smudges_2_weight), 0.429999977f), overlay((histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(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).y, ::math::lerp(0.f, 0.430000007f, roughness_variation), ::math::lerp(0.0299999993f, 0.349999994f, roughness)) - float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(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).z * ::math::lerp(0.0299999993f, 0.349999994f, roughness) * dents_bump_strength) * (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(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).y, ::math::lerp(0.f, 0.430000007f, roughness_variation), ::math::lerp(0.0299999993f, 0.349999994f, roughness)) - float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(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).z * ::math::lerp(0.0299999993f, 0.349999994f, roughness) * dents_bump_strength), overlay(smudges_1_weight * ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).x, ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 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), smudges_falloff + 1.f).y, smudges_2_weight), 0.429999977f), color(brightness * 0.300000012f + 0.600000024f), color(brightness * 0.300000012f + 0.600000024f), ::state::texture_tangent_u(0), ::df::scatter_reflect), bsdf(), add_detail_normal(infinite_tiling ? endless_normal(texture_2d("./textures/stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, false, false, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale)), 9.13999939f, float3(0.5f, 0.5f, 0.999000013f), 8.38000011f) : normalmap_normal(texture_2d("./textures/stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale))), infinite_tiling ? endless_normal(texture_2d("./textures/stainless_norm.jpg", ::tex::gamma_linear), milling_bump_strength, false, false, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.5f)), 9.13999939f, float3(0.5f, 0.5f, 0.999000013f), 8.38000011f) : normalmap_normal(texture_2d("./textures/stainless_norm.jpg", ::tex::gamma_linear), milling_bump_strength, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.5f))))), add_detail_normal(infinite_tiling ? endless_normal(texture_2d("./textures/stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, false, false, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale)), 9.13999939f, float3(0.5f, 0.5f, 0.999000013f), 8.38000011f) : normalmap_normal(texture_2d("./textures/stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale))), infinite_tiling ? endless_normal(texture_2d("./textures/stainless_norm.jpg", ::tex::gamma_linear), milling_bump_strength, false, false, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.5f)), 9.13999939f, float3(0.5f, 0.5f, 0.999000013f), 8.38000011f) : normalmap_normal(texture_2d("./textures/stainless_norm.jpg", ::tex::gamma_linear), milling_bump_strength, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.5f)))))), ::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()); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + + +export material Stainless_Steel_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(1) + ]], + float2 punching_grid_size = float2(.5f, .5f) + [[ + ::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.8f + [[ + ::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 = 2.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(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) + ]], + + + +// Stainless Steel parameters + 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"), + ::anno::ui_order(9) + ]], + float roughness = 0.f [[ + ::anno::description("Higher values lead to blurrier reflections."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(10) + ]], + float roughness_variation = 0.21f [[ + ::anno::description("Adds variation to the roughness following the shape of the milling bump map."), + ::anno::display_name("Roughness Variation"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(11) + ]], + float cloudiness = 0.3f [[ + ::anno::description("Adds a cloudy reflection to the metal material."), + ::anno::display_name("Cloudiness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(12) + ]], + float brightness = 0.5f [[ + ::anno::description("Low values make the metal darker and add slight variation to the brightness while a high value gives it a bright uniform look."), + ::anno::display_name("Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(13) + ]], + float milling_bump_strength = 0.0f [[ + ::anno::description("Adds milled grooves on the metal."), + ::anno::display_name("Milling Bump Strength"), + ::anno::in_group("Appearance", "Bump"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(14) + ]], + float dents_bump_strength = 0.01f [[ + ::anno::description("Adds dents and bumps."), + ::anno::display_name("Dents Bump Strength"), + ::anno::in_group("Appearance", "Bump"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(15) + ]], + float dents_scale = 1.f [[ + ::anno::description("Scales the size of the dents pattern on the material."), + ::anno::display_name("Dents Scale"), + ::anno::in_group("Appearance", "Bump"), + ::anno::ui_order(16) + ]], + float smudges_1_weight = 0.f [[ + ::anno::description("Adds smudges on the material which impact the reflectivity."), + ::anno::display_name("Smudges Weight"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(17) + ]], + float smudges_2_weight = 0.f [[ + ::anno::description("Adds imperfections that resemble stains on the material which impact the reflectivity."), + ::anno::display_name("Stains Weight"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(18) + ]], + float smudges_falloff = .45f [[ + ::anno::description("Controls the falloff of the smudges and stains on the surface. Low values make the smudges wide and soft while high values make them small."), + ::anno::display_name("Smudges Falloff"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(19) + ]], + float smudges_scale = 1.f [[ + ::anno::description("Scales the smudges relative to the overal scale of the material."), + ::anno::display_name("Smudges and Stains Scale"), + ::anno::in_group("Appearance", "Imperfections"), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(20) + ]], + uniform float2 texture_translate = float2(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(0.f, 360.f), + ::anno::ui_order(22) + ]], + uniform float2 texture_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(0.70f, 0.70f)), + ::anno::ui_order(23) + ]], + 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::hard_range(0, 10), + ::anno::ui_order(24) + ]], + 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(25) + ]], + 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(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) + ]] +) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Stainless Steel - Circular Punched"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Stainless_Steel_Punched.Stainless_Steel_Punched.png"), + ::anno::key_words(string[]("metal", "steel", "stainless", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "decorative", "new", "shiny", "smooth", "reflective", "plain", "gray")) +]] = let +{ + material base_mat = Stainless_Steel_Punched( + infinite_tiling: infinite_tiling, + roughness: roughness, + roughness_variation: roughness_variation, + cloudiness: cloudiness, + brightness: brightness, + milling_bump_strength: milling_bump_strength, + dents_bump_strength: dents_bump_strength, + dents_scale: dents_scale, + smudges_1_weight: smudges_1_weight, + smudges_2_weight: smudges_2_weight, + smudges_falloff: smudges_falloff, + smudges_scale: smudges_scale, + 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 + ); + + // 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); + texture_2d punching_cutout = texture_2d("./textures/atlas_02_norm_dist.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 + ) : 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 + ) +); + + + + + + +export material Stainless_Steel_Punched_Small_Circular(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Stainless Steel - Small Circular Punch"), + ::anno::description("Punched stainless steel."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Stainless_Steel_Punched.Stainless_Steel_Punched_Small_Circular.png"), + ::anno::key_words(string[]("metal", "steel", "stainless", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "decorative", "shiny", "reflective", "plain", "punched", "punching", "circular", "gray")) +]] = Stainless_Steel_Punched_( + // Punching parameters + shape_select: pattern_circle, + punching_grid_size: float2(.6f), + 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, + + // Material Parameters + infinite_tiling: true, + roughness: 0.3f, + roughness_variation: 0.2f, + cloudiness: 0.44f, + brightness: 0.5f, + milling_bump_strength: 0.05f, + dents_bump_strength: 0.02f, + dents_scale: 1.0f, + smudges_1_weight: 0.04f, + smudges_2_weight: 0.05f, + smudges_falloff: 0.0f, + smudges_scale: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + + +export material Stainless_Steel_Punched_Hexagonal(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Stainless Steel - Hexagonal Punch"), + ::anno::description("Punched stainless steel."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Stainless_Steel_Punched.Stainless_Steel_Punched_Hexagonal.png"), + ::anno::key_words(string[]("metal", "steel", "stainless", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "decorative", "shiny", "reflective", "plain", "punched", "punching", "hexagon", "hexagonal", "gray")) +]] = Stainless_Steel_Punched_( + // Punching parameters + shape_select: pattern_hexagon, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: true, + roughness: 0.3f, + roughness_variation: 0.2f, + cloudiness: 0.44f, + brightness: 0.5f, + milling_bump_strength: 0.05f, + dents_bump_strength: 0.02f, + dents_scale: 1.0f, + smudges_1_weight: 0.04f, + smudges_2_weight: 0.05f, + smudges_falloff: 0.0f, + smudges_scale: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + + +export material Stainless_Steel_Punched_Hexagonal_Small(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Stainless Steel - Small Hexagonal Punch"), + ::anno::description("Punched stainless steel."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Stainless_Steel_Punched.Stainless_Steel_Punched_Hexagonal_Small.png"), + ::anno::key_words(string[]("metal", "steel", "stainless", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "decorative", "shiny", "reflective", "plain", "punched", "punching", "hexagon", "hexagonal", "gray")) +]] = Stainless_Steel_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, + + // Material Parameters + infinite_tiling: true, + roughness: 0.3f, + roughness_variation: 0.2f, + cloudiness: 0.44f, + brightness: 0.5f, + milling_bump_strength: 0.05f, + dents_bump_strength: 0.02f, + dents_scale: 1.0f, + smudges_1_weight: 0.04f, + smudges_2_weight: 0.05f, + smudges_falloff: 0.0f, + smudges_scale: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + + +export material Stainless_Steel_Punched_Square(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Stainless Steel - Square Punch"), + ::anno::description("Punched stainless steel."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Stainless_Steel_Punched.Stainless_Steel_Punched_Square.png"), + ::anno::key_words(string[]("metal", "steel", "stainless", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "decorative", "shiny", "reflective", "plain", "punched", "punching", "square", "gray")) +]] = Stainless_Steel_Punched_( + // Punching parameters + shape_select: pattern_square, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: true, + roughness: 0.3f, + roughness_variation: 0.2f, + cloudiness: 0.44f, + brightness: 0.5f, + milling_bump_strength: 0.05f, + dents_bump_strength: 0.02f, + dents_scale: 1.0f, + smudges_1_weight: 0.04f, + smudges_2_weight: 0.05f, + smudges_falloff: 0.0f, + smudges_scale: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + + +export material Stainless_Steel_Punched_Line(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Stainless Steel - Line Punch"), + ::anno::description("Punched stainless steel."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Stainless_Steel_Punched.Stainless_Steel_Punched_Line.png"), + ::anno::key_words(string[]("metal", "steel", "stainless", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "decorative", "shiny", "reflective", "plain", "punched", "punching", "line", "gray")) +]] = Stainless_Steel_Punched_( + // Punching parameters + shape_select: pattern_line, + punching_grid_size: float2(.8f), + 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, + + // Material Parameters + infinite_tiling: true, + roughness: 0.3f, + roughness_variation: 0.2f, + cloudiness: 0.44f, + brightness: 0.5f, + milling_bump_strength: 0.05f, + dents_bump_strength: 0.02f, + dents_scale: 1.0f, + smudges_1_weight: 0.04f, + smudges_2_weight: 0.05f, + smudges_falloff: 0.0f, + smudges_scale: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + + +export material Stainless_Steel_Punched_Cross(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Stainless Steel - Cross Punch"), + ::anno::description("Punched stainless steel."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Stainless_Steel_Punched.Stainless_Steel_Punched_Cross.png"), + ::anno::key_words(string[]("metal", "steel", "stainless", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "decorative", "shiny", "reflective", "plain", "punched", "punching", "cross", "gray")) +]] = Stainless_Steel_Punched_( + // Punching parameters + shape_select: pattern_cross, + punching_grid_size: float2(.8f), + 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, + + // Material Parameters + infinite_tiling: true, + roughness: 0.3f, + roughness_variation: 0.2f, + cloudiness: 0.44f, + brightness: 0.5f, + milling_bump_strength: 0.05f, + dents_bump_strength: 0.02f, + dents_scale: 1.0f, + smudges_1_weight: 0.04f, + smudges_2_weight: 0.05f, + smudges_falloff: 0.0f, + smudges_scale: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + + +export material Stainless_Steel_Punched_Rhombus(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Stainless Steel - Rhombus Punch"), + ::anno::description("Punched stainless steel."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Stainless_Steel_Punched.Stainless_Steel_Punched_Rhombus.png"), + ::anno::key_words(string[]("metal", "steel", "stainless", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "decorative", "shiny", "reflective", "plain", "punched", "punching", "rhombus", "gray")) +]] = Stainless_Steel_Punched_( + // Punching parameters + shape_select: pattern_rhombus, + punching_grid_size: float2(.8f), + 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, + + // Material Parameters + infinite_tiling: true, + roughness: 0.3f, + roughness_variation: 0.2f, + cloudiness: 0.44f, + brightness: 0.5f, + milling_bump_strength: 0.05f, + dents_bump_strength: 0.02f, + dents_scale: 1.0f, + smudges_1_weight: 0.04f, + smudges_2_weight: 0.05f, + smudges_falloff: 0.0f, + smudges_scale: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + + +export material Stainless_Steel_Punched_Triangle(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Stainless Steel - Triangle Punch"), + ::anno::description("Punched stainless steel."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Stainless_Steel_Punched.Stainless_Steel_Punched_Triangle.png"), + ::anno::key_words(string[]("metal", "steel", "stainless", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "decorative", "shiny", "reflective", "plain", "punched", "punching", "triangle", "gray")) +]] = Stainless_Steel_Punched_( + shape_select: pattern_triangle, + punching_grid_size: float2(.8f), + 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, + + // Material Parameters + infinite_tiling: true, + roughness: 0.3f, + roughness_variation: 0.2f, + cloudiness: 0.44f, + brightness: 0.5f, + milling_bump_strength: 0.05f, + dents_bump_strength: 0.02f, + dents_scale: 1.0f, + smudges_1_weight: 0.04f, + smudges_2_weight: 0.05f, + smudges_falloff: 0.0f, + smudges_scale: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + + +export material Stainless_Steel_Punched_Star(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Stainless Steel - Star Punch"), + ::anno::description("Punched stainless steel."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Stainless_Steel_Punched.Stainless_Steel_Punched_Star.png"), + ::anno::key_words(string[]("metal", "steel", "stainless", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "decorative", "shiny", "reflective", "plain", "punched", "punching", "star", "gray")) +]] = Stainless_Steel_Punched_( + shape_select: pattern_star, + punching_grid_size: float2(.8f), + 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, + + // Material Parameters + infinite_tiling: true, + roughness: 0.3f, + roughness_variation: 0.2f, + cloudiness: 0.44f, + brightness: 0.5f, + milling_bump_strength: 0.05f, + dents_bump_strength: 0.02f, + dents_scale: 1.0f, + smudges_1_weight: 0.04f, + smudges_2_weight: 0.05f, + smudges_falloff: 0.0f, + smudges_scale: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Metal/Steel_Carbon.mdl b/code/third_party/vMaterials_2/Metal/Steel_Carbon.mdl new file mode 100644 index 0000000000000000000000000000000000000000..476a819295c23922affb05183f2e8f26cd660c5f --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Steel_Carbon.mdl @@ -0,0 +1,964 @@ +/****************************************************************************** + * 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 ::math::*; +import ::state::*; +import ::tex::*; +import ::df::*; +import ::nvidia::core_definitions::*; +import ::nvidia::core_definitions::dimension; + +const string DESCRIPTION = "A carbon steel material with adjustable rust oxidation and different levels of carbon saturation. " + "Note that a thick layer of oxide (rust) makes the appearance of the material more matte. " + "To achieve a highly reflective metal set the oxide thickness to 0.0 and adjust the roughness accordingly."; + +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; +} + +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); +} + + +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(1935); // 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; +} + +::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); +} + +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; +} + +vm_3float vm_util_balanced_weight( + uniform float input_1 [[::anno::in_group("Inputs")]], + uniform float input_2 [[::anno::in_group("Inputs")]], + uniform float input_3 [[::anno::in_group("Inputs")]], + float weight_1 [[::anno::in_group("Output Weights")]], + float weight_2 [[::anno::in_group("Output Weights")]], + float weight_3 [[::anno::in_group("Output Weights")]] +) +[[ + ::anno::description("Takes three inputs and scales them so that the largest weight is scaled to 1.0 " + "E.g. inputs (0.2, 0.1, 0.05) will result in (1.0, 0.5, 0.25).") +]] +{ + vm_3float result; + + float max = ::math::max(::math::max(input_1, input_2), input_3); + if(max > 0.0f) + { + result.x = (input_1/max) * weight_1; + result.y = (input_2/max) * weight_2; + result.z = (input_3/max) * weight_3; + } + else + { + result.x = weight_1; + result.y = weight_2; + result.z = weight_3; + } + return result; +} + + +// ********************** *********************** + + +float screen(float base, float layer, float weight) +{ + return base + (1.0f - base) * layer * weight; +} + +// 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)); +} + +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; +} + +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); +} + +export material Steel_Carbon( + 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"), + ::anno::ui_order(0) + ]], + float 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::soft_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float roughness = 0.04f [[ + ::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::soft_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float bump_strength = 0.f [[ + ::anno::description("Specifies the strength of the bump."), + ::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(3) + ]], + float oxide_thickness = 0.f [[ + ::anno::description("Adjusts the thickness of the rusty, dark brown oxidation layer. This makes the material also appear rougher."), + ::anno::display_name("Oxide Thickness"), + ::anno::in_group("Appearance", "Oxide"), + ::anno::hard_range(0.f, 1.f), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + float oxide_contrast = 1.f [[ + ::anno::description("Low values spread the oxide layer more evenly while higher values break up the oxide layer to reveal the clean metal."), + ::anno::display_name("Oxide Contrast"), + ::anno::in_group("Appearance", "Oxide"), + ::anno::hard_range(0.f, 1.f), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(5) + ]], + float bright_rust_amount = 0.03f [[ + ::anno::description("Increases the brightness of the rusty oxide layer."), + ::anno::display_name("Oxide Brightness"), + ::anno::in_group("Appearance", "Oxide"), + ::anno::hard_range(0.f, 1.f), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(6) + ]], + float rust_saturation = 0.f [[ + ::anno::description("Adjusts the saturation of the rusty oxide layer."), + ::anno::display_name("Oxide Saturation"), + ::anno::in_group("Appearance", "Oxide"), + ::anno::hard_range(0.f, 1.f), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(7) + ]], + uniform float impurities_weight_1 = 0.2f [[ + ::anno::description("Adds directional imperfections to the oxide variation."), + ::anno::display_name("Directional Imperfections Weight"), + ::anno::in_group("Appearance", "Oxide"), + ::anno::hard_range(0.f, 1.f), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(8) + ]], + uniform float impurities_weight_2 = 0.69f [[ + ::anno::description("Adds a spotted look to the oxide variation."), + ::anno::display_name("Spotted Imperfections Weight"), + ::anno::in_group("Appearance", "Oxide"), + ::anno::hard_range(0.f, 1.f), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(9) + ]], + uniform float impurities_weight_3 = 0.f [[ + ::anno::description("Adds a scratched look to the oxide variation."), + ::anno::display_name("Scratched Imperfections Weight"), + ::anno::in_group("Appearance", "Oxide"), + ::anno::hard_range(0.f, 1.f), + ::anno::soft_range(0.f, 1.f), + ::anno::ui_order(10) + ]], + float2 texture_translate = float2(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::ui_order(12) + ]], + float2 texture_scale = float2(1.0f) [[ + ::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("Use selected UV space for the material."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Transform"), + ::anno::ui_order(14) + ]], + 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(15) + ]], + uniform float roundcorner_radius = 0.5f [[ + ::anno::description("Radius of the rounded corners in millimeters (mm)."), + ::anno::display_name("Round Corner Radious"), + ::anno::in_group("Round Corners"), + ::anno::soft_range(0.f, 2.f), + ::anno::ui_order(16) + ]], + 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(17) + ]]) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Low Carbon Steel - New"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("metal", "steel", "metallic", "medium", "carbon", "infinite", "tiling", "construction", "automotive", "naval", "architecture", "design", "new", "shiny", "gray")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Steel_Carbon.Steel_Carbon.png") +]] + = + let { + bool tmp0 = false; + float2 tex_rescale = texture_scale * 0.5f; + material_surface tmp1(::df::weighted_layer(::math::pow(::math::lerp(0.f, screen(screen(vm_util_balanced_weight(impurities_weight_1, impurities_weight_2, impurities_weight_3 + 0.00100000005f, ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f)), ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f)), ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f))).x * ::math::pow(histogram_scan_big(float3(infinite_tiling ? color(vm_tex_infinite_color_normal(texture_2d("./textures/carbon_steel_multi.jpg", ::tex::gamma_linear), texture_2d("./textures/carbon_steel_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.430999994f, 0.361000001f, 0.501999974f), float3(0.5f, 0.5f, 0.984000027f), 1.39999998f, false, 2.20000005f, bump_strength).value) : vm_tex_lookup(texture_2d("./textures/carbon_steel_multi.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint)[0], 0.949999988f, 0.359999985f), 2.24000001f), ::math::pow(histogram_scan_big(float3(infinite_tiling ? color(vm_tex_infinite_color_normal(texture_2d("./textures/carbon_steel_multi.jpg", ::tex::gamma_linear), texture_2d("./textures/carbon_steel_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.430999994f, 0.361000001f, 0.501999974f), float3(0.5f, 0.5f, 0.984000027f), 1.39999998f, false, 2.20000005f, bump_strength).value) : vm_tex_lookup(texture_2d("./textures/carbon_steel_multi.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint)[1], 0.649999976f, 0.269999981f), 2.24000001f), vm_util_balanced_weight(impurities_weight_1, impurities_weight_2, impurities_weight_3 + 0.00100000005f, ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f)), ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f)), ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f))).y), ::math::pow(histogram_scan_big(float3(infinite_tiling ? color(vm_tex_infinite_color_normal(texture_2d("./textures/carbon_steel_multi.jpg", ::tex::gamma_linear), texture_2d("./textures/carbon_steel_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.430999994f, 0.361000001f, 0.501999974f), float3(0.5f, 0.5f, 0.984000027f), 1.39999998f, false, 2.20000005f, bump_strength).value) : vm_tex_lookup(texture_2d("./textures/carbon_steel_multi.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint)[2], 0.870000005f, 0.529999971f), 0.399999976f), vm_util_balanced_weight(impurities_weight_1, impurities_weight_2, impurities_weight_3 + 0.00100000005f, ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f)), ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f)), ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f))).z), ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f))), oxide_contrast * 0.850000024f + 0.150000006f), ::df::diffuse_reflection_bsdf(hsl2rgb(float3(1.f, rust_saturation * 2.5f, bright_rust_amount * 0.800000012f + 0.200000003f) * rgb2hsl(float3(nvidia::core_definitions::blend_colors(color(0.330343992f, 0.178270996f, 0.0280590001f), color(0.0396829993f, 0.0231379997f, 0.0170900002f), ::base::color_layer_blend, infinite_tiling ? vm_tex_infinite(texture_2d("./textures/carbon_steel_ao.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.728999972f), 1.39999998f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./textures/carbon_steel_ao.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(1.f)).x, true).tint))), 0.f), ::df::color_custom_curve_layer(color(0.827881992f, 0.827881992f, 0.827881992f), color(1.f, 1.f, 1.f), 5.f, color(brightness * 0.400000006f + 0.600000024f), ::df::weighted_layer(0.0700000003f, ::df::microfacet_ggx_smith_bsdf(0.150000006f, 0.150000006f, color(1.f, 1.f, 1.f), color(0.f, 0.f, 0.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::microfacet_ggx_smith_bsdf(::math::lerp(roughness, ::math::lerp(roughness * 0.5f, screen(screen(vm_util_balanced_weight(impurities_weight_1, impurities_weight_2, impurities_weight_3 + 0.00100000005f, ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f)), ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f)), ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f))).x * ::math::pow(histogram_scan_big(float3(infinite_tiling ? color(vm_tex_infinite_color_normal(texture_2d("./textures/carbon_steel_multi.jpg", ::tex::gamma_linear), texture_2d("./textures/carbon_steel_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.430999994f, 0.361000001f, 0.501999974f), float3(0.5f, 0.5f, 0.984000027f), 1.39999998f, false, 2.20000005f, bump_strength).value) : vm_tex_lookup(texture_2d("./textures/carbon_steel_multi.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint)[0], 0.949999988f, 0.359999985f), 2.24000001f), ::math::pow(histogram_scan_big(float3(infinite_tiling ? color(vm_tex_infinite_color_normal(texture_2d("./textures/carbon_steel_multi.jpg", ::tex::gamma_linear), texture_2d("./textures/carbon_steel_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.430999994f, 0.361000001f, 0.501999974f), float3(0.5f, 0.5f, 0.984000027f), 1.39999998f, false, 2.20000005f, bump_strength).value) : vm_tex_lookup(texture_2d("./textures/carbon_steel_multi.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint)[1], 0.649999976f, 0.269999981f), 2.24000001f), vm_util_balanced_weight(impurities_weight_1, impurities_weight_2, impurities_weight_3 + 0.00100000005f, ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f)), ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f)), ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f))).y), ::math::pow(histogram_scan_big(float3(infinite_tiling ? color(vm_tex_infinite_color_normal(texture_2d("./textures/carbon_steel_multi.jpg", ::tex::gamma_linear), texture_2d("./textures/carbon_steel_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.430999994f, 0.361000001f, 0.501999974f), float3(0.5f, 0.5f, 0.984000027f), 1.39999998f, false, 2.20000005f, bump_strength).value) : vm_tex_lookup(texture_2d("./textures/carbon_steel_multi.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint)[2], 0.870000005f, 0.529999971f), 0.399999976f), vm_util_balanced_weight(impurities_weight_1, impurities_weight_2, impurities_weight_3 + 0.00100000005f, ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f)), ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f)), ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f))).z), ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f))) + (1.f - (infinite_tiling ? vm_tex_infinite(texture_2d("./textures/carbon_steel_ao.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.728999972f), 1.39999998f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./textures/carbon_steel_ao.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(1.f)).x)) * roughness, oxide_thickness) * ::math::lerp(roughness, ::math::lerp(roughness * 0.5f, screen(screen(vm_util_balanced_weight(impurities_weight_1, impurities_weight_2, impurities_weight_3 + 0.00100000005f, ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f)), ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f)), ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f))).x * ::math::pow(histogram_scan_big(float3(infinite_tiling ? color(vm_tex_infinite_color_normal(texture_2d("./textures/carbon_steel_multi.jpg", ::tex::gamma_linear), texture_2d("./textures/carbon_steel_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.430999994f, 0.361000001f, 0.501999974f), float3(0.5f, 0.5f, 0.984000027f), 1.39999998f, false, 2.20000005f, bump_strength).value) : vm_tex_lookup(texture_2d("./textures/carbon_steel_multi.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint)[0], 0.949999988f, 0.359999985f), 2.24000001f), ::math::pow(histogram_scan_big(float3(infinite_tiling ? color(vm_tex_infinite_color_normal(texture_2d("./textures/carbon_steel_multi.jpg", ::tex::gamma_linear), texture_2d("./textures/carbon_steel_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.430999994f, 0.361000001f, 0.501999974f), float3(0.5f, 0.5f, 0.984000027f), 1.39999998f, false, 2.20000005f, bump_strength).value) : vm_tex_lookup(texture_2d("./textures/carbon_steel_multi.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint)[1], 0.649999976f, 0.269999981f), 2.24000001f), vm_util_balanced_weight(impurities_weight_1, impurities_weight_2, impurities_weight_3 + 0.00100000005f, ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f)), ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f)), ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f))).y), ::math::pow(histogram_scan_big(float3(infinite_tiling ? color(vm_tex_infinite_color_normal(texture_2d("./textures/carbon_steel_multi.jpg", ::tex::gamma_linear), texture_2d("./textures/carbon_steel_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.430999994f, 0.361000001f, 0.501999974f), float3(0.5f, 0.5f, 0.984000027f), 1.39999998f, false, 2.20000005f, bump_strength).value) : vm_tex_lookup(texture_2d("./textures/carbon_steel_multi.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint)[2], 0.870000005f, 0.529999971f), 0.399999976f), vm_util_balanced_weight(impurities_weight_1, impurities_weight_2, impurities_weight_3 + 0.00100000005f, ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f)), ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f)), ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f))).z), ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f))) + (1.f - (infinite_tiling ? vm_tex_infinite(texture_2d("./textures/carbon_steel_ao.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.728999972f), 1.39999998f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./textures/carbon_steel_ao.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(1.f)).x)) * roughness, oxide_thickness), ::math::lerp(roughness, ::math::lerp(roughness * 0.5f, screen(screen(vm_util_balanced_weight(impurities_weight_1, impurities_weight_2, impurities_weight_3 + 0.00100000005f, ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f)), ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f)), ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f))).x * ::math::pow(histogram_scan_big(float3(infinite_tiling ? color(vm_tex_infinite_color_normal(texture_2d("./textures/carbon_steel_multi.jpg", ::tex::gamma_linear), texture_2d("./textures/carbon_steel_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.430999994f, 0.361000001f, 0.501999974f), float3(0.5f, 0.5f, 0.984000027f), 1.39999998f, false, 2.20000005f, bump_strength).value) : vm_tex_lookup(texture_2d("./textures/carbon_steel_multi.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint)[0], 0.949999988f, 0.359999985f), 2.24000001f), ::math::pow(histogram_scan_big(float3(infinite_tiling ? color(vm_tex_infinite_color_normal(texture_2d("./textures/carbon_steel_multi.jpg", ::tex::gamma_linear), texture_2d("./textures/carbon_steel_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.430999994f, 0.361000001f, 0.501999974f), float3(0.5f, 0.5f, 0.984000027f), 1.39999998f, false, 2.20000005f, bump_strength).value) : vm_tex_lookup(texture_2d("./textures/carbon_steel_multi.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint)[1], 0.649999976f, 0.269999981f), 2.24000001f), vm_util_balanced_weight(impurities_weight_1, impurities_weight_2, impurities_weight_3 + 0.00100000005f, ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f)), ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f)), ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f))).y), ::math::pow(histogram_scan_big(float3(infinite_tiling ? color(vm_tex_infinite_color_normal(texture_2d("./textures/carbon_steel_multi.jpg", ::tex::gamma_linear), texture_2d("./textures/carbon_steel_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.430999994f, 0.361000001f, 0.501999974f), float3(0.5f, 0.5f, 0.984000027f), 1.39999998f, false, 2.20000005f, bump_strength).value) : vm_tex_lookup(texture_2d("./textures/carbon_steel_multi.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint)[2], 0.870000005f, 0.529999971f), 0.399999976f), vm_util_balanced_weight(impurities_weight_1, impurities_weight_2, impurities_weight_3 + 0.00100000005f, ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f)), ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f)), ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f))).z), ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f))) + (1.f - (infinite_tiling ? vm_tex_infinite(texture_2d("./textures/carbon_steel_ao.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.728999972f), 1.39999998f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./textures/carbon_steel_ao.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(1.f)).x)) * roughness, oxide_thickness) * ::math::lerp(roughness, ::math::lerp(roughness * 0.5f, screen(screen(vm_util_balanced_weight(impurities_weight_1, impurities_weight_2, impurities_weight_3 + 0.00100000005f, ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f)), ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f)), ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f))).x * ::math::pow(histogram_scan_big(float3(infinite_tiling ? color(vm_tex_infinite_color_normal(texture_2d("./textures/carbon_steel_multi.jpg", ::tex::gamma_linear), texture_2d("./textures/carbon_steel_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.430999994f, 0.361000001f, 0.501999974f), float3(0.5f, 0.5f, 0.984000027f), 1.39999998f, false, 2.20000005f, bump_strength).value) : vm_tex_lookup(texture_2d("./textures/carbon_steel_multi.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint)[0], 0.949999988f, 0.359999985f), 2.24000001f), ::math::pow(histogram_scan_big(float3(infinite_tiling ? color(vm_tex_infinite_color_normal(texture_2d("./textures/carbon_steel_multi.jpg", ::tex::gamma_linear), texture_2d("./textures/carbon_steel_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.430999994f, 0.361000001f, 0.501999974f), float3(0.5f, 0.5f, 0.984000027f), 1.39999998f, false, 2.20000005f, bump_strength).value) : vm_tex_lookup(texture_2d("./textures/carbon_steel_multi.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint)[1], 0.649999976f, 0.269999981f), 2.24000001f), vm_util_balanced_weight(impurities_weight_1, impurities_weight_2, impurities_weight_3 + 0.00100000005f, ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f)), ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f)), ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f))).y), ::math::pow(histogram_scan_big(float3(infinite_tiling ? color(vm_tex_infinite_color_normal(texture_2d("./textures/carbon_steel_multi.jpg", ::tex::gamma_linear), texture_2d("./textures/carbon_steel_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.430999994f, 0.361000001f, 0.501999974f), float3(0.5f, 0.5f, 0.984000027f), 1.39999998f, false, 2.20000005f, bump_strength).value) : vm_tex_lookup(texture_2d("./textures/carbon_steel_multi.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint)[2], 0.870000005f, 0.529999971f), 0.399999976f), vm_util_balanced_weight(impurities_weight_1, impurities_weight_2, impurities_weight_3 + 0.00100000005f, ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f)), ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f)), ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f))).z), ::math::lerp(0.48999998f, 1.f, ::math::pow(oxide_thickness, 0.689999998f))) + (1.f - (infinite_tiling ? vm_tex_infinite(texture_2d("./textures/carbon_steel_ao.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.728999972f), 1.39999998f, false, 2.20000005f).x : vm_tex_lookup_3float(texture_2d("./textures/carbon_steel_ao.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(1.f)).x)) * roughness, oxide_thickness), color(1.f, 1.f, 1.f), color(0.f, 0.f, 0.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::math::normalize(::math::lerp(::state::normal(), vm_tex_infinite_color_normal(texture_2d("./textures/carbon_steel_multi.jpg", ::tex::gamma_linear), texture_2d("./textures/carbon_steel_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.430999994f, 0.361000001f, 0.501999974f), float3(0.5f, 0.5f, 0.984000027f), 1.39999998f, false, 2.20000005f, bump_strength).norm, 1.f))), bsdf(), ::math::normalize(::math::lerp(::state::normal(), vm_tex_infinite_color_normal(texture_2d("./textures/carbon_steel_multi.jpg", ::tex::gamma_linear), texture_2d("./textures/carbon_steel_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.430999994f, 0.361000001f, 0.501999974f), float3(0.5f, 0.5f, 0.984000027f), 1.39999998f, false, 2.20000005f, bump_strength).norm, 1.f))), ::math::normalize(::math::lerp(::state::normal(), vm_tex_infinite_color_normal(texture_2d("./textures/carbon_steel_multi.jpg", ::tex::gamma_linear), texture_2d("./textures/carbon_steel_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.430999994f, 0.361000001f, 0.501999974f), float3(0.5f, 0.5f, 0.984000027f), 1.39999998f, false, 2.20000005f, bump_strength).norm, 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, 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); + + + +// 2 - "Medium Carbon Steel - Shiny" +export material Steel_Carbon_Medium_Shiny(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Medium Carbon Steel - New"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("metal", "steel", "metallic", "medium", "carbon", "infinite", "tiling", "construction", "automotive", "naval", "architecture", "design", "new", "shiny", "gray")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Steel_Carbon.Steel_Carbon_Medium_Shiny.png") +]] = Steel_Carbon( + infinite_tiling: true, + brightness: 0.92f, + roughness: 0.04f, + bump_strength: 0.0f, + oxide_thickness: 0.0f, + oxide_contrast: 0.78f, + bright_rust_amount: 1.0f, + rust_saturation: 0.05f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.06f, + impurities_weight_3: 0.28f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + roundcorner_radius: 0.5f, + across_materials: false +); + +// 3 - "High Carbon Steel - Shiny" +export material Steel_Carbon_High_Shiny(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("High Carbon Steel - New"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("metal", "steel", "metallic", "high", "carbon", "infinite", "tiling", "construction", "automotive", "naval", "architecture", "design", "new", "shiny", "gray")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Steel_Carbon.Steel_Carbon_High_Shiny.png") +]] = Steel_Carbon( + infinite_tiling: true, + brightness: 0.83f, + roughness: 0.04f, + bump_strength: 0.0f, + oxide_thickness: 0.0f, + oxide_contrast: 0.78f, + bright_rust_amount: 1.0f, + rust_saturation: 0.05f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.13f, + impurities_weight_3: 0.28f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + roundcorner_radius: 0.5f, + across_materials: false +); + +// 4 - "Low Carbon Steel - Directional Imperfections" +export material Steel_Carbon_Low_Directional_Imperfections(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Low Carbon Steel - Directional Imperfections"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("metal", "steel", "metallic", "low", "carbon", "infinite", "tiling", "construction", "automotive", "naval", "architecture", "design", "imperfections", "directional", "shiny", "gray")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Steel_Carbon.Steel_Carbon_Low_Directional_Imperfections.png") +]] = Steel_Carbon( + infinite_tiling: true, + brightness: 1.0f, + roughness: 0.17f, + bump_strength: 0.0f, + oxide_thickness: 0.2f, + oxide_contrast: 0.78f, + bright_rust_amount: 1.0f, + rust_saturation: 0.05f, + impurities_weight_1: 1.00f, + impurities_weight_2: 0.0f, + impurities_weight_3: 0.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + roundcorner_radius: 0.5f, + across_materials: false +); + +// 5 - "Medium Carbon Steel - Glossy" +export material Steel_Carbon_Medium_Glossy(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Medium Carbon Steel - Glossy"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("metal", "steel", "metallic", "medium", "carbon", "infinite", "tiling", "construction", "automotive", "naval", "architecture", "design", "new", "glossy", "gray")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Steel_Carbon.Steel_Carbon_Medium_Glossy.png") +]] = Steel_Carbon( + infinite_tiling: true, + brightness: 0.92f, + roughness: 0.44f, + bump_strength: 0.19f, + oxide_thickness: 0.0f, + oxide_contrast: 0.78f, + bright_rust_amount: 1.0f, + rust_saturation: 0.05f, + impurities_weight_1: 0.03f, + impurities_weight_2: 0.022f, + impurities_weight_3: 0.6f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + roundcorner_radius: 0.5f, + across_materials: false +); + +// 6 - "High Carbon Steel - Glossy" +export material Steel_Carbon_High_Glossy(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("High Carbon Steel - Glossy"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("metal", "steel", "metallic", "high", "carbon", "infinite", "tiling", "construction", "automotive", "naval", "architecture", "design", "new", "glossy", "gray")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Steel_Carbon.Steel_Carbon_High_Glossy.png") +]] = Steel_Carbon( + infinite_tiling: true, + brightness: 0.8f, + roughness: 0.44f, + bump_strength: 0.19f, + oxide_thickness: 0.0f, + oxide_contrast: 0.78f, + bright_rust_amount: 1.0f, + rust_saturation: 0.05f, + impurities_weight_1: 0.03f, + impurities_weight_2: 0.12f, + impurities_weight_3: 0.29f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + roundcorner_radius: 0.5f, + across_materials: false +); + +// 7 - "Low Carbon Steel - Matte" +export material Steel_Carbon_Low_Matte(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Low Carbon Steel - Matte"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("metal", "steel", "metallic", "low", "carbon", "infinite", "tiling", "construction", "automotive", "naval", "architecture", "design", "oxidized", "worn", "matte", "gray")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Steel_Carbon.Steel_Carbon_Low_Matte.png") +]] = Steel_Carbon( + infinite_tiling: true, + brightness: 1.0f, + roughness: 0.4f, + bump_strength: 0.25f, + oxide_thickness: 0.45f, + oxide_contrast: 0.78f, + bright_rust_amount: 0.57f, + rust_saturation: 0.05f, + impurities_weight_1: 0.03f, + impurities_weight_2: 0.27f, + impurities_weight_3: 0.6f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + roundcorner_radius: 0.5f, + across_materials: false +); + +// 8 - "Medium Carbon Steel - Matte" +export material Steel_Carbon_Medium_Matte(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Medium Carbon Steel - Matte"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("metal", "steel", "metallic", "medium", "carbon", "infinite", "tiling", "construction", "automotive", "naval", "architecture", "design", "oxidized", "worn", "matte", "gray")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Steel_Carbon.Steel_Carbon_Medium_Matte.png") +]] = Steel_Carbon( + infinite_tiling: true, + brightness: 0.92f, + roughness: 0.44f, + bump_strength: 0.19f, + oxide_thickness: 0.39f, + oxide_contrast: 0.78f, + bright_rust_amount: 1.0f, + rust_saturation: 0.05f, + impurities_weight_1: 0.03f, + impurities_weight_2: 0.22f, + impurities_weight_3: 0.6f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + roundcorner_radius: 0.5f, + across_materials: false +); + +// 9 - "High Carbon Steel - Matte" +export material Steel_Carbon_High_Matte(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("High Carbon Steel - Matte"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("metal", "steel", "metallic", "high", "carbon", "infinite", "tiling", "construction", "automotive", "naval", "architecture", "design", "oxidized", "worn", "matte", "gray")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Steel_Carbon.Steel_Carbon_High_Matte.png") +]] = Steel_Carbon( + infinite_tiling: true, + brightness: 0.8f, + roughness: 0.76f, + bump_strength: 0.19f, + oxide_thickness: 0.19f, + oxide_contrast: 1.0f, + bright_rust_amount: 1.0f, + rust_saturation: 0.05f, + impurities_weight_1: 0.09f, + impurities_weight_2: 0.15f, + impurities_weight_3: 0.29f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + roundcorner_radius: 0.5f, + across_materials: false +); + +// 10 +export material Steel_Carbon_Low_Medium_Rust(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Low Carbon Steel - Medium Rust"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("metal", "steel", "metallic", "carbon", "infinite", "tiling", "construction", "design", "oxidized", "old", "worn", "matte", "rust", "rusty", "brown", "gray")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Steel_Carbon.Steel_Carbon_Low_Medium_Rust.png") +]] = Steel_Carbon( + infinite_tiling: true, + brightness: 1.0f, + roughness: 0.0f, + bump_strength: 0.82f, + oxide_thickness: 1.0f, + oxide_contrast: 1.0f, + bright_rust_amount: 0.49f, + rust_saturation: 0.64f, + impurities_weight_1: 0.03f, + impurities_weight_2: 0.14f, + impurities_weight_3: 0.39f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + roundcorner_radius: 0.5f, + across_materials: false +); + +// 11 - "Low Carbon Steel - Directional Rust" +export material Steel_Carbon_Low_Directional_Rust(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Low Carbon Steel - Directional Rust"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("metal", "steel", "metallic", "low", "carbon", "infinite", "tiling", "construction", "design", "directional", "oxidized", "old", "worn", "matte", "rust", "rusty", "brown", "gray")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Steel_Carbon.Steel_Carbon_Low_Directional_Rust.png") +]] = Steel_Carbon( + infinite_tiling: true, + brightness: 1.0f, + roughness: 0.0f, + bump_strength: 0.82f, + oxide_thickness: 1.0f, + oxide_contrast: 1.0f, + bright_rust_amount: 0.14f, + rust_saturation: 0.64f, + impurities_weight_1: 1.0f, + impurities_weight_2: 0.07f, + impurities_weight_3: 0.42f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + roundcorner_radius: 0.5f, + across_materials: false +); + +// 12 - "Low Carbon Steel - Heavy Rust" +export material Steel_Carbon_Low_Heavy_Rust(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Low Carbon Steel - Heavy Rust"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("metal", "steel", "metallic", "low", "carbon", "infinite", "tiling", "construction", "architecture", "oxidized", "old", "matte", "rust", "rusty", "brown", "gray")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Steel_Carbon.Steel_Carbon_Low_Heavy_Rust.png") +]] = Steel_Carbon( + infinite_tiling: true, + brightness: 1.0f, + roughness: 0.4f, + bump_strength: 0.82f, + oxide_thickness: 1.0f, + oxide_contrast: 0.7f, + bright_rust_amount: 1.0f, + rust_saturation: 0.52f, + impurities_weight_1: 0.04f, + impurities_weight_2: 0.59f, + impurities_weight_3: 0.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + roundcorner_radius: 0.5f, + across_materials: false +); + +// 13 - "Low Carbon Steel - Bright Rust" +export material Steel_Carbon_Low_Bright_Rust(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Low Carbon Steel - Bright Rust"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("metal", "steel", "metallic", "low", "carbon", "infinite", "tiling", "construction", "architecture", "oxidized", "old", "matte", "rust", "rusty", "brown", "saturated")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Steel_Carbon.Steel_Carbon_Low_Bright_Rust.png") +]] = Steel_Carbon( + infinite_tiling: true, + brightness: 1.0f, + roughness: 0.4f, + bump_strength: 1.0f, + oxide_thickness: 1.0f, + oxide_contrast: 0.7f, + bright_rust_amount: 1.0f, + rust_saturation: 1.0f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.59f, + impurities_weight_3: 0.61f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + roundcorner_radius: 0.5f, + across_materials: false +); diff --git a/code/third_party/vMaterials_2/Metal/Steel_Galvanized.mdl b/code/third_party/vMaterials_2/Metal/Steel_Galvanized.mdl new file mode 100644 index 0000000000000000000000000000000000000000..d6befc348723292e1e3bc35712d10e6239ddba8c --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Steel_Galvanized.mdl @@ -0,0 +1,444 @@ +/****************************************************************************** + * 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 = "Steel material that has been galvanized with a layer of zinc."; + +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)); +} + +export material Steel_Galvanized( + 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"), + ::anno::ui_order(0) + ]], + float zinc_roughness = 0.39f [[ + ::anno::description("The roughness of the zinc crystals."), + ::anno::display_name("Zinc Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float oxidation_amount = 0.08f [[ + ::anno::description("Controls the amount of oxidation on the material."), + ::anno::display_name("Oxidation Amount"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float oxide_roughness = 0.79f [[ + ::anno::description("Controls the roughness of the oxidation on the material. Only visible if Oxidation Amount is greater than 0."), + ::anno::display_name("Oxide Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float dirt_spots_weight = 0.18f [[ + ::anno::description("Adds dirty spots to the material."), + ::anno::display_name("Dirt Spots Weight"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + float leak_dirt_weight = 0.03f [[ + ::anno::description("Adds leaky dirt to the material."), + ::anno::display_name("Leak Dirt Weight"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(5) + ]], + uniform float bump_strength = 0.28f [[ + ::anno::description("The Strength of the bump map."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(6) + ]], + uniform float2 texture_translate = float2(0.f) [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform"), + ::anno::ui_order(7) + ]], + 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(8) + ]], + uniform float2 texture_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(0.7f, 0.7f)), + ::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 = true [[ + ::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("Steel Galvanized - New"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("metal", "steel", "infinite", "tiling", "construction", "architecture", "galvanized", "coated", "new", "metallic", "shiny", "gray")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Steel_Galvanized.Steel_Galvanized.png") +]] + = + let { + + texture_2d multi_rough_tex = texture_2d("./textures/metal_galvan_multi_R_dirt_G_urough_B_vrough.jpg", ::tex::gamma_linear); + texture_2d multi_tex = texture_2d("./textures/metal_galvan_multi_R_base_G_dirtmask_B_dirt.jpg", ::tex::gamma_linear); + texture_2d normal_tex = texture_2d("./textures/metal_galvan_normal.jpg", ::tex::gamma_linear); + + material_surface tmp1(::df::weighted_layer(::math::max(::math::pow(dirt_spots_weight * float3(infinite_tiling ? endless_texture(multi_rough_tex, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.153999999f, 0.501999974f, 0.493999988f), 3.f, false) : ::base::file_texture(multi_rough_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, ::base::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, 1.18999994f), ::math::pow(float3(infinite_tiling ? endless_texture(multi_tex, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.379000008f, 0.689999998f, 0.750999987f), 3.f, false) : ::base::file_texture(multi_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, ::base::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, 0.729999959f) * (leak_dirt_weight * 0.379999995f)), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(color(0.f, 0.f, 0.f), nvidia::core_definitions::blend_colors(color(0.212230995f, 0.186502993f, 0.166861996f), color(0.266355991f, 0.240462005f, 0.225070998f), ::base::color_layer_blend, histogram_range(float3(infinite_tiling ? endless_texture(multi_tex, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.379000008f, 0.689999998f, 0.750999987f), 3.f, false) : ::base::file_texture(multi_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, ::base::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, 0.469999999f, 0.170000002f)).tint, ::base::color_layer_blend, ::math::max(::math::pow(dirt_spots_weight * float3(infinite_tiling ? endless_texture(multi_rough_tex, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.153999999f, 0.501999974f, 0.493999988f), 3.f, false) : ::base::file_texture(multi_rough_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, ::base::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, 1.18999994f), ::math::pow(float3(infinite_tiling ? endless_texture(multi_tex, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.379000008f, 0.689999998f, 0.750999987f), 3.f, false) : ::base::file_texture(multi_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, ::base::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, 0.729999959f) * (leak_dirt_weight * 0.379999995f))).tint, 0.f), bsdf(), infinite_tiling ? endless_normal(normal_tex, bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.25f, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.5f, 0.5f, 0.996999979f), 3.f) : nvidia::core_definitions::normalmap_texture(normal_tex, 1.f / texture_scale * 4.f, texture_translate, texture_rotate, false, bump_strength, uv_space_index)), ::df::weighted_layer(1.f, ::df::microfacet_ggx_smith_bsdf((dirt_spots_weight * float3(infinite_tiling ? endless_texture(multi_rough_tex, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.153999999f, 0.501999974f, 0.493999988f), 3.f, false) : ::base::file_texture(multi_rough_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, ::base::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 + ::math::lerp(histogram_range(float3(infinite_tiling ? endless_texture(multi_rough_tex, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.153999999f, 0.501999974f, 0.493999988f), 3.f, false) : ::base::file_texture(multi_rough_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, ::base::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, 0.419999987f, zinc_roughness * 0.400000006f + 0.400000006f), ::math::lerp(::math::clamp(histogram_range(float3(infinite_tiling ? endless_texture(multi_tex, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.379000008f, 0.689999998f, 0.750999987f), 3.f, false) : ::base::file_texture(multi_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, ::base::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, 1.f, oxide_roughness * 0.219999999f + 0.600000024f), 0.f, 1.f), float3(infinite_tiling ? endless_texture(multi_tex, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.379000008f, 0.689999998f, 0.750999987f), 3.f, false) : ::base::file_texture(multi_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, ::base::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, ::math::pow(float3(infinite_tiling ? endless_texture(multi_tex, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.379000008f, 0.689999998f, 0.750999987f), 3.f, false) : ::base::file_texture(multi_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, ::base::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, 0.729999959f) * (leak_dirt_weight * 0.25f)), oxidation_amount) + ::math::pow(float3(infinite_tiling ? endless_texture(multi_tex, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.379000008f, 0.689999998f, 0.750999987f), 3.f, false) : ::base::file_texture(multi_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, ::base::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, 0.729999959f) * (leak_dirt_weight * 0.25f)) * (dirt_spots_weight * float3(infinite_tiling ? endless_texture(multi_rough_tex, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.153999999f, 0.501999974f, 0.493999988f), 3.f, false) : ::base::file_texture(multi_rough_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, ::base::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 + ::math::lerp(histogram_range(float3(infinite_tiling ? endless_texture(multi_rough_tex, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.153999999f, 0.501999974f, 0.493999988f), 3.f, false) : ::base::file_texture(multi_rough_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, ::base::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, 0.419999987f, zinc_roughness * 0.400000006f + 0.400000006f), ::math::lerp(::math::clamp(histogram_range(float3(infinite_tiling ? endless_texture(multi_tex, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.379000008f, 0.689999998f, 0.750999987f), 3.f, false) : ::base::file_texture(multi_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, ::base::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, 1.f, oxide_roughness * 0.219999999f + 0.600000024f), 0.f, 1.f), float3(infinite_tiling ? endless_texture(multi_tex, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.379000008f, 0.689999998f, 0.750999987f), 3.f, false) : ::base::file_texture(multi_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, ::base::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, ::math::pow(float3(infinite_tiling ? endless_texture(multi_tex, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.379000008f, 0.689999998f, 0.750999987f), 3.f, false) : ::base::file_texture(multi_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, ::base::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, 0.729999959f) * (leak_dirt_weight * 0.25f)), oxidation_amount) + ::math::pow(float3(infinite_tiling ? endless_texture(multi_tex, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.379000008f, 0.689999998f, 0.750999987f), 3.f, false) : ::base::file_texture(multi_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, ::base::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, 0.729999959f) * (leak_dirt_weight * 0.25f)), (dirt_spots_weight * float3(infinite_tiling ? endless_texture(multi_rough_tex, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.153999999f, 0.501999974f, 0.493999988f), 3.f, false) : ::base::file_texture(multi_rough_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, ::base::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 + ::math::lerp(histogram_range(float3(infinite_tiling ? endless_texture(multi_rough_tex, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.153999999f, 0.501999974f, 0.493999988f), 3.f, false) : ::base::file_texture(multi_rough_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, ::base::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.419999987f, zinc_roughness * 0.400000006f + 0.400000006f), ::math::lerp(::math::clamp(histogram_range(float3(infinite_tiling ? endless_texture(multi_tex, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.379000008f, 0.689999998f, 0.750999987f), 3.f, false) : ::base::file_texture(multi_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, ::base::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, 1.f, oxide_roughness * 0.219999999f + 0.600000024f), 0.f, 1.f), float3(infinite_tiling ? endless_texture(multi_tex, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.379000008f, 0.689999998f, 0.750999987f), 3.f, false) : ::base::file_texture(multi_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, ::base::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, ::math::pow(float3(infinite_tiling ? endless_texture(multi_tex, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.379000008f, 0.689999998f, 0.750999987f), 3.f, false) : ::base::file_texture(multi_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, ::base::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, 0.729999959f) * (leak_dirt_weight * 0.25f)), oxidation_amount) + ::math::pow(float3(infinite_tiling ? endless_texture(multi_tex, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.379000008f, 0.689999998f, 0.750999987f), 3.f, false) : ::base::file_texture(multi_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, ::base::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, 0.729999959f) * (leak_dirt_weight * 0.25f)) * (dirt_spots_weight * float3(infinite_tiling ? endless_texture(multi_rough_tex, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.153999999f, 0.501999974f, 0.493999988f), 3.f, false) : ::base::file_texture(multi_rough_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, ::base::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 + ::math::lerp(histogram_range(float3(infinite_tiling ? endless_texture(multi_rough_tex, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.153999999f, 0.501999974f, 0.493999988f), 3.f, false) : ::base::file_texture(multi_rough_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, ::base::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.419999987f, zinc_roughness * 0.400000006f + 0.400000006f), ::math::lerp(::math::clamp(histogram_range(float3(infinite_tiling ? endless_texture(multi_tex, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.379000008f, 0.689999998f, 0.750999987f), 3.f, false) : ::base::file_texture(multi_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, ::base::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, 1.f, oxide_roughness * 0.219999999f + 0.600000024f), 0.f, 1.f), float3(infinite_tiling ? endless_texture(multi_tex, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.379000008f, 0.689999998f, 0.750999987f), 3.f, false) : ::base::file_texture(multi_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, ::base::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, ::math::pow(float3(infinite_tiling ? endless_texture(multi_tex, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.379000008f, 0.689999998f, 0.750999987f), 3.f, false) : ::base::file_texture(multi_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, ::base::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, 0.729999959f) * (leak_dirt_weight * 0.25f)), oxidation_amount) + ::math::pow(float3(infinite_tiling ? endless_texture(multi_tex, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.379000008f, 0.689999998f, 0.750999987f), 3.f, false) : ::base::file_texture(multi_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, ::base::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, 0.729999959f) * (leak_dirt_weight * 0.25f)), color(0.450940013f, 0.512027025f, 0.590619028f), color(0.f, 0.f, 0.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), bsdf(), infinite_tiling ? endless_normal(normal_tex, bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.25f, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.5f, 0.5f, 0.996999979f), 3.f) : nvidia::core_definitions::normalmap_texture(normal_tex, 1.f / texture_scale * 4.f, texture_translate, texture_rotate, false, bump_strength, 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(0.f, roundcorners_across_materials, roundcorners_radius_mm) : ::state::normal()); + } in + material( + thin_walled: false, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + +export material Steel_Galvanized_Rough_Crystals(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Steel Galvanized - Rough Crystals"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("metal", "steel", "infinite", "tiling", "construction", "architecture", "galvanized", "coated", "metallic", "rough", "gray")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Steel_Galvanized.Steel_Galvanized_Rough_Crystals.png") +]] = Steel_Galvanized ( + infinite_tiling: true, + zinc_roughness: 0.72f, + oxidation_amount: 0.08f, + oxide_roughness: 0.79f, + dirt_spots_weight: 0.18f, + leak_dirt_weight: 0.03f, + bump_strength: 0.28, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 0.8f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +export material Steel_Galvanized_Oxidized(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Steel Galvanized - Oxidized"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("metal", "steel", "infinite", "tiling", "construction", "architecture", "galvanized", "oxidized", "aged", "old", "coated", "metallic", "rough", "gray")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Steel_Galvanized.Steel_Galvanized_Rough_Crystals.png") +]] = Steel_Galvanized ( + infinite_tiling: true, + zinc_roughness: 0.2f, + oxidation_amount: 0.7f, + oxide_roughness: 0.79f, + dirt_spots_weight: 0.18f, + leak_dirt_weight: 0.03f, + bump_strength: 0.28, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 0.8f, + roundcorners_across_materials: false, + uv_space_index: 0 +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Metal/Steel_Painted.mdl b/code/third_party/vMaterials_2/Metal/Steel_Painted.mdl new file mode 100644 index 0000000000000000000000000000000000000000..ce4da1ab1ec81a9970b27272a4bba5c9b04870d3 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/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 = float2(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 = float2(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 = float2(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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/cracked_paint_surface_paint_bg_norm.jpg", ::tex::gamma_linear), texture_2d("./textures/cracked_paint_surface_chaotic_paint_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), vm_coord(float2(0.f), 0.f, float2(1.f), 0), (enable_rust_damage ? 1.f - float3(vm_tex_lookup(texture_2d("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/cracked_paint_surface_paint_bg_norm.jpg", ::tex::gamma_linear), texture_2d("./textures/cracked_paint_surface_chaotic_paint_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), vm_coord(float2(0.f), 0.f, float2(1.f), 0), (enable_rust_damage ? 1.f - float3(vm_tex_lookup(texture_2d("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/cracked_paint_surface_paint_bg_norm.jpg", ::tex::gamma_linear), texture_2d("./textures/cracked_paint_surface_chaotic_paint_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), vm_coord(float2(0.f), 0.f, float2(1.f), 0), (enable_rust_damage ? 1.f - float3(vm_tex_lookup(texture_2d("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/cracked_paint_surface_paint_bg_norm.jpg", ::tex::gamma_linear), texture_2d("./textures/cracked_paint_surface_chaotic_paint_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), vm_coord(float2(0.f), 0.f, float2(1.f), 0), (enable_rust_damage ? 1.f - float3(vm_tex_lookup(texture_2d("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/cracked_paint_surface_paint_bg_norm.jpg", ::tex::gamma_linear), texture_2d("./textures/cracked_paint_surface_chaotic_paint_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), vm_coord(float2(0.f), 0.f, float2(1.f), 0), (enable_rust_damage ? 1.f - float3(vm_tex_lookup(texture_2d("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/cracked_paint_surface_paint_bg_norm.jpg", ::tex::gamma_linear), texture_2d("./textures/cracked_paint_surface_chaotic_paint_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), vm_coord(float2(0.f), 0.f, float2(1.f), 0), (enable_rust_damage ? 1.f - float3(vm_tex_lookup(texture_2d("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/cracked_paint_surface_paint_bg_norm.jpg", ::tex::gamma_linear), texture_2d("./textures/cracked_paint_surface_chaotic_paint_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), vm_coord(float2(0.f), 0.f, float2(1.f), 0), (enable_rust_damage ? 1.f - float3(vm_tex_lookup(texture_2d("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/cracked_paint_surface_paint_bg_norm.jpg", ::tex::gamma_linear), texture_2d("./textures/cracked_paint_surface_chaotic_paint_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), vm_coord(float2(0.f), 0.f, float2(1.f), 0), (enable_rust_damage ? 1.f - float3(vm_tex_lookup(texture_2d("./textures/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("./textures/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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + // texture_rotate: 0.0f, + // texture_scale: float2(1.0f), + // uv_space_index: 0, + // roundcorners_enable: false, + // roundcorners_radius_mm: 0.5f, + // roundcorners_across_materials: false +// ); + diff --git a/code/third_party/vMaterials_2/Metal/Steel_Painted_Cracked.mdl b/code/third_party/vMaterials_2/Metal/Steel_Painted_Cracked.mdl new file mode 100644 index 0000000000000000000000000000000000000000..c7e5284d5ad45b8d0d2d2289cb4fe735567f29b7 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Steel_Painted_Cracked.mdl @@ -0,0 +1,804 @@ +/****************************************************************************** + * 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, optional cracked paint effect on the surface as well as 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 = float2(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_Cracked( + 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"), + ::anno::ui_order(0) + ]], + color paint_color = color(0.603827f) [[ + ::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.28f [[ + ::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.34f [[ + ::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.1f [[ + ::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.1f [[ + ::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.35f [[ + ::anno::description("Specifies the strength of the bump that shows the paint strokes."), + ::anno::display_name("Paint Stroke Bump 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.42f [[ + ::anno::description("Specifies the strength of the bump that shows signs of being aleady overpainted."), + ::anno::display_name("Overpaint Bump 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 = true [[ + ::anno::description("Enables the damaged rust spots."), + ::anno::display_name("Enable Rust Damage"), + ::anno::in_group("Appearance", "Damage"), + ::anno::ui_order(8) + ]], + float cracks_bump_strength = 0.4f [[ + ::anno::description("Adjusts how much the cracked paint bumps the surface."), + ::anno::display_name("Cracks Bump Strength"), + ::anno::in_group("Appearance", "Damage"), + ::anno::soft_range(0.f, 1.f), + ::anno::hard_range(0.f, 2.f), + ::anno::ui_order(9) + ]], + float cracks_darkness = 0.58f [[ + ::anno::description("Darkens the cracks"), + ::anno::display_name("Cracks Darkness"), + ::anno::in_group("Appearance", "Damage"), + ::anno::soft_range(0.f, 1.f), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(10) + ]], + 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(11) + ]], + float2 texture_translate = float2(0.f) [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform"), + ::anno::ui_order(12) + ]], + 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(13) + ]], + float2 texture_scale = float2(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(14) + ]], + 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(15) + ]], + uniform bool roundcorners_enable = true [[ + ::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(16) + ]], + 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(17) + ]], + 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(18) + ]]) +[[ + ::anno::display_name("Steel Painted - White Cracked"), + ::anno::author("Nvidia vMaterials"), + ::anno::description(DESCRIPTION), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Steel_Painted_Cracked.Steel_Painted_Cracked.png"), + ::anno::key_words(string[]("steel", "metal", "paint", "coated", "construction", "urban", "architecture", "naval", "automotive", "multimaterial", "interior", "exterior", "old", "cracked", "white", "neutral", "warm")) +]] + = + let { + bool tmp0 = false; + float2 tex_rescale = texture_scale * 0.5f; + + material_surface tmp1(::df::weighted_layer(dirt_weight * float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, 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(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), 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(enable_rust_damage ? nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(paint_color, color(0.0843759999f, 0.0304700006f, 0.00322300009f), ::base::color_layer_blend, 1.f - ::math::pow(1.f - float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).z, 4.48000002f), true).tint, ::math::pow(vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_bare_metal_albedo.jpg", ::tex::gamma_srgb), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint, 0.569999993f), ::base::color_layer_blend, histogram_scan_big(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.0500000007f, 0.0700000003f), true).tint : 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("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint).z, 0.439999998f), true).tint, color(::math::pow(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).y, 1.57999992f)), ::base::color_layer_multiply, cracks_darkness, true) : nvidia::core_definitions::blend_colors(enable_rust_damage ? nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(paint_color, color(0.0843759999f, 0.0304700006f, 0.00322300009f), ::base::color_layer_blend, 1.f - ::math::pow(1.f - float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).z, 4.48000002f), true).tint, ::math::pow(vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_bare_metal_albedo.jpg", ::tex::gamma_srgb), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint, 0.569999993f), ::base::color_layer_blend, histogram_scan_big(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.0500000007f, 0.0700000003f), true).tint : 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("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, 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(screen(enable_rust_damage ? screen(::math::lerp(histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, 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)) + float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint).x * dirt_weight, histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, 1.f, 0.359999985f), histogram_scan_big(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.0500000007f, 0.0700000003f)), ::math::pow(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).z, 0.459999979f), 0.f) : histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, 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)) + float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint).x * dirt_weight, ::math::pow(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint).z, 0.439999998f), wash_weight) * screen(enable_rust_damage ? screen(::math::lerp(histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, 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)) + float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint).x * dirt_weight, histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, 1.f, 0.359999985f), histogram_scan_big(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.0500000007f, 0.0700000003f)), ::math::pow(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).z, 0.459999979f), 0.f) : histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, 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)) + float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint).x * dirt_weight, ::math::pow(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint).z, 0.439999998f), wash_weight), screen(enable_rust_damage ? screen(::math::lerp(histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, 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)) + float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint).x * dirt_weight, histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, 1.f, 0.359999985f), histogram_scan_big(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.0500000007f, 0.0700000003f)), ::math::pow(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).z, 0.459999979f), 0.f) : histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, 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)) + float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint).x * dirt_weight, ::math::pow(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint).z, 0.439999998f), wash_weight) * screen(enable_rust_damage ? screen(::math::lerp(histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, 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)) + float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint).x * dirt_weight, histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, 1.f, 0.359999985f), histogram_scan_big(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.0500000007f, 0.0700000003f)), ::math::pow(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).z, 0.459999979f), 0.f) : histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, 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)) + float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint).x * dirt_weight, ::math::pow(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint).z, 0.439999998f), wash_weight), color(1.f, 0.810754001f, 0.730461001f), 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(screen(enable_rust_damage ? screen(::math::lerp(histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, 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)) + float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint).x * dirt_weight, histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, 1.f, 0.359999985f), histogram_scan_big(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.0500000007f, 0.0700000003f)), ::math::pow(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).z, 0.459999979f), 0.f) : histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, 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)) + float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint).x * dirt_weight, ::math::pow(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint).z, 0.439999998f), wash_weight) * screen(enable_rust_damage ? screen(::math::lerp(histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, 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)) + float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint).x * dirt_weight, histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, 1.f, 0.359999985f), histogram_scan_big(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.0500000007f, 0.0700000003f)), ::math::pow(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).z, 0.459999979f), 0.f) : histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, 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)) + float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint).x * dirt_weight, ::math::pow(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint).z, 0.439999998f), wash_weight), screen(enable_rust_damage ? screen(::math::lerp(histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, 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)) + float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint).x * dirt_weight, histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, 1.f, 0.359999985f), histogram_scan_big(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.0500000007f, 0.0700000003f)), ::math::pow(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).z, 0.459999979f), 0.f) : histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, 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)) + float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint).x * dirt_weight, ::math::pow(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint).z, 0.439999998f), wash_weight) * screen(enable_rust_damage ? screen(::math::lerp(histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, 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)) + float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint).x * dirt_weight, histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint).y, 1.f, 0.359999985f), histogram_scan_big(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.0500000007f, 0.0700000003f)), ::math::pow(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).z, 0.459999979f), 0.f) : histogram_range(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, 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)) + float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint).x * dirt_weight, ::math::pow(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint).z, 0.439999998f), wash_weight), color(1.f, 0.810754001f, 0.730461001f), 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(enable_rust_damage ? nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(paint_color, color(0.0843759999f, 0.0304700006f, 0.00322300009f), ::base::color_layer_blend, 1.f - ::math::pow(1.f - float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).z, 4.48000002f), true).tint, ::math::pow(vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_bare_metal_albedo.jpg", ::tex::gamma_srgb), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint, 0.569999993f), ::base::color_layer_blend, histogram_scan_big(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.0500000007f, 0.0700000003f), true).tint : 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("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint).z, 0.439999998f), true).tint, color(::math::pow(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).y, 1.57999992f)), ::base::color_layer_multiply, cracks_darkness, true) : nvidia::core_definitions::blend_colors(enable_rust_damage ? nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(paint_color, color(0.0843759999f, 0.0304700006f, 0.00322300009f), ::base::color_layer_blend, 1.f - ::math::pow(1.f - float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).z, 4.48000002f), true).tint, ::math::pow(vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_bare_metal_albedo.jpg", ::tex::gamma_srgb), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint, 0.569999993f), ::base::color_layer_blend, histogram_scan_big(float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.0500000007f, 0.0700000003f), true).tint : 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("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.151999995f, 0.635999978f, 0.0820000023f), 0.439999998f, false, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_met_damage_multi_R_dirt_G_nrm_B_wash.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), mono_a, float4(1.f)).tint).z, 0.439999998f), true)).tint, 0.f), bsdf(), enable_rust_damage ? ::math::lerp(vm_tex_normal_lookup(texture_2d("./textures/cracked_paint_surface_met_norm.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale * 0.5f)), 0.930000007f), add_detail_normal(infinite_tiling ? vm_tex_infinite_normal(texture_2d("./textures/cracked_paint_surface_crackedpaint_norm.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.5f), 0.439999998f, cracks_bump_strength * 1.70000005f) : vm_tex_normal_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_norm.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), cracks_bump_strength * 1.70000005f), infinite_tiling ? add_detail_normal(vm_tex_infinite_normal(texture_2d("./textures/cracked_paint_surface_paint_bg_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.5f), 0.439999998f, histogram_scan_big(1.f - float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.399999976f, 0.649999976f) * uneven_normal_strength), vm_tex_infinite_normal(texture_2d("./textures/cracked_paint_surface_chaotic_paint_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.5f), 0.439999998f, histogram_scan_big(1.f - float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.399999976f, 0.649999976f) * paint_stroke_normal_strength)) : vm_tex_normal_lookup_2x(texture_2d("./textures/cracked_paint_surface_paint_bg_norm.jpg", ::tex::gamma_linear), texture_2d("./textures/cracked_paint_surface_chaotic_paint_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), vm_coord(float2(0.f), 0.f, float2(1.f), 0), histogram_scan_big(1.f - float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.399999976f, 0.649999976f) * uneven_normal_strength, histogram_scan_big(1.f - float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.399999976f, 0.649999976f) * paint_stroke_normal_strength, false)), histogram_scan_big(1.f - float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.399999976f, 0.649999976f)) : infinite_tiling ? add_detail_normal(vm_tex_infinite_normal(texture_2d("./textures/cracked_paint_surface_paint_bg_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.5f), 0.439999998f, histogram_scan_big(1.f - float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.399999976f, 0.649999976f) * uneven_normal_strength), vm_tex_infinite_normal(texture_2d("./textures/cracked_paint_surface_chaotic_paint_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.5f), 0.439999998f, histogram_scan_big(1.f - float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.399999976f, 0.649999976f) * paint_stroke_normal_strength)) : vm_tex_normal_lookup_2x(texture_2d("./textures/cracked_paint_surface_paint_bg_norm.jpg", ::tex::gamma_linear), texture_2d("./textures/cracked_paint_surface_chaotic_paint_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), vm_coord(float2(0.f), 0.f, float2(1.f), 0), histogram_scan_big(1.f - float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.399999976f, 0.649999976f) * uneven_normal_strength, histogram_scan_big(1.f - float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.399999976f, 0.649999976f) * paint_stroke_normal_strength, false)), enable_rust_damage ? ::math::lerp(vm_tex_normal_lookup(texture_2d("./textures/cracked_paint_surface_met_norm.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale * 0.5f)), 0.930000007f), add_detail_normal(infinite_tiling ? vm_tex_infinite_normal(texture_2d("./textures/cracked_paint_surface_crackedpaint_norm.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.5f), 0.439999998f, cracks_bump_strength * 1.70000005f) : vm_tex_normal_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_norm.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), cracks_bump_strength * 1.70000005f), infinite_tiling ? add_detail_normal(vm_tex_infinite_normal(texture_2d("./textures/cracked_paint_surface_paint_bg_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.5f), 0.439999998f, histogram_scan_big(1.f - float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.399999976f, 0.649999976f) * uneven_normal_strength), vm_tex_infinite_normal(texture_2d("./textures/cracked_paint_surface_chaotic_paint_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.5f), 0.439999998f, histogram_scan_big(1.f - float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.399999976f, 0.649999976f) * paint_stroke_normal_strength)) : vm_tex_normal_lookup_2x(texture_2d("./textures/cracked_paint_surface_paint_bg_norm.jpg", ::tex::gamma_linear), texture_2d("./textures/cracked_paint_surface_chaotic_paint_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), vm_coord(float2(0.f), 0.f, float2(1.f), 0), histogram_scan_big(1.f - float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.399999976f, 0.649999976f) * uneven_normal_strength, histogram_scan_big(1.f - float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.399999976f, 0.649999976f) * paint_stroke_normal_strength, false)), histogram_scan_big(1.f - float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.399999976f, 0.649999976f)) : infinite_tiling ? add_detail_normal(vm_tex_infinite_normal(texture_2d("./textures/cracked_paint_surface_paint_bg_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.5f), 0.439999998f, histogram_scan_big(1.f - float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.399999976f, 0.649999976f) * uneven_normal_strength), vm_tex_infinite_normal(texture_2d("./textures/cracked_paint_surface_chaotic_paint_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.5f), 0.439999998f, histogram_scan_big(1.f - float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.399999976f, 0.649999976f) * paint_stroke_normal_strength)) : vm_tex_normal_lookup_2x(texture_2d("./textures/cracked_paint_surface_paint_bg_norm.jpg", ::tex::gamma_linear), texture_2d("./textures/cracked_paint_surface_chaotic_paint_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), vm_coord(float2(0.f), 0.f, float2(1.f), 0), histogram_scan_big(1.f - float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.399999976f, 0.649999976f) * uneven_normal_strength, histogram_scan_big(1.f - float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.399999976f, 0.649999976f) * paint_stroke_normal_strength, false)), enable_rust_damage ? ::math::lerp(vm_tex_normal_lookup(texture_2d("./textures/cracked_paint_surface_met_norm.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale * 0.5f)), 0.930000007f), add_detail_normal(infinite_tiling ? vm_tex_infinite_normal(texture_2d("./textures/cracked_paint_surface_crackedpaint_norm.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.5f), 0.439999998f, cracks_bump_strength * 1.70000005f) : vm_tex_normal_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_norm.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), cracks_bump_strength * 1.70000005f), infinite_tiling ? add_detail_normal(vm_tex_infinite_normal(texture_2d("./textures/cracked_paint_surface_paint_bg_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.5f), 0.439999998f, histogram_scan_big(1.f - float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.399999976f, 0.649999976f) * uneven_normal_strength), vm_tex_infinite_normal(texture_2d("./textures/cracked_paint_surface_chaotic_paint_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.5f), 0.439999998f, histogram_scan_big(1.f - float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.399999976f, 0.649999976f) * paint_stroke_normal_strength)) : vm_tex_normal_lookup_2x(texture_2d("./textures/cracked_paint_surface_paint_bg_norm.jpg", ::tex::gamma_linear), texture_2d("./textures/cracked_paint_surface_chaotic_paint_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), vm_coord(float2(0.f), 0.f, float2(1.f), 0), histogram_scan_big(1.f - float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.399999976f, 0.649999976f) * uneven_normal_strength, histogram_scan_big(1.f - float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.399999976f, 0.649999976f) * paint_stroke_normal_strength, false)), histogram_scan_big(1.f - float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.399999976f, 0.649999976f)) : infinite_tiling ? add_detail_normal(vm_tex_infinite_normal(texture_2d("./textures/cracked_paint_surface_paint_bg_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.5f), 0.439999998f, histogram_scan_big(1.f - float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.399999976f, 0.649999976f) * uneven_normal_strength), vm_tex_infinite_normal(texture_2d("./textures/cracked_paint_surface_chaotic_paint_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.5f), 0.439999998f, histogram_scan_big(1.f - float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.399999976f, 0.649999976f) * paint_stroke_normal_strength)) : vm_tex_normal_lookup_2x(texture_2d("./textures/cracked_paint_surface_paint_bg_norm.jpg", ::tex::gamma_linear), texture_2d("./textures/cracked_paint_surface_chaotic_paint_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), vm_coord(float2(0.f), 0.f, float2(1.f), 0), histogram_scan_big(1.f - float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.399999976f, 0.649999976f) * uneven_normal_strength, histogram_scan_big(1.f - float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.399999976f, 0.649999976f) * paint_stroke_normal_strength, false)), enable_rust_damage ? ::math::lerp(vm_tex_normal_lookup(texture_2d("./textures/cracked_paint_surface_met_norm.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale * 0.5f)), 0.930000007f), add_detail_normal(infinite_tiling ? vm_tex_infinite_normal(texture_2d("./textures/cracked_paint_surface_crackedpaint_norm.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.5f), 0.439999998f, cracks_bump_strength * 1.70000005f) : vm_tex_normal_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_norm.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), cracks_bump_strength * 1.70000005f), infinite_tiling ? add_detail_normal(vm_tex_infinite_normal(texture_2d("./textures/cracked_paint_surface_paint_bg_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.5f), 0.439999998f, histogram_scan_big(1.f - float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.399999976f, 0.649999976f) * uneven_normal_strength), vm_tex_infinite_normal(texture_2d("./textures/cracked_paint_surface_chaotic_paint_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.5f), 0.439999998f, histogram_scan_big(1.f - float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.399999976f, 0.649999976f) * paint_stroke_normal_strength)) : vm_tex_normal_lookup_2x(texture_2d("./textures/cracked_paint_surface_paint_bg_norm.jpg", ::tex::gamma_linear), texture_2d("./textures/cracked_paint_surface_chaotic_paint_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), vm_coord(float2(0.f), 0.f, float2(1.f), 0), histogram_scan_big(1.f - float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.399999976f, 0.649999976f) * uneven_normal_strength, histogram_scan_big(1.f - float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.399999976f, 0.649999976f) * paint_stroke_normal_strength, false)), histogram_scan_big(1.f - float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.399999976f, 0.649999976f)) : infinite_tiling ? add_detail_normal(vm_tex_infinite_normal(texture_2d("./textures/cracked_paint_surface_paint_bg_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.5f), 0.439999998f, histogram_scan_big(1.f - float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.399999976f, 0.649999976f) * uneven_normal_strength), vm_tex_infinite_normal(texture_2d("./textures/cracked_paint_surface_chaotic_paint_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float3(0.5f), 0.439999998f, histogram_scan_big(1.f - float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.399999976f, 0.649999976f) * paint_stroke_normal_strength)) : vm_tex_normal_lookup_2x(texture_2d("./textures/cracked_paint_surface_paint_bg_norm.jpg", ::tex::gamma_linear), texture_2d("./textures/cracked_paint_surface_chaotic_paint_norm.jpg", ::tex::gamma_linear), vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), vm_coord(float2(0.f), 0.f, float2(1.f), 0), histogram_scan_big(1.f - float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.399999976f, 0.649999976f) * uneven_normal_strength, histogram_scan_big(1.f - float3(infinite_tiling ? color(vm_tex_infinite(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), float3(0.0439999998f, 0.898000002f, 0.0109999999f), 0.439999998f, true, 2.20000005f)) : vm_tex_lookup(texture_2d("./textures/cracked_paint_surface_crackedpaint_multi.jpg", ::tex::gamma_linear), vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, tex_rescale, uv_space_index), float2(damages_scale)), mono_a, float4(1.f)).tint).x, 0.399999976f, 0.649999976f) * 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()); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + +export material Steel_Painted_Turquise_Cracked_Shiny(*) +[[ + ::anno::display_name("Steel Painted - Turquoise Cracked Shiny"), + ::anno::author("Nvidia vMaterials"), + ::anno::description(DESCRIPTION), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Steel_Painted_Cracked.Steel_Painted_Turquise_Cracked_Shiny.png"), + ::anno::key_words(string[]("steel", "metal", "paint", "coated", "construction", "urban", "architecture", "naval", "automotive", "multimaterial", "exterior", "worn", "old", "cracked", "bumped", "turquoise", "light", "cool")) +]] = Steel_Painted_Cracked( + infinite_tiling: false, + paint_color: color(0.031896f, 0.356400f, 0.514918f), + paint_roughness: 0.18f, + paint_roughness_variation: 0.69f, + dirt_weight: 0.1f, + wash_weight: 0.1f, + paint_stroke_normal_strength: 0.35f, + uneven_normal_strength: 0.42f, + enable_rust_damage: true, + cracks_bump_strength: 1.0f, + cracks_darkness: 0.26f, + damages_scale: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + + +export material Steel_Painted_Light_Blue_Cracked_Matte(*) +[[ + ::anno::display_name("Steel Painted - Light Blue Cracked 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_Cracked.Steel_Painted_Light_Blue_Cracked_Matte.png"), + ::anno::key_words(string[]("steel", "metal", "paint", "coated", "construction", "urban", "architecture", "naval", "automotive", "multimaterial", "exterior", "worn", "old", "bleached", "cracked", "bumped", "blue", "light", "cool")) +]] = Steel_Painted_Cracked( + infinite_tiling: false, + paint_color: color(0.031896f, 0.356400f, 0.514918f), + paint_roughness: 0.2f, + paint_roughness_variation: 0.69f, + dirt_weight: 0.1f, + wash_weight: 0.1f, + paint_stroke_normal_strength: 0.35f, + uneven_normal_strength: 0.42f, + enable_rust_damage: true, + cracks_bump_strength: 1.0f, + cracks_darkness: 0.26f, + damages_scale: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + +export material Steel_Painted_Russet_Cracked_Dirty(*) +[[ + ::anno::display_name("Steel Painted - Russet Cracked 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_Cracked.Steel_Painted_Russet_Cracked_Dirty.png"), + ::anno::key_words(string[]("steel", "metal", "paint", "coated", "construction", "urban", "architecture", "naval", "automotive", "multimaterial", "exterior", "worn", "old", "dirty", "weathered", "cracked", "bumped", "russet", "red", "brown", "warm")) +]] = Steel_Painted_Cracked( + infinite_tiling: false, + paint_color: color(0.332452f, 0.035601f, 0.021219f), + paint_roughness: 0.31f, + paint_roughness_variation: 0.39f, + dirt_weight: 1.0f, + wash_weight: 0.1f, + paint_stroke_normal_strength: 0.39f, + uneven_normal_strength: 0.9f, + enable_rust_damage: true, + cracks_bump_strength: 1.0f, + cracks_darkness: 0.74f, + damages_scale: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + +export material Steel_Painted_Red_Cracked_Matte(*) +[[ + ::anno::display_name("Steel Painted - Red Cracked 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_Cracked.Steel_Painted_Red_Cracked_Matte.png"), + ::anno::key_words(string[]("steel", "metal", "paint", "coated", "construction", "urban", "architecture", "naval", "automotive", "multimaterial", "exterior", "worn", "old", "dirty", "matte", "weathered", "cracked", "bumped", "red", "saturated", "warm")) +]] = Steel_Painted_Cracked( + infinite_tiling: false, + paint_color: color(0.332452f, 0.035601f, 0.021219f), + paint_roughness: 0.42f, + paint_roughness_variation: 0.39f, + dirt_weight: 1.0f, + wash_weight: 0.1f, + paint_stroke_normal_strength: 0.39f, + uneven_normal_strength: 0.9f, + enable_rust_damage: true, + cracks_bump_strength: 1.0f, + cracks_darkness: 0.74f, + damages_scale: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + + + +export material Steel_Painted_Orange_Cracked_Worn(*) +[[ + ::anno::display_name("Steel Painted - Orange Cracked Worn"), + ::anno::author("Nvidia vMaterials"), + ::anno::description(DESCRIPTION), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Steel_Painted_Cracked.Steel_Painted_Orange_Cracked_Worn.png"), + ::anno::key_words(string[]("steel", "metal", "paint", "coated", "construction", "urban", "architecture", "naval", "automotive", "multimaterial", "exterior", "matte", "worn", "old", "dirty", "weathered", "cracked", "bumped", "orange", "saturated", "warm")) +]] = Steel_Painted_Cracked( + infinite_tiling: false, + paint_color: color(0.505f, 0.212f, 0.0303f), + paint_roughness: 0.49f, + paint_roughness_variation: 0.45f, + dirt_weight: 0.79f, + wash_weight: 0.65f, + paint_stroke_normal_strength: 0.9f, + uneven_normal_strength: 0.9f, + enable_rust_damage: true, + cracks_bump_strength: 1.0f, + cracks_darkness: 0.77f, + damages_scale: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + + +export material Steel_Painted_Army_Green_Cracked_Dirty(*) +[[ + ::anno::display_name("Steel Painted - Army Green Cracked 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_Cracked.Steel_Painted_Army_Green_Cracked_Dirty.png"), + ::anno::key_words(string[]("steel", "metal", "paint", "coated", "construction", "urban", "architecture", "naval", "automotive", "multimaterial", "exterior", "matte", "worn", "old", "dirty", "weathered", "cracked", "bumped", "army", "green", "cool")) +]] = Steel_Painted_Cracked( + infinite_tiling: false, + paint_color: color(0.122139f, 0.147027f, 0.021219f), + paint_roughness: 0.36f, + paint_roughness_variation: 0.86f, + dirt_weight: 1.0f, + wash_weight: 0.65f, + paint_stroke_normal_strength: 0.9f, + uneven_normal_strength: 0.9f, + enable_rust_damage: true, + cracks_bump_strength: 1.0f, + cracks_darkness: 0.77f, + damages_scale: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); + + +export material Steel_Painted_Yellow_Cracked_Bleached(*) +[[ + ::anno::display_name("Steel Painted - Yellow Cracked Bleached"), + ::anno::author("Nvidia vMaterials"), + ::anno::description(DESCRIPTION), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Steel_Painted_Cracked.Steel_Painted_Yellow_Cracked_Bleached.png"), + ::anno::key_words(string[]("steel", "metal", "paint", "coated", "construction", "urban", "architecture", "naval", "automotive", "multimaterial", "exterior", "matte", "worn", "old", "dirty", "weathered", "cracked", "bumped", "yellow", "warm", "light")) +]] = Steel_Painted_Cracked( + infinite_tiling: false, + paint_color: color(0.854993f, 0.665387f, 0.162029f), + paint_roughness: 0.36f, + paint_roughness_variation: 0.86f, + dirt_weight: 1.0f, + wash_weight: 0.65f, + paint_stroke_normal_strength: 0.9f, + uneven_normal_strength: 0.9f, + enable_rust_damage: true, + cracks_bump_strength: 1.0f, + cracks_darkness: 0.77f, + damages_scale: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + roundcorners_enable: false, + roundcorners_radius_mm: 0.5f, + roundcorners_across_materials: false +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Metal/Titanium.mdl b/code/third_party/vMaterials_2/Metal/Titanium.mdl new file mode 100644 index 0000000000000000000000000000000000000000..245c0c6a081ada375c33451557aa982d0f04119b --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Titanium.mdl @@ -0,0 +1,378 @@ +/****************************************************************************** + * 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 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 Titanium( + 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 = 0.03f [[ + ::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::description("When enabled the round corner effect is applied across different materials."), + ::anno::in_group("Round Corners") + ]], + uniform float2 texture_translate = float2(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 = float2(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("Titanium"), + ::anno::description("Pure metal material with optional smudges."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Titanium.Titanium.png"), + ::anno::key_words(string[]("metal", "pure", "smudged", "design", "reflective", "infinite tiling", "smooth", "conductor", "new", "polished", "titanium")) +]] + = + let { + + color normal_reflectivity = color(0.618264052974f, 0.579396264956f, 0.542545225681f); // Titanium + 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(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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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, across_materials, 1.f) : ::state::normal()); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + +export material Titanium_Polished(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Titanium Polished"), + ::anno::description("Pure metal material with optional smudges."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Titanium.Titanium_Polished.png"), + ::anno::key_words(string[]("metal", "pure", "design", "reflective", "infinite tiling", "smooth", "conductor", "new", "polished", "titanium")) +]] += Titanium( + 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 Titanium_Glossy_Fingerprints(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Titanium Glossy Fingerprints"), + ::anno::description("Pure metal material with optional smudges."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Titanium.Titanium_Glossy_Fingerprints.png"), + ::anno::key_words(string[]("metal", "pure", "design", "smudged", "reflective", "infinite tiling", "smooth", "conductor", "new", "polished", "titanium")) +]] += Titanium( + 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/code/third_party/vMaterials_2/Metal/Titanium_Brushed.mdl b/code/third_party/vMaterials_2/Metal/Titanium_Brushed.mdl new file mode 100644 index 0000000000000000000000000000000000000000..3b8040b11204e5f7247d5bafac62d6a14f9bb5b9 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Titanium_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 Titanium_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 = float2(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 = float2(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 Titanium - Strong Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Titanium_Brushed.Titanium_Brushed.png"), + ::anno::key_words(string[]("aec", "metal", "titanium", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] + = + let { + color normal_reflectivity = color(0.618264052974f, 0.579396264956f, 0.542545225681f); // Titanium + 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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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 Titanium_Brushed_Light_Brushing(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Brushed Titanium - Light Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Titanium_Brushed.Titanium_Brushed_Light_Brushing.png"), + ::anno::key_words(string[]("aec", "metal", "titanium", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] + = Titanium_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + +export material Titanium_Brushed_Medium_Light_Brushing(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Brushed Titanium - Medium Light Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Titanium_Brushed.Titanium_Brushed_Medium_Light_Brushing.png"), + ::anno::key_words(string[]("aec", "metal", "titanium", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] += Titanium_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + +export material Titanium_Brushed_Medium_Brushing(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Brushed Titanium - Medium Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Titanium_Brushed.Titanium_Brushed_Medium_Brushing.png"), + ::anno::key_words(string[]("aec", "metal", "titanium", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] += Titanium_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Titanium_Brushed_Very_Strong_Brushing(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Brushed Titanium - Very Strong Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Titanium_Brushed.Titanium_Brushed_Very_Strong_Brushing.png"), + ::anno::key_words(string[]("aec", "metal", "titanium", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] += Titanium_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + + diff --git a/code/third_party/vMaterials_2/Metal/Titanium_Foil.mdl b/code/third_party/vMaterials_2/Metal/Titanium_Foil.mdl new file mode 100644 index 0000000000000000000000000000000000000000..39c063ab8deabab5dad33fc889b6e41f7408b320 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Titanium_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 Titanium_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 = float2(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 = float2(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("Titanium Foil - Slightly Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Titanium_Foil.Titanium_Foil.png"), + ::anno::key_words(string[]("design", "metal", "titanium", "foil", "smooth", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral")) +]] + = + let { + color normal_reflectivity = color(0.618264052974, 0.579396264956, 0.542545225681f); // Titanium + color grazing_reflectivity = color(0.99942f, 1.f, 1.f); + + texture_2d rough_ao_tex = texture_2d("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear); + texture_2d smudge_splotch_tex = texture_2d("./textures/foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear); + texture_2d norm_tex = texture_2d("./textures/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 Titanium_Foil_Smudged_Foil(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Titanium Foil - Smudgy Foil"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Titanium_Foil.Titanium_Foil_Smudged_Foil.png"), + ::anno::key_words(string[]("design", "metal", "titanium", "foil", "smooth", "unfinished", "decorative", "creative", "neutral")) +]] += Titanium_Foil( + infinite_tiling: true, + roughness: 0.15f, + roughness_variation: 0.84f, + smudges: 0.35f, + bump_strength: 0.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + +export material Titanium_Foil_Shiny_Wrinkled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Titanium Foil - Shiny Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Titanium_Foil.Titanium_Foil_Shiny_Wrinkled.png"), + ::anno::key_words(string[]("design", "metal", "titanium", "foil", "shiny", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral")) +]] += Titanium_Foil( + infinite_tiling: true, + roughness: 0.25f, + roughness_variation: 0.25f, + smudges: 0.75f, + bump_strength: 0.25f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + + +export material Titanium_Foil_Matte_Wrinkled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Titanium Foil - Matte Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Titanium_Foil.Titanium_Foil_Matte_Wrinkled.png"), + ::anno::key_words(string[]("design", "metal", "titanium", "foil", "matte", "smooth", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral", "gray")) +]] += Titanium_Foil( + infinite_tiling: true, + roughness: 0.65f, + roughness_variation: 1.0f, + smudges: 0.4f, + bump_strength: 0.15f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + +export material Titanium_Foil_Heavy_Glossy_Wrinkles(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Titanium Foil - Heavy Glossy Wrinkles"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Titanium_Foil.Titanium_Foil_Heavy_Glossy_Wrinkles.png"), + ::anno::key_words(string[]("design", "metal", "titanium", "foil", "smooth", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral")) +]] += Titanium_Foil( + infinite_tiling: true, + roughness: 0.164f, + roughness_variation: 0.021f, + smudges: 0.143f, + bump_strength: 0.99f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + +export material Titanium_Foil_Heavy_Matte_Wrinkled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Titanium Foil - Heavy Matte Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Titanium_Foil.Titanium_Foil_Heavy_Matte_Wrinkled.png"), + ::anno::key_words(string[]("design", "metal", "titanium", "foil", "matte", "bumped", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral", "gray")) +]] += Titanium_Foil( + infinite_tiling: true, + roughness: 0.889f, + roughness_variation: 0.018f, + smudges: 0.246f, + bump_strength: 0.732f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + + + + + + + + + + + + diff --git a/code/third_party/vMaterials_2/Metal/Titanium_Hammered.mdl b/code/third_party/vMaterials_2/Metal/Titanium_Hammered.mdl new file mode 100644 index 0000000000000000000000000000000000000000..0a9bf5c580f96790916c45b36ef5d96f7dd27405 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Titanium_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 Titanium_Hammered( + color metal_color = color(0.5f, 0.47f, 0.442f) [[ + ::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 = float2(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 = float2(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 Titanium - Dark Pits"), + ::anno::author("NVIDIA vMaterials"), + ::anno::in_group("Metal"), + ::anno::key_words(string[]("metal", "titanium", "blackened", "hammered", "design", "classic", "architecture", "pattern", "reflective", "rough", "bumped", "conductor")), + ::anno::thumbnail("./.thumbs/Titanium_Hammered.Titanium_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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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 Titanium_Hammered_Shiny(*) +[[ + ::anno::display_name("Hammered Titanium - Shiny"), + ::anno::author("NVIDIA vMaterials"), + ::anno::in_group("Metal"), + ::anno::key_words(string[]("metal", "titanium", "hammered", "design", "classic", "architecture", "pattern", "reflective", "rough", "bumped", "conductor", "shiny")), + ::anno::thumbnail("./.thumbs/Titanium_Hammered.Titanium_Hammered_Shiny.png"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT) +]] + = Titanium_Hammered( + metal_color: color(0.5f, 0.47f, 0.442f), + 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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + +export material Titanium_Hammered_Dull(*) +[[ + ::anno::display_name("Hammered Titanium - Dull"), + ::anno::author("NVIDIA vMaterials"), + ::anno::in_group("Metal"), + ::anno::key_words(string[]("metal", "titanium", "hammered", "design", "classic", "architecture", "pattern", "reflective", "rough", "bumped", "conductor", "matte", "dull")), + ::anno::thumbnail("./.thumbs/Titanium_Hammered.Titanium_Hammered_Dull.png"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT) +]] + = Titanium_Hammered( + metal_color: color(0.5f, 0.47f, 0.442f), + 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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Metal/Titanium_Knurling.mdl b/code/third_party/vMaterials_2/Metal/Titanium_Knurling.mdl new file mode 100644 index 0000000000000000000000000000000000000000..31667d472b110fdfdc9a410120ac17eab81c304b --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Titanium_Knurling.mdl @@ -0,0 +1,359 @@ +/****************************************************************************** + * 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 ::df::*; +import ::tex::*; +import ::math::*; +import ::base::*; +import ::state::*; +import ::anno::*; +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 = "Metal with a diamond knurling finish"; + +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; + //TODO: at least also handle sign of z? + //TODO: handle tangent becoming 0 + + + 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)); +} + +export material Titanium_Knurling( + //Appearance + float brightness = float(0.7f) [[ + ::anno::description("Adjusts the brightness of the material."), + ::anno::display_name("Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.0f, 1.0f) + ]], + float roughness = float(0.5f) [[ + ::anno::description("Higher values lead to a rougher appearance of the material."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.0f, 1.0f) + ]], + float grooves_dirt = float(0.4f) [[ + ::anno::description("Adds dirt in the grooves of the knurling pattern."), + ::anno::display_name("Grooves Dirt"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.0f, 1.0f) + ]], + uniform float bump_strength = float(0.8f) [[ + ::anno::description("Adds dirt in the grooves of the knurling pattern."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.0f, 1.0f) + ]], + + // Round Corners + 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("Sets the radius of the round corners in millimeters."), + ::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") + ]], + //Transform + float2 texture_translate = float2(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"), + ::anno::soft_range(0.f, 360.f) + ]], + float2 texture_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(0.35f, .35f)), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + + // Advanced + uniform int uv_space_index = 0 [[ + ::anno::description("Uses the selected UV space index."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced"), + ::anno::soft_range(0, 4) + ]] +) +[[ + ::anno::display_name("Metal Knurling Titanium"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Titanium_Knurling.Titanium_Knurling.png"), + ::anno::key_words(string[]("metal", "titanium", "knurled", "knurling", "pattern", "design", "bumped")), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials") +]] += let +{ + color metal_tint = color(0.618264052974f, 0.579396264956f, 0.542545225681f); // Titanium + + // Texture setup + texture_2d normal_tex = texture_2d("./textures/metal_knurling_norm.jpg", ::tex::gamma_linear); + texture_2d multi_heights_tex = texture_2d("./textures/metal_knurling_multi_heights.jpg", ::tex::gamma_linear); + texture_2d diff_rough_grunge_tex = texture_2d("./textures/metal_knurling_multi_R_diff_G_rough_B_grunge.jpg", ::tex::gamma_linear); + + // Coordinate setup + ::base::texture_coordinate_info uvw = vmat_transform( + translation: texture_translate, + rotation: texture_rotate, + scaling: texture_scale, + system: ::base::texture_coordinate_uvw, + uv_space: uv_space_index + ); + + // ---------- Diff Rough Grunge Lookup ---------- + + float3 diff_rough_grunge_lookup = float3( + ::base::file_texture( + texture: diff_rough_grunge_tex, + uvw: uvw, + mono_source: ::base::mono_average + ).tint ); + + float3 multi_height_lookup = float3( + ::base::file_texture( + texture: multi_heights_tex, + uvw: uvw, + mono_source: ::base::mono_average + ).tint ); + + float3 norm = ::base::tangent_space_normal_texture( + texture: normal_tex, + factor: bump_strength, + uvw: uvw + ); + + + float remap_rough = histogram_range( + input: diff_rough_grunge_lookup.y, + range: 1.0f, + position: 0.234f + ); + + + float roughness_mapped = remap_rough + (roughness * multi_height_lookup.y); + + float remapped_diff = histogram_range( + input: diff_rough_grunge_lookup.x, + range: 1.0f, + position: (brightness * 0.4f) + 0.4f + ); + + float diff_contribution = ::math::pow(remapped_diff - ((grooves_dirt * 0.5) * multi_height_lookup.x * diff_rough_grunge_lookup.z), 2.67f); + + bsdf ggx_smith_bumped = ::df::weighted_layer( + layer: ::df::microfacet_ggx_smith_bsdf( + roughness_u: roughness_mapped * roughness_mapped, + roughness_v: roughness_mapped * roughness_mapped, + tint: color(diff_contribution), + mode: ::df::scatter_reflect + ), + base: bsdf(), + weight: 1.0f, + normal: norm + ); + + bsdf diff_bsdf = ::df::diffuse_reflection_bsdf( + tint: color(diff_contribution) + ); + + + bsdf final_bsdf = ::df::weighted_layer( + weight: 1.0f - (diff_rough_grunge_lookup.z * multi_height_lookup.x * grooves_dirt), + layer: ::df::directional_factor( + normal_tint: metal_tint, + grazing_tint: color(1.0f), + base: ggx_smith_bumped + ), + base: diff_bsdf + ); + + + // Round Corners + float3 round_normal = enable_round_corners ? + ::state::rounded_corner_normal( + radius: roundcorner_radius * 0.001, + across_materials: across_materials + ) : ::state::normal(); +} +in material ( + + surface: material_surface( + scattering: final_bsdf + ), + geometry: material_geometry( + normal: round_normal + ) +); + + +export material Titanium_Knurling_Worn(*) +[[ + ::anno::display_name("Metal Knurling - Titanium Worn"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Titanium_Knurling.Titanium_Knurling_Worn.png"), + ::anno::key_words(string[]("metal", "titanium", "knurled", "pattern", "knurling", "design", "bumped", "worn")), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials") +]] = Titanium_Knurling( + brightness: 0.4f, + roughness: 1.0f, + grooves_dirt: 1.0f, + bump_strength: 0.8f, + + enable_round_corners: false, + roundcorner_radius: 1.2f, + across_materials: false, + + texture_translate: float2(0.0f), + texture_rotate: 0.f, + texture_scale: float2(1.0f), + + uv_space_index: 0 +); + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/code/third_party/vMaterials_2/Metal/Titanium_Scratched.mdl b/code/third_party/vMaterials_2/Metal/Titanium_Scratched.mdl new file mode 100644 index 0000000000000000000000000000000000000000..552bed505831b1ce47f1ba0ff0a4c36b4474b59c --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/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 = float2(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 = float2(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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); diff --git a/code/third_party/vMaterials_2/Metal/Titanium_Sheet.mdl b/code/third_party/vMaterials_2/Metal/Titanium_Sheet.mdl new file mode 100644 index 0000000000000000000000000000000000000000..2c4a66ffd28c244dad3ca1cdad00977cc86ac2c0 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Titanium_Sheet.mdl @@ -0,0 +1,1341 @@ +/****************************************************************************** + * 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 titanium 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) + float2(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 Titanium_Sheet( + 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::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::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 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 = float2(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 = float2(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 Titanium - New Clean"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Titanium_Sheet.Titanium_Sheet.png"), + ::anno::key_words(string[]("metal", "sheet", "titanium", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "neutral")) +]] + = + let { + color normal_reflectivity = color(0.618264052974f, 0.579396264956f, 0.542545225681f); // Titanium + 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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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 Titanium_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 = float2(.5f, .5f) + [[ + ::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) + ]], + + + +// Titanium 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::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::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 = float2(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 = float2(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("Titanium Sheet - Circular Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Titanium_Sheet.Titanium_Sheet_Punched.png"), + ::anno::key_words(string[]("metal", "sheet", "titanium", "decorative", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "punched", "punching", "circular", "gray", "neutral")) +]] = let +{ + material base_mat = Titanium_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, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + enable_round_corners: enable_round_corners, + roundcorner_radius: roundcorner_radius, + across_materials: across_materials + ); + texture_2d punching_cutout = texture_2d("./textures/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 + ) +); + +// ------------------------ Titanium Sheet Presets ------------------------ +export material Titanium_Sheet_Soft_Splotches(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Titanium - Soft Splotches"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Titanium_Sheet.Titanium_Sheet_Soft_Splotches.png"), + ::anno::key_words(string[]("metal", "sheet", "titanium", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "neutral", "gray")) +]] += Titanium_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + + +export material Titanium_Sheet_Matte_Imperfections(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Titanium - Matte Imperfections"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Titanium_Sheet.Titanium_Sheet_Matte_Imperfections.png"), + ::anno::key_words(string[]("metal", "sheet", "titanium", "imperfections", "new", "matte", "unfinished", "reflective", "design", "infinite tiling", "neutral")) +]]= Titanium_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + + +export material Titanium_Sheet_Glossy_Imperfections(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Titanium - Glossy Imperfections"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Titanium_Sheet.Titanium_Sheet_Glossy_Imperfections.png"), + ::anno::key_words(string[]("metal", "sheet", "titanium", "imperfections", "new", "glossy", "unfinished", "reflective", "design", "infinite tiling", "neutral")) +]] += Titanium_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + + +export material Titanium_Sheet_Splotchy_Streaks(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Titanium - Splotchy Streaks"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Titanium_Sheet.Titanium_Sheet_Splotchy_Streaks.png"), + ::anno::key_words(string[]("metal", "sheet", "titanium", "imperfections", "new", "glossy", "unfinished", "reflective", "design", "infinite tiling", "neutral")) +]]= Titanium_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + +export material Titanium_Sheet_Glossy_Streaks(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Titanium - Glossy Streaks"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Titanium_Sheet.Titanium_Sheet_Glossy_Streaks.png"), + ::anno::key_words(string[]("metal", "sheet", "titanium", "imperfections", "new", "glossy", "unfinished", "reflective", "design", "infinite tiling", "neutral")) +]] += Titanium_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// ------------------------ Punched Titanium Sheet Presets ------------------------ + +export material Titanium_Sheet_Punched_Small_Circular(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Titanium Sheet - Small Circular Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Titanium_Sheet.Titanium_Sheet_Punched_Small_Circular.png"), + ::anno::key_words(string[]("metal", "sheet", "titanium", "decorative", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "punched", "punching", "circular", "gray", "neutral")) +]] += Titanium_Sheet_Punched( + // Punching Parameters + shape_select: pattern_circle, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.4f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.2f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.5f, + impurities_weight_3: 0.86f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Titanium_Sheet_Punched_Hexagonal(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Titanium Sheet - Hexagonal Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Titanium_Sheet.Titanium_Sheet_Punched_Hexagonal.png"), + ::anno::key_words(string[]("metal", "sheet", "titanium", "decorative", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "punched", "punching", "hexagonal", "gray", "neutral")) +]] += Titanium_Sheet_Punched( + // Punching Parameters + shape_select: pattern_hexagon, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.4f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.2f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.5f, + impurities_weight_3: 0.86f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Titanium_Sheet_Punched_Hexagonal_Small(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Titanium Sheet - Small Hexagonal Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Titanium_Sheet.Titanium_Sheet_Punched_Hexagonal_Small.png"), + ::anno::key_words(string[]("metal", "sheet", "titanium", "decorative", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "punched", "punching", "hexagonal", "gray", "neutral")) +]] += Titanium_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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.4f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.2f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.5f, + impurities_weight_3: 0.86f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Titanium_Sheet_Punched_Square(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Titanium Sheet - Square Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Titanium_Sheet.Titanium_Sheet_Punched_Square.png"), + ::anno::key_words(string[]("metal", "sheet", "titanium", "decorative", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "punched", "punching", "square", "gray", "neutral")) +]] += Titanium_Sheet_Punched( + // Punching Parameters + shape_select: pattern_square, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.4f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.2f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.5f, + impurities_weight_3: 0.86f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Titanium_Sheet_Punched_Line(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Titanium Sheet - Line Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Titanium_Sheet.Titanium_Sheet_Punched_Line.png"), + ::anno::key_words(string[]("metal", "sheet", "titanium", "decorative", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "punched", "punching", "line", "gray", "neutral")) +]] += Titanium_Sheet_Punched( + // Punching Parameters + shape_select: pattern_line, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.4f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.2f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.5f, + impurities_weight_3: 0.86f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Titanium_Sheet_Punched_Cross(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Titanium Sheet - Cross Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Titanium_Sheet.Titanium_Sheet_Punched_Cross.png"), + ::anno::key_words(string[]("metal", "sheet", "titanium", "decorative", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "punched", "punching", "cross", "gray", "neutral")) +]] += Titanium_Sheet_Punched( + // Punching Parameters + shape_select: pattern_cross, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.4f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.2f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.5f, + impurities_weight_3: 0.86f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Titanium_Sheet_Punched_Rhombus(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Titanium Sheet - Rhombus Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Titanium_Sheet.Titanium_Sheet_Punched_Rhombus.png"), + ::anno::key_words(string[]("metal", "sheet", "titanium", "decorative", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "punched", "punching", "rhombus", "gray", "neutral")) +]] += Titanium_Sheet_Punched( + // Punching Parameters + shape_select: pattern_rhombus, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.4f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.2f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.5f, + impurities_weight_3: 0.86f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Titanium_Sheet_Punched_Triangle(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Titanium Sheet - Triangle Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Titanium_Sheet.Titanium_Sheet_Punched_Triangle.png"), + ::anno::key_words(string[]("metal", "sheet", "titanium", "decorative", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "punched", "punching", "triangle", "gray", "neutral")) +]] += Titanium_Sheet_Punched( + // Punching Parameters + shape_select: pattern_triangle, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.4f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.2f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.5f, + impurities_weight_3: 0.86f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Titanium_Sheet_Punched_Star(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Titanium Sheet - Star Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Titanium_Sheet.Titanium_Sheet_Punched_Star.png"), + ::anno::key_words(string[]("metal", "sheet", "titanium", "decorative", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "punched", "punching", "star", "gray", "neutral")) +]] += Titanium_Sheet_Punched( + // Punching Parameters + shape_select: pattern_star, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.4f, + streaks: 0.0f, + scratch_bump_factor: 0.0f, + imperfections_amount: 0.2f, + impurities_weight_1: 0.0f, + impurities_weight_2: 0.5f, + impurities_weight_3: 0.86f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Metal/Tungsten.mdl b/code/third_party/vMaterials_2/Metal/Tungsten.mdl new file mode 100644 index 0000000000000000000000000000000000000000..65c45b33936d865ebd58b747a29c0cb31c26fe28 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Tungsten.mdl @@ -0,0 +1,381 @@ +/****************************************************************************** + * 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 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 Tungsten( + 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 = 0.03f [[ + ::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::description("When enabled the round corner effect is applied across different materials."), + ::anno::in_group("Round Corners") + ]], + uniform float2 texture_translate = float2(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 = float2(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("Tungsten"), + ::anno::description("Pure metal material with optional smudges."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Tungsten.Tungsten.png"), + ::anno::key_words(string[]("metal", "pure", "smudged", "design", "reflective", "infinite tiling", "smooth", "conductor", "new", "polished", "tungsten")) +]] + = + 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(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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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, across_materials, 1.f) : ::state::normal()); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + + + +export material Tungsten_Polished(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Tungsten Polished"), + ::anno::description("Pure metal material with optional smudges."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Tungsten.Tungsten_Polished.png"), + ::anno::key_words(string[]("metal", "pure", "design", "reflective", "infinite tiling", "smooth", "conductor", "new", "polished", "tungsten")) +]] += Tungsten( + 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 Tungsten_Glossy_Fingerprints(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Tungsten Glossy Fingerprints"), + ::anno::description("Pure metal material with optional smudges."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Tungsten.Tungsten_Glossy_Fingerprints.png"), + ::anno::key_words(string[]("metal", "pure", "design", "smudged", "reflective", "infinite tiling", "smooth", "conductor", "new", "polished", "tungsten")) +]] += Tungsten( + 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/code/third_party/vMaterials_2/Metal/Tungsten_Brushed.mdl b/code/third_party/vMaterials_2/Metal/Tungsten_Brushed.mdl new file mode 100644 index 0000000000000000000000000000000000000000..a7bfe8e4df6ba55d073b7785b76a5ec516b3ac3d --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/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 = float2(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 = float2(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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + + diff --git a/code/third_party/vMaterials_2/Metal/Tungsten_Foil.mdl b/code/third_party/vMaterials_2/Metal/Tungsten_Foil.mdl new file mode 100644 index 0000000000000000000000000000000000000000..a7246b55b66f4e12268481740a27dc2b7722e06d --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Tungsten_Foil.mdl @@ -0,0 +1,497 @@ +/****************************************************************************** + * 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 Tungsten_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 = float2(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 = float2(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("Tungsten Foil - Slightly Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Tungsten_Foil.Tungsten_Foil.png"), + ::anno::key_words(string[]("design", "metal", "tungsten", "foil", "smooth", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "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::weighted_layer(0.0299999993f, ::df::microfacet_ggx_smith_bsdf(0.300000012f, 0.300000012f, color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::color_custom_curve_layer(normal_reflectivity, grazing_reflectivity, 5.f, color(::math::lerp(0.600000024f, 1.f, brightness) * histogram_scan_big(::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.328999996f, 0.513999999f, 0.764999986f), 8.f, false) : ::base::file_texture(texture_2d("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 2.20000005f), 1.f, bump_strength * 0.400000006f)), ::df::microfacet_ggx_smith_bsdf((histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.328999996f, 0.513999999f, 0.764999986f), 8.f, false) : ::base::file_texture(texture_2d("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], roughness * 0.5f * roughness_variation, roughness * 0.5f) + roughness * 0.5f * roughness_variation * (float3(infinite_tiling ? endless_texture(texture_2d("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.328999996f, 0.513999999f, 0.764999986f), 8.f, false) : ::base::file_texture(texture_2d("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1] - 0.5f) + (1.f - roughness) * smudges * float3(infinite_tiling ? endless_texture(texture_2d("./textures/foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.0820000023f), 8.f, false) : ::base::file_texture(texture_2d("./textures/foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] + roughness_variation * 0.200000003f * float3(infinite_tiling ? endless_texture(texture_2d("./textures/foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.0820000023f), 8.f, false) : ::base::file_texture(texture_2d("./textures/foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]) * (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.328999996f, 0.513999999f, 0.764999986f), 8.f, false) : ::base::file_texture(texture_2d("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], roughness * 0.5f * roughness_variation, roughness * 0.5f) + roughness * 0.5f * roughness_variation * (float3(infinite_tiling ? endless_texture(texture_2d("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.328999996f, 0.513999999f, 0.764999986f), 8.f, false) : ::base::file_texture(texture_2d("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1] - 0.5f) + (1.f - roughness) * smudges * float3(infinite_tiling ? endless_texture(texture_2d("./textures/foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.0820000023f), 8.f, false) : ::base::file_texture(texture_2d("./textures/foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] + roughness_variation * 0.200000003f * float3(infinite_tiling ? endless_texture(texture_2d("./textures/foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.0820000023f), 8.f, false) : ::base::file_texture(texture_2d("./textures/foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.328999996f, 0.513999999f, 0.764999986f), 8.f, false) : ::base::file_texture(texture_2d("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], roughness * 0.5f * roughness_variation, roughness * 0.5f) + roughness * 0.5f * roughness_variation * (float3(infinite_tiling ? endless_texture(texture_2d("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.328999996f, 0.513999999f, 0.764999986f), 8.f, false) : ::base::file_texture(texture_2d("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1] - 0.5f) + (1.f - roughness) * smudges * float3(infinite_tiling ? endless_texture(texture_2d("./textures/foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.0820000023f), 8.f, false) : ::base::file_texture(texture_2d("./textures/foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] + roughness_variation * 0.200000003f * float3(infinite_tiling ? endless_texture(texture_2d("./textures/foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.0820000023f), 8.f, false) : ::base::file_texture(texture_2d("./textures/foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]) * (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.328999996f, 0.513999999f, 0.764999986f), 8.f, false) : ::base::file_texture(texture_2d("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], roughness * 0.5f * roughness_variation, roughness * 0.5f) + roughness * 0.5f * roughness_variation * (float3(infinite_tiling ? endless_texture(texture_2d("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.328999996f, 0.513999999f, 0.764999986f), 8.f, false) : ::base::file_texture(texture_2d("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1] - 0.5f) + (1.f - roughness) * smudges * float3(infinite_tiling ? endless_texture(texture_2d("./textures/foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.0820000023f), 8.f, false) : ::base::file_texture(texture_2d("./textures/foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] + roughness_variation * 0.200000003f * float3(infinite_tiling ? endless_texture(texture_2d("./textures/foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.0820000023f), 8.f, false) : ::base::file_texture(texture_2d("./textures/foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), bsdf(), infinite_tiling ? endless_normal(texture_2d("./textures/foil_crumpled_norm.jpg", ::tex::gamma_linear), bump_strength * 1.5f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.5f, 0.5f, 1.f), 8.f) : ::base::tangent_space_normal_texture(texture_2d("./textures/foil_crumpled_norm.jpg", ::tex::gamma_linear), bump_strength * 1.5f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), infinite_tiling ? endless_normal(texture_2d("./textures/foil_crumpled_norm.jpg", ::tex::gamma_linear), bump_strength * 1.5f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.5f, 0.5f, 1.f), 8.f) : ::base::tangent_space_normal_texture(texture_2d("./textures/foil_crumpled_norm.jpg", ::tex::gamma_linear), bump_strength * 1.5f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), + 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 Tungsten_Foil_Smudged_Foil(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Tungsten Foil - Smudged"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Tungsten_Foil.Tungsten_Foil_Smudged_Foil.png"), + ::anno::key_words(string[]("design", "metal", "tungsten", "foil", "smooth", "unfinished", "decorative", "creative", "neutral")) +]] += Tungsten_Foil( + infinite_tiling: true, + roughness: 0.15f, + roughness_variation: 0.84f, + smudges: 0.35f, + bump_strength: 0.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + +export material Tungsten_Foil_Shiny_Wrinkled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Tungsten Foil - Shiny Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Tungsten_Foil.Tungsten_Foil_Shiny_Wrinkled.png"), + ::anno::key_words(string[]("design", "metal", "tungsten", "foil", "shiny", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral")) +]] += Tungsten_Foil( + infinite_tiling: true, + roughness: 0.25f, + roughness_variation: 0.25f, + smudges: 0.75f, + bump_strength: 0.25f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + + +export material Tungsten_Foil_Matte_Wrinkled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Tungsten Foil - Matte Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Tungsten_Foil.Tungsten_Foil_Matte_Wrinkled.png"), + ::anno::key_words(string[]("design", "metal", "tungsten", "foil", "matte", "smooth", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral", "gray")) +]] += Tungsten_Foil( + infinite_tiling: true, + roughness: 0.65f, + roughness_variation: 1.0f, + smudges: 0.4f, + bump_strength: 0.15f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + +export material Tungsten_Foil_Heavy_Glossy_Wrinkles(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Tungsten Foil - Heavy Glossy Wrinkles"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Tungsten_Foil.Tungsten_Foil_Heavy_Glossy_Wrinkles.png"), + ::anno::key_words(string[]("design", "metal", "tungsten", "foil", "smooth", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral")) +]] += Tungsten_Foil( + infinite_tiling: true, + roughness: 0.164f, + roughness_variation: 0.021f, + smudges: 0.143f, + bump_strength: 0.99f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + +export material Tungsten_Foil_Heavy_Matte_Wrinkled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Tungsten Foil - Heavy Matte Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Tungsten_Foil.Tungsten_Foil_Heavy_Matte_Wrinkled.png"), + ::anno::key_words(string[]("design", "metal", "tungsten", "foil", "matte", "bumped", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral", "gray")) +]] += Tungsten_Foil( + infinite_tiling: true, + roughness: 0.889f, + roughness_variation: 0.018f, + smudges: 0.246f, + bump_strength: 0.732f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + + + + + + + + + + + + diff --git a/code/third_party/vMaterials_2/Metal/Tungsten_Hammered.mdl b/code/third_party/vMaterials_2/Metal/Tungsten_Hammered.mdl new file mode 100644 index 0000000000000000000000000000000000000000..52f45b4224e4e8b063c1439b7a33fc578f8a398d --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Tungsten_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 Tungsten_Hammered( + color metal_color = color(0.767f, 0.659f, 0.605f) [[ + ::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 = float2(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 = float2(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 Tungsten - Dark Pits"), + ::anno::author("NVIDIA vMaterials"), + ::anno::in_group("Metal"), + ::anno::key_words(string[]("metal", "tungsten", "blackened", "hammered", "design", "classic", "architecture", "pattern", "reflective", "rough", "bumped", "conductor")), + ::anno::thumbnail("./.thumbs/Tungsten_Hammered.Tungsten_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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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 Tungsten_Hammered_Shiny(*) +[[ + ::anno::display_name("Hammered Tungsten - Shiny"), + ::anno::author("NVIDIA vMaterials"), + ::anno::in_group("Metal"), + ::anno::key_words(string[]("metal", "tungsten", "hammered", "design", "classic", "architecture", "pattern", "reflective", "rough", "bumped", "conductor", "shiny")), + ::anno::thumbnail("./.thumbs/Tungsten_Hammered.Tungsten_Hammered_Shiny.png"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT) +]] + = Tungsten_Hammered( + metal_color: color(0.767f, 0.659f, 0.605f), + 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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + +export material Tungsten_Hammered_Dull(*) +[[ + ::anno::display_name("Hammered Tungsten - Dull"), + ::anno::author("NVIDIA vMaterials"), + ::anno::in_group("Metal"), + ::anno::key_words(string[]("metal", "tungsten", "hammered", "design", "classic", "architecture", "pattern", "reflective", "rough", "bumped", "conductor", "matte", "dull")), + ::anno::thumbnail("./.thumbs/Tungsten_Hammered.Tungsten_Hammered_Dull.png"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT) +]] + = Tungsten_Hammered( + metal_color: color(0.767f, 0.659f, 0.605f), + 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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Metal/Tungsten_Knurling.mdl b/code/third_party/vMaterials_2/Metal/Tungsten_Knurling.mdl new file mode 100644 index 0000000000000000000000000000000000000000..66bc28e6d5116634c3b66b82fb1d48554b5bde6c --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Tungsten_Knurling.mdl @@ -0,0 +1,359 @@ +/****************************************************************************** + * 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 ::df::*; +import ::tex::*; +import ::math::*; +import ::base::*; +import ::state::*; +import ::anno::*; +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 = "Metal with a diamond knurling finish"; + +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; + //TODO: at least also handle sign of z? + //TODO: handle tangent becoming 0 + + + 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)); +} + +export material Tungsten_Knurling( + //Appearance + float brightness = float(0.7f) [[ + ::anno::description("Adjusts the brightness of the material."), + ::anno::display_name("Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.0f, 1.0f) + ]], + float roughness = float(0.5f) [[ + ::anno::description("Higher values lead to a rougher appearance of the material."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.0f, 1.0f) + ]], + float grooves_dirt = float(0.4f) [[ + ::anno::description("Adds dirt in the grooves of the knurling pattern."), + ::anno::display_name("Grooves Dirt"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.0f, 1.0f) + ]], + uniform float bump_strength = float(0.8f) [[ + ::anno::description("Adds dirt in the grooves of the knurling pattern."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.0f, 1.0f) + ]], + + // Round Corners + 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("Sets the radius of the round corners in millimeters."), + ::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") + ]], + //Transform + float2 texture_translate = float2(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"), + ::anno::soft_range(0.f, 360.f) + ]], + float2 texture_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(0.35f, .35f)), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + + // Advanced + uniform int uv_space_index = 0 [[ + ::anno::description("Uses the selected UV space index."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced"), + ::anno::soft_range(0, 4) + ]] +) +[[ + ::anno::display_name("Metal Knurling Tungsten"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Tungsten_Knurling.Tungsten_Knurling.png"), + ::anno::key_words(string[]("metal", "tungsten", "knurled", "knurling", "pattern", "design", "bumped")), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials") +]] += let +{ + color metal_tint = color(0.951001417565f, 0.815051845356f, 0.751931718925f); // Tungsten + + // Texture setup + texture_2d normal_tex = texture_2d("./textures/metal_knurling_norm.jpg", ::tex::gamma_linear); + texture_2d multi_heights_tex = texture_2d("./textures/metal_knurling_multi_heights.jpg", ::tex::gamma_linear); + texture_2d diff_rough_grunge_tex = texture_2d("./textures/metal_knurling_multi_R_diff_G_rough_B_grunge.jpg", ::tex::gamma_linear); + + // Coordinate setup + ::base::texture_coordinate_info uvw = vmat_transform( + translation: texture_translate, + rotation: texture_rotate, + scaling: texture_scale, + system: ::base::texture_coordinate_uvw, + uv_space: uv_space_index + ); + + // ---------- Diff Rough Grunge Lookup ---------- + + float3 diff_rough_grunge_lookup = float3( + ::base::file_texture( + texture: diff_rough_grunge_tex, + uvw: uvw, + mono_source: ::base::mono_average + ).tint ); + + float3 multi_height_lookup = float3( + ::base::file_texture( + texture: multi_heights_tex, + uvw: uvw, + mono_source: ::base::mono_average + ).tint ); + + float3 norm = ::base::tangent_space_normal_texture( + texture: normal_tex, + factor: bump_strength, + uvw: uvw + ); + + + float remap_rough = histogram_range( + input: diff_rough_grunge_lookup.y, + range: 1.0f, + position: 0.234f + ); + + + float roughness_mapped = remap_rough + (roughness * multi_height_lookup.y); + + float remapped_diff = histogram_range( + input: diff_rough_grunge_lookup.x, + range: 1.0f, + position: (brightness * 0.4f) + 0.4f + ); + + float diff_contribution = ::math::pow(remapped_diff - ((grooves_dirt * 0.5) * multi_height_lookup.x * diff_rough_grunge_lookup.z), 2.67f); + + bsdf ggx_smith_bumped = ::df::weighted_layer( + layer: ::df::microfacet_ggx_smith_bsdf( + roughness_u: roughness_mapped * roughness_mapped, + roughness_v: roughness_mapped * roughness_mapped, + tint: color(diff_contribution), + mode: ::df::scatter_reflect + ), + base: bsdf(), + weight: 1.0f, + normal: norm + ); + + bsdf diff_bsdf = ::df::diffuse_reflection_bsdf( + tint: color(diff_contribution) + ); + + + bsdf final_bsdf = ::df::weighted_layer( + weight: 1.0f - (diff_rough_grunge_lookup.z * multi_height_lookup.x * grooves_dirt), + layer: ::df::directional_factor( + normal_tint: metal_tint, + grazing_tint: color(1.0f), + base: ggx_smith_bumped + ), + base: diff_bsdf + ); + + + // Round Corners + float3 round_normal = enable_round_corners ? + ::state::rounded_corner_normal( + radius: roundcorner_radius * 0.001, + across_materials: across_materials + ) : ::state::normal(); +} +in material ( + + surface: material_surface( + scattering: final_bsdf + ), + geometry: material_geometry( + normal: round_normal + ) +); + + +export material Tungsten_Knurling_Worn(*) +[[ + ::anno::display_name("Metal Knurling - Tungsten Worn"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Tungsten_Knurling.Tungsten_Knurling_Worn.png"), + ::anno::key_words(string[]("metal", "tungsten", "knurled", "pattern", "knurling", "design", "bumped", "worn")), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials") +]] = Tungsten_Knurling( + brightness: 0.4f, + roughness: 1.0f, + grooves_dirt: 1.0f, + bump_strength: 0.8f, + + enable_round_corners: false, + roundcorner_radius: 1.2f, + across_materials: false, + + texture_translate: float2(0.0f), + texture_rotate: 0.f, + texture_scale: float2(1.0f), + + uv_space_index: 0 +); + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/code/third_party/vMaterials_2/Metal/Tungsten_Scratched.mdl b/code/third_party/vMaterials_2/Metal/Tungsten_Scratched.mdl new file mode 100644 index 0000000000000000000000000000000000000000..0f35bb2a4e90d87a09fc2c01b6756c8ffe7ecc14 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Tungsten_Scratched.mdl @@ -0,0 +1,595 @@ +/****************************************************************************** + * 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 Tungsten_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 = float2(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 = float2(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("Tungsten Scratched"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "tungsten", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped")), + ::anno::thumbnail("./.thumbs/Tungsten_Scratched.Tungsten_Scratched.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = + let { + float brush_scratches_weight = 0.5f; + // Tungsten Reflection Color + color reflection_color = color(0.951001417565f, 0.815051845356f, 0.751931718925f); // Tungsten + 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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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 Tungsten_Scratched_Light_Bumpy(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Tungsten Scratched - Bright and Bumped"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "tungsten", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "shiny")), + ::anno::thumbnail("./.thumbs/Tungsten_Scratched.Tungsten_Scratched_Light_Bumpy.png"), + ::anno::copyright_notice(COPYRIGHT) +]]= Tungsten_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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); + + + +export material Tungsten_Scratched_Dark_Shiny(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Tungsten Scratched - Dark Shiny"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "tungsten", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "shiny", "dark")), + ::anno::thumbnail("./.thumbs/Tungsten_Scratched.Tungsten_Scratched_Dark_Shiny.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Tungsten_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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); + + +export material Tungsten_Scratched_Dark_Matte(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Tungsten Scratched - Dark Matte"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "tungsten", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "matte", "dark")), + ::anno::thumbnail("./.thumbs/Tungsten_Scratched.Tungsten_Scratched_Dark_Matte.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Tungsten_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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); + + + + +export material Tungsten_Scratched_Scuffs_and_Grime(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Tungsten Scratched - Scuffs and Grime"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "tungsten", "scratched", "worn", "dirty", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "matte", "dark")), + ::anno::thumbnail("./.thumbs/Tungsten_Scratched.Tungsten_Scratched_Scuffs_and_Grime.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Tungsten_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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); + + + + +export material Tungsten_Scratched_Dirty_Rough(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Tungsten Scratched - Dirty Rough"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "tungsten", "scratched", "worn", "dirt", "dirty", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "matte", "dark")), + ::anno::thumbnail("./.thumbs/Tungsten_Scratched.Tungsten_Scratched_Dirty_Rough.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Tungsten_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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); diff --git a/code/third_party/vMaterials_2/Metal/Tungsten_Sheet.mdl b/code/third_party/vMaterials_2/Metal/Tungsten_Sheet.mdl new file mode 100644 index 0000000000000000000000000000000000000000..a1a1bec9faaf8ed0b5840bb396da00f29030d3de --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Tungsten_Sheet.mdl @@ -0,0 +1,1342 @@ +/****************************************************************************** + * 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 tungsten 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) + float2(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 Tungsten_Sheet( + 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::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::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 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 = float2(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 = float2(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 Tungsten - New Clean"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Tungsten_Sheet.Tungsten_Sheet.png"), + ::anno::key_words(string[]("metal", "sheet", "tungsten", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "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(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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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 Tungsten_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 = float2(.5f, .5f) + [[ + ::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) + ]], + + + +// Tungsten 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::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::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 = float2(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 = float2(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("Tungsten Sheet - Circular Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Tungsten_Sheet.Tungsten_Sheet_Punched.png"), + ::anno::key_words(string[]("metal", "sheet", "tungsten", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "punched", "punching", "circular", "gray")) +]] = let +{ + material base_mat = Tungsten_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, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + enable_round_corners: enable_round_corners, + roundcorner_radius: roundcorner_radius, + across_materials: across_materials + ); + texture_2d punching_cutout = texture_2d("./textures/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 + ) +); + + + +// ------------------------ Tungsten Sheet Presets ------------------------ +export material Tungsten_Sheet_Soft_Splotches(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Tungsten - Soft Splotches"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Tungsten_Sheet.Tungsten_Sheet_Soft_Splotches.png"), + ::anno::key_words(string[]("metal", "sheet", "tungsten", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "neutral", "gray")) +]] += Tungsten_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + + +export material Tungsten_Sheet_Matte_Imperfections(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Tungsten - Matte Imperfections"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Tungsten_Sheet.Tungsten_Sheet_Matte_Imperfections.png"), + ::anno::key_words(string[]("metal", "sheet", "tungsten", "imperfections", "new", "matte", "unfinished", "reflective", "design", "infinite tiling", "neutral")) +]]= Tungsten_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + + +export material Tungsten_Sheet_Glossy_Imperfections(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Tungsten - Glossy Imperfections"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Tungsten_Sheet.Tungsten_Sheet_Glossy_Imperfections.png"), + ::anno::key_words(string[]("metal", "sheet", "tungsten", "imperfections", "new", "glossy", "unfinished", "reflective", "design", "infinite tiling", "neutral")) +]] += Tungsten_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + + +export material Tungsten_Sheet_Splotchy_Streaks(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Tungsten - Splotchy Streaks"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Tungsten_Sheet.Tungsten_Sheet_Splotchy_Streaks.png"), + ::anno::key_words(string[]("metal", "sheet", "tungsten", "imperfections", "new", "glossy", "unfinished", "reflective", "design", "infinite tiling", "neutral")) +]]= Tungsten_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + +export material Tungsten_Sheet_Glossy_Streaks(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Tungsten - Glossy Streaks"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Tungsten_Sheet.Tungsten_Sheet_Glossy_Streaks.png"), + ::anno::key_words(string[]("metal", "sheet", "tungsten", "imperfections", "new", "glossy", "unfinished", "reflective", "design", "infinite tiling", "neutral")) +]] += Tungsten_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + +// ------------------------ Punched Tungsten Sheet Presets ------------------------ + +export material Tungsten_Sheet_Punched_Small_Circular(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Tungsten Sheet - Small Circular Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Tungsten_Sheet.Tungsten_Sheet_Punched_Small_Circular.png"), + ::anno::key_words(string[]("metal", "sheet", "tungsten", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "punched", "punching", "circular", "gray")) +]] += Tungsten_Sheet_Punched( + // Punching Parameters + shape_select: pattern_circle, + punching_grid_size: float2(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, + + // Material Parameters + 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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Tungsten_Sheet_Punched_Hexagonal(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Tungsten Sheet - Hexagonal Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Tungsten_Sheet.Tungsten_Sheet_Punched_Hexagonal.png"), + ::anno::key_words(string[]("metal", "sheet", "tungsten", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "punched", "punching", "hexagonal", "gray")) +]] += Tungsten_Sheet_Punched( + // Punching Parameters + shape_select: pattern_hexagon, + punching_grid_size: float2(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, + + // Material Parameters + 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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Tungsten_Sheet_Punched_Hexagonal_Small(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Tungsten Sheet - Small Hexagonal Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Tungsten_Sheet.Tungsten_Sheet_Punched_Hexagonal_Small.png"), + ::anno::key_words(string[]("metal", "sheet", "tungsten", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "punched", "punching", "hexagonal", "gray")) +]] += Tungsten_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, + + // Material Parameters + 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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Tungsten_Sheet_Punched_Square(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Tungsten Sheet - Square Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Tungsten_Sheet.Tungsten_Sheet_Punched_Square.png"), + ::anno::key_words(string[]("metal", "sheet", "tungsten", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "punched", "punching", "square", "gray")) +]] += Tungsten_Sheet_Punched( + // Punching Parameters + shape_select: pattern_square, + punching_grid_size: float2(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, + + // Material Parameters + 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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + +export material Tungsten_Sheet_Punched_Line(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Tungsten Sheet - Line Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Tungsten_Sheet.Tungsten_Sheet_Punched_Line.png"), + ::anno::key_words(string[]("metal", "sheet", "tungsten", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "punched", "punching", "line", "gray")) +]] += Tungsten_Sheet_Punched( + // Punching Parameters + shape_select: pattern_line, + punching_grid_size: float2(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, + + // Material Parameters + 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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Tungsten_Sheet_Punched_Cross(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Tungsten Sheet - Cross Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Tungsten_Sheet.Tungsten_Sheet_Punched_Cross.png"), + ::anno::key_words(string[]("metal", "sheet", "tungsten", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "punched", "punching", "cross", "gray")) +]] += Tungsten_Sheet_Punched( + // Punching Parameters + shape_select: pattern_cross, + punching_grid_size: float2(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, + + // Material Parameters + 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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Tungsten_Sheet_Punched_Rhombus(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Tungsten Sheet - Rhombus Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Tungsten_Sheet.Tungsten_Sheet_Punched_Rhombus.png"), + ::anno::key_words(string[]("metal", "sheet", "tungsten", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "punched", "punching", "rhombus", "gray")) +]] += Tungsten_Sheet_Punched( + // Punching Parameters + shape_select: pattern_rhombus, + punching_grid_size: float2(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, + + // Material Parameters + 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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Tungsten_Sheet_Punched_Triangle(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Tungsten Sheet - Triangle Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Tungsten_Sheet.Tungsten_Sheet_Punched_Triangle.png"), + ::anno::key_words(string[]("metal", "sheet", "tungsten", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "punched", "punching", "triangle", "gray")) +]] += Tungsten_Sheet_Punched( + // Punching Parameters + shape_select: pattern_triangle, + punching_grid_size: float2(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, + + // Material Parameters + 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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Tungsten_Sheet_Punched_Star(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Tungsten Sheet - Star Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Tungsten_Sheet.Tungsten_Sheet_Punched_Star.png"), + ::anno::key_words(string[]("metal", "sheet", "tungsten", "imperfections", "new", "unfinished", "reflective", "design", "infinite tiling", "punched", "punching", "star", "gray")) +]] += Tungsten_Sheet_Punched( + // Punching Parameters + shape_select: pattern_star, + punching_grid_size: float2(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, + + // Material Parameters + 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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Metal/Zinc.mdl b/code/third_party/vMaterials_2/Metal/Zinc.mdl new file mode 100644 index 0000000000000000000000000000000000000000..63b1d7986d25e8be6beed2003ab916f7029f83cb --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Zinc.mdl @@ -0,0 +1,378 @@ +/****************************************************************************** + * 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 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 Zinc( + 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 = 0.03f [[ + ::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::description("When enabled the round corner effect is applied across different materials."), + ::anno::in_group("Round Corners") + ]], + uniform float2 texture_translate = float2(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 = float2(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("Zinc"), + ::anno::description("Pure metal material with optional smudges."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Zinc.Zinc.png"), + ::anno::key_words(string[]("metal", "pure", "smudged", "design", "reflective", "infinite tiling", "smooth", "conductor", "new", "polished", "zinc")) +]] + = + let { + + color normal_reflectivity = color(0.87467950988f,0.868943040106f,0.855089634324f); // Zinc + 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(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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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, across_materials, 1.f) : ::state::normal()); + } in + material( + thin_walled: tmp0, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + + +export material Zinc_Polished(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Zinc Polished"), + ::anno::description("Pure metal material with optional smudges."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Zinc.Zinc_Polished.png"), + ::anno::key_words(string[]("metal", "pure", "design", "reflective", "infinite tiling", "smooth", "conductor", "new", "polished", "zinc")) +]] += Zinc( + 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 Zinc_Glossy_Fingerprints(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Zinc Glossy Fingerprints"), + ::anno::description("Pure metal material with optional smudges."), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Zinc.Zinc_Glossy_Fingerprints.png"), + ::anno::key_words(string[]("metal", "pure", "design", "smudged", "reflective", "infinite tiling", "smooth", "conductor", "new", "polished", "zinc")) +]] += Zinc( + 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/code/third_party/vMaterials_2/Metal/Zinc_Brushed.mdl b/code/third_party/vMaterials_2/Metal/Zinc_Brushed.mdl new file mode 100644 index 0000000000000000000000000000000000000000..90cad12a26459466fef7f38922062811721efac0 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Zinc_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 Zinc_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 = float2(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 = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Scale"), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)) + ]], + 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("Brushed Zinc - Strong Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Zinc_Brushed.Zinc_Brushed.png"), + ::anno::key_words(string[]("aec", "metal", "zinc", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] + = + let { + color normal_reflectivity = color(0.87467950988f, 0.868943040106f, 0.855089634324f); // Zinc + color grazing_reflectivity = color(1.0f, 1.0f, 1.0f); + + 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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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 Zinc_Brushed_Light_Brushing(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Brushed Zinc - Light Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Zinc_Brushed.Zinc_Brushed_Light_Brushing.png"), + ::anno::key_words(string[]("aec", "metal", "zinc", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] + = Zinc_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + +export material Zinc_Brushed_Medium_Light_Brushing(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Brushed Zinc - Medium Light Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Zinc_Brushed.Zinc_Brushed_Medium_Light_Brushing.png"), + ::anno::key_words(string[]("aec", "metal", "zinc", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] += Zinc_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + +export material Zinc_Brushed_Medium_Brushing(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Brushed Zinc - Medium Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Zinc_Brushed.Zinc_Brushed_Medium_Brushing.png"), + ::anno::key_words(string[]("aec", "metal", "zinc", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] += Zinc_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Zinc_Brushed_Very_Strong_Brushing(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Brushed Zinc - Very Strong Brushing"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Zinc_Brushed.Zinc_Brushed_Very_Strong_Brushing.png"), + ::anno::key_words(string[]("aec", "metal", "zinc", "brushed", "kitchen", "design", "modern", "reflective", "shiny", "architecture", "sanitary", "new", "gray", "neutral")) +]] += Zinc_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + + diff --git a/code/third_party/vMaterials_2/Metal/Zinc_Foil.mdl b/code/third_party/vMaterials_2/Metal/Zinc_Foil.mdl new file mode 100644 index 0000000000000000000000000000000000000000..faac57080840fabf89b0d018cc112a9fe3a0eb3a --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Zinc_Foil.mdl @@ -0,0 +1,498 @@ +/****************************************************************************** + * 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 Zinc_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 = float2(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 = float2(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("Metal Foil Zinc - Slightly Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Zinc_Foil.Zinc_Foil.png"), + ::anno::key_words(string[]("design", "metal", "zinc", "aluminium", "foil", "smooth", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral")) +]] + = + let { + color normal_reflectivity = color(0.87467950988f, 0.868943040106f, 0.855089634324f); // Zinc + color grazing_reflectivity = color(0.99942f, 1.f, 1.f); + + 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(texture_2d("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.328999996f, 0.513999999f, 0.764999986f), 8.f, false) : ::base::file_texture(texture_2d("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 2.20000005f), 1.f, bump_strength * 0.400000006f)), ::df::microfacet_ggx_smith_bsdf((histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.328999996f, 0.513999999f, 0.764999986f), 8.f, false) : ::base::file_texture(texture_2d("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], roughness * 0.5f * roughness_variation, roughness * 0.5f) + roughness * 0.5f * roughness_variation * (float3(infinite_tiling ? endless_texture(texture_2d("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.328999996f, 0.513999999f, 0.764999986f), 8.f, false) : ::base::file_texture(texture_2d("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1] - 0.5f) + (1.f - roughness) * smudges * float3(infinite_tiling ? endless_texture(texture_2d("./textures/foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.0820000023f), 8.f, false) : ::base::file_texture(texture_2d("./textures/foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] + roughness_variation * 0.200000003f * float3(infinite_tiling ? endless_texture(texture_2d("./textures/foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.0820000023f), 8.f, false) : ::base::file_texture(texture_2d("./textures/foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]) * (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.328999996f, 0.513999999f, 0.764999986f), 8.f, false) : ::base::file_texture(texture_2d("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], roughness * 0.5f * roughness_variation, roughness * 0.5f) + roughness * 0.5f * roughness_variation * (float3(infinite_tiling ? endless_texture(texture_2d("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.328999996f, 0.513999999f, 0.764999986f), 8.f, false) : ::base::file_texture(texture_2d("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1] - 0.5f) + (1.f - roughness) * smudges * float3(infinite_tiling ? endless_texture(texture_2d("./textures/foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.0820000023f), 8.f, false) : ::base::file_texture(texture_2d("./textures/foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] + roughness_variation * 0.200000003f * float3(infinite_tiling ? endless_texture(texture_2d("./textures/foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.0820000023f), 8.f, false) : ::base::file_texture(texture_2d("./textures/foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.328999996f, 0.513999999f, 0.764999986f), 8.f, false) : ::base::file_texture(texture_2d("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], roughness * 0.5f * roughness_variation, roughness * 0.5f) + roughness * 0.5f * roughness_variation * (float3(infinite_tiling ? endless_texture(texture_2d("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.328999996f, 0.513999999f, 0.764999986f), 8.f, false) : ::base::file_texture(texture_2d("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1] - 0.5f) + (1.f - roughness) * smudges * float3(infinite_tiling ? endless_texture(texture_2d("./textures/foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.0820000023f), 8.f, false) : ::base::file_texture(texture_2d("./textures/foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] + roughness_variation * 0.200000003f * float3(infinite_tiling ? endless_texture(texture_2d("./textures/foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.0820000023f), 8.f, false) : ::base::file_texture(texture_2d("./textures/foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]) * (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.328999996f, 0.513999999f, 0.764999986f), 8.f, false) : ::base::file_texture(texture_2d("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], roughness * 0.5f * roughness_variation, roughness * 0.5f) + roughness * 0.5f * roughness_variation * (float3(infinite_tiling ? endless_texture(texture_2d("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.328999996f, 0.513999999f, 0.764999986f), 8.f, false) : ::base::file_texture(texture_2d("./textures/foil_crumpled_R_rough1_G_rough2_G_ao.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1] - 0.5f) + (1.f - roughness) * smudges * float3(infinite_tiling ? endless_texture(texture_2d("./textures/foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.0820000023f), 8.f, false) : ::base::file_texture(texture_2d("./textures/foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0] + roughness_variation * 0.200000003f * float3(infinite_tiling ? endless_texture(texture_2d("./textures/foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), ::base::coordinate_source(::base::texture_coordinate_uvw, 0), 10.f, float3(0.0820000023f), 8.f, false) : ::base::file_texture(texture_2d("./textures/foil_crumpled_R_smudge_G_splotch.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1]), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), bsdf(), infinite_tiling ? endless_normal(texture_2d("./textures/foil_crumpled_norm.jpg", ::tex::gamma_linear), bump_strength * 1.5f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.5f, 0.5f, 1.f), 8.f) : ::base::tangent_space_normal_texture(texture_2d("./textures/foil_crumpled_norm.jpg", ::tex::gamma_linear), bump_strength * 1.5f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), infinite_tiling ? endless_normal(texture_2d("./textures/foil_crumpled_norm.jpg", ::tex::gamma_linear), bump_strength * 1.5f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.5f, 0.5f, 1.f), 8.f) : ::base::tangent_space_normal_texture(texture_2d("./textures/foil_crumpled_norm.jpg", ::tex::gamma_linear), bump_strength * 1.5f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f)), + 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 Zinc_Foil_Smudged_Foil(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Foil Zinc - Smudgy Foil"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Zinc_Foil.Zinc_Foil_Smudged_Foil.png"), + ::anno::key_words(string[]("design", "metal", "zinc", "aluminium", "foil", "smooth", "unfinished", "decorative", "creative", "neutral")) +]] += Zinc_Foil( + infinite_tiling: true, + roughness: 0.15f, + roughness_variation: 0.84f, + smudges: 0.35f, + bump_strength: 0.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + +export material Zinc_Foil_Shiny_Wrinkled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Foil Zinc - Shiny Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Zinc_Foil.Zinc_Foil_Shiny_Wrinkled.png"), + ::anno::key_words(string[]("design", "metal", "zinc", "aluminium", "foil", "shiny", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral")) +]] += Zinc_Foil( + infinite_tiling: true, + roughness: 0.25f, + roughness_variation: 0.25f, + smudges: 0.75f, + bump_strength: 0.25f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + + +export material Zinc_Foil_Matte_Wrinkled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Foil Zinc - Matte Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Zinc_Foil.Zinc_Foil_Matte_Wrinkled.png"), + ::anno::key_words(string[]("design", "metal", "zinc", "aluminium", "foil", "matte", "smooth", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral", "gray")) +]] += Zinc_Foil( + infinite_tiling: true, + roughness: 0.65f, + roughness_variation: 1.0f, + smudges: 0.4f, + bump_strength: 0.15f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + +export material Zinc_Foil_Heavy_Glossy_Wrinkles(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Foil Zinc - Heavy Glossy Wrinkles"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Zinc_Foil.Zinc_Foil_Heavy_Glossy_Wrinkles.png"), + ::anno::key_words(string[]("design", "metal", "zinc", "aluminium", "foil", "smooth", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral")) +]] += Zinc_Foil( + infinite_tiling: true, + roughness: 0.164f, + roughness_variation: 0.021f, + smudges: 0.143f, + bump_strength: 0.99f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + +export material Zinc_Foil_Heavy_Matte_Wrinkled(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Foil Zinc - Heavy Matte Wrinkled"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Zinc_Foil.Zinc_Foil_Heavy_Matte_Wrinkled.png"), + ::anno::key_words(string[]("design", "metal", "zinc", "aluminium", "foil", "matte", "bumped", "crumpled", "wrinkled", "creased", "unfinished", "decorative", "creative", "neutral", "gray")) +]] += Zinc_Foil( + infinite_tiling: true, + roughness: 0.889f, + roughness_variation: 0.018f, + smudges: 0.246f, + bump_strength: 0.732f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0, + enable_round_corners: false, + radius: 0.002f, + across_materials: false +); + + + + + + + + + + + + + + diff --git a/code/third_party/vMaterials_2/Metal/Zinc_Galvanizing.mdl b/code/third_party/vMaterials_2/Metal/Zinc_Galvanizing.mdl new file mode 100644 index 0000000000000000000000000000000000000000..4cd4d37fee4f971116525b1d47dadbe40a5b5c5a --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Zinc_Galvanizing.mdl @@ -0,0 +1,494 @@ +/****************************************************************************** + * 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)); +} + +export material Zinc_Galvanizing( + 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"), + ::anno::ui_order(0) + ]], + float zinc_roughness = 0.39f [[ + ::anno::description("The roughness of the zinc crystals."), + ::anno::display_name("Zinc Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(1) + ]], + float oxidation_amount = 0.08f [[ + ::anno::description("Controls the amount of oxidation on the material."), + ::anno::display_name("Oxidation Amount"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(2) + ]], + float oxide_roughness = 0.79f [[ + ::anno::description("Controls the roughness of the oxidation on the material. Only visible if Oxidation Amount is greater than 0."), + ::anno::display_name("Oxide Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(3) + ]], + float dirt_spots_weight = 0.18f [[ + ::anno::description("Adds dirty spots to the material."), + ::anno::display_name("Dirt Spots Weight"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(4) + ]], + float leak_dirt_weight = 0.03f [[ + ::anno::description("Adds leaky dirt to the material."), + ::anno::display_name("Leak Dirt Weight"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(5) + ]], + uniform float bump_strength = 0.28f [[ + ::anno::description("The Strength of the bump map."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.f, 1.f), + ::anno::ui_order(6) + ]], + uniform float2 texture_translate = float2(0.f) [[ + ::anno::description("Controls the position of the texture."), + ::anno::display_name("Texture Translate"), + ::anno::in_group("Transform"), + ::anno::ui_order(7) + ]], + 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(8) + ]], + uniform float2 texture_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(0.7f, 0.7f)), + ::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 = true [[ + ::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("Zinc Galvanizing - New Shiny"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("metal", "zinc", "infinite", "tiling", "construction", "architecture", "galvanized", "coated", "new", "metallic", "shiny", "gray")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Zinc_Galvanizing.Zinc_Galvanizing.png") +]] + = + let { + material_surface tmp1(::df::weighted_layer(::math::max(::math::pow(dirt_spots_weight * float3(infinite_tiling ? endless_texture(texture_2d("./textures/zinc_galvanized_multi_R_dirt_G_urough_B_vrough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.153999999f, 0.501999974f, 0.493999988f), 3.f, false) : ::base::file_texture(texture_2d("./textures/zinc_galvanized_multi_R_dirt_G_urough_B_vrough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::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, 1.18999994f), ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/zinc_galvanized_multi_R_base_G_dirtmask_B_dirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.379000008f, 0.689999998f, 0.750999987f), 3.f, false) : ::base::file_texture(texture_2d("./textures/zinc_galvanized_multi_R_base_G_dirtmask_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::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, 0.729999959f) * (leak_dirt_weight * 0.379999995f)), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(color(0.f, 0.f, 0.f), nvidia::core_definitions::blend_colors(color(0.212230995f, 0.186502993f, 0.166861996f), color(0.266355991f, 0.240462005f, 0.225070998f), ::base::color_layer_blend, histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/zinc_galvanized_multi_R_base_G_dirtmask_B_dirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.379000008f, 0.689999998f, 0.750999987f), 3.f, false) : ::base::file_texture(texture_2d("./textures/zinc_galvanized_multi_R_base_G_dirtmask_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::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, 0.469999999f, 0.170000002f)).tint, ::base::color_layer_blend, ::math::max(::math::pow(dirt_spots_weight * float3(infinite_tiling ? endless_texture(texture_2d("./textures/zinc_galvanized_multi_R_dirt_G_urough_B_vrough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.153999999f, 0.501999974f, 0.493999988f), 3.f, false) : ::base::file_texture(texture_2d("./textures/zinc_galvanized_multi_R_dirt_G_urough_B_vrough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::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, 1.18999994f), ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/zinc_galvanized_multi_R_base_G_dirtmask_B_dirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.379000008f, 0.689999998f, 0.750999987f), 3.f, false) : ::base::file_texture(texture_2d("./textures/zinc_galvanized_multi_R_base_G_dirtmask_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::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, 0.729999959f) * (leak_dirt_weight * 0.379999995f))).tint, 0.f), bsdf(), infinite_tiling ? endless_normal(texture_2d("./textures/zinc_galvanized_normal.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.25f, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.5f, 0.5f, 0.996999979f), 3.f) : nvidia::core_definitions::normalmap_texture(texture_2d("./textures/zinc_galvanized_normal.jpg", ::tex::gamma_linear), 1.f / texture_scale * 4.f, texture_translate, texture_rotate, false, bump_strength, uv_space_index)), ::df::weighted_layer(1.f, ::df::microfacet_ggx_smith_bsdf((dirt_spots_weight * float3(infinite_tiling ? endless_texture(texture_2d("./textures/zinc_galvanized_multi_R_dirt_G_urough_B_vrough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.153999999f, 0.501999974f, 0.493999988f), 3.f, false) : ::base::file_texture(texture_2d("./textures/zinc_galvanized_multi_R_dirt_G_urough_B_vrough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::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 + ::math::lerp(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/zinc_galvanized_multi_R_dirt_G_urough_B_vrough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.153999999f, 0.501999974f, 0.493999988f), 3.f, false) : ::base::file_texture(texture_2d("./textures/zinc_galvanized_multi_R_dirt_G_urough_B_vrough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::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, 0.419999987f, zinc_roughness * 0.400000006f + 0.400000006f), ::math::lerp(::math::clamp(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/zinc_galvanized_multi_R_base_G_dirtmask_B_dirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.379000008f, 0.689999998f, 0.750999987f), 3.f, false) : ::base::file_texture(texture_2d("./textures/zinc_galvanized_multi_R_base_G_dirtmask_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::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, 1.f, oxide_roughness * 0.219999999f + 0.600000024f), 0.f, 1.f), float3(infinite_tiling ? endless_texture(texture_2d("./textures/zinc_galvanized_multi_R_base_G_dirtmask_B_dirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.379000008f, 0.689999998f, 0.750999987f), 3.f, false) : ::base::file_texture(texture_2d("./textures/zinc_galvanized_multi_R_base_G_dirtmask_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::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, ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/zinc_galvanized_multi_R_base_G_dirtmask_B_dirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.379000008f, 0.689999998f, 0.750999987f), 3.f, false) : ::base::file_texture(texture_2d("./textures/zinc_galvanized_multi_R_base_G_dirtmask_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::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, 0.729999959f) * (leak_dirt_weight * 0.25f)), oxidation_amount) + ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/zinc_galvanized_multi_R_base_G_dirtmask_B_dirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.379000008f, 0.689999998f, 0.750999987f), 3.f, false) : ::base::file_texture(texture_2d("./textures/zinc_galvanized_multi_R_base_G_dirtmask_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::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, 0.729999959f) * (leak_dirt_weight * 0.25f)) * (dirt_spots_weight * float3(infinite_tiling ? endless_texture(texture_2d("./textures/zinc_galvanized_multi_R_dirt_G_urough_B_vrough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.153999999f, 0.501999974f, 0.493999988f), 3.f, false) : ::base::file_texture(texture_2d("./textures/zinc_galvanized_multi_R_dirt_G_urough_B_vrough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::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 + ::math::lerp(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/zinc_galvanized_multi_R_dirt_G_urough_B_vrough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.153999999f, 0.501999974f, 0.493999988f), 3.f, false) : ::base::file_texture(texture_2d("./textures/zinc_galvanized_multi_R_dirt_G_urough_B_vrough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::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, 0.419999987f, zinc_roughness * 0.400000006f + 0.400000006f), ::math::lerp(::math::clamp(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/zinc_galvanized_multi_R_base_G_dirtmask_B_dirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.379000008f, 0.689999998f, 0.750999987f), 3.f, false) : ::base::file_texture(texture_2d("./textures/zinc_galvanized_multi_R_base_G_dirtmask_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::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, 1.f, oxide_roughness * 0.219999999f + 0.600000024f), 0.f, 1.f), float3(infinite_tiling ? endless_texture(texture_2d("./textures/zinc_galvanized_multi_R_base_G_dirtmask_B_dirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.379000008f, 0.689999998f, 0.750999987f), 3.f, false) : ::base::file_texture(texture_2d("./textures/zinc_galvanized_multi_R_base_G_dirtmask_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::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, ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/zinc_galvanized_multi_R_base_G_dirtmask_B_dirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.379000008f, 0.689999998f, 0.750999987f), 3.f, false) : ::base::file_texture(texture_2d("./textures/zinc_galvanized_multi_R_base_G_dirtmask_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::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, 0.729999959f) * (leak_dirt_weight * 0.25f)), oxidation_amount) + ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/zinc_galvanized_multi_R_base_G_dirtmask_B_dirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.379000008f, 0.689999998f, 0.750999987f), 3.f, false) : ::base::file_texture(texture_2d("./textures/zinc_galvanized_multi_R_base_G_dirtmask_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::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, 0.729999959f) * (leak_dirt_weight * 0.25f)), (dirt_spots_weight * float3(infinite_tiling ? endless_texture(texture_2d("./textures/zinc_galvanized_multi_R_dirt_G_urough_B_vrough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.153999999f, 0.501999974f, 0.493999988f), 3.f, false) : ::base::file_texture(texture_2d("./textures/zinc_galvanized_multi_R_dirt_G_urough_B_vrough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::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 + ::math::lerp(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/zinc_galvanized_multi_R_dirt_G_urough_B_vrough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.153999999f, 0.501999974f, 0.493999988f), 3.f, false) : ::base::file_texture(texture_2d("./textures/zinc_galvanized_multi_R_dirt_G_urough_B_vrough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::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.419999987f, zinc_roughness * 0.400000006f + 0.400000006f), ::math::lerp(::math::clamp(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/zinc_galvanized_multi_R_base_G_dirtmask_B_dirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.379000008f, 0.689999998f, 0.750999987f), 3.f, false) : ::base::file_texture(texture_2d("./textures/zinc_galvanized_multi_R_base_G_dirtmask_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::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, 1.f, oxide_roughness * 0.219999999f + 0.600000024f), 0.f, 1.f), float3(infinite_tiling ? endless_texture(texture_2d("./textures/zinc_galvanized_multi_R_base_G_dirtmask_B_dirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.379000008f, 0.689999998f, 0.750999987f), 3.f, false) : ::base::file_texture(texture_2d("./textures/zinc_galvanized_multi_R_base_G_dirtmask_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::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, ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/zinc_galvanized_multi_R_base_G_dirtmask_B_dirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.379000008f, 0.689999998f, 0.750999987f), 3.f, false) : ::base::file_texture(texture_2d("./textures/zinc_galvanized_multi_R_base_G_dirtmask_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::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, 0.729999959f) * (leak_dirt_weight * 0.25f)), oxidation_amount) + ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/zinc_galvanized_multi_R_base_G_dirtmask_B_dirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.379000008f, 0.689999998f, 0.750999987f), 3.f, false) : ::base::file_texture(texture_2d("./textures/zinc_galvanized_multi_R_base_G_dirtmask_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::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, 0.729999959f) * (leak_dirt_weight * 0.25f)) * (dirt_spots_weight * float3(infinite_tiling ? endless_texture(texture_2d("./textures/zinc_galvanized_multi_R_dirt_G_urough_B_vrough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.153999999f, 0.501999974f, 0.493999988f), 3.f, false) : ::base::file_texture(texture_2d("./textures/zinc_galvanized_multi_R_dirt_G_urough_B_vrough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::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 + ::math::lerp(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/zinc_galvanized_multi_R_dirt_G_urough_B_vrough.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.153999999f, 0.501999974f, 0.493999988f), 3.f, false) : ::base::file_texture(texture_2d("./textures/zinc_galvanized_multi_R_dirt_G_urough_B_vrough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::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.419999987f, zinc_roughness * 0.400000006f + 0.400000006f), ::math::lerp(::math::clamp(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/zinc_galvanized_multi_R_base_G_dirtmask_B_dirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.379000008f, 0.689999998f, 0.750999987f), 3.f, false) : ::base::file_texture(texture_2d("./textures/zinc_galvanized_multi_R_base_G_dirtmask_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::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, 1.f, oxide_roughness * 0.219999999f + 0.600000024f), 0.f, 1.f), float3(infinite_tiling ? endless_texture(texture_2d("./textures/zinc_galvanized_multi_R_base_G_dirtmask_B_dirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.379000008f, 0.689999998f, 0.750999987f), 3.f, false) : ::base::file_texture(texture_2d("./textures/zinc_galvanized_multi_R_base_G_dirtmask_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::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, ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/zinc_galvanized_multi_R_base_G_dirtmask_B_dirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.379000008f, 0.689999998f, 0.750999987f), 3.f, false) : ::base::file_texture(texture_2d("./textures/zinc_galvanized_multi_R_base_G_dirtmask_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::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, 0.729999959f) * (leak_dirt_weight * 0.25f)), oxidation_amount) + ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/zinc_galvanized_multi_R_base_G_dirtmask_B_dirt.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.379000008f, 0.689999998f, 0.750999987f), 3.f, false) : ::base::file_texture(texture_2d("./textures/zinc_galvanized_multi_R_base_G_dirtmask_B_dirt.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale, ::base::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, 0.729999959f) * (leak_dirt_weight * 0.25f)), color(0.450940013f, 0.512027025f, 0.590619028f), color(0.f, 0.f, 0.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), bsdf(), infinite_tiling ? endless_normal(texture_2d("./textures/zinc_galvanized_normal.jpg", ::tex::gamma_linear), bump_strength, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.25f, ::base::texture_coordinate_uvw, uv_space_index), 2.72000003f, float3(0.5f, 0.5f, 0.996999979f), 3.f) : nvidia::core_definitions::normalmap_texture(texture_2d("./textures/zinc_galvanized_normal.jpg", ::tex::gamma_linear), 1.f / texture_scale * 4.f, texture_translate, texture_rotate, false, bump_strength, 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(0.f, roundcorners_across_materials, roundcorners_radius_mm) : ::state::normal()); + } in + material( + thin_walled: false, + surface: tmp1, + backface: tmp2, + ior: tmp3, + volume: tmp4, + geometry: tmp5); + + +export material Zinc_Rough_Crystals(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Zinc Galvanizing - Rough Crystals"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("metal", "zinc", "infinite", "tiling", "construction", "architecture", "galvanized", "coated", "metallic", "rough", "gray")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Zinc_Galvanizing.Zinc_Rough_Crystals.png") +]] = Zinc_Galvanizing ( + infinite_tiling: true, + zinc_roughness: 0.83f, + oxidation_amount: 0.08f, + oxide_roughness: 0.79f, + dirt_spots_weight: 0.18f, + leak_dirt_weight: 0.03f, + bump_strength: 0.28, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 0.8f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +export material Zinc_Rough_Medium_Oxidized(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Zinc Galvanizing - Medium Oxidized"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("metal", "zinc", "infinite", "tiling", "construction", "architecture", "galvanized", "oxidized", "aged", "old", "coated", "dirty", "metallic", "rough", "gray")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Zinc_Galvanizing.Zinc_Rough_Medium_Oxidized.png") +]] = Zinc_Galvanizing ( + infinite_tiling: true, + zinc_roughness: 0.83f, + oxidation_amount: 0.08f, + oxide_roughness: 0.79f, + dirt_spots_weight: 0.18f, + leak_dirt_weight: 0.03f, + bump_strength: 0.28, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 0.8f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + +export material Zinc_Rough_Heavy_Shiny_Oxidized(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Zinc Galvanizing - Heavy Shiny Oxidized"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("metal", "zinc", "infinite", "tiling", "construction", "architecture", "galvanized", "oxidized", "aged", "old", "coated", "dirty", "metallic", "rough", "gray")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Zinc_Galvanizing.Zinc_Rough_Heavy_Shiny_Oxidized.png") +]] = Zinc_Galvanizing ( + infinite_tiling: true, + zinc_roughness: 0.29f, + oxidation_amount: 0.82f, + oxide_roughness: 0.21f, + dirt_spots_weight: 0.59f, + leak_dirt_weight: 0.57f, + bump_strength: 0.56, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 0.8f, + roundcorners_across_materials: false, + uv_space_index: 0 +); + + +export material Zinc_Dirty_Rough_Oxidized(*) +[[ + ::anno::description(DESCRIPTION), + ::anno::display_name("Zinc Galvanizing - Dirty Rough"), + ::anno::copyright_notice(COPYRIGHT), + ::anno::key_words(string[]("metal", "zinc", "infinite", "tiling", "construction", "architecture", "galvanized", "oxidized", "aged", "worn", "old", "coated", "dirty", "metallic", "rough", "gray")), + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("Maik Rohland"), + ::anno::contributor("Ruediger Raab"), + ::anno::thumbnail("./.thumbs/Zinc_Galvanizing.Zinc_Dirty_Rough_Oxidized.png") +]] = Zinc_Galvanizing ( + infinite_tiling: true, + zinc_roughness: 0.29f, + oxidation_amount: 0.82f, + oxide_roughness: 0.72f, + dirt_spots_weight: 0.86f, + leak_dirt_weight: 0.73f, + bump_strength: 1.0f, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + roundcorners_enable: false, + roundcorners_radius_mm: 0.8f, + roundcorners_across_materials: false, + uv_space_index: 0 +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Metal/Zinc_Hammered.mdl b/code/third_party/vMaterials_2/Metal/Zinc_Hammered.mdl new file mode 100644 index 0000000000000000000000000000000000000000..2f89448647567e44959604dc0dbfe968e38d3827 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Zinc_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 Zinc_Hammered( + color metal_color = color(0.708f, 0.708f, 0.701f) [[ + ::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 = float2(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 = float2(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 Zinc - Dark Pits"), + ::anno::author("NVIDIA vMaterials"), + ::anno::in_group("Metal"), + ::anno::key_words(string[]("metal", "zinc", "blackened", "hammered", "design", "classic", "architecture", "pattern", "reflective", "rough", "bumped", "conductor")), + ::anno::thumbnail("./.thumbs/Zinc_Hammered.Zinc_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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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 Zinc_Hammered_Shiny(*) +[[ + ::anno::display_name("Hammered Zinc - Shiny"), + ::anno::author("NVIDIA vMaterials"), + ::anno::in_group("Metal"), + ::anno::key_words(string[]("metal", "zinc", "hammered", "design", "classic", "architecture", "pattern", "reflective", "rough", "bumped", "conductor", "shiny")), + ::anno::thumbnail("./.thumbs/Zinc_Hammered.Zinc_Hammered_Shiny.png"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT) +]] + = Zinc_Hammered( + metal_color: color(0.708f, 0.708f, 0.701f), + 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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + +export material Zinc_Hammered_Dull(*) +[[ + ::anno::display_name("Hammered Zinc - Dull"), + ::anno::author("NVIDIA vMaterials"), + ::anno::in_group("Metal"), + ::anno::key_words(string[]("metal", "zinc", "hammered", "design", "classic", "architecture", "pattern", "reflective", "rough", "bumped", "conductor", "matte", "dull")), + ::anno::thumbnail("./.thumbs/Zinc_Hammered.Zinc_Hammered_Dull.png"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT) +]] + = Zinc_Hammered( + metal_color: color(0.708f, 0.708f, 0.701f), + 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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Metal/Zinc_Knurling.mdl b/code/third_party/vMaterials_2/Metal/Zinc_Knurling.mdl new file mode 100644 index 0000000000000000000000000000000000000000..99f9c11aaad6d3a6e8d69443764d7033d0374d23 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Zinc_Knurling.mdl @@ -0,0 +1,359 @@ +/****************************************************************************** + * 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 ::df::*; +import ::tex::*; +import ::math::*; +import ::base::*; +import ::state::*; +import ::anno::*; +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 = "Metal with a diamond knurling finish"; + +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; + //TODO: at least also handle sign of z? + //TODO: handle tangent becoming 0 + + + 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)); +} + +export material Zinc_Knurling( + //Appearance + float brightness = float(0.7f) [[ + ::anno::description("Adjusts the brightness of the material."), + ::anno::display_name("Brightness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.0f, 1.0f) + ]], + float roughness = float(0.5f) [[ + ::anno::description("Higher values lead to a rougher appearance of the material."), + ::anno::display_name("Roughness"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.0f, 1.0f) + ]], + float grooves_dirt = float(0.4f) [[ + ::anno::description("Adds dirt in the grooves of the knurling pattern."), + ::anno::display_name("Grooves Dirt"), + ::anno::in_group("Appearance"), + ::anno::hard_range(0.0f, 1.0f) + ]], + uniform float bump_strength = float(0.8f) [[ + ::anno::description("Adds dirt in the grooves of the knurling pattern."), + ::anno::display_name("Bump Strength"), + ::anno::in_group("Appearance"), + ::anno::soft_range(0.0f, 1.0f) + ]], + + // Round Corners + 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("Sets the radius of the round corners in millimeters."), + ::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") + ]], + //Transform + float2 texture_translate = float2(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"), + ::anno::soft_range(0.f, 360.f) + ]], + float2 texture_scale = float2(1.f) [[ + ::anno::description("Larger numbers increase the size."), + ::anno::display_name("Texture Scale"), + ::anno::in_group("Transform"), + ::nvidia::core_definitions::dimension(float2(0.35f, .35f)), + ::anno::soft_range(float2(0.f), float2(2.f)) + ]], + + // Advanced + uniform int uv_space_index = 0 [[ + ::anno::description("Uses the selected UV space index."), + ::anno::display_name("UV Space Index"), + ::anno::in_group("Advanced"), + ::anno::soft_range(0, 4) + ]] +) +[[ + ::anno::display_name("Zinc Knurling"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Zinc_Knurling.Zinc_Knurling.png"), + ::anno::key_words(string[]("metal", "zinc", "knurled", "knurling", "pattern", "design", "bumped")), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials") +]] += let +{ + color metal_tint = color(0.87467950988f,0.868943040106f,0.855089634324f); // Zinc + + // Texture setup + texture_2d normal_tex = texture_2d("./textures/metal_knurling_norm.jpg", ::tex::gamma_linear); + texture_2d multi_heights_tex = texture_2d("./textures/metal_knurling_multi_heights.jpg", ::tex::gamma_linear); + texture_2d diff_rough_grunge_tex = texture_2d("./textures/metal_knurling_multi_R_diff_G_rough_B_grunge.jpg", ::tex::gamma_linear); + + // Coordinate setup + ::base::texture_coordinate_info uvw = vmat_transform( + translation: texture_translate, + rotation: texture_rotate, + scaling: texture_scale, + system: ::base::texture_coordinate_uvw, + uv_space: uv_space_index + ); + + // ---------- Diff Rough Grunge Lookup ---------- + + float3 diff_rough_grunge_lookup = float3( + ::base::file_texture( + texture: diff_rough_grunge_tex, + uvw: uvw, + mono_source: ::base::mono_average + ).tint ); + + float3 multi_height_lookup = float3( + ::base::file_texture( + texture: multi_heights_tex, + uvw: uvw, + mono_source: ::base::mono_average + ).tint ); + + float3 norm = ::base::tangent_space_normal_texture( + texture: normal_tex, + factor: bump_strength, + uvw: uvw + ); + + + float remap_rough = histogram_range( + input: diff_rough_grunge_lookup.y, + range: 1.0f, + position: 0.234f + ); + + + float roughness_mapped = remap_rough + (roughness * multi_height_lookup.y); + + float remapped_diff = histogram_range( + input: diff_rough_grunge_lookup.x, + range: 1.0f, + position: (brightness * 0.4f) + 0.4f + ); + + float diff_contribution = ::math::pow(remapped_diff - ((grooves_dirt * 0.5) * multi_height_lookup.x * diff_rough_grunge_lookup.z), 2.67f); + + bsdf ggx_smith_bumped = ::df::weighted_layer( + layer: ::df::microfacet_ggx_smith_bsdf( + roughness_u: roughness_mapped * roughness_mapped, + roughness_v: roughness_mapped * roughness_mapped, + tint: color(diff_contribution), + mode: ::df::scatter_reflect + ), + base: bsdf(), + weight: 1.0f, + normal: norm + ); + + bsdf diff_bsdf = ::df::diffuse_reflection_bsdf( + tint: color(diff_contribution) + ); + + + bsdf final_bsdf = ::df::weighted_layer( + weight: 1.0f - (diff_rough_grunge_lookup.z * multi_height_lookup.x * grooves_dirt), + layer: ::df::directional_factor( + normal_tint: metal_tint, + grazing_tint: color(1.0f), + base: ggx_smith_bumped + ), + base: diff_bsdf + ); + + + // Round Corners + float3 round_normal = enable_round_corners ? + ::state::rounded_corner_normal( + radius: roundcorner_radius * 0.001, + across_materials: across_materials + ) : ::state::normal(); +} +in material ( + + surface: material_surface( + scattering: final_bsdf + ), + geometry: material_geometry( + normal: round_normal + ) +); + + +export material Zinc_Knurling_Worn(*) +[[ + ::anno::display_name("Zinc Knurling - Zinc Worn"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Zinc_Knurling.Zinc_Knurling_Worn.png"), + ::anno::key_words(string[]("metal", "zinc", "knurled", "pattern", "knurling", "design", "bumped", "worn")), + ::anno::contributor("Ruediger Raab"), + ::anno::author("NVIDIA vMaterials") +]] = Zinc_Knurling( + brightness: 0.4f, + roughness: 1.0f, + grooves_dirt: 1.0f, + bump_strength: 0.8f, + + enable_round_corners: false, + roundcorner_radius: 1.2f, + across_materials: false, + + texture_translate: float2(0.0f), + texture_rotate: 0.f, + texture_scale: float2(1.0f), + + uv_space_index: 0 +); + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/code/third_party/vMaterials_2/Metal/Zinc_Scratched.mdl b/code/third_party/vMaterials_2/Metal/Zinc_Scratched.mdl new file mode 100644 index 0000000000000000000000000000000000000000..9f14ee69d9a4854db8c7e8bdb9a9ab9f9bc98f80 --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Zinc_Scratched.mdl @@ -0,0 +1,595 @@ +/****************************************************************************** + * 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 Zinc_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 = float2(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 = float2(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 Zinc"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "zinc", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped")), + ::anno::thumbnail("./.thumbs/Zinc_Scratched.Zinc_Scratched.png"), + ::anno::copyright_notice(COPYRIGHT) +]] + = + let { + float brush_scratches_weight = 0.5f; + // Zinc Reflection Color + color reflection_color = color(0.87467950988f, 0.868943040106f, 0.855089634324f); // Zinc + 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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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 Zinc_Scratched_Light_Bumpy(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Scratched Zinc - Bright and Bumped"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "zinc", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "shiny")), + ::anno::thumbnail("./.thumbs/Zinc_Scratched.Zinc_Scratched_Light_Bumpy.png"), + ::anno::copyright_notice(COPYRIGHT) +]]= Zinc_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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); + + + +export material Zinc_Scratched_Dark_Shiny(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Scratched Zinc - Dark Shiny"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "zinc", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "shiny", "dark")), + ::anno::thumbnail("./.thumbs/Zinc_Scratched.Zinc_Scratched_Dark_Shiny.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Zinc_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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); + + +export material Zinc_Scratched_Dark_Matte(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Scratched Zinc - Dark Matte"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "zinc", "scratched", "worn", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "matte", "dark")), + ::anno::thumbnail("./.thumbs/Zinc_Scratched.Zinc_Scratched_Dark_Matte.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Zinc_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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); + + + + +export material Zinc_Scratched_Scuffs_and_Grime(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Scratched Zinc - Scuffs and Grime"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "zinc", "scratched", "worn", "dirty", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "matte", "dark")), + ::anno::thumbnail("./.thumbs/Zinc_Scratched.Zinc_Scratched_Scuffs_and_Grime.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Zinc_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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); + + + + +export material Zinc_Scratched_Dirty_Rough(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Scratched Zinc - Dirty Rough"), + ::anno::description(DESCRIPTION), + ::anno::key_words(string[]("metal", "zinc", "scratched", "worn", "dirt", "dirty", "old", "aged", "oxidized", "scratches", "infinite tiling", "rough", "bumped", "matte", "dark")), + ::anno::thumbnail("./.thumbs/Zinc_Scratched.Zinc_Scratched_Dirty_Rough.png"), + ::anno::copyright_notice(COPYRIGHT) +]] = Zinc_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: float2(1.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + enable_round_corners: false, + radius_mm: 1.5, + across_materials: true, + uv_space_index: 0 +); diff --git a/code/third_party/vMaterials_2/Metal/Zinc_Sheet.mdl b/code/third_party/vMaterials_2/Metal/Zinc_Sheet.mdl new file mode 100644 index 0000000000000000000000000000000000000000..608241e38a78013b845dd43ba0221b30e10289eb --- /dev/null +++ b/code/third_party/vMaterials_2/Metal/Zinc_Sheet.mdl @@ -0,0 +1,1341 @@ +/****************************************************************************** + * 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 zinc 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) + float2(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 Zinc_Sheet( + 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::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::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 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 = float2(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 = float2(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 Zinc - New Clean"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Zinc_Sheet.Zinc_Sheet.png"), + ::anno::key_words(string[]("metal", "sheet", "zinc", "exterior", "interior", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "neutral")) +]] + = + let { + color normal_reflectivity = color(0.87467950988f, 0.868943040106f, 0.855089634324f); // Zinc + 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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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("./textures/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 Zinc_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 = float2(.5f, .5f) + [[ + ::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) + ]], + + + +// Zinc 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::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::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 = float2(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 = float2(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("Zinc Sheet - Circular Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Zinc_Sheet.Zinc_Sheet_Punched.png"), + ::anno::key_words(string[]("metal", "sheet", "zinc", "decorative", "interior", "exterior", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "sanitary", "design", "infinite tiling", "punched", "punching", "circular", "gray")) +]] = let +{ + material base_mat = Zinc_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, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + uv_space_index: uv_space_index, + enable_round_corners: enable_round_corners, + roundcorner_radius: roundcorner_radius, + across_materials: across_materials + ); + texture_2d punching_cutout = texture_2d("./textures/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 + ) +); + + + +export material Zinc_Sheet_Soft_Splotches(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Zinc - Soft Splotches"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Zinc_Sheet.Zinc_Sheet_Soft_Splotches.png"), + ::anno::key_words(string[]("metal", "sheet", "zinc", "exterior", "interior", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "neutral", "gray")) +]] += Zinc_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// ------------------------ Zinc Sheet Presets ------------------------ + +export material Zinc_Sheet_Matte_Imperfections(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Zinc - Matte Imperfections"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Zinc_Sheet.Zinc_Sheet_Matte_Imperfections.png"), + ::anno::key_words(string[]("metal", "sheet", "zinc", "exterior", "interior", "imperfections", "new", "matte", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "neutral")) +]]= Zinc_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + + +export material Zinc_Sheet_Glossy_Imperfections(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Zinc - Glossy Imperfections"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Zinc_Sheet.Zinc_Sheet_Glossy_Imperfections.png"), + ::anno::key_words(string[]("metal", "sheet", "zinc", "exterior", "interior", "imperfections", "new", "glossy", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "neutral")) +]] += Zinc_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + + + +export material Zinc_Sheet_Splotchy_Streaks(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Zinc - Splotchy Streaks"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Zinc_Sheet.Zinc_Sheet_Splotchy_Streaks.png"), + ::anno::key_words(string[]("metal", "sheet", "zinc", "exterior", "interior", "imperfections", "new", "glossy", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "neutral")) +]]= Zinc_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + +export material Zinc_Sheet_Glossy_Streaks(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::display_name("Metal Sheet Zinc - Glossy Streaks"), + ::anno::description(DESCRIPTION), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Zinc_Sheet.Zinc_Sheet_Glossy_Streaks.png"), + ::anno::key_words(string[]("metal", "sheet", "zinc", "exterior", "interior", "imperfections", "new", "glossy", "unfinished", "reflective", "oxidized", "construction", "design", "infinite tiling", "neutral")) +]] += Zinc_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: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +// ------------------------ Punched Zinc Sheet Presets ------------------------ + +export material Zinc_Sheet_Punched_Small_Circular(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Zinc Sheet - Small Circular Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Zinc_Sheet.Zinc_Sheet_Punched_Small_Circular.png"), + ::anno::key_words(string[]("metal", "sheet", "zinc", "decorative", "interior", "exterior", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "sanitary", "design", "infinite tiling", "punched", "punching", "circular", "gray")) +]] += Zinc_Sheet_Punched( + // Punching Parameters + shape_select: pattern_circle, + punching_grid_size: float2(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, + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.6f, + streaks: 0.1f, + scratch_bump_factor: 0.15f, + imperfections_amount: 1.0f, + impurities_weight_1: 0.75f, + impurities_weight_2: 1.0f, + impurities_weight_3: 0.86f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Zinc_Sheet_Punched_Hexagonal(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Zinc Sheet - Hexagonal Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Zinc_Sheet.Zinc_Sheet_Punched_Hexagonal.png"), + ::anno::key_words(string[]("metal", "sheet", "zinc", "decorative", "interior", "exterior", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "sanitary", "design", "infinite tiling", "punched", "punching", "hexagonal", "gray")) +]] += Zinc_Sheet_Punched( + // Punching Parameters + shape_select: pattern_hexagon, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.6f, + streaks: 0.1f, + scratch_bump_factor: 0.15f, + imperfections_amount: 1.0f, + impurities_weight_1: 0.75f, + impurities_weight_2: 1.0f, + impurities_weight_3: 0.86f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Zinc_Sheet_Punched_Hexagonal_Small(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Zinc Sheet - Small Hexagonal Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Zinc_Sheet.Zinc_Sheet_Punched_Hexagonal_Small.png"), + ::anno::key_words(string[]("metal", "sheet", "zinc", "decorative", "interior", "exterior", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "sanitary", "design", "infinite tiling", "punched", "punching", "hexagonal", "gray")) +]] += Zinc_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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.6f, + streaks: 0.1f, + scratch_bump_factor: 0.15f, + imperfections_amount: 1.0f, + impurities_weight_1: 0.75f, + impurities_weight_2: 1.0f, + impurities_weight_3: 0.86f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Zinc_Sheet_Punched_Square(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Zinc Sheet - Square Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Zinc_Sheet.Zinc_Sheet_Punched_Square.png"), + ::anno::key_words(string[]("metal", "sheet", "zinc", "decorative", "interior", "exterior", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "sanitary", "design", "infinite tiling", "punched", "punching", "square", "gray")) +]] += Zinc_Sheet_Punched( + // Punching Parameters + shape_select: pattern_square, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.6f, + streaks: 0.1f, + scratch_bump_factor: 0.15f, + imperfections_amount: 1.0f, + impurities_weight_1: 0.75f, + impurities_weight_2: 1.0f, + impurities_weight_3: 0.86f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Zinc_Sheet_Punched_Line(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Zinc Sheet - Line Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Zinc_Sheet.Zinc_Sheet_Punched_Line.png"), + ::anno::key_words(string[]("metal", "sheet", "zinc", "decorative", "interior", "exterior", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "sanitary", "design", "infinite tiling", "punched", "punching", "line", "gray")) +]] += Zinc_Sheet_Punched( + // Punching Parameters + shape_select: pattern_line, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.6f, + streaks: 0.1f, + scratch_bump_factor: 0.15f, + imperfections_amount: 1.0f, + impurities_weight_1: 0.75f, + impurities_weight_2: 1.0f, + impurities_weight_3: 0.86f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Zinc_Sheet_Punched_Cross(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Zinc Sheet - Cross Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Zinc_Sheet.Zinc_Sheet_Punched_Cross.png"), + ::anno::key_words(string[]("metal", "sheet", "zinc", "decorative", "interior", "exterior", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "sanitary", "design", "infinite tiling", "punched", "punching", "cross", "gray")) +]] += Zinc_Sheet_Punched( + // Punching Parameters + shape_select: pattern_cross, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.6f, + streaks: 0.1f, + scratch_bump_factor: 0.15f, + imperfections_amount: 1.0f, + impurities_weight_1: 0.75f, + impurities_weight_2: 1.0f, + impurities_weight_3: 0.86f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Zinc_Sheet_Punched_Rhombus(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Zinc Sheet - Rhombus Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Zinc_Sheet.Zinc_Sheet_Punched_Rhombus.png"), + ::anno::key_words(string[]("metal", "sheet", "zinc", "decorative", "interior", "exterior", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "sanitary", "design", "infinite tiling", "punched", "punching", "rhombus", "gray")) +]] += Zinc_Sheet_Punched( + // Punching Parameters + shape_select: pattern_rhombus, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.6f, + streaks: 0.1f, + scratch_bump_factor: 0.15f, + imperfections_amount: 1.0f, + impurities_weight_1: 0.75f, + impurities_weight_2: 1.0f, + impurities_weight_3: 0.86f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Zinc_Sheet_Punched_Triangle(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Zinc Sheet - Triangle Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Zinc_Sheet.Zinc_Sheet_Punched_Triangle.png"), + ::anno::key_words(string[]("metal", "sheet", "zinc", "decorative", "interior", "exterior", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "sanitary", "design", "infinite tiling", "punched", "punching", "triangle", "gray")) +]] += Zinc_Sheet_Punched( + // Punching Parameters + shape_select: pattern_triangle, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.6f, + streaks: 0.1f, + scratch_bump_factor: 0.15f, + imperfections_amount: 1.0f, + impurities_weight_1: 0.75f, + impurities_weight_2: 1.0f, + impurities_weight_3: 0.86f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); + + +export material Zinc_Sheet_Punched_Star(*) +[[ + ::anno::author("NVIDIA vMaterials"), + ::anno::contributor("RĂ¼diger Raab"), + ::anno::contributor("Maik Rohland"), + ::anno::display_name("Zinc Sheet - Star Punch"), + ::anno::description(DESCRIPTION_PUNCH), + ::anno::copyright_notice(COPYRIGHT), + ::anno::thumbnail("./.thumbs/Zinc_Sheet.Zinc_Sheet_Punched_Star.png"), + ::anno::key_words(string[]("metal", "sheet", "zinc", "decorative", "interior", "exterior", "imperfections", "new", "unfinished", "reflective", "oxidized", "construction", "sanitary", "design", "infinite tiling", "punched", "punching", "star", "gray")) +]] += Zinc_Sheet_Punched( + // Punching Parameters + shape_select: pattern_star, + punching_grid_size: float2(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, + + // Material Parameters + infinite_tiling: false, + sheet_brightness: 0.85f, + roughness: 0.6f, + streaks: 0.1f, + scratch_bump_factor: 0.15f, + imperfections_amount: 1.0f, + impurities_weight_1: 0.75f, + impurities_weight_2: 1.0f, + impurities_weight_3: 0.86f, + enable_round_corners: false, + roundcorner_radius: 0.01f, + across_materials: false, + texture_translate: float2(0.0f), + texture_rotate: 0.0f, + texture_scale: float2(1.0f), + uv_space_index: 0 +); \ No newline at end of file diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Prepreg.mdl.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Prepreg.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..002ee0623501be0e0400cf15b6e70ee9d724c8f4 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Prepreg.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6b5a96ada5406a130a06f53fb2b8b95596ee6838fd6c831533884558995641c1 +size 104569 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Prepreg.mdl@PCB_Prepreg.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Prepreg.mdl@PCB_Prepreg.png new file mode 100644 index 0000000000000000000000000000000000000000..002ee0623501be0e0400cf15b6e70ee9d724c8f4 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Prepreg.mdl@PCB_Prepreg.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6b5a96ada5406a130a06f53fb2b8b95596ee6838fd6c831533884558995641c1 +size 104569 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Prepreg.mdl@PCB_Prepreg_Rough.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Prepreg.mdl@PCB_Prepreg_Rough.png new file mode 100644 index 0000000000000000000000000000000000000000..4d6c570e848ce820e665adc1b19c29b5921c9617 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Prepreg.mdl@PCB_Prepreg_Rough.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:410926a76c8da835d7f6f31a7f3baca3a29a5aca815123fea48ac8e4e12d8dc3 +size 104100 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Prepreg.mdl@PCB_Prepreg_Shiny.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Prepreg.mdl@PCB_Prepreg_Shiny.png new file mode 100644 index 0000000000000000000000000000000000000000..a77e91053f0773f51b21c9947425f9d1562d14b0 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Prepreg.mdl@PCB_Prepreg_Shiny.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1e82f1a0180afe63591a73a283b3f471c2a6c7c9554e5cab8f2209bc382a8d01 +size 106955 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..bd6895c4a4900a84568b5af17b47580d9d093b06 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7d1d09c174e0435e010daa2f024be8da8ca38a3d550842e2fb296c875e869a9e +size 81256 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl@PCB_Solder_Mask.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl@PCB_Solder_Mask.png new file mode 100644 index 0000000000000000000000000000000000000000..bd6895c4a4900a84568b5af17b47580d9d093b06 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl@PCB_Solder_Mask.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7d1d09c174e0435e010daa2f024be8da8ca38a3d550842e2fb296c875e869a9e +size 81256 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl@PCB_Solder_Mask_Black.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl@PCB_Solder_Mask_Black.png new file mode 100644 index 0000000000000000000000000000000000000000..a0b0339ab8d6edcb217c224493dc1257830364fc --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl@PCB_Solder_Mask_Black.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4e1819f44fcb42d8711c936d2334829dd974c6c43385c1cf2e0551422a3d7ac0 +size 81924 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl@PCB_Solder_Mask_Black_Fast.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl@PCB_Solder_Mask_Black_Fast.png new file mode 100644 index 0000000000000000000000000000000000000000..80308c6a822f2f95af2be7240f88f8bf34fd5d4a --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl@PCB_Solder_Mask_Black_Fast.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dd0dca3213ebe3eade1c9be07124ccf621fc7ca55fea6e0896dfcadcbd28f9b2 +size 75502 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl@PCB_Solder_Mask_Blue_Fast.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl@PCB_Solder_Mask_Blue_Fast.png new file mode 100644 index 0000000000000000000000000000000000000000..ab06a001e7e551615342dc2b7c0b845a815bbb00 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl@PCB_Solder_Mask_Blue_Fast.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e79afcba9ef256b416ea96795840e88111cdb447ee108db225bc6c6d659f48a8 +size 78579 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl@PCB_Solder_Mask_Green_Fast.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl@PCB_Solder_Mask_Green_Fast.png new file mode 100644 index 0000000000000000000000000000000000000000..1393f7316ca4c0b320e4586b35c9d8f7fd40bb3a --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl@PCB_Solder_Mask_Green_Fast.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ed07ff874eae6349fed5f95959f5a63eafa62a03c665eff10d00049cf4f58092 +size 78624 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl@PCB_Solder_Mask_Red.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl@PCB_Solder_Mask_Red.png new file mode 100644 index 0000000000000000000000000000000000000000..e4bf61c34f7ac23f7dacb218ca917504f111e4be --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl@PCB_Solder_Mask_Red.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3d3d456aedef91a4a687b279035befb237c7d3415b90d625fca5bdbdcbf47940 +size 81678 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl@PCB_Solder_Mask_Red_Fast.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl@PCB_Solder_Mask_Red_Fast.png new file mode 100644 index 0000000000000000000000000000000000000000..82652da5086ba7ab36fbef8e8797466bfeb47251 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl@PCB_Solder_Mask_Red_Fast.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3e80bb5c0b3163a3b9f4fba8f04c2b2aeb41095c758e50b86def38cc9640d812 +size 84203 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl@PCB_Solder_Mask_White.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl@PCB_Solder_Mask_White.png new file mode 100644 index 0000000000000000000000000000000000000000..57b92c87f11582bec778173c5f0409ec1c045d8a --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl@PCB_Solder_Mask_White.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a48fc89feb8ab6495225bfba81e860a415f4e352e5e1df1687a597a3d986041d +size 78748 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl@PCB_Solder_Mask_White_Fast.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl@PCB_Solder_Mask_White_Fast.png new file mode 100644 index 0000000000000000000000000000000000000000..93e0354ea70314cfec1680edeb9636cc025f545b --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl@PCB_Solder_Mask_White_Fast.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:99fc8e3e17e41cfdbb35acb7de2262ca4d999f4fda3277ef1c03c21e9b5d9452 +size 78349 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl@PCB_Solder_Mask_Yellow.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl@PCB_Solder_Mask_Yellow.png new file mode 100644 index 0000000000000000000000000000000000000000..033f9159854817c53d0ba00e6652d60cb7f5bcd5 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl@PCB_Solder_Mask_Yellow.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:080fd402bbac9a6e05205084652fa984c69da2c74d6afcbe3dc3be59894ffe53 +size 83903 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl@PCB_Solder_Mask_Yellow_Fast.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl@PCB_Solder_Mask_Yellow_Fast.png new file mode 100644 index 0000000000000000000000000000000000000000..3b94d5ac7cd7cfeb0b378ae45b348a0b6157385a --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PCB_Solder_Mask.mdl@PCB_Solder_Mask_Yellow_Fast.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:27398a21b0ce8727f805a7c53a266286e13f4374748db36318eb33db03311357 +size 84535 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PET_Clear.mdl.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PET_Clear.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..cae9b2497c381683947a8d5faf6ab4d005c9f9d6 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PET_Clear.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a12d4d94c3b3ad7ce7703d01a698596fb35b9064d11c166b5ec20feddb05a48f +size 129996 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PET_Clear.mdl@PET_Clear.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PET_Clear.mdl@PET_Clear.png new file mode 100644 index 0000000000000000000000000000000000000000..cae9b2497c381683947a8d5faf6ab4d005c9f9d6 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PET_Clear.mdl@PET_Clear.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a12d4d94c3b3ad7ce7703d01a698596fb35b9064d11c166b5ec20feddb05a48f +size 129996 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PET_Clear.mdl@PET_Smudged.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PET_Clear.mdl@PET_Smudged.png new file mode 100644 index 0000000000000000000000000000000000000000..0c4e6b2fcee31f3eb59ea31ff2a99e117020a16a --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/PET_Clear.mdl@PET_Smudged.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cd3a6e7499af9c4f2b03fc818ec3c653a85a187bccefe88755508094714ec25c +size 133179 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..1d4690b86548c7f1ccef4f0483e067ce4e3a69b0 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b2869187d3ae47af44e0e91d55a32a8b04889f20f33597bab07b545410a0bc8e +size 74497 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish.png new file mode 100644 index 0000000000000000000000000000000000000000..1d4690b86548c7f1ccef4f0483e067ce4e3a69b0 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b2869187d3ae47af44e0e91d55a32a8b04889f20f33597bab07b545410a0bc8e +size 74497 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_Template_V2.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_Template_V2.png new file mode 100644 index 0000000000000000000000000000000000000000..225be9873b89c5eb9b487844a85102425b2af678 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_Template_V2.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6b042e163ccd89e33d28319ca9431645d85919bcc1f4c9dcdfcf1299e0c1ae7a +size 76903 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V12.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V12.png new file mode 100644 index 0000000000000000000000000000000000000000..471d7713971e00e3acdc51e77a0ecc7505b48ef0 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V12.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9549fba9f5db09b9a0b2b2a495a08a89a47c7b577b4269080a8c5bdf071a1c01 +size 68533 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V15.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V15.png new file mode 100644 index 0000000000000000000000000000000000000000..5344f03fb88731b872c7b26eb2204993d397a874 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V15.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:89b8d7512d9e601f2b0c4b2e24ab29f55c862bccb510b45cd15e449b3eb73e93 +size 69789 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V18.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V18.png new file mode 100644 index 0000000000000000000000000000000000000000..af06658e88235d7491953fcc8f2a4910f22c883a --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V18.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cf1750c756bbe88d1613108e329c2cae7c91b59884975f6ea008fb8f15c991b1 +size 74666 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V21.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V21.png new file mode 100644 index 0000000000000000000000000000000000000000..569b3c5429a2864c78ee7f0aab279d9751754974 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V21.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:16b331525275f46f528e2a8a005fb4014cc7855a64665125cf354740fea7bd2f +size 74564 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V24.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V24.png new file mode 100644 index 0000000000000000000000000000000000000000..e170bd2b28060ac67a5bd8a22b729a5bbea0196e --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V24.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:92c7ca8d624d74bb439a14f6158ef160cd45fbab1cbc23489d7c35efb8e5d81f +size 74557 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V27.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V27.png new file mode 100644 index 0000000000000000000000000000000000000000..c69b7c0010bbea5785d90e68d88451911486bc19 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V27.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:20f21ea50bd4f0ca94bed2baa3764402dc3830525ba3266f94b069445f345fa2 +size 74584 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V30.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V30.png new file mode 100644 index 0000000000000000000000000000000000000000..65d4c15a48bae1044eb1ac92f48ef824e2e074f9 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V30.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f1322afae2088524b62508ae346775a9dee41a5cb02631f6c18fa69a023ef337 +size 75922 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V33.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V33.png new file mode 100644 index 0000000000000000000000000000000000000000..98ac8ce5e7b39e677a15f2908ff36ec74359b33d --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V33.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b0e37d8cb59ce193d335082bfeb2f6681451ffc3f25f3d77da2301677dc5bef7 +size 75873 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V36.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V36.png new file mode 100644 index 0000000000000000000000000000000000000000..41d24e32cf8b653ca6df740c5328df7a7f47cc88 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V36.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d95f41c01d97ac11a05beeda904db66dbd0bae293ede92aa0b814d84e65dc12b +size 75970 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V39.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V39.png new file mode 100644 index 0000000000000000000000000000000000000000..dd527b84f3fc43785f8893aa64737ce864b4cc81 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V39.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f4615ccaeef6ba84a5d356b09eeade2a2ad9cab9aedd5f36c92fe8ea6586d66f +size 75872 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V42.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V42.png new file mode 100644 index 0000000000000000000000000000000000000000..50d5ac95745c0af236a01f47fc88a8f12df10337 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V42.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4767639a9a29f891ae0f5acc64b4c974dc3fb5557646351cd032051c8682bc5f +size 76222 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V45.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V45.png new file mode 100644 index 0000000000000000000000000000000000000000..3f0e96e6b9c56a9127011c21a1e354d25f410a48 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Standardized_Surface_Finish.mdl@Plastic_Standardized_Surface_Finish_V45.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1905735d9bb2e9fc3fca0c55b4aa0445254d0f8553990ca82d6620b867018156 +size 79302 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..0fe74d0dc4f23ac4ad6dd4aa338178f098eb50f2 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4f294c21505ed7ddc613e05a2b5d4eaa13a0f4f66cf6917f448f7349f29a9f5b +size 103883 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@Plastic_Thick_Translucent.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@Plastic_Thick_Translucent.png new file mode 100644 index 0000000000000000000000000000000000000000..0fe74d0dc4f23ac4ad6dd4aa338178f098eb50f2 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@Plastic_Thick_Translucent.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4f294c21505ed7ddc613e05a2b5d4eaa13a0f4f66cf6917f448f7349f29a9f5b +size 103883 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_black.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_black.png new file mode 100644 index 0000000000000000000000000000000000000000..01f78d5587f877c6498d68121ff6635124b47804 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_black.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:10236df834d4287206e1ab0949c3b886e77c5f880ae371bb6f4b91936c357db1 +size 79179 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_blue.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_blue.png new file mode 100644 index 0000000000000000000000000000000000000000..9d967e5e8cb533665754ef2423be401f25faec51 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:32a4014308f8c64e47b1011749e4a9ec20cfab7213c8ae21353fbd3a5c1ef0d7 +size 87005 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_dark_blue.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_dark_blue.png new file mode 100644 index 0000000000000000000000000000000000000000..1749e1e5cd674c822a29ed140347cc1a214ec0e8 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_dark_blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:131be198abf9ab2d7573c6e9b8f4932f3c8fbb51a363464a328a69cfba95e0de +size 82413 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_dark_gray.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_dark_gray.png new file mode 100644 index 0000000000000000000000000000000000000000..4858baa40ac0b4795f9315a96d41050aee498c33 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_dark_gray.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b488b8d1549f44d1e218aa0e4efbb6405800744dd0ae79510ecc6d64cfb457f2 +size 79979 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_dark_green.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_dark_green.png new file mode 100644 index 0000000000000000000000000000000000000000..605ea6acf181e942ded5bf2b08c6f3ab321fb4ae --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_dark_green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b92ae839176219e45794820cf74d72bebbdfa2abb3ea93880e6f09aec78f4625 +size 81249 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_dark_orange.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_dark_orange.png new file mode 100644 index 0000000000000000000000000000000000000000..74a81a46b1127153af4d3031eba6b0fdcbe3ffd0 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_dark_orange.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3200d6d508378ee3ac2f8383f217200b818f2602e35fbd32d220ea73c90cbf71 +size 88393 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_green.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_green.png new file mode 100644 index 0000000000000000000000000000000000000000..7f089b8960de0a6424d6d8d05bfdcef15f012b4d --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e38021483e9bd31f700f17516955c6a8395eaebfab9fdfe16c0e3fa79ea4554f +size 85241 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_ivory_white.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_ivory_white.png new file mode 100644 index 0000000000000000000000000000000000000000..8ecac950f5d577526e8214a4bac964f416fbdd55 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_ivory_white.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:912b258a60098f038df33990a0dfd40eedfc0ab128b90626ed507b3f190f9584 +size 79172 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_lemon.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_lemon.png new file mode 100644 index 0000000000000000000000000000000000000000..9c933297f4fbe93481c08b29b7e79d91580085cc --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_lemon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6f83717c7104e9c79206709b018c8b0fe30667b6a525368968bc77d3fb97985d +size 92816 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_light_blue.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_light_blue.png new file mode 100644 index 0000000000000000000000000000000000000000..2e6a99dab24e8b52c27994f478c571ba8ab34ab4 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_light_blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:19a1f7d9a6b739b6a689065f6fcecd9fd01a834fbbdfad55de99d2c29b71ec44 +size 84031 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_light_gray.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_light_gray.png new file mode 100644 index 0000000000000000000000000000000000000000..f78b45be2d5b79da0e6e697c6da622ef6f42674e --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_light_gray.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c2f493114ea9ee1b9984f49e546f1778095bb527a914ab5fa53d5bce4dac27ff +size 79600 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_light_green.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_light_green.png new file mode 100644 index 0000000000000000000000000000000000000000..10fc6ef03b5e7a49e87dcc7557e9aaa0527de7aa --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_light_green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dcd8d4ac0d8d3b1a69d9e9fbee390a1f3e5ca41be7b0ab3e9f334fb95af7e5ad +size 87707 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_lime_green.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_lime_green.png new file mode 100644 index 0000000000000000000000000000000000000000..e9165dc56dfb859e2b79cb23667f09a9ca59bdcd --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_lime_green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:467b3c415440ef25eeb402ace6219c359f7127d00d74a8d068caf4b709bbc885 +size 88191 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_magenta.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_magenta.png new file mode 100644 index 0000000000000000000000000000000000000000..1b04bba888dc654940115d8a242135a9c2630457 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_magenta.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:da471b837784ae7dcbcd99278c7920cf2a10957db9cdf4af72ee6f2b0ec49d00 +size 87150 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_orange.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_orange.png new file mode 100644 index 0000000000000000000000000000000000000000..089cbfc266250454e43c0486aa04c0e6eb02500f --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_orange.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:61c0bb850905eb5dec15adba39cba43c778a61083b30aad48932261271f198a0 +size 89723 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_purple.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_purple.png new file mode 100644 index 0000000000000000000000000000000000000000..249e5c0201137ccd1bb0ac23a291b007f367106c --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_purple.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fd1ff5c8022b59f7ecfac97d6d5f34783ad5662a3af7d7b2920a2261530133fb +size 90088 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_red.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_red.png new file mode 100644 index 0000000000000000000000000000000000000000..a8bc8add8599f6572996c31fcdfa21c920c6a286 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_red.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dcb88e0f9dc6a726046b406adc44742030c2bb0c4127acdd8d62b5f7bec0d94c +size 85995 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_simple_controls.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_simple_controls.png new file mode 100644 index 0000000000000000000000000000000000000000..4d77cee8f772f76b5f8d75a9d48576c35def342f --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_simple_controls.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:48e006a947a197f9b6d26feb6c7add0028ac13db1e8cee66bc67c554a032b6d8 +size 87952 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_sky_blue.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_sky_blue.png new file mode 100644 index 0000000000000000000000000000000000000000..584de3720212633440e5e197e73c62989a2a7f21 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_sky_blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3b1bcaa1022ddc916ad25165ff8cae23c006dc9ce1dfc48f43a5fe1f86da54f1 +size 85308 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_teal.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_teal.png new file mode 100644 index 0000000000000000000000000000000000000000..6b440a6d59109432ba246941eba253cefd5aa578 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_teal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:684d69ad59d45563c033ce81bdaccffd724a462000239e29ea136fd260c7b356 +size 86317 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_white.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_white.png new file mode 100644 index 0000000000000000000000000000000000000000..51ad806f10a411d5441ecc01918f945b193c1c2a --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent.mdl@plastic_white.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9bfdd371ef1a7c602b304baa7e5123346a07be7e357177cc475bd64d8b987b1c +size 78222 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..01291eecfdc65bc2c0e063ea1e1aae0f52c440ed --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:092976244c66bc77ed2a051f25e08cd4b10a0a68f235d12b39b627ef58f99b26 +size 115620 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@Plastic_Thick_Translucent_Flakes.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@Plastic_Thick_Translucent_Flakes.png new file mode 100644 index 0000000000000000000000000000000000000000..01291eecfdc65bc2c0e063ea1e1aae0f52c440ed --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@Plastic_Thick_Translucent_Flakes.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:092976244c66bc77ed2a051f25e08cd4b10a0a68f235d12b39b627ef58f99b26 +size 115620 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@metallic_plastic_simple_controls.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@metallic_plastic_simple_controls.png new file mode 100644 index 0000000000000000000000000000000000000000..5a091816fc5eb689b1df941469881cf42e8e5377 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@metallic_plastic_simple_controls.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9010a0829849aed2c00485ebdecccb69d8fd2bb431ada7426eebd45915451806 +size 100613 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_black.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_black.png new file mode 100644 index 0000000000000000000000000000000000000000..45b4483708a60f4d3f2a0ba204236e7516b13c7e --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_black.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2ef444860008d13c6a296913df4b74290d8d7666ebe009bf6d19b04ade58b09a +size 104492 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_blue.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_blue.png new file mode 100644 index 0000000000000000000000000000000000000000..e729fae159d955bf316981ec2ee22dcda11e554a --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:604ebb5d6d04c16b5879a16746ad23c2bb2c9a8d84e1b79fdd2a5ae5ceca479d +size 103128 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_dark_blue.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_dark_blue.png new file mode 100644 index 0000000000000000000000000000000000000000..d4c63c1496c438121b7cc8500e6ed685900e54b2 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_dark_blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:17ae6c040e2163199e6197a3dd27eef2e6c0b5122fd870002f13eb31d580377b +size 103159 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_dark_gray.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_dark_gray.png new file mode 100644 index 0000000000000000000000000000000000000000..88c639ce274d9d2487f390bca3918fe59351f3ac --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_dark_gray.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b2857560db61ffd0c2377734c6c282867f33528c02c6ca21ae373df9e39dd66d +size 101580 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_dark_orange.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_dark_orange.png new file mode 100644 index 0000000000000000000000000000000000000000..087cc1fa73e487beabe0ef666a3b76b5765ba3d7 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_dark_orange.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ed925dfe1d087488f245f17c818a72fd703047279d5f692acf383997bfd66cf4 +size 103925 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_green.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_green.png new file mode 100644 index 0000000000000000000000000000000000000000..daf664484e2f4bcc3d5f59f5494eb77f4cd5d4ce --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:743ee69d9df5174a85197a68c07cd9e6146eb56165b3d6539c23558dcaa5d620 +size 106144 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_ivory_white.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_ivory_white.png new file mode 100644 index 0000000000000000000000000000000000000000..ab8795088a5fd4a2f1b86785490c5d2d8637dcdf --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_ivory_white.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:005a3e7db9927198a83dcb61278ff7c8e9a7fcea876cf76558479f5282a0cf24 +size 89591 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_lemon.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_lemon.png new file mode 100644 index 0000000000000000000000000000000000000000..c7c8161922701803f63ec522388f95a49f158c7d --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_lemon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5a3c048ecdc39005a23e4ffcae807d362c521ddf85126ea505b319624f2c258e +size 104029 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_light_blue.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_light_blue.png new file mode 100644 index 0000000000000000000000000000000000000000..9b1c789328ade247501f5f7143cfa8e0977523a0 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_light_blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fb8a1f3a80d593f8a715662a88d932ae4b93fe7fa8ce5ab329ce565a9fa651a9 +size 95021 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_light_gray.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_light_gray.png new file mode 100644 index 0000000000000000000000000000000000000000..37ca1156258468714b3b411a08b85f91c46703bb --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_light_gray.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:20dd7867056d7423d475e0e9b1876327a4947d184a3c2c07f94371c49d1fa836 +size 94122 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_light_green.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_light_green.png new file mode 100644 index 0000000000000000000000000000000000000000..56bc509d213ca02d4a456ced66a503262a35104e --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_light_green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bedad2a1cc91d1d5095ef689868ec16229aed682e9cbbc9552e2f3342d89a95f +size 106345 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_lime_green.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_lime_green.png new file mode 100644 index 0000000000000000000000000000000000000000..cb817afee9060e0f8be569ebe7bc752571e8b484 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_lime_green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f256fadea5f5d1354c459c9776b842a606ac6f155a14f6c655af7dd75b8c8384 +size 103625 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_magenta.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_magenta.png new file mode 100644 index 0000000000000000000000000000000000000000..6576400c84c8de5fda172da8d8a988b707a9ceec --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_magenta.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4484367ad5e304cbd34748b5ce417cd809ca4ecb5e7a312adb75ca3a3720f9c6 +size 101572 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_orange.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_orange.png new file mode 100644 index 0000000000000000000000000000000000000000..e1f2cc5e351bed7d2c2a658602f03445cd7f6d46 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_orange.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:28ae6b6d44b649f78bcfce9bcaa86fc5d85560d46e8095afbf8955b583b439ac +size 102704 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_purple.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_purple.png new file mode 100644 index 0000000000000000000000000000000000000000..c53a8bd2eef8c69e1f8809b21a3c333d775336aa --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_purple.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c3e02ad49956b102d16dbbec2115998f61d7d4a675d9009b61e6da665d005f63 +size 104202 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_red.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_red.png new file mode 100644 index 0000000000000000000000000000000000000000..ee187600ed20c6e202ce65d8e165555d3c9f55d8 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_red.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:94f7d90c180b3664763f359d7c478253e3309eb2d94883decdf7e8d39a024e58 +size 105558 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_sky_blue.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_sky_blue.png new file mode 100644 index 0000000000000000000000000000000000000000..c507da7a8fd69ced3751d53283f67eb7525794a2 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_sky_blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0eb89f5dfede8ad4f23437709b72a6abc68568d49e80d86bb7ead812ae32079a +size 99735 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_teal.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_teal.png new file mode 100644 index 0000000000000000000000000000000000000000..a94a248a8943f2a60ac1a55572c80f7ec8e6be72 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_teal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6a8fbf16c1b2bb6e71e998c9a3e62054b9104a8cdfed29a9ab8576a0c0ccb4fa +size 101931 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_white.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_white.png new file mode 100644 index 0000000000000000000000000000000000000000..f798485e41ff7c4b7d039b06d29331cb461958b6 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_white.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c2915a7745469c3baf40d21dc4b43a6851cddd7ae0839476b2e6e32ef31226aa +size 87764 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_yellow_orange.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_yellow_orange.png new file mode 100644 index 0000000000000000000000000000000000000000..6a857b36d86613f25c15d56fe8b4da8c7d246352 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Plastic_Thick_Translucent_Flakes.mdl@plastic_yellow_orange.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8dccee3279386391a1ab5e611dbc0ef5e0548b5393419679c8b4d6b5d83f1cd2 +size 101495 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Clear.mdl.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Clear.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..e346e3667b6f47645dd40df9cf846267f6c6193b --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Clear.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c9d703b810275f39a91480043173794bdf0ce856df1a9cea8e6a2c86331c12ae +size 104393 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Clear.mdl@Polycarbonate_Clear.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Clear.mdl@Polycarbonate_Clear.png new file mode 100644 index 0000000000000000000000000000000000000000..e346e3667b6f47645dd40df9cf846267f6c6193b --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Clear.mdl@Polycarbonate_Clear.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c9d703b810275f39a91480043173794bdf0ce856df1a9cea8e6a2c86331c12ae +size 104393 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Clear.mdl@Polycarbonate_Smudged.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Clear.mdl@Polycarbonate_Smudged.png new file mode 100644 index 0000000000000000000000000000000000000000..9314df998831b95e02f5bbb5f939b11937530733 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Clear.mdl@Polycarbonate_Smudged.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b72b973e23564f435fa7423d6fa4bf9b51045434743b2ae8dda630b300f483ec +size 110559 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Cloudy.mdl.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Cloudy.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..b3160c9d7c7d62fe9ced3350647ef5a82bafe619 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Cloudy.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f6f4154f1b850f3bfe8322ca2421f4c79d8262240dbdafd8bc037def72d66e93 +size 115748 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Cloudy.mdl@Polycarbonate_Cloudy.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Cloudy.mdl@Polycarbonate_Cloudy.png new file mode 100644 index 0000000000000000000000000000000000000000..b3160c9d7c7d62fe9ced3350647ef5a82bafe619 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Cloudy.mdl@Polycarbonate_Cloudy.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f6f4154f1b850f3bfe8322ca2421f4c79d8262240dbdafd8bc037def72d66e93 +size 115748 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Cloudy.mdl@Polycarbonate_Cloudy_Rough.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Cloudy.mdl@Polycarbonate_Cloudy_Rough.png new file mode 100644 index 0000000000000000000000000000000000000000..fb275c9636752fb9e24d95b6e89a67e2b7f43de5 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Cloudy.mdl@Polycarbonate_Cloudy_Rough.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a5159cab1ae59a88918b909b764e4392121e2c7ba86ecb3e48c75b30cd5d8b25 +size 115804 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Cloudy.mdl@Polycarbonate_Cloudy_Soft.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Cloudy.mdl@Polycarbonate_Cloudy_Soft.png new file mode 100644 index 0000000000000000000000000000000000000000..8fe2124ff353d08280705b66f0fba8c4ec6a31d2 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Cloudy.mdl@Polycarbonate_Cloudy_Soft.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4e52129a76141b6eaea8a830c1fabad6ec890834f5309b4030f231986e7ca41b +size 111215 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Cloudy.mdl@Polycarbonate_Cloudy_Thick.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Cloudy.mdl@Polycarbonate_Cloudy_Thick.png new file mode 100644 index 0000000000000000000000000000000000000000..6d938ebc09eb843d39438069de042366852c399e --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Cloudy.mdl@Polycarbonate_Cloudy_Thick.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d2535412826fbe06a1bdc04211dca4a8381d46a848bc798a26e84429e478a483 +size 140133 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..225891957d514eddbcbd596b3ab69f0c780f4096 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2d8bd298a898958f831bdc077551793bf92bcc0ffa6b927ce32064bf0708d350 +size 86421 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Black.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Black.png new file mode 100644 index 0000000000000000000000000000000000000000..aad527b39c2431be879ccd75d316f76455c630b4 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Black.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:47700c9124b8bc9c56ca85ad5fe10e1ab3cdd27aeb1b3d7a32781d885e342e46 +size 66438 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Blue.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..b16e76100364b86ff6e81e3c308d689f8f8d5800 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:21a2e248809801356e95c3244163d3745a960ca6ab683dc2b5a43a7117ef31d0 +size 90938 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Dark_Blue.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Dark_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..1b3e71ddda7ae94e784f5400bd6f3b9a94bc6557 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Dark_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4bdaa68fc576d45bbcf9635a890d66a3b8804bc143839f650316d2aa3ffdc5a3 +size 89373 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Dark_Gray.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Dark_Gray.png new file mode 100644 index 0000000000000000000000000000000000000000..9f60709b4146936c8ce6c221fb62b5a15d1f5172 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Dark_Gray.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2d475990aa27871b50a7c6d242a2c25e345523fd7a8f2a98791946f3c97267fb +size 90091 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Dark_Green.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Dark_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..fc0f5672d5ef9124a4faf321ddc961fd52ff9af2 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Dark_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:12701ffa5b0412b030721bb0217608d54e3e8e373048f448120423a515e5043c +size 87344 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Dark_Orange.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Dark_Orange.png new file mode 100644 index 0000000000000000000000000000000000000000..5cff53adc625d3986474d05452e8bd57be7137af --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Dark_Orange.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:04fa94b4611340be278467efca9a7dd4b2851b29a6d7585820a1ef9d09102301 +size 88828 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Green.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..964cd9875f13b7edef5fa713bf8224fc58a16306 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cd4b3950071354cf3c77e3423d0fa4fd2c2051bc1cdd38c540400d15d18352ce +size 90349 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Lemon.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Lemon.png new file mode 100644 index 0000000000000000000000000000000000000000..566a90d1fc745df1e067dfadc8215c11cba79881 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Lemon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:87a6929536ee5a3c9bae88cfa1dee0c0521989b422eb76e288dc948e7447717d +size 90684 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Light_Blue.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Light_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..291d9c71024120510dc7f1c666f0d3441a4eaf1c --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Light_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2f48983f96843e047d4186cfd4baf342f759302e195d001ce51ea5bdad93bbdd +size 87180 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Light_Gray.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Light_Gray.png new file mode 100644 index 0000000000000000000000000000000000000000..65fdf917e53bc8d7d7c96906a080c1c1a74ed12d --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Light_Gray.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c6175c0365257e3390417ce278b0f32b0a4d701e15c32ec07d19a751ae0d2bca +size 90652 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Light_Green.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Light_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..6984090e2577b2ea67fed91542cda2ce17d89580 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Light_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e1f11d5015f5ac19e4d9c2991af8ed524823bdb5833abf55a2abb812b7a47fd9 +size 89213 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Lime_Green.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Lime_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..ad9d74907017cb2c0c882ed4f3c19b7621c1a7da --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Lime_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:836afbde3b02da64d255cb6004270062ae245c38a088a3e5351d368bf5893a78 +size 88798 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Magenta.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Magenta.png new file mode 100644 index 0000000000000000000000000000000000000000..b073f3618c2233107cfb03635e59316cd2991c9a --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Magenta.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fa0afc9e2c31f7809855749128e367dc60dfbe176c0e8372e861b991350f1648 +size 91271 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Opaque.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Opaque.png new file mode 100644 index 0000000000000000000000000000000000000000..225891957d514eddbcbd596b3ab69f0c780f4096 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Opaque.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2d8bd298a898958f831bdc077551793bf92bcc0ffa6b927ce32064bf0708d350 +size 86421 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Purple.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Purple.png new file mode 100644 index 0000000000000000000000000000000000000000..0ed21dcee21c6b1789f7cad5625e8be377031714 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Purple.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f0b86f4371c2176568663c228a52dd0c1a0fe7982afc2e317332e3e5a1b0af19 +size 86390 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Red.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Red.png new file mode 100644 index 0000000000000000000000000000000000000000..971ecc009cbc5d518255a257b9a3c12aaadab078 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Red.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0d735fce1418ea5213511a3d92ff911d5a8b37b5e7555588b92aa304e1dd628a +size 86838 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Sky_Blue.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Sky_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..362c243f0edd3100c2c73f74457cc2755bd5591f --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Sky_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:15da7f6af583dda965a66a0de1b794097193cfa9c3865bb8947c0c117f1dcd85 +size 90352 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Teal.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Teal.png new file mode 100644 index 0000000000000000000000000000000000000000..8103d4f3fe3f0c31eadf76618b6457962f541e78 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Teal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:45bbff20e16500ef5a8fb1d97fc0c8e5fa4de9e7fd197e2cb05afb799dc253e8 +size 90524 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Yellow.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Yellow.png new file mode 100644 index 0000000000000000000000000000000000000000..3041957878fbe0340bacc79e1ad6e3ae6a8c1df1 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Opaque.mdl@Polycarbonate_Yellow.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:89bbd7942e2f6700e435d5bbb32a6e63bd911a8a4779151f66ceb9bdd55f60f1 +size 90137 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Spectral_Clear.mdl.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Spectral_Clear.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..3a84061f092d4fc22cdf7d689ac72e8b6d5099cd --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Spectral_Clear.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a63e1569a3fd57956f8e1fe950de4166ac0ffb1ffafb28e59640559d2e05bb24 +size 130065 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Spectral_Clear.mdl@Polycarbonate_Spectral_Clear.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Spectral_Clear.mdl@Polycarbonate_Spectral_Clear.png new file mode 100644 index 0000000000000000000000000000000000000000..3a84061f092d4fc22cdf7d689ac72e8b6d5099cd --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Spectral_Clear.mdl@Polycarbonate_Spectral_Clear.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a63e1569a3fd57956f8e1fe950de4166ac0ffb1ffafb28e59640559d2e05bb24 +size 130065 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Spectral_Clear.mdl@Polycarbonate_Spectral_Smudges.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Spectral_Clear.mdl@Polycarbonate_Spectral_Smudges.png new file mode 100644 index 0000000000000000000000000000000000000000..aefd4befab09bea1e90a339d03af6b79bd9bafff --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polycarbonate_Spectral_Clear.mdl@Polycarbonate_Spectral_Smudges.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de57ef83a747dd4e76a376eebe370f0fd61ba5f4dfedb55f387b9c5c25a0156b +size 132643 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Clear.mdl.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Clear.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..a5373bf6bc62b69aee303c3ad26321c34c1ea39a --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Clear.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3a321d608a225af443c0e23fbf0c3e88a8b0e4188f0a139f602963d846f3814e +size 129385 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Clear.mdl@Polyethylene_Clear.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Clear.mdl@Polyethylene_Clear.png new file mode 100644 index 0000000000000000000000000000000000000000..a5373bf6bc62b69aee303c3ad26321c34c1ea39a --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Clear.mdl@Polyethylene_Clear.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3a321d608a225af443c0e23fbf0c3e88a8b0e4188f0a139f602963d846f3814e +size 129385 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Clear.mdl@Polyethylene_Smudged.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Clear.mdl@Polyethylene_Smudged.png new file mode 100644 index 0000000000000000000000000000000000000000..8b181465354ed3e343118c94c5ef03b29849a233 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Clear.mdl@Polyethylene_Smudged.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9ca0d71ba2f346427f6b846a6f54ed5de766fe2aace25987878f3008f93d09a5 +size 132542 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Cloudy.mdl.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Cloudy.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..b4ebc7b708c7a4ad00b330dd18c89b37c4f26499 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Cloudy.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:45f25ce15f5e267736121ffea5af5afa17985ca6bf70e518eb76cb81a04f01f5 +size 115828 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Cloudy.mdl@Polyethylene_Cloudy.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Cloudy.mdl@Polyethylene_Cloudy.png new file mode 100644 index 0000000000000000000000000000000000000000..b4ebc7b708c7a4ad00b330dd18c89b37c4f26499 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Cloudy.mdl@Polyethylene_Cloudy.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:45f25ce15f5e267736121ffea5af5afa17985ca6bf70e518eb76cb81a04f01f5 +size 115828 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Cloudy.mdl@Polyethylene_Cloudy_Rough.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Cloudy.mdl@Polyethylene_Cloudy_Rough.png new file mode 100644 index 0000000000000000000000000000000000000000..b02837fcf34ec2437a1d4c9b42c2baff385687f7 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Cloudy.mdl@Polyethylene_Cloudy_Rough.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b665f0b84e25374778f9e25f5e09c7b106a1f91044001cb368a6995c7e8ca83a +size 115651 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Cloudy.mdl@Polyethylene_Cloudy_Soft.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Cloudy.mdl@Polyethylene_Cloudy_Soft.png new file mode 100644 index 0000000000000000000000000000000000000000..e44fe14d12f390cb4c56bf7cd3f761134ddd83cf --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Cloudy.mdl@Polyethylene_Cloudy_Soft.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2a8fa33ebe1403708156eae1b9ac95f15f81efb49ab746dc6ae682ecae47e6ee +size 111647 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Cloudy.mdl@Polyethylene_Cloudy_Thick.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Cloudy.mdl@Polyethylene_Cloudy_Thick.png new file mode 100644 index 0000000000000000000000000000000000000000..d5a81e5de9caa762481384421985400f791cae73 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Cloudy.mdl@Polyethylene_Cloudy_Thick.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2c890a762af2435b19c61f5c9d53eab976329b040be7d51b2bec9d8ef6a56839 +size 139719 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..8689edf7038e814b771772962160fd595ec5dc02 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eeefd19b4d6e7cf4ce9f428e22a5672104c6fbd74f0188e49812470aacd12a97 +size 89077 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Black.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Black.png new file mode 100644 index 0000000000000000000000000000000000000000..bd5acdad4cde71e5ec1a9087eeeae0791e64f55c --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Black.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:28d8d27475ad019e69874f31568fe84b8925f52ae59f796a85be531be5976a4a +size 66277 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Blue.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..1845f5e663a31fa8c2106a8ff8305870873bf5e1 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:76cdbec6d1955f9f989ab9b7154ab7810211815b10ce4608c6bb10219fb0ed84 +size 90723 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Dark_Gray.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Dark_Gray.png new file mode 100644 index 0000000000000000000000000000000000000000..e4f0cd446d160150b3d75dd84c2c58adc9278539 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Dark_Gray.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:815744b19e4db14ad371881927f961ac2fc7fd4d05bb2efc0e54f2a4407da856 +size 89623 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Dark_Green.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Dark_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..123bdabd500ec16593e63d519522c59f8fb2d72a --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Dark_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dcab8e809c0bd2cab2e37a8692aedce44674f5e0f5b5d5f3999e1f3a4fab8c46 +size 87216 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Dark_Orange.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Dark_Orange.png new file mode 100644 index 0000000000000000000000000000000000000000..c06f5c2996c508b0da7fd29f06ba782608ade83c --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Dark_Orange.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7bfe9820a4daebd5948c095423ad22285f709f283efbc99c61b819a0bca912d6 +size 88816 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Green.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..c142b25f76c12952c92eb0194e4bafdff56ccfd3 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e67ba7a71d45501b7a645247670cc2c5e75ac5ce31c3660f154d28b4ac26bcc9 +size 90340 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Ivory.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Ivory.png new file mode 100644 index 0000000000000000000000000000000000000000..f995220aeedfa371164c8a6785a0598960ad3ba5 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Ivory.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5ab43d1149a88019e32af7de13d87ad171fc5d0219658d40702c5a715450e42f +size 82945 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Lemon.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Lemon.png new file mode 100644 index 0000000000000000000000000000000000000000..5b1bd02c8b34c17c00ebad6efc24e8746acf7fc4 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Lemon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f33a0b69b998a018ff485757c89912f66b3a8a5207ddde91d00649994ba2ea4b +size 90874 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Light_Blue.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Light_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..70683959d335d6f3cea3d2b69a15bd61f4074319 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Light_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c04cedfe86343a26493f9ef524d6fb73ec4ef6bf8c930f3a8a525332afde6e61 +size 87070 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Light_Gray.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Light_Gray.png new file mode 100644 index 0000000000000000000000000000000000000000..d090b79533559b3b27bb756a7b05f33763aa3c19 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Light_Gray.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d4148628c7574c78871776ee0e7c8ea41ea97cd8ac6f7a080c8a908016d31353 +size 90837 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Light_Green.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Light_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..2bd7170030dbfce0b86411100e9ff979f7191aaf --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Light_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:62220fdb1123b19701f038f4e1fea7270b1bdc9980e993846fbfd4f7cabb0579 +size 89105 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Lime_Green.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Lime_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..8103b16fe1282780fe7aef8635203625e091c725 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Lime_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4202c252fe6a20b59e3d109595de8914ac2284bfa10fa47809fb3dfe95d6b64f +size 88546 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Magenta.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Magenta.png new file mode 100644 index 0000000000000000000000000000000000000000..2908b1fc17d49a6191238507e28699c1fd27a57a --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Magenta.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b5a9f1650087cf8a097c71a222107684f2a1d1d8f8cfe902ea80e0be5debef02 +size 91041 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Opaque.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Opaque.png new file mode 100644 index 0000000000000000000000000000000000000000..8689edf7038e814b771772962160fd595ec5dc02 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Opaque.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eeefd19b4d6e7cf4ce9f428e22a5672104c6fbd74f0188e49812470aacd12a97 +size 89077 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Purple.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Purple.png new file mode 100644 index 0000000000000000000000000000000000000000..aa1dd7de71eabfa4641413d96095b225d34cf9da --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Purple.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0eadda07c9b4c68412995e5ef917645e0aaf5b223e715c927a2639082f097d9c +size 86228 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Red.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Red.png new file mode 100644 index 0000000000000000000000000000000000000000..70ddec975caf9a2cc619e816fd45ace9f4533497 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Red.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:361b04b38619a541c1f13ffc5999da23685074ea783f59fa5fd4a06ba9a5081e +size 86387 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Sky_Blue.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Sky_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..5073805fcb587a00fe2f78c99f20045a68d79a8b --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Sky_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2fcdf3a293164ae610f051d67122b70548fd8f8e4246a0c87cff7c4c897bc252 +size 90115 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Teal.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Teal.png new file mode 100644 index 0000000000000000000000000000000000000000..c1230b4873e75dbd10316e362590e438fa81d49b --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Teal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9a7e1294a494a61eebf6704a29a50f011b2cb2aee7bd5f5a7d13899decc0e561 +size 90466 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Yellow.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Yellow.png new file mode 100644 index 0000000000000000000000000000000000000000..b70a9ee206605dedff7e1d8bb18f8335b3ef5e43 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polyethylene_Opaque.mdl@Polyethylene_Yellow.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:852caea5924a647d76caadcecffcd947572b5c8e4051e5701cd15fe025db40bb +size 90041 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polymethylmethacrylate_Clear.mdl.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polymethylmethacrylate_Clear.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..6033af9e0183e2401cb95ef0fd625b95de32965b --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polymethylmethacrylate_Clear.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:967d84e0027d5bacf67908d16942a2e826fc9eac8d2123f666306ce534248939 +size 113812 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polymethylmethacrylate_Clear.mdl@Polymethylmethacrylate_Clear.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polymethylmethacrylate_Clear.mdl@Polymethylmethacrylate_Clear.png new file mode 100644 index 0000000000000000000000000000000000000000..6033af9e0183e2401cb95ef0fd625b95de32965b --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polymethylmethacrylate_Clear.mdl@Polymethylmethacrylate_Clear.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:967d84e0027d5bacf67908d16942a2e826fc9eac8d2123f666306ce534248939 +size 113812 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polymethylmethacrylate_Clear.mdl@Polymethylmethacrylate_Smudged.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polymethylmethacrylate_Clear.mdl@Polymethylmethacrylate_Smudged.png new file mode 100644 index 0000000000000000000000000000000000000000..0ad53d81fb8d37182983e459657b3f411ebdc19a --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polymethylmethacrylate_Clear.mdl@Polymethylmethacrylate_Smudged.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:230099994886bee99b277f8a11eb49a9725e245b7188256f6430694a8f35c7c3 +size 95332 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Clear.mdl.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Clear.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..9f9459e451429a4c990e2578c69ecc5dea7fa6a5 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Clear.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7a3f32dcb9a8ae47808b9dba8db57ec5274976ca2adc2bcabeeddfd267a188f5 +size 103330 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Clear.mdl@Polypropylene_Clear.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Clear.mdl@Polypropylene_Clear.png new file mode 100644 index 0000000000000000000000000000000000000000..9f9459e451429a4c990e2578c69ecc5dea7fa6a5 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Clear.mdl@Polypropylene_Clear.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7a3f32dcb9a8ae47808b9dba8db57ec5274976ca2adc2bcabeeddfd267a188f5 +size 103330 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Clear.mdl@Polypropylene_Smudged.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Clear.mdl@Polypropylene_Smudged.png new file mode 100644 index 0000000000000000000000000000000000000000..8684c647c64e3f99dd8ba6b0be109448c16419f2 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Clear.mdl@Polypropylene_Smudged.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:56367d2f5c85a6a4a2623001cc956dc09117f5a6ac60e3818a77662f0a21b6eb +size 108908 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Cloudy.mdl.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Cloudy.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..cbdb912c0f02c64e87d4fea0aa91bef88f13ab6d --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Cloudy.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8e4261378e0eb78096c81f84ddd0c736de6959e50e88a3b251d95ad4bc1e87b5 +size 115860 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Cloudy.mdl@Polypropylene_Cloudy.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Cloudy.mdl@Polypropylene_Cloudy.png new file mode 100644 index 0000000000000000000000000000000000000000..cbdb912c0f02c64e87d4fea0aa91bef88f13ab6d --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Cloudy.mdl@Polypropylene_Cloudy.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8e4261378e0eb78096c81f84ddd0c736de6959e50e88a3b251d95ad4bc1e87b5 +size 115860 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Cloudy.mdl@Polypropylene_Cloudy_Rough.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Cloudy.mdl@Polypropylene_Cloudy_Rough.png new file mode 100644 index 0000000000000000000000000000000000000000..45b79856dee3f1ecae391bf5b0337937c74d0910 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Cloudy.mdl@Polypropylene_Cloudy_Rough.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0472db6227088a697ded212a689f4cdadd8dea92d9b3a012edc81d3b5ef569b0 +size 115617 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Cloudy.mdl@Polypropylene_Cloudy_Soft.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Cloudy.mdl@Polypropylene_Cloudy_Soft.png new file mode 100644 index 0000000000000000000000000000000000000000..2aecb154f3251d6033ec13eb3505b4b8bbfc0741 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Cloudy.mdl@Polypropylene_Cloudy_Soft.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2f0fa51be02511f801863b2f9dd21c4c0ff95efc7c0d5250a12731148ce390d4 +size 111651 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Cloudy.mdl@Polypropylene_Cloudy_Thick.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Cloudy.mdl@Polypropylene_Cloudy_Thick.png new file mode 100644 index 0000000000000000000000000000000000000000..b2d78c0452dcf9bed750aa89617ad42fba45ca98 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Cloudy.mdl@Polypropylene_Cloudy_Thick.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b12d01ed9879c7eaeced22e11a63fb3694f8c10999072d38913845f4eb1ccafa +size 139718 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..c2367e34bdbc7f475c07910d0cd7b4fd63afdc2d --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8692cf7a37488a902698ba3c738513c0f19518591a9f15a38d8bca33d07bb52a +size 87946 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Black.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Black.png new file mode 100644 index 0000000000000000000000000000000000000000..8386919286514087df3a0757aa68aee3f00f4973 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Black.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:db4b0468791a578a26a2b8d05ebbaef4af1d4b379f92bd7fe28fc365994dde1f +size 65885 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Blue.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..7cf2129a672e5a28096b443105b34070d06d74e1 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6de91d9b83821a2b50f6b6c773e21a86ea3e83b7477d7f2d93011c62fd8c8623 +size 88253 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Dark_Blue.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Dark_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..654bb1d1d7e4387a4ac37c59ea6b9a0d22368ce1 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Dark_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cde9d54e86870a01146f012ae15a3214f578631b0f15a6d0888cacd247ea1c72 +size 87872 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Dark_Gray.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Dark_Gray.png new file mode 100644 index 0000000000000000000000000000000000000000..0ce2da45b40cbb4c3ecd87943910a4d46dc98600 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Dark_Gray.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ae97debf3dd57c185ed66faea5c22d6f422ecf0268dc0e64c624726c9c5bc164 +size 91893 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Dark_Green.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Dark_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..9bd12c3f73b34bb79ae49df5630070e29bd0ff03 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Dark_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a0adfda8619c0eab7abe55ec9ea3d6d01502e04a333c148ded709ca90aba9225 +size 87031 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Dark_Orange.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Dark_Orange.png new file mode 100644 index 0000000000000000000000000000000000000000..9a4766833aa8a57437ac488b0ec8c85e7cbfeba5 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Dark_Orange.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2bcae9a5c2aee4c8f5a41382a8c6eacd097084375f9f45d391f571b64c7848c7 +size 88442 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Green.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..39fbbfcf53c1d37d3bae00f5789274d5246adc26 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9e1b7c5f42db0903f4eb6c0419b48964159dbed593c9748ce23ada8f6257d697 +size 89815 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Ivory.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Ivory.png new file mode 100644 index 0000000000000000000000000000000000000000..99699c242e7f7405402c5995ee5e806d883f39bd --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Ivory.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:620af4d52e7b176e059ff2352275724c0bc95a1ea0ded44943cedd81869a6449 +size 83897 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Lemon.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Lemon.png new file mode 100644 index 0000000000000000000000000000000000000000..7aafae6a73a3735f5fda977f88535c121786b01e --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Lemon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0f6e32671ae2e8b2e287172448d755486f826e914c1399addb544e4daa520ff3 +size 89669 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Light_Blue.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Light_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..612041fd9ab350fc9fd3be44a755e24cbb0a2f49 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Light_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d209cee2c72091a4c8cae5ac8c0a3ef628293b0f1f0223bbafe54f41976e718b +size 87300 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Light_Gray.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Light_Gray.png new file mode 100644 index 0000000000000000000000000000000000000000..2190fd1e7010d4ad2e59024f7ad0b108be6eecd8 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Light_Gray.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4d4d6ea164070057046926fc6fcdb57946148929dc40ada36016bb04c4603a83 +size 90676 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Light_Green.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Light_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..1567148b3ba6d7bba8ebdb9d714392537fb50513 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Light_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:410ec9004f3a227a5eb3a59254c98c2b9e087fa3326956ba4fb838e5ff725fa8 +size 88301 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Lime_Green.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Lime_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..2347ce3901000a7e931beff10f418b59725654a6 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Lime_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0702c139508708b557d35117b22b734f4f47e1224096dc469df5d5c1bdebcbaa +size 87033 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Magenta.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Magenta.png new file mode 100644 index 0000000000000000000000000000000000000000..0a2c25aa870bc7cf60836974f8bf6fe74208a94b --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Magenta.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a8e09cda4149dedd49e23c1ac6e9e30d894b6961b134ba6e32bdbb8feab151d2 +size 89676 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Opaque.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Opaque.png new file mode 100644 index 0000000000000000000000000000000000000000..c2367e34bdbc7f475c07910d0cd7b4fd63afdc2d --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Opaque.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8692cf7a37488a902698ba3c738513c0f19518591a9f15a38d8bca33d07bb52a +size 87946 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Purple.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Purple.png new file mode 100644 index 0000000000000000000000000000000000000000..85365d4b64aa1c0da8b5a3cfa8a9efcaeb90e0b5 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Purple.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:20aeee7f4e42c5a89b7871b37e258b3a4b376346b42d2afa268b4b68e0c8ef6d +size 86444 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Sky_Blue.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Sky_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..c046d39e3913bb2ad9d42e22c83e2c18639c87ae --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Sky_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5352e9bda168a8b31ec408b489b6119845f896e1304feb877a82a8531b74960c +size 88577 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Teal.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Teal.png new file mode 100644 index 0000000000000000000000000000000000000000..3bce33156eb9fd4640972202fe0d319bded6e35d --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Teal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5dd59f95fea6237bd73a24386ceb3233d37a821197eec32f8008edf5eaeb2330 +size 91019 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Yellow.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Yellow.png new file mode 100644 index 0000000000000000000000000000000000000000..942ee2161ac0717dc82011ce3bed7ff0c628f902 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polypropylene_Opaque.mdl@Polypropylene_Yellow.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4d6375bcffa51139ec86d7129df5621508f5e37aa9095ce39fb1484ba94b2d30 +size 89242 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polystyrene_Clear.mdl.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polystyrene_Clear.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..4c70d9c011e16f6b5026c32d5b8d742dbacf76d3 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polystyrene_Clear.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cce8a10bdef7c82d2691eae38969cd1ef960b14e2b7889defdf793f1e133f84a +size 130213 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polystyrene_Clear.mdl@Polystyrene_Clear.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polystyrene_Clear.mdl@Polystyrene_Clear.png new file mode 100644 index 0000000000000000000000000000000000000000..4c70d9c011e16f6b5026c32d5b8d742dbacf76d3 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polystyrene_Clear.mdl@Polystyrene_Clear.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cce8a10bdef7c82d2691eae38969cd1ef960b14e2b7889defdf793f1e133f84a +size 130213 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polystyrene_Clear.mdl@Polystyrene_Smudged.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polystyrene_Clear.mdl@Polystyrene_Smudged.png new file mode 100644 index 0000000000000000000000000000000000000000..855c86569e23500f39677507818048cca4eef023 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Polystyrene_Clear.mdl@Polystyrene_Smudged.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3536f3897ddf0a3851a3266568c423b2354db281fce0019612faa91c3df1624a +size 133310 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Styrofoam.mdl.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Styrofoam.mdl.png new file mode 100644 index 0000000000000000000000000000000000000000..7c5b5aaa8f60e7b4e70d3beba8eb4c1463b3053e --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Styrofoam.mdl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:264915d7b2c347dcbc446b9ea3732336b2ab7d1d2f67fdadc01f27b992b5a02d +size 102845 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Styrofoam.mdl@Styrofoam.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Styrofoam.mdl@Styrofoam.png new file mode 100644 index 0000000000000000000000000000000000000000..7c5b5aaa8f60e7b4e70d3beba8eb4c1463b3053e --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Styrofoam.mdl@Styrofoam.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:264915d7b2c347dcbc446b9ea3732336b2ab7d1d2f67fdadc01f27b992b5a02d +size 102845 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Styrofoam.mdl@Styrofoam_no_SSS.png b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Styrofoam.mdl@Styrofoam_no_SSS.png new file mode 100644 index 0000000000000000000000000000000000000000..ac9c6eff0e84e73c04809c237e73d70c9f6ede4a --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/256x256/Styrofoam.mdl@Styrofoam_no_SSS.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:27ac96e0861b1dc0396787bd61b428de88eb63ab5162ed8c2454a67eb975c466 +size 105408 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/PCB_Prepreg.PCB_Prepreg.png b/code/third_party/vMaterials_2/Plastic/.thumbs/PCB_Prepreg.PCB_Prepreg.png new file mode 100644 index 0000000000000000000000000000000000000000..928d83682bdd6afc1ccf90c584de818792b8ba02 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/PCB_Prepreg.PCB_Prepreg.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7920230f5962e7505eb50b189f028421de76a2aef89ea9360f14b2c6cb12d4fa +size 112222 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/PCB_Prepreg.PCB_Prepreg_Rough.png b/code/third_party/vMaterials_2/Plastic/.thumbs/PCB_Prepreg.PCB_Prepreg_Rough.png new file mode 100644 index 0000000000000000000000000000000000000000..809801b170631c8e427bc63c180db56a86ad9b73 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/PCB_Prepreg.PCB_Prepreg_Rough.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:264588a0cc484a840275c3910d242affcef12d8b0a167de121c8436527368149 +size 110271 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_Black.png b/code/third_party/vMaterials_2/Plastic/.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_Black.png new file mode 100644 index 0000000000000000000000000000000000000000..782b0442e6042ff5e597cef9733fc7142ab3d4b7 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_Black.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:109d19d791855e8297e465eef61db9ab64cf9abe8a67da5c7773d08dc7e2745a +size 107918 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_Black_Fast.png b/code/third_party/vMaterials_2/Plastic/.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_Black_Fast.png new file mode 100644 index 0000000000000000000000000000000000000000..3c7306c91e103b598aec4a7091e0b5fdfefb2a17 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_Black_Fast.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e5442fb86625b5b92fea40c6cd7f9c1fd512b4e82f62d26d5d23dec7233cc137 +size 92589 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_Blue_Fast.png b/code/third_party/vMaterials_2/Plastic/.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_Blue_Fast.png new file mode 100644 index 0000000000000000000000000000000000000000..4ab3d3a8f5045666b54d5ab758698bab3ede3568 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_Blue_Fast.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:72c7b91621fc984169dbbd55d98df30aca9317e381abdcd56ae65df5874db4fd +size 101508 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_Red.png b/code/third_party/vMaterials_2/Plastic/.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_Red.png new file mode 100644 index 0000000000000000000000000000000000000000..16ab791190e45ae55f7cbec2edb2f032937ec317 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_Red.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8d984c3db6fb6474beebdd3a350d33105e9acdf853bdd8978b63355d3f0723cb +size 109961 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_Smooth.png b/code/third_party/vMaterials_2/Plastic/.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_Smooth.png new file mode 100644 index 0000000000000000000000000000000000000000..f7b50292dfea9eddb4f6ac9f36cc55d8e25a8a43 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_Smooth.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c077e0de7f8c0306295b88f4973faa6bc562698df40264cc1e651711911b6357 +size 109393 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_White.png b/code/third_party/vMaterials_2/Plastic/.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_White.png new file mode 100644 index 0000000000000000000000000000000000000000..aec8feaeaf4628f358a411b98dda880adb149883 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_White.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7c2e0deb696042e3e451209ec6f06702e8e808aad161055e3b3e683bf481003b +size 109308 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_White_Fast.png b/code/third_party/vMaterials_2/Plastic/.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_White_Fast.png new file mode 100644 index 0000000000000000000000000000000000000000..88cfdbcc623ba7522d8e723da02b6bd9e23c0567 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_White_Fast.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:980ebd7189341f3d26f10275cb5e71571bdbc415d39d3fba9941a6f7cb5ae406 +size 97429 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_Yellow.png b/code/third_party/vMaterials_2/Plastic/.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_Yellow.png new file mode 100644 index 0000000000000000000000000000000000000000..909933fdd4d776fa5bd243a6f60a0a1029495d00 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/PCB_Solder_Mask.PCB_Solder_Mask_Yellow.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fc6d312cd669f58d4233f361d645e653e8be3675e298ca8d51077397760968be +size 114529 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/PET_Clear.PET_Clear.png b/code/third_party/vMaterials_2/Plastic/.thumbs/PET_Clear.PET_Clear.png new file mode 100644 index 0000000000000000000000000000000000000000..bc7a3b253ffba346c99d23a163cd454ed2085609 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/PET_Clear.PET_Clear.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ab9caf3d612e63061b0620fc31fb97e5e85de5744b88c204fca05170e7593293 +size 148432 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/PET_Clear.PET_Smudged.png b/code/third_party/vMaterials_2/Plastic/.thumbs/PET_Clear.PET_Smudged.png new file mode 100644 index 0000000000000000000000000000000000000000..d6aabae269793b2f14b393f414d127197962e0f4 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/PET_Clear.PET_Smudged.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:85dd03b024f6d0477dc49c129d8166abe5c923fc82429b8c79e3f0713ba83133 +size 147888 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish.png new file mode 100644 index 0000000000000000000000000000000000000000..23cfe384734db861c7a2a203e1a843d333757290 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:57b02e4d6955d9dd24ada9c550dd58f10c1532dd4748deb531e9d98aedaa1760 +size 93946 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_V15.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_V15.png new file mode 100644 index 0000000000000000000000000000000000000000..d7bca53cafcd14f3e2e29c015280d935ccecaf86 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_V15.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:721ce581e53dbbccf0daf038f40a13e5d99c8f33cd335b2cab53697140636d9d +size 92478 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_V24.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_V24.png new file mode 100644 index 0000000000000000000000000000000000000000..62dc31138e1c6f203b579501186186d02e4a817e --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_V24.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e519a5036441df413ee0339b36d49e89da336a8f53579643e182f5a9749ea8e8 +size 92811 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_V27.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_V27.png new file mode 100644 index 0000000000000000000000000000000000000000..21655887abf2c2231f140a63705122589c8c9f1e --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_V27.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:33a0d18efe89ce923d32207faf051193fe8bf1d88bf4d08f68af5a8ab35f2166 +size 92716 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_V30.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_V30.png new file mode 100644 index 0000000000000000000000000000000000000000..85c0c89eae169c628b3d9564e518647f1d213376 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_V30.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:64f924ea046929f6fb1f54aea0590d438c75dc77ac675f3514a8d9ab9d9ef2cb +size 92018 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_V33.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_V33.png new file mode 100644 index 0000000000000000000000000000000000000000..8f6c288999989ea8751df356219d39cd6e005674 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_V33.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3b278b71f2415dd6e774828c5cf22de6a1c006811a26c2d0e311b0cda7f3141a +size 92033 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_V36.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_V36.png new file mode 100644 index 0000000000000000000000000000000000000000..5f9bba294042c2b8e517d66cf6a8644123b67b73 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_V36.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a1dfecbc5fff774a1654563880cd7c13e40fef6d08ee580d93f7bc760251acee +size 91976 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_V39.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_V39.png new file mode 100644 index 0000000000000000000000000000000000000000..11ea4b6b9c92a2701d11730ac2d7c02c14e46cf9 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Standardized_Surface_Finish.Plastic_Standardized_Surface_Finish_V39.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:90a4dabfbcabc343fc2138c9edba44bb7f55b18f8f0fe6312eaf9afe1285a47e +size 92159 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.Plastic_Thick_Translucent.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.Plastic_Thick_Translucent.png new file mode 100644 index 0000000000000000000000000000000000000000..5ca35e97afbb1259ce0d2ac2358dc04292d8eb3d --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.Plastic_Thick_Translucent.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:46473f800a1200babd827c54a0d22a04880b00c68e80ea90219ea9132e3b4c19 +size 127073 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_black.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_black.png new file mode 100644 index 0000000000000000000000000000000000000000..dea610dc7b02d5b552bcc83fffbf368ea5499c6d --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_black.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:df4c8d0a20574d532538c48fa599754c5757abf244299abe186bb8f17269165d +size 100692 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_dark_green.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_dark_green.png new file mode 100644 index 0000000000000000000000000000000000000000..16e3440242052f1d60665c693e368964393e08b5 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_dark_green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c6e8d3c02f097362c21d6e39972531df3cccdf623fb7b9446a945fb616faf218 +size 108023 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_dark_orange.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_dark_orange.png new file mode 100644 index 0000000000000000000000000000000000000000..17b72ee5e6b74a4fbc3c58fad6e4afd990cb5cfa --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_dark_orange.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7390ea7e72fb95d5c5e932f74654adfa7eda42ad4224e0ebb0f33aba71e907bb +size 115204 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_ivory_white.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_ivory_white.png new file mode 100644 index 0000000000000000000000000000000000000000..1a0e5b078a408a21e7afeca92f59d66078f12892 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_ivory_white.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:198a68e66609ec2687e3778bc780002e7d1e8e54f2816ea2ff6ebd2ea7886b90 +size 104409 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_lemon.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_lemon.png new file mode 100644 index 0000000000000000000000000000000000000000..c3a0f67a97bb72e94c9b523e1f8ffc11286ffa18 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_lemon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f8814a430cfcfcd203412121b418b550ce13bfc5edfd7aa21d06d8bc136324e4 +size 120033 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_light_blue.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_light_blue.png new file mode 100644 index 0000000000000000000000000000000000000000..e97fc6abfd971442024b96e2c12722272cf15a96 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_light_blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:73462404e1a3592c8fe1ae774704371b0a6c7066c250b524f9ddfcc939d98f25 +size 111334 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_light_green.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_light_green.png new file mode 100644 index 0000000000000000000000000000000000000000..274aaea69133f56c630755302db87cd2228e47cd --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_light_green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:06c64b7f7f4bf7d089ae8e104bbf200d636865677833aa2d694bd15ea80ce7c7 +size 116818 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_lime_green.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_lime_green.png new file mode 100644 index 0000000000000000000000000000000000000000..f0782a16a2992409a64a4c0bf12eb5f45212aa18 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_lime_green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bd890b12af82ebcab953b3edcc528bc5caaaa68dfb2a871d171d0b329ed16acc +size 115773 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_magenta.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_magenta.png new file mode 100644 index 0000000000000000000000000000000000000000..bf6cd2df7f31afff0594d72f01f036b46edccfb9 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_magenta.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:312196464d3653a6472664c1a7af8c54aee07064d94c38c8a7cf22b897e69808 +size 115354 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_purple.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_purple.png new file mode 100644 index 0000000000000000000000000000000000000000..c406b8a5ac6b77f3e2e03c1a17af5e24bf188359 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_purple.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c4f2b3b2decf6f036c27a0962e53124975aa47010692f971c60b3ab785a8bf09 +size 117433 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_red.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_red.png new file mode 100644 index 0000000000000000000000000000000000000000..5e3675371b23e960fc3dd12f1dc3e924d1e5b731 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_red.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:438f11b05e9e845be123201b8541e635f1a3a98059c6d0a42dc26cde0725e6c4 +size 112822 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_simple_controls.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_simple_controls.png new file mode 100644 index 0000000000000000000000000000000000000000..2d100d8e5ba3e667cd8c82c89b778fa3f6fe5f2f --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_simple_controls.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c9c1db67c710ab18ebeb2e86c27813b582d07f3a22c50c38dc46757a313a6c2c +size 113310 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_white.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_white.png new file mode 100644 index 0000000000000000000000000000000000000000..f1acd0d0a81c8c7a617a5bc48a52d38b6e36108c --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_white.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d73569e77d8c6e49cfa45782ad0c599393e89da306cac7adca135dbad42244cd +size 102741 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_yellow_orange.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_yellow_orange.png new file mode 100644 index 0000000000000000000000000000000000000000..d0c99f8b319e53641592a63269fa9ecd41cb4a2e --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent.plastic_yellow_orange.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b590081ac9e8594572ac9d93c6fbbababdb572a33f9cdea9abdf3ca2f8e12a81 +size 118408 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.Plastic_Thick_Translucent_Flakes.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.Plastic_Thick_Translucent_Flakes.png new file mode 100644 index 0000000000000000000000000000000000000000..501ee20967053077d02e7e12ce7d3717c4b11bb5 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.Plastic_Thick_Translucent_Flakes.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:58112c3b26cc1a3e35f6e6bc8ffa7035e2ebc7c7f623f5c50cd4a461da73d052 +size 129715 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_black.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_black.png new file mode 100644 index 0000000000000000000000000000000000000000..f5948d05bb89c995e8dc342463cc3a7f1d1f1752 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_black.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ca6c6708339dc3e0f218c2f356f935b56648ad6d45765cfe3331e031aacc710d +size 92934 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_blue.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_blue.png new file mode 100644 index 0000000000000000000000000000000000000000..267e958f78e6b1fd03f58f9b8e0643ede16829e9 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ac6c16ad7ca23f4dc4e400c5b49e4abaf7f758a5d4576b372ad8060d8cffec9a +size 97495 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_dark_gray.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_dark_gray.png new file mode 100644 index 0000000000000000000000000000000000000000..3034dfc4b878d2db758402351ab25bb72a0b87b1 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_dark_gray.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e9a5e64ba7fa0dc115d30686ad914a2ed901bd0d7aaab76bf374673ab7ad5cb2 +size 88950 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_dark_green.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_dark_green.png new file mode 100644 index 0000000000000000000000000000000000000000..823aa33cca45ba2a022df8d1b89b2c2ccf252a79 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_dark_green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:80a7a5b6659782242babbb7d6ed32a3bf44ef37cc187a0d5550200d975fa0927 +size 95347 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_dark_orange.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_dark_orange.png new file mode 100644 index 0000000000000000000000000000000000000000..7004f0a39f2e69b64ba280df5dcdbd2debd9d0ed --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_dark_orange.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:325db28c7771ec2021fef1a48edd6d4e566937d8317f6df6e6428b7a6f12e698 +size 97332 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_green.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_green.png new file mode 100644 index 0000000000000000000000000000000000000000..426b15a9af1c2553f22e980a1d0289a2247ba9bc --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f151d71c88458da54ebc384bdb86dd0c112437f47908fe7253719571a1b34203 +size 97576 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_light_blue.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_light_blue.png new file mode 100644 index 0000000000000000000000000000000000000000..4a5d590146efcaa0a34d66aeabe272c56589ba83 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_light_blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c3ba1884584593e5c47c133152443892b39941cfafe66a990848dd929fe13127 +size 93264 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_light_gray.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_light_gray.png new file mode 100644 index 0000000000000000000000000000000000000000..2cc8ddcbcec87018be5084e1e8e1cf9cd29cae9c --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_light_gray.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:52495bf4d6c95404797ffa3f59d3432e3180b50036d0031bb9d9c2cefb8b87be +size 85208 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_light_green.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_light_green.png new file mode 100644 index 0000000000000000000000000000000000000000..d02e84298fdea2145cffae94447b7a00fedfb34a --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_light_green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dff305c3d334064fdbd0cfba8d93bd648416741e394ca202981fb6add46a5677 +size 98340 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_lime_green.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_lime_green.png new file mode 100644 index 0000000000000000000000000000000000000000..a462210b807ee583e9b6602f8f126ecbf896fef4 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_lime_green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:439c6265a05f1be868b8baffbfea120e93b768ca9fac58e44003eb04ef646619 +size 96948 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_magenta.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_magenta.png new file mode 100644 index 0000000000000000000000000000000000000000..9642425174d93a1e78419af8d40295ec937d1d61 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_magenta.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:915ebf3209f36288b3bed2b45e6ac481f9fb9261e0e919e378d250c558c53795 +size 95897 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_simple_controls.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_simple_controls.png new file mode 100644 index 0000000000000000000000000000000000000000..e3fd2692906b7de01cd871b5b1dc3dc4d474ad92 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_simple_controls.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:922df8f68b09f507fe740421598c4d8da43c213c92e73eb90d98955d9e880901 +size 117236 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_sky_blue.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_sky_blue.png new file mode 100644 index 0000000000000000000000000000000000000000..8a8994c1c91d8a0940187d324dd9b2753ccbceee --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_sky_blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39cb197591090f0210b1c45f95a52b4b0d0e993aee49a176adc6e588f6506856 +size 95853 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_teal.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_teal.png new file mode 100644 index 0000000000000000000000000000000000000000..121c55c036b5b36f402b5a4f014e66406b95958a --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_teal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0aa3ec883c3195a5893fb13ee1480ad28f1242018b16aa0844a16d6b4f93403f +size 95886 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_white.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_white.png new file mode 100644 index 0000000000000000000000000000000000000000..f275dafda12b15798baa66f1320c343e6f61e1ae --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_white.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f186966800b4c6195b5f658c688b522759a8153686c57f975caba9d60ea45807 +size 85592 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_yellow_orange.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_yellow_orange.png new file mode 100644 index 0000000000000000000000000000000000000000..226b0ea25a53e4fd397bebe02d9f7d275b89aef3 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.metallic_plastic_yellow_orange.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9de8f05b738bf497b6f124111a2c4af309dbfaa9ea3de1840eb3edeec436665b +size 97353 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_black.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_black.png new file mode 100644 index 0000000000000000000000000000000000000000..853c210a5fac3fa221dd776db6df9542144bcb76 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_black.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:13bf2c154e03e5260d5a30cb91c31e0bbd62d3c44464c0a948da0aea2ef1202e +size 114129 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_dark_green.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_dark_green.png new file mode 100644 index 0000000000000000000000000000000000000000..0a76df1a1dda9f67b4bf0bbd38b02db325c5d08d --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_dark_green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f35fa05548c058b113c96f463c03ef38153acdf9ab6dbfe77c933904c928400d +size 116366 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_dark_orange.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_dark_orange.png new file mode 100644 index 0000000000000000000000000000000000000000..7b7cb01d133e795d629d4ee636901753389b33e7 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_dark_orange.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7795bb4bd412812eaa1d6e764aed010ee9b9729a44d277a69cf859b706bce7c2 +size 119964 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_ivory_white.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_ivory_white.png new file mode 100644 index 0000000000000000000000000000000000000000..28e867d61f359b288b2c83e0bbce0b16da0ac97f --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_ivory_white.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7095263151ddce745dd44de3e9da6c5a26bff92198b31dc58f4c089c63f4f781 +size 108591 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_lemon.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_lemon.png new file mode 100644 index 0000000000000000000000000000000000000000..c2dd7ff711ba9c1143bafe8bcdb4d2c0f23bb780 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_lemon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4431e2ce60829c7a50f9aa1e28a7263da1f2f4ae378ae8a63c67b121ee52fe55 +size 122685 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_light_blue.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_light_blue.png new file mode 100644 index 0000000000000000000000000000000000000000..868b17c06f70b294b15138fdc767d92b02dccc43 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_light_blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:58814f276e760f905e98002e5c9f18f66ecc683806118e2eb875268b4d8dabad +size 114219 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_light_gray.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_light_gray.png new file mode 100644 index 0000000000000000000000000000000000000000..f223ecf4e63f8ad2ae22c330c990612d8edf7781 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_light_gray.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b382e4c9cc79f9f21f99aed2dca14f5335419947d71c76bdf4bfe8bd805abd14 +size 109353 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_light_green.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_light_green.png new file mode 100644 index 0000000000000000000000000000000000000000..1651702fc3b89b5809c70651e8919ad38e61d800 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_light_green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:09208b7ecc4fd5e1f005a9a02d5ae67673d170c5a2c73a7031aa70a62e32e15b +size 123431 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_lime_green.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_lime_green.png new file mode 100644 index 0000000000000000000000000000000000000000..6f2ee2072c9fe853df2601822c977565b78cbccc --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_lime_green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:abdeb96b7caf312fc4649bca31d3524b03cb92a071366b1d48c7c3412f6f6830 +size 120813 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_purple.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_purple.png new file mode 100644 index 0000000000000000000000000000000000000000..2873c78e707a7dcb3cae0bf617875b769c9bd680 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_purple.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0a9e884aa686f99e9a893ac3a442caac4153785a99246ab02e5a53cab204ac41 +size 121204 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_sky_blue.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_sky_blue.png new file mode 100644 index 0000000000000000000000000000000000000000..0310342a0e1d277cd13246b866b7b98458300746 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Plastic_Thick_Translucent_Flakes.plastic_sky_blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e807ec6cededecd782f35e090ebed71c449ccd4992e0fea96550afcd4f9e3369 +size 118426 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Polycarbonate_Cloudy.Polycarbonate_Cloudy.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Polycarbonate_Cloudy.Polycarbonate_Cloudy.png new file mode 100644 index 0000000000000000000000000000000000000000..f9bad32d420c93a91815bdf551eb6f35ffc4bac4 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Polycarbonate_Cloudy.Polycarbonate_Cloudy.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8de67b700486967973bbf1c0cceaae162531c3664348affa1ed9980104f31efb +size 124668 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Black.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Black.png new file mode 100644 index 0000000000000000000000000000000000000000..c2170ff190937de50d7418253c12e6ddfbb34e84 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Black.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:338a8d41043a51bdd3dc67beab95ab63d00978a7a4158c9e357fb98153c55bb2 +size 96744 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Blue.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..34695ffe3d457366837a4e6b02575497bb6e6a34 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b8ac6e462ce1953a98c722e36b95b1ae0117054b494b433af01fd102f0df6c4e +size 114694 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Dark_Gray.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Dark_Gray.png new file mode 100644 index 0000000000000000000000000000000000000000..2da3e3ea7034e9ffd4f8ce95759e50688b5f2f58 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Dark_Gray.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7e2d7f6675d08346a39a1387cef8ce905acd1619df553d3c13cf3bfb459c82a9 +size 106135 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Dark_Green.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Dark_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..0a51fa31c9564492bed1351ccee7bbc7f5d23e9c --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Dark_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0c27c30467b0a0c42e288ecf3118b2e4c307c8aa2030b903b884ee8611caac29 +size 112472 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Dark_Orange.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Dark_Orange.png new file mode 100644 index 0000000000000000000000000000000000000000..b12c4d54a4fe2b08568a3802cecf2db9b7d8f0b9 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Dark_Orange.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7f72e78a0425d104853a2d101c790f848d26f15c8a0b21940462221a3180041f +size 115507 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Green.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..f3c6083ab00b5cf0796e85e2d13ff2e8a295a87f --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5288a4c753e1d0182379d0afecba184f9826d03f88e03f9c4058cd65e79cb695 +size 116211 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Ivory.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Ivory.png new file mode 100644 index 0000000000000000000000000000000000000000..6a765f8b93f0e62bb9180e20e54f7981d5a2f234 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Ivory.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:470702d186bb1a05a9485cb8aebe78c985853b34cbaecc61667c05e5ed5e5f7d +size 106484 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Light_Blue.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Light_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..f95757ca2c1368853612a4cc2a7c089913d63f70 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Light_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1b701e16e3d4dd46d9855b2b866cb34c35f2b298c3d024c9781bb2424d4b7aea +size 112194 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Light_Green.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Light_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..f775e3c086cdae03883d00c79a4802515837ec00 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Light_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:96763055ed67a0c9dd9ec7475f6e6dc3fadd53b908693cef548494c58c261949 +size 116683 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Lime_Green.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Lime_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..334f8afe0f3ce48e71e218e6c144c05225bc6620 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Lime_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6839039005be1b59a0a8c7a3f0b78e86b2cbe73b8e837eaccd18ba0deaaa88eb +size 115740 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Magenta.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Magenta.png new file mode 100644 index 0000000000000000000000000000000000000000..bfcd7020545e5dbeb5fd740758a787a6a2af8f04 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Magenta.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7424d343df851129b462fde21b50fc98d85acf09a65a92f11648cedfdb466144 +size 116978 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Purple.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Purple.png new file mode 100644 index 0000000000000000000000000000000000000000..f26871bccf1a7a8665b9c6ef0759543874b40753 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Purple.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6fc84c9ef079037f3bda03e0eebf56ccf240d2743b7f2762e6ccba66111e1318 +size 113677 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Yellow.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Yellow.png new file mode 100644 index 0000000000000000000000000000000000000000..6a2bbec44160138cf55f4e39c3d2f8f24c5baf5a --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Polycarbonate_Opaque.Polycarbonate_Yellow.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bcdb447c500aa0cefe1d4bfb15553e50d16ceecb02c77d607c9c036a0fa7f26d +size 116701 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Polycarbonate_Spectral_Clear.Polycarbonate_Spectral_Clear.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Polycarbonate_Spectral_Clear.Polycarbonate_Spectral_Clear.png new file mode 100644 index 0000000000000000000000000000000000000000..e0a6a8ba5cd87f6a844654d8b49a0361cb164f32 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Polycarbonate_Spectral_Clear.Polycarbonate_Spectral_Clear.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:58b7b8a4a4f6cfc6ca73ef4e770fc39abb39e0e8436663064a03674aa7fa804b +size 148228 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Polyethylene_Cloudy.Polyethylene_Cloudy_Rough.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Polyethylene_Cloudy.Polyethylene_Cloudy_Rough.png new file mode 100644 index 0000000000000000000000000000000000000000..80b491de4ebf00b5b677a2e5b6d80a6458ecf784 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Polyethylene_Cloudy.Polyethylene_Cloudy_Rough.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a9a3776660b5d780fb1c1053d6b30935dd4bc3e54b86dd516d9e6ba4915e107c +size 124249 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Polyethylene_Cloudy.Polyethylene_Cloudy_Soft.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Polyethylene_Cloudy.Polyethylene_Cloudy_Soft.png new file mode 100644 index 0000000000000000000000000000000000000000..d758b511055bd2957674c1220e361d87ab04d163 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Polyethylene_Cloudy.Polyethylene_Cloudy_Soft.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:76988d780e39917d28f5017efce2dbd73504b0e5c70823af40eebf6254055dd2 +size 125870 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Black.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Black.png new file mode 100644 index 0000000000000000000000000000000000000000..a408d58aca467937609a8c33913a28dbad38c6a6 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Black.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a4b2c5e8ed1b65231b41736985ed11fc50a87f536fdab69eb55487453781ce23 +size 97238 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Blue.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..092d7420de422ad334a1bcd032fef01fdb71e28f --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c00d9e2511cb71bc40a934208a79063b61933a93632bf649c4e41edde30abfc8 +size 114730 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Dark_Blue.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Dark_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..f319908dd73fe5d54d8713d1f0e2b4eaccdc10da --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Dark_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3f354dbca3801c66d74e0e94133605d21ba1da88c36e563238375f078c7dadd2 +size 110577 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Dark_Orange.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Dark_Orange.png new file mode 100644 index 0000000000000000000000000000000000000000..e6b6d89e90d823436219cb6e53d2bb6e24420efb --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Dark_Orange.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b4c66c736b41d7531f628c10b23f2754308c72266d6360a479f215f635d26f6e +size 115460 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Green.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..c4e68c019851d93a279818e0137231d77a91c4ad --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d7d3952f84100ec261f67d4a568875a02bd068d8961615a3c85a3f3f9c1783b0 +size 116126 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Lime_Green.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Lime_Green.png new file mode 100644 index 0000000000000000000000000000000000000000..0c73298d8230597cecebdd883c3522f0076ca507 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Lime_Green.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0b2fe7555d3c22437c339725b84eb54c9289d5b7baf78503bca6fe1a87c0926f +size 116346 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Magenta.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Magenta.png new file mode 100644 index 0000000000000000000000000000000000000000..94757472082f9a7e3505d5a6b1b4aa5c1c8d1668 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Magenta.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3a3c844ee95992b05f7821ee8e67d99aa6adf52ca0da4d19ce737f8fb7b2c0a1 +size 117320 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Opaque.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Opaque.png new file mode 100644 index 0000000000000000000000000000000000000000..25f05fe75d5913db185b1ec7977489a6bf82edd8 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Opaque.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d3ba01ed587b2694ca69899835d3c685329c5308fc3554886aed7b2656e4d29a +size 107872 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Purple.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Purple.png new file mode 100644 index 0000000000000000000000000000000000000000..16633ee78c26a64d1190d7512f747921f228882e --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Purple.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:54e0bf47a1106f3536f2cb4dacdcf9cc5a92150cd2b1361b8696e9eef27a64eb +size 113736 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Sky_Blue.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Sky_Blue.png new file mode 100644 index 0000000000000000000000000000000000000000..47c1ab97c8a372b642d3ef5421ccbeaa6048d623 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Polyethylene_Opaque.Polyethylene_Sky_Blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7c9b3ddc27ebbf4179f6b39605899ad4330e3d23315185c9ed4f8e0a348587d2 +size 113484 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Polymethylmethacrylate_Clear.Polymethylmethacrylate_Clear.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Polymethylmethacrylate_Clear.Polymethylmethacrylate_Clear.png new file mode 100644 index 0000000000000000000000000000000000000000..db432c99c4f8d203d7e55bd0008aa50aade62f09 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Polymethylmethacrylate_Clear.Polymethylmethacrylate_Clear.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:65bea4b843114933b75d7fbb9194464a2136368e3d4563c6fd5ba6fe4a8ef466 +size 139748 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Polypropylene_Clear.Polypropylene_Smudged.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Polypropylene_Clear.Polypropylene_Smudged.png new file mode 100644 index 0000000000000000000000000000000000000000..c602433403e706ab09e436e8c6ebcb837e0248c8 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Polypropylene_Clear.Polypropylene_Smudged.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:935c8418aa6fe5fd3823ab0120e7b51d961f92d4d96cf9a20c36dff0a4545639 +size 118907 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Polypropylene_Cloudy.Polypropylene_Cloudy.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Polypropylene_Cloudy.Polypropylene_Cloudy.png new file mode 100644 index 0000000000000000000000000000000000000000..de0e74bdd12de6841144536932750d3e8dacaf54 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Polypropylene_Cloudy.Polypropylene_Cloudy.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e9cbbb3075c623e9d649a328d4007321da8f7a4d18f8b4eed4387c1ac358fea7 +size 123468 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Polypropylene_Cloudy.Polypropylene_Cloudy_Rough.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Polypropylene_Cloudy.Polypropylene_Cloudy_Rough.png new file mode 100644 index 0000000000000000000000000000000000000000..1fbd09b1bb68da0c57b2d1c0185c03787eec986a --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Polypropylene_Cloudy.Polypropylene_Cloudy_Rough.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c8c3fd4fbb7089bcee3a7c664f8b3c0d78dd87b1088bf6d8e803a49694f0f77a +size 124389 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Polypropylene_Cloudy.Polypropylene_Cloudy_Thick.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Polypropylene_Cloudy.Polypropylene_Cloudy_Thick.png new file mode 100644 index 0000000000000000000000000000000000000000..80f112170bae3d9cd7b29ec312a9f117907610c7 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Polypropylene_Cloudy.Polypropylene_Cloudy_Thick.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a84b0d80271c7db92a789da2e1f679732c20ffae3029030904bd5848763beed9 +size 153603 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Polypropylene_Opaque.Polypropylene_Black.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Polypropylene_Opaque.Polypropylene_Black.png new file mode 100644 index 0000000000000000000000000000000000000000..45a6f79dd1953aba3349ae6cb0abaea7ceb7b5fd --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Polypropylene_Opaque.Polypropylene_Black.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e70268aa17820cf157eec5a4d5c3e2067c7f84d295b8abec5f52a86d781bca1c +size 93899 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Polypropylene_Opaque.Polypropylene_Dark_Orange.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Polypropylene_Opaque.Polypropylene_Dark_Orange.png new file mode 100644 index 0000000000000000000000000000000000000000..e860a78b47d0b2fb306a1761c3e9431e6cfd09c5 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Polypropylene_Opaque.Polypropylene_Dark_Orange.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:be3f218bb06532e49f910d9277a0cb1957879351e7c7be934785ac24ee9bd1f6 +size 110269 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Polypropylene_Opaque.Polypropylene_Ivory.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Polypropylene_Opaque.Polypropylene_Ivory.png new file mode 100644 index 0000000000000000000000000000000000000000..1ce6db5fb67710f104041368c2fa034ada528bce --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Polypropylene_Opaque.Polypropylene_Ivory.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9d39f0b8e008b678ecd9faa0aaa1af57c45655765f9469e32ce5eeb83f2bc1e3 +size 102043 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Polypropylene_Opaque.Polypropylene_Magenta.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Polypropylene_Opaque.Polypropylene_Magenta.png new file mode 100644 index 0000000000000000000000000000000000000000..f1170fc32c173aa9246266e7e45bfe41048244fa --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Polypropylene_Opaque.Polypropylene_Magenta.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a8ec94eb92e1eb0bddb2df3ea3ee1f491340e9bbdc816bd1775559e05a20732f +size 112605 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Polypropylene_Opaque.Polypropylene_Opaque.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Polypropylene_Opaque.Polypropylene_Opaque.png new file mode 100644 index 0000000000000000000000000000000000000000..c12ae9bb95499fd7c8900ba50987bb4526e577a6 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Polypropylene_Opaque.Polypropylene_Opaque.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4a91508eda81947c0aee97f61f267201994d35aa7d7d245c6d5b54a7a862c920 +size 102031 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Polypropylene_Opaque.Polypropylene_Teal.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Polypropylene_Opaque.Polypropylene_Teal.png new file mode 100644 index 0000000000000000000000000000000000000000..4cbf1fc006ca6589acf23ce1917c64d0eb76bc66 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Polypropylene_Opaque.Polypropylene_Teal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:64b96e7a60eded87b1e6735b2f9562c7d657784481f12caf9bb8a0d74ce49e7d +size 113003 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Polypropylene_Opaque.Polypropylene_Yellow.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Polypropylene_Opaque.Polypropylene_Yellow.png new file mode 100644 index 0000000000000000000000000000000000000000..aeca74349acba19be546668b18776282ae12a577 --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Polypropylene_Opaque.Polypropylene_Yellow.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:333f68cbe346ce983c33be5725461b9bdb1469a47ebc30fe6e4a1451e6c34a88 +size 112039 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Polystyrene_Clear.Polystyrene_Clear.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Polystyrene_Clear.Polystyrene_Clear.png new file mode 100644 index 0000000000000000000000000000000000000000..ec45a5e8924ba49897b8464935ec5bb35ece63cb --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Polystyrene_Clear.Polystyrene_Clear.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c78dab338a8503cf0d7458c7db9bad8325143c4a0a87bca4984f564849a3a838 +size 148376 diff --git a/code/third_party/vMaterials_2/Plastic/.thumbs/Styrofoam.Styrofoam_no_SSS.png b/code/third_party/vMaterials_2/Plastic/.thumbs/Styrofoam.Styrofoam_no_SSS.png new file mode 100644 index 0000000000000000000000000000000000000000..d6298ea92287db6f9b51386d673e4182263aca5d --- /dev/null +++ b/code/third_party/vMaterials_2/Plastic/.thumbs/Styrofoam.Styrofoam_no_SSS.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a50cabe8df8f4ce0d66c2570d194a046eaeeaa8330656ddac112afa2ecbf90c5 +size 111181